:root {
  --paper: rgb(var(--primitives-yellow-25));
  --ink: color-mix(in srgb, rgb(var(--primitives-gray-950)) 65%, rgb(var(--primitives-linen-950)));
  --muted: rgb(var(--primitives-linen-950));
  --line: rgb(var(--primitives-linen-700));
  --accent: rgb(var(--primitives-orange-700));
  --accent-hover: rgb(var(--primitives-orange-800));
  --wash: color-mix(
    in srgb,
    rgb(var(--primitives-yellow-100)) 45%,
    rgb(var(--primitives-linen-400))
  );
  --rung: color-mix(
    in srgb,
    rgb(var(--primitives-orange-300)) 65%,
    rgb(var(--primitives-linen-800))
  );
  --rung-strong: color-mix(in srgb, var(--rung) 35%, var(--paper));
  --climb-neutral: var(--wash);
  --climb-peach: rgb(var(--primitives-yellow-600));
  --depth: rgb(var(--primitives-gray-transparent-100));
  --depth-strong: rgb(var(--primitives-gray-transparent-200));
  --scene-sky: color-mix(in srgb, var(--accent) 62%, var(--rung));
  --scene-hill-back: color-mix(in srgb, var(--accent) 82%, var(--rung));
  --scene-hill-front: color-mix(in srgb, var(--accent) 80%, var(--ink));
  --gk-card: var(--paper);
  --gk-ink: var(--ink);
  --gk-muted: var(--muted);
  --gk-line: var(--line);
  --gk-menu-ink: var(--ink);
  --gk-accent: var(--accent);
  --gk-accent-ink: var(--color-content-invert);

  --rail-gutter: 10px;
  --rung-height: 40px;
  --rung-gap: 5px;
  --end-height: 32px;
  --slot-height: 56px;
  --card-height: 48px;
  --card-pad: 12px;
  --card-font: 14px;
}
body {
  color: var(--ink);
  background: var(--paper);
}
button,
select {
  font: inherit;
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 18px;
  background: var(--paper);
  color: var(--ink);
  min-height: 44px;
}
button:disabled {
  cursor: default;
  opacity: 0.35;
}
button:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--wash);
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--color-content-invert);
}
button.primary:hover {
  background: var(--accent-hover);
}
button[aria-pressed="true"] {
  border-color: var(--accent);
}
button:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
h2 {
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 12px;
}
p {
  margin: 0 0 12px;
}
.small {
  font-size: 12px;
  color: var(--muted);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 16px 16px 24px;
  background: var(--paper);
}
.gk-window .shell {
  min-height: 100svh;
  padding-top: calc(16px + var(--gk-inset-top, 0px));
  padding-bottom: calc(24px + var(--gk-inset-bottom, 0px));
}
.shell.welcome,
.shell[data-stage="results"] {
  padding: 0;
}

.status,
.workspace {
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
}
.status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "clock controls"
    "day day";
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
}
.status-day {
  grid-area: day;
  font-size: 12px;
  color: var(--muted);
}
.status-day:empty {
  display: none;
}
.clock-wrap {
  grid-area: clock;
  position: relative;
  justify-self: start;
  font-variant-numeric: tabular-nums;
}
#run-clock {
  display: block;
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
}
#time-penalty {
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  color: var(--color-action-warning-dark);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  animation: penalty-rise 1.6s ease-out forwards;
}
@keyframes penalty-rise {
  0% {
    opacity: 0;
    transform: translateY(-50%) scale(0.7);
  }
  20% {
    opacity: 1;
    transform: translateY(-50%) scale(1.15);
  }
  65% {
    opacity: 1;
    transform: translateY(-90%);
  }
  100% {
    opacity: 0;
    transform: translateY(-130%);
  }
}
@media (prefers-reduced-motion: reduce) {
  #time-penalty {
    animation: none;
    transform: translateY(-50%);
  }
}
.header-controls {
  grid-area: controls;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 32px;
}
.header-controls .hint {
  display: flex;
}
.run-counters {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.run-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
}
.run-counter .game-icon {
  width: 17px;
  height: 17px;
}
.mistake-icon {
  display: inline-flex;
}
.tutorial-badge {
  display: inline-block;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 5px;
  background: var(--climb-neutral);
  color: var(--muted);
  font-size: 11px;
}
.welcome .status,
.shell[data-stage="results"] .status {
  position: absolute;
  z-index: 2;
  top: calc(12px + var(--gk-inset-top, 0px));
  right: 16px;
  display: block;
  width: auto;
  --gk-menu-ink: var(--paper);
}

#hint-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-height: 0;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--rung) 65%, var(--muted));
  border-radius: 8px;
  background: color-mix(in srgb, var(--rung) 24%, var(--paper));
  color: var(--ink);
  font-weight: 600;
}
#hint-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--rung) 45%, var(--paper));
  border-color: var(--accent);
}
#hint-button:active {
  transform: translateY(1px);
}
.hint-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--muted);
}
.hint-cost {
  border-radius: 6px;
  padding: 2px 5px;
  background: var(--paper);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.workspace {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}
.ladder-board {
  display: flex;
  flex-direction: column;
  gap: var(--rung-gap);
  min-height: 0;
}
.ladder {
  list-style: none;
  margin: 0;
  padding: 0 var(--rail-gutter);
  border-inline: 2px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--rung-gap);
  min-height: 0;
}
.rung {
  position: relative;
  display: grid;
  border-radius: 4px;
  background: var(--climb-neutral);
  box-shadow: inset 0 -3px 0 var(--depth);
  overflow: hidden;
}
.rung.selected {
  background: var(--rung);
  box-shadow: inset 0 -3px 0 var(--depth-strong);
}
.rung.solved {
  background: var(--rung-strong);
}
.rung.solved.selected {
  background: var(--rung);
}
.rung-select {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--rung-height);
  display: grid;
  align-items: center;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}
button.rung-select:hover:not(:disabled) {
  background: transparent;
}
.rung-content {
  min-width: 0;
}
.chain-formula {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  text-align: center;
}
.literal {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.arrow,
.chain-link-arrow {
  color: var(--accent);
  line-height: 1;
  transform-origin: center;
}
.rung .arrow {
  font-size: 16px;
}
.blank-formula .blank-line {
  height: 2px;
  margin: 0 22px;
  background: var(--line);
}
.blank-formula .arrow {
  color: var(--line);
}
.rung.selected .blank-line {
  background: var(--ink);
  opacity: 0.45;
}
.rung.selected .blank-formula .arrow {
  color: var(--accent);
}
.end-rung {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: var(--end-height);
  margin: 0 var(--rail-gutter);
  padding: 2px 8px;
  border: 0;
  border-radius: 4px;
  background: var(--climb-peach);
  box-shadow: inset 0 -3px 0 var(--depth);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.end-clue {
  transition: opacity 160ms;
}
.end-clue[aria-pressed="true"] {
  box-shadow: inset 0 -3px 0 var(--accent);
}
.end-clue[aria-pressed="false"] {
  opacity: 0.55;
}
.end-clue[aria-pressed="false"]:hover {
  opacity: 0.8;
}
.end-clue:hover:not(:disabled) {
  background: var(--climb-peach);
}
.end-clue:focus:not(:focus-visible) {
  outline: none;
}
.solved-end .chain-formula {
  width: 100%;
}
.game-icon.end-lock {
  width: 15px;
  height: 15px;
}

.chain-heading {
  margin-bottom: 15px;
}
.task-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}
.task-note {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.chain-heading .task-note {
  margin-top: 8px;
}
.playing[data-stage="chain"] {
  --rung-height: 44px;
}
.sortable-rung {
  overflow: visible;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.sortable-rung::before,
.sortable-rung::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 10px;
  height: 5px;
  border-block: 2px solid var(--muted);
  background: var(--paper);
  box-shadow: 0 0 0 5px var(--paper);
  transform: translateY(-50%);
  cursor: grab;
}
.sortable-rung::before {
  left: calc(-1 * var(--rail-gutter) - 6px);
}
.sortable-rung::after {
  right: calc(-1 * var(--rail-gutter) - 6px);
}
.sortable-rung.dragging-rung::before,
.sortable-rung.dragging-rung::after {
  cursor: grabbing;
}
.sortable-rung:focus,
.sortable-rung:focus-visible,
.sortable-rung.dragging-rung {
  outline: none;
}
.dragging-rung {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  cursor: grabbing;
  margin: 0;
  list-style: none;
}
.rung-gap {
  border: 2px dashed var(--color-content-muted);
  border-radius: 5px;
  background: var(--wash);
}
.logic-tile,
.sortable-rung {
  -webkit-touch-callout: none;
}

.panel {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.playing[data-stage="chain"] .panel {
  margin-top: 0;
  padding-top: 0;
  border: 0;
}
.playing[data-stage="chain"] .panel > :not(.sr-only):first-child,
.playing[data-stage="chain"] .panel > .sr-only + * {
  margin-top: 14px;
}
.panel .section-label {
  font-size: 13px;
  color: var(--muted);
}
.statement {
  margin: 6px 0 0;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}
#editor-title:focus {
  outline: none;
}
.reverse-diagram {
  box-sizing: border-box;
  display: grid;
  align-items: center;
  min-height: 48px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--climb-peach);
  box-shadow: inset 0 -3px 0 var(--accent);
}
.reverse-diagram .chain-formula {
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
}
.reverse-diagram .literal {
  font-size: 15px;
}
.reverse-diagram .arrow {
  font-size: 18px;
}
.reverse-diagram + .task-title {
  margin-top: 16px;
  font-size: 19px;
}

.tile-slots {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  margin-top: 22px;
}
.tile-slots > .arrow {
  text-align: center;
  font-size: 26px;
}
.tile-slot {
  display: grid;
  min-width: 0;
  min-height: var(--slot-height);
}
.empty-slot {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--slot-height);
  padding: 0;
  border: 2px dashed var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-size: 22px;
}
.tile-slot:not(.filled) ~ .tile-slot .empty-slot {
  border-color: var(--line);
  color: var(--muted);
}
.tile-slot.drop-target .empty-slot {
  border-style: solid;
  border-color: var(--accent);
  background: var(--rung-strong);
  color: var(--accent);
}
.tile-slot.drop-target .logic-tile {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.tile-slots.rejected .empty-slot {
  border-color: var(--color-content-error);
  background: var(--color-surface-negative);
  color: var(--color-content-error);
  font-size: 14px;
  font-weight: 600;
  opacity: 1;
}
@media (prefers-reduced-motion: no-preference) {
  .tile-slots.rejected {
    animation: wrong-answer 420ms ease-in-out;
  }
  @keyframes wrong-answer {
    0%,
    100% {
      transform: translateX(0);
    }
    20%,
    60% {
      transform: translateX(-8px);
    }
    40%,
    80% {
      transform: translateX(8px);
    }
  }
}
.sentence-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  font-size: 16px;
  font-weight: 500;
}
.sentence-slots .tile-slot {
  flex: 1 1 0;
}
.sentence-slots #slot-right {
  flex-basis: 100%;
}
.sentence-connector {
  white-space: nowrap;
}

.tile-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.bank-space {
  display: grid;
  min-width: 0;
  max-width: 100%;
}
.bank-space > * {
  grid-area: 1 / 1;
}
.bank-sizer,
.logic-tile {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--card-height);
  padding: 4px var(--card-pad);
  border-radius: 6px;
  font-size: var(--card-font);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-wrap: pretty;
}
.bank-sizer {
  border: 1px dashed var(--line);
  color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.logic-tile {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--climb-neutral);
  box-shadow: inset 0 -3px 0 var(--depth);
  color: var(--ink);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.logic-tile:active {
  cursor: grabbing;
}
.logic-tile:disabled {
  opacity: 1;
}
.logic-tile:hover:not(:disabled),
.logic-tile[aria-pressed="true"] {
  border-color: var(--line);
}
.logic-tile[aria-pressed="true"],
.tile-slot.filled .logic-tile {
  background: var(--rung);
}
.logic-tile:focus,
.logic-tile:focus-visible {
  outline: none;
}
.tile-slot .logic-tile {
  height: 100%;
  min-height: var(--slot-height);
  padding-inline: 8px;
}
.dragging-card {
  position: fixed;
  z-index: 2000;
  pointer-events: none;
  cursor: grabbing;
  margin: 0;
  transform: none;
}
.logic-tile.dragging-card {
  background: var(--rung);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.playing[data-stage="extend"] .tile-bank {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 22px;
}
.playing[data-stage="extend"] {
  --slot-height: 48px;
  --card-height: 52px;
  --card-pad: 10px;
}
.playing[data-stage="extend"] :is(.bank-sizer, .logic-tile) {
  padding-block: 8px;
}
.playing[data-stage="infer"] {
  --slot-height: 52px;
  --card-height: 40px;
}
.playing[data-stage="infer"] .tile-slots {
  margin-top: 18px;
}
.playing[data-stage="infer"] .tile-bank {
  gap: 8px;
  margin-top: 22px;
}
.tile-instruction {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.hint-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.4;
}
.hint-message .hint-icon {
  margin-top: 1px;
}
.tile-slots.accepted .logic-tile {
  opacity: 1;
  color: var(--color-action-success-dark);
  animation: answer-flash 350ms ease-out;
}
@keyframes answer-flash {
  0%,
  75% {
    background: var(--color-surface-positive);
    border-color: var(--color-border-positive);
  }
  100% {
    background: var(--paper);
    border-color: var(--line);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tile-slots.accepted .logic-tile {
    animation: none;
  }
}

.playing[data-stage="infer"][data-celebrating="false"] .ladder-board {
  display: none;
}
.playing[data-stage="infer"][data-celebrating="true"] .connected-board {
  margin-top: 20px;
}
.connected-board {
  position: relative;
  padding: 14px;
  border-radius: 8px;
  background: var(--rung);
  border: 1px solid var(--accent);
}
.statusline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.statusline .section-label,
.topic {
  color: var(--muted);
  font-size: 12px;
}
.connected-terms {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 6px;
}
.connected-term {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.term-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.chain-link-arrow {
  display: inline-block;
  font-size: 18px;
}
.chain-assembling .assembly-token {
  opacity: 0;
  position: relative;
  z-index: 2;
}
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  top: -16px;
  left: var(--confetti-x);
  width: 8px;
  height: 13px;
  background: var(--accent);
  border-radius: 2px;
}
.confetti span:nth-child(3n) {
  background: var(--color-action-warning-base);
}
.confetti span:nth-child(3n + 1) {
  background: var(--color-positive-base);
}
.confetti span:nth-child(2n) {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .celebrating-rows .rung,
  .celebrating-rows .end-rung {
    animation: chain-wave 480ms ease-in-out var(--wave-delay, 0ms) both;
  }
  .chain-assembling {
    animation: box-appear 240ms ease-out both;
  }
  .confetti span {
    animation: confetti-fall 1100ms ease-in var(--confetti-delay) both;
  }
  @keyframes chain-wave {
    0%,
    100% {
      transform: translateX(0);
    }
    40% {
      transform: translateX(12px);
    }
    75% {
      transform: translateX(-4px);
    }
  }
  @keyframes box-appear {
    from {
      opacity: 0;
      transform: scale(0.92);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  @keyframes confetti-fall {
    0% {
      opacity: 0;
      transform: translate(0, 0) rotate(0);
    }
    12% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      transform: translate(var(--confetti-drift), 540px) rotate(var(--confetti-turn));
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .confetti {
    display: none;
  }
}

.scene-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.scene-art {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(84px + var(--gk-inset-top, 0px)) 30px 132px;
}
.shell[data-stage="results"][data-mode="daily"] .scene-art,
.shell[data-stage="results"][data-mode="archive"] .scene-art {
  padding-top: calc(10px + var(--gk-inset-top, 0px));
  padding-bottom: 120px;
}
.scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  --scene-edge:
    url("icons/scene-edge-bottom.svg") bottom / 100% 30px no-repeat,
    linear-gradient(black, black) top / 100% calc(100% - 29px) no-repeat;
}
.scene-sky,
.scene-ground {
  position: absolute;
  inset: 0;
  mask: var(--scene-edge);
}
.scene-sky {
  z-index: -3;
  background: var(--scene-sky);
}
.scene-sun {
  position: absolute;
  z-index: -2;
  left: 34px;
  top: calc(14px + var(--gk-inset-top, 0px));
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--climb-peach);
}
.scene-ground {
  z-index: -1;
}
.scene-hill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  mask: var(--hill-shape) center / 100% 100% no-repeat;
}
.scene-hill-back {
  height: 110px;
  background: var(--scene-hill-back);
  --hill-shape: url("icons/scene-hill-back.svg");
}
.scene-hill-front {
  height: 70px;
  background: var(--scene-hill-front);
  --hill-shape: url("icons/scene-hill-front.svg");
}
.welcome-ladder {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-width: 330px;
}
.welcome-end {
  display: grid;
  place-items: center;
  height: 30px;
  margin: 0 10px;
  border-radius: 4px;
  background: var(--climb-peach);
  box-shadow: inset 0 -3px 0 var(--depth);
}
.welcome-end .game-icon {
  width: 14px;
  height: 14px;
}
.welcome-rails {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 10px;
  border-inline: 2px solid var(--line);
}
.welcome-rung {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 4px;
  background: var(--climb-neutral);
  box-shadow: inset 0 -3px 0 var(--depth);
}
.welcome-term {
  height: 2px;
  margin: 0 22px;
  background: var(--line);
}
.welcome-arrow {
  text-align: center;
  color: var(--line);
  font-size: 18px;
  line-height: 1;
}
.welcome-active {
  background: var(--rung);
  box-shadow: inset 0 -3px 0 var(--depth-strong);
}
.welcome-active .welcome-term {
  background: var(--ink);
  opacity: 0.45;
}
.welcome-active .welcome-arrow {
  color: var(--accent);
}
.result-time {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 280px;
  height: 280px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.result-time::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: 50%;
  background: var(--climb-peach);
}
.result-time strong {
  font-size: 92px;
  font-weight: 600;
  line-height: 1;
}
.result-time p {
  margin: 12px 0 0;
  font-size: 14px;
  opacity: 0.8;
}
.scene-body {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 16px calc(24px + var(--gk-inset-bottom, 0px));
}
.scene-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
.scene-note {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.scene-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}
.finished-chain {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: var(--climb-neutral);
  box-shadow: inset 0 -3px 0 var(--depth);
}
.finished-chain .chain-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.finished-chain .literal {
  display: inline-block;
  font-size: 15px;
}
.finished-chain .arrow {
  font-size: 20px;
}
.result-label {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}
.result-label:focus {
  outline: none;
}
.result-note {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.result-inference {
  margin-top: 6px;
}
.result-note + .result-inference {
  margin-top: 10px;
}
.result-inference .chain-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  text-align: left;
}
.result-inference .literal {
  display: inline-block;
  font-size: 21px;
  line-height: 1.3;
}
.result-inference .arrow {
  font-size: 23px;
}
.result-stats {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  align-items: center;
  margin-top: 24px;
  padding: 16px 0;
  border-block: 1px solid var(--line);
}
.result-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 8px 0 12px;
  border-left: 1px solid var(--line);
}
.result-stat:first-child {
  padding-left: 0;
  border-left: 0;
}
.result-stat .game-icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.result-stat > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.result-stat strong {
  font-size: 20px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.result-stat strong + span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.result-stats + .scene-actions {
  margin-top: 32px;
}
.entrance-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 9px 14px 11px;
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  transition: background 160ms;
}
.entrance-button.primary {
  background: var(--rung);
  border-color: color-mix(in srgb, var(--rung) 72%, var(--muted));
  color: var(--ink);
}
button.entrance-button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--rung) 35%, var(--paper));
}
button.entrance-button.primary:hover:not(:disabled) {
  background: var(--rung-strong);
}
.entrance-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--paper) 65%, transparent);
}
.entrance-icon .game-icon {
  width: 22px;
  height: 22px;
}
.entrance-label {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}
.entrance-arrow {
  font-size: 22px;
  line-height: 1;
}
.scene-screen button:focus:not(:focus-visible) {
  outline: none;
}

#daily-archive {
  box-sizing: border-box;
  width: min(480px, calc(100% - 16px));
  padding: 20px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
}
#daily-archive::backdrop {
  background: rgb(var(--primitives-gray-transparent-400));
}
.gk-window #daily-archive {
  max-height: calc(100svh - var(--gk-inset-top, 0px) - var(--gk-inset-bottom, 0px) - 16px);
  overflow-y: auto;
}
.archive-heading,
.archive-week {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.archive-heading h2 {
  margin: 0;
  font-size: 22px;
}
.archive-heading button,
.archive-week button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
}
.archive-heading button {
  margin: -4px -8px -4px 0;
  border-color: transparent;
  background: transparent;
}
.archive-note {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.archive-week {
  margin-top: 16px;
}
.archive-week strong {
  font-size: 15px;
  text-align: center;
}
.archive-days {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}
.archive-day {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 4px 12px;
  border: 0;
  border-radius: 4px;
  background: var(--climb-neutral);
  box-shadow: inset 0 -3px 0 var(--depth);
  color: var(--ink);
  font-size: 14px;
  text-align: left;
}
.archive-day:disabled {
  opacity: 1;
}
.archive-day:hover:not(:disabled) {
  background: var(--rung-strong);
}
.archive-date {
  font-weight: 600;
}
.archive-weekday-short {
  display: none;
}
.archive-theme {
  color: var(--muted);
}
.archive-tag {
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--paper);
  font-size: 11px;
  line-height: 1;
}
.archive-day .game-icon {
  width: 18px;
  height: 18px;
}
.archive-today {
  background: var(--rung);
  box-shadow: inset 0 -3px 0 var(--depth-strong);
}
.archive-today .archive-theme {
  color: var(--ink);
}
.archive-today:hover:not(:disabled) {
  background: var(--rung);
}
.archive-completed {
  background: var(--rung-strong);
}
.archive-day:is(.archive-locked, .archive-unavailable) {
  opacity: 0.5;
}
.archive-locked .game-icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
@media (max-width: 600px) {
  #daily-archive {
    padding: 16px 14px 14px;
  }
  .archive-day {
    grid-template-columns: 64px minmax(0, 1fr) auto auto;
    min-height: 44px;
    font-size: 13px;
  }
  .archive-weekday-long {
    display: none;
  }
  .archive-weekday-short {
    display: inline;
  }
}

.tutorial-skip {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
}
.tutorial-skip button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
}
.tutorial-skip button:hover:not(:disabled) {
  border-color: transparent;
  background: var(--climb-neutral);
}
.walkthrough-heading,
.walkthrough-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.walkthrough-title {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.3;
  margin: 12px 0;
}
.walkthrough-scene {
  position: relative;
  height: 220px;
  border-radius: 8px;
  background: var(--wash);
  overflow: hidden;
  font-size: 12px;
}
.demo-clue,
.demo-finish-chain {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  font-size: 11px;
}
.demo-slot {
  position: absolute;
  top: 73px;
  width: 38%;
  height: 44px;
  border: 2px dashed var(--accent);
  border-radius: 5px;
}
.demo-left {
  left: 6%;
}
.demo-right {
  right: 6%;
}
.demo-arrow {
  position: absolute;
  top: 80px;
  left: 47%;
  font-size: 23px;
}
.demo-card {
  position: absolute;
  top: 155px;
  width: 38%;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--rung);
  border: 1px solid var(--accent);
  font-weight: 500;
}
.demo-gate {
  left: 6%;
}
.demo-lights {
  right: 6%;
}
.demo-cursor {
  position: absolute;
  width: 26px;
  height: 34px;
  pointer-events: none;
}
.demo-translate .demo-cursor,
.demo-finish .demo-cursor {
  top: 175px;
  left: 30%;
}
.demo-row {
  position: absolute;
  left: 7%;
  width: 86%;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--rung);
}
.demo-row-one {
  top: 24px;
}
.demo-row-two {
  top: 84px;
}
.demo-row-three {
  top: 144px;
}
.demo-gap {
  position: absolute;
  top: 24px;
  left: 7%;
  width: 86%;
  height: 42px;
  border: 2px dashed var(--color-content-muted);
  border-radius: 5px;
}
.demo-reorder .demo-cursor {
  top: 104px;
  left: 65%;
}
.demo-original,
.demo-flipped {
  top: 85px;
}
.demo-contra .demo-cursor {
  top: 110px;
  left: 62%;
}
.demo-click-ring {
  position: absolute;
  top: 110px;
  left: 62%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
}
.demo-flipped {
  opacity: 0;
}
.walkthrough-note {
  min-height: 74px;
  font-size: 13px;
}
.walkthrough-nav {
  margin: 14px 0;
}
.walkthrough-scene * {
  animation-duration: 4.5s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}
.demo-translate .demo-gate,
.demo-finish .demo-gate {
  animation-name: tutorial-first-tile;
}
.demo-translate .demo-lights,
.demo-finish .demo-lights {
  animation-name: tutorial-second-tile;
}
.demo-translate .demo-cursor,
.demo-finish .demo-cursor {
  animation-name: tutorial-two-placements;
}
.demo-row-one {
  animation-name: tutorial-row-down;
}
.demo-row-two,
.demo-reorder .demo-cursor {
  animation-name: tutorial-row-up;
}
.demo-original {
  animation-name: tutorial-original;
}
.demo-flipped {
  animation-name: tutorial-flipped;
}
.demo-click-ring {
  animation-name: tutorial-double-click;
}
.demo-paused * {
  animation-play-state: paused;
}
@keyframes tutorial-first-tile {
  0%,
  10%,
  95%,
  100% {
    transform: translateY(0);
  }
  30%,
  85% {
    transform: translateY(-82px);
  }
}
@keyframes tutorial-second-tile {
  0%,
  40%,
  95%,
  100% {
    transform: translateY(0);
  }
  60%,
  85% {
    transform: translateY(-82px);
  }
}
@keyframes tutorial-row-down {
  0%,
  10%,
  95%,
  100% {
    transform: translateY(0);
  }
  40%,
  85% {
    transform: translateY(60px);
  }
}
@keyframes tutorial-row-up {
  0%,
  10%,
  95%,
  100% {
    transform: translateY(0);
  }
  40%,
  85% {
    transform: translateY(-60px);
  }
}
@keyframes tutorial-original {
  0%,
  34%,
  95%,
  100% {
    opacity: 1;
  }
  40%,
  90% {
    opacity: 0;
  }
}
@keyframes tutorial-flipped {
  0%,
  34%,
  95%,
  100% {
    opacity: 0;
  }
  40%,
  90% {
    opacity: 1;
  }
}
@keyframes tutorial-double-click {
  0%,
  19%,
  27%,
  35%,
  100% {
    opacity: 0;
    transform: scale(0.7);
  }
  22%,
  30% {
    opacity: 1;
    transform: scale(1.4);
  }
}
@media (prefers-reduced-motion: reduce) {
  .walkthrough-scene * {
    animation: none !important;
  }
  .demo-gate,
  .demo-lights {
    transform: translateY(-82px);
  }
  .demo-original {
    opacity: 0;
  }
  .demo-flipped {
    opacity: 1;
  }
}
.walkthrough {
  border-left: 3px solid var(--accent);
  background: var(--wash);
  padding: 8px 12px 12px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}
.walkthrough-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.walkthrough-heading button {
  min-height: 36px;
  padding: 8px;
  font-size: 12px;
  background: transparent;
  border-color: transparent;
}
.walkthrough p {
  margin: 0;
}
.demo-sentence-indicator {
  position: absolute;
  left: 44%;
  width: 12%;
  top: 79px;
  font-size: 11px;
  text-align: center;
}
.demo-sentence .demo-card {
  font-size: 11px;
  text-align: center;
  padding: 5px;
}
.demo-sentence .demo-cursor {
  top: 175px;
  left: 30%;
  animation-name: tutorial-two-placements;
}
.demo-sentence .demo-gate {
  animation-name: tutorial-first-tile;
}
.demo-sentence .demo-lights {
  animation-name: tutorial-second-tile;
}

.demo-translate {
  height: 278px;
}
.demo-negated {
  top: 211px;
}
.demo-not-gate {
  left: 6%;
}
.demo-not-lights {
  right: 6%;
}
@keyframes tutorial-two-placements {
  0%,
  10%,
  95%,
  100% {
    left: 30%;
    transform: translateY(0);
  }
  30% {
    left: 30%;
    transform: translateY(-82px);
  }
  40% {
    left: 74%;
    transform: translateY(0);
  }
  60%,
  85% {
    left: 74%;
    transform: translateY(-82px);
  }
}
.board-guide {
  position: fixed;
  z-index: 50;
  pointer-events: none;
}
.guide-card {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: var(--rung);
  color: var(--ink);
  font-size: 12px;
  text-align: center;
}
.guide-pointer {
  position: absolute;
  z-index: 1;
  left: 65%;
  top: 55%;
  width: 26px;
}
.guide-target .empty-slot {
  border-color: var(--accent);
  background: var(--rung);
}
.rung.guide-target {
  background: var(--rung);
}
.guide-tap-ring {
  position: absolute;
  left: 65%;
  top: 55%;
  width: 26px;
  height: 26px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
}
.guide-touch-point {
  display: none;
}
@media (pointer: coarse), (max-width: 600px) {
  .board-guide .guide-pointer {
    display: none;
  }
  .guide-touch-point {
    display: block;
    position: absolute;
    left: 65%;
    top: 55%;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: color-mix(in srgb, var(--ink) 28%, transparent);
    border: 2px solid var(--paper);
    box-shadow: 0 1px 4px rgb(var(--primitives-gray-transparent-200));
  }
}

@media (max-width: 600px) {
  .walkthrough {
    padding: 0 8px 6px;
    margin-bottom: 8px;
    font-size: 12px;
  }
  .walkthrough-heading {
    float: right;
    margin-left: 6px;
  }
  .walkthrough-heading strong {
    display: none;
  }
  .walkthrough p {
    clear: both;
    line-height: 1.3;
  }
  .tutorial-skip {
    margin-bottom: 2px;
  }
  .tutorial-skip button {
    font-size: 11px;
  }
  .guide-target .empty-slot {
    border-color: var(--line);
    background: color-mix(in srgb, var(--rung) 35%, var(--paper));
  }
}

@media (max-height: 700px) and (max-width: 859px) {
  .gk-window {
    --rung-height: 30px;
    --rung-gap: 4px;
    --end-height: 24px;
    --slot-height: 48px;
    --card-height: 44px;
  }
  .gk-window .shell {
    padding-top: calc(12px + var(--gk-inset-top, 0px));
    padding-bottom: calc(12px + var(--gk-inset-bottom, 0px));
  }
  .gk-window .shell.welcome,
  .gk-window .shell[data-stage="results"] {
    padding: 0;
  }
  .gk-window #run-clock {
    font-size: 22px;
  }
  .gk-window .workspace {
    margin-top: 14px;
  }
  .gk-window .panel {
    margin-top: 10px;
    padding-top: 10px;
  }
  .gk-window :is(.statement, .task-title) {
    font-size: 19px;
    line-height: 1.3;
  }
  .gk-window .tile-slots {
    margin-top: 14px;
  }
  .gk-window .tile-bank {
    gap: 8px;
    margin-top: 16px;
  }
  .gk-window .tile-instruction,
  .gk-window .hint-message {
    margin-top: 10px;
  }
  .gk-window .playing[data-stage="extend"] {
    --slot-height: 44px;
    --card-height: 44px;
  }
  .gk-window .playing[data-stage="infer"] {
    --slot-height: 44px;
    --card-height: 36px;
  }
  .gk-window .scene-art {
    padding: calc(62px + var(--gk-inset-top, 0px)) 30px 96px;
  }
  .gk-window .scene-sun {
    top: calc(10px + var(--gk-inset-top, 0px));
    width: 44px;
    height: 44px;
  }
  .gk-window .welcome-end {
    height: 24px;
  }
  .gk-window .welcome-rung {
    height: 30px;
  }
  .gk-window .scene-hill-back {
    height: 88px;
  }
  .gk-window .scene-hill-front {
    height: 56px;
  }
  .gk-window .result-time {
    width: 216px;
    height: 216px;
  }
  .gk-window .result-time strong {
    font-size: 72px;
  }
  .gk-window .scene-body {
    padding-top: 14px;
    padding-bottom: calc(16px + var(--gk-inset-bottom, 0px));
  }
  .gk-window .scene-actions {
    margin-top: 16px;
  }
}

@media (min-width: 860px) {
  :root {
    --rung-height: 46px;
    --rung-gap: 6px;
    --end-height: 36px;
    --slot-height: 60px;
    --card-height: 52px;
    --card-pad: 22px;
    --card-font: 15px;
  }
  .shell {
    min-height: 600px;
    padding: 24px clamp(24px, 5vw, 56px) 40px;
  }
  .gk-window .shell {
    padding-top: calc(24px + var(--gk-inset-top, 0px));
    padding-bottom: calc(40px + var(--gk-inset-bottom, 0px));
  }
  .gk-window .shell.welcome,
  .gk-window .shell[data-stage="results"] {
    padding: 0;
  }
  .status {
    max-width: none;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "day clock controls";
  }
  .status-day {
    font-size: 13px;
  }
  .status-day:empty {
    display: block;
  }
  .clock-wrap {
    justify-self: center;
  }
  .header-controls {
    gap: 12px;
  }
  .run-counters {
    gap: 12px;
  }
  .welcome .status,
  .shell[data-stage="results"] .status {
    top: calc(24px + var(--gk-inset-top, 0px));
    right: clamp(24px, 5vw, 56px);
    --gk-menu-ink: var(--ink);
  }

  .workspace {
    flex: 1;
    display: grid;
    grid-template-columns: clamp(320px, 41%, 400px) minmax(0, 1fr);
    column-gap: 48px;
    row-gap: 20px;
    align-content: center;
    align-items: center;
    max-width: 976px;
    min-height: 440px;
    margin-top: 16px;
  }
  .ladder-board,
  .connected-board {
    grid-column: 1;
  }
  .playing[data-stage="infer"][data-celebrating="true"] .connected-board {
    margin-top: 0;
  }
  .panel {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    justify-content: center;
    margin: 28px 0;
    padding: 0 0 0 48px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .literal {
    font-size: 14px;
  }
  .rung-select {
    padding-inline: 12px;
  }
  .chain-formula {
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    gap: 8px;
  }
  .rung .arrow {
    font-size: 18px;
  }
  .blank-formula .blank-line {
    margin: 0 26px;
  }
  .end-rung {
    font-size: 14px;
  }
  .game-icon.end-lock {
    width: 16px;
    height: 16px;
  }
  .statement,
  .task-title {
    font-size: 26px;
  }
  .task-note {
    margin-top: 6px;
    font-size: 15px;
  }
  .tile-slots {
    grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
    column-gap: 12px;
    margin-top: 24px;
  }
  .tile-slots > .arrow {
    font-size: 28px;
  }
  .tile-bank {
    gap: 12px;
    margin-top: 32px;
  }

  .playing[data-stage="chain"] {
    --rung-height: 52px;
  }
  .playing[data-stage="chain"] .workspace {
    grid-template-columns: minmax(0, 480px);
    justify-content: center;
    row-gap: 0;
  }
  .playing[data-stage="chain"] .panel {
    grid-column: 1;
    grid-row: auto;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .chain-heading {
    margin-bottom: 22px;
    text-align: center;
  }
  .chain-heading .task-title {
    font-size: 22px;
  }
  .playing[data-stage="chain"] .literal {
    font-size: 15px;
  }

  .playing[data-stage="extend"] {
    --slot-height: 56px;
    --card-height: 50px;
    --card-pad: 14px;
  }
  .playing[data-stage="extend"] .workspace {
    column-gap: 30px;
  }
  .playing[data-stage="extend"] .panel {
    padding-left: 30px;
  }
  .reverse-diagram {
    min-height: 56px;
    padding-inline: 16px;
  }
  .reverse-diagram .chain-formula {
    grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  }
  .reverse-diagram .literal {
    font-size: 17px;
  }
  .reverse-diagram .arrow {
    font-size: 22px;
  }
  .reverse-diagram + .task-title {
    margin-top: 20px;
    font-size: 22px;
  }
  .sentence-slots {
    gap: 10px;
    margin-top: 16px;
    font-size: 18px;
  }
  .sentence-slots .tile-slot,
  .sentence-slots #slot-right {
    flex: 1 1 170px;
  }
  .playing[data-stage="extend"] .tile-bank {
    gap: 10px;
    margin-top: 28px;
  }

  .playing[data-stage="infer"] {
    --slot-height: 56px;
    --card-height: 46px;
    --card-pad: 14px;
  }
  .playing[data-stage="infer"] .tile-slots {
    margin-top: 24px;
  }
  .playing[data-stage="infer"] .tile-bank {
    gap: 10px;
    margin-top: 28px;
  }
  .connected-board {
    padding: 18px;
  }
  .connected-terms {
    gap: 10px 6px;
  }
  .term-pill {
    font-size: 14px;
  }
  .chain-link-arrow {
    font-size: 21px;
  }

  .scene-screen {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }
  .scene-art,
  .shell[data-stage="results"][data-mode="daily"] .scene-art,
  .shell[data-stage="results"][data-mode="archive"] .scene-art {
    position: static;
    justify-self: end;
    width: min(400px, 100% - 99px);
    margin-right: 75px;
    padding: 40px 0;
  }
  .scene {
    inset: 0 auto 0 0;
    width: calc(50% + 10px);
    --scene-edge:
      url("icons/scene-edge-right.svg") right / 80px 100% no-repeat,
      linear-gradient(black, black) left / calc(100% - 79px) 100% no-repeat;
  }
  .scene-sun {
    left: auto;
    right: 80px;
    top: calc(16px + var(--gk-inset-top, 0px));
    width: 124px;
    height: 124px;
  }
  .scene-hill-back {
    height: 170px;
  }
  .scene-hill-front {
    height: 120px;
  }
  .welcome-ladder {
    gap: 6px;
    max-width: 400px;
  }
  .welcome-end {
    height: 36px;
  }
  .welcome-end .game-icon {
    width: 16px;
    height: 16px;
  }
  .welcome-rails {
    gap: 6px;
  }
  .welcome-rung {
    height: 46px;
  }
  .welcome-term {
    margin: 0 26px;
  }
  .result-time {
    width: 344px;
    height: 344px;
    max-width: 100%;
  }
  .result-time strong {
    font-size: 104px;
  }
  .result-time p {
    margin-top: 14px;
    font-size: 15px;
  }
  .scene-body {
    justify-self: start;
    width: min(440px, 100% - 59px);
    max-width: none;
    margin: 0 0 0 35px;
    padding: 40px 0;
  }
  .scene-title {
    font-size: 26px;
    line-height: 1.35;
  }
  .scene-note {
    margin-top: 10px;
    font-size: 15px;
  }
  .scene-actions {
    margin-top: 28px;
  }
  .finished-chain {
    margin-top: 16px;
    padding: 14px 18px;
  }
  .finished-chain .chain-formula {
    gap: 10px;
  }
  .result-inference .literal {
    font-size: 24px;
  }
  .result-inference .arrow {
    font-size: 26px;
  }
  .result-stat {
    gap: 10px;
    padding: 0 12px 0 18px;
  }
}
@media (min-width: 860px) {
  .gk-window .shell {
    min-height: 100svh;
  }
}

/* Standalone mobile play is a fixed surface, not a scrollable document.
   Embedded games retain GameKit's content-driven iframe sizing. */
@media (max-width: 600px) {
  html.gk-window:has(.playing:not([data-stage="results"])) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .gk-window body:has(.playing:not([data-stage="results"])) {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .gk-window #game:has(.playing:not([data-stage="results"])) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  .gk-window .playing:not([data-stage="results"]) {
    min-height: 100%;
    touch-action: none;
  }
  #daily-archive,
  .gk-sheet {
    touch-action: pan-y;
    overscroll-behavior: contain;
  }
}
@media (max-width: 600px) {
  .gk-window .shell.playing:not([data-stage="results"]) {
    height: 100%;
    min-height: 0;
  }
  .gk-window .playing .workspace {
    flex: 1;
    min-height: 0;
  }
  .gk-window .playing .rung {
    flex: 0 1 var(--rung-height);
    min-height: 20px;
  }
  .gk-window .playing .rung-select {
    height: 100%;
    min-height: 0;
    padding-block: 0;
  }
  .gk-window .playing .end-rung {
    flex: 0 1 var(--end-height);
    min-height: 16px;
    padding-block: 0;
  }
  .gk-window .playing .panel {
    flex: none;
  }
}

/* External assets retain current-color icons without embedding SVG markup. */
.game-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}
span.game-icon {
  background: currentColor;
  mask: var(--icon-image) center / contain no-repeat;
}
.icon-book {
  --icon-image: url("icons/book.svg");
}
.icon-ladder {
  --icon-image: url("icons/ladder.svg");
}
.icon-close {
  --icon-image: url("icons/close.svg");
}
.icon-arrow-left {
  --icon-image: url("icons/arrow-left.svg");
}
.icon-arrow-right {
  --icon-image: url("icons/arrow-right.svg");
}
.icon-lock {
  --icon-image: url("icons/lock.svg");
}
.icon-calendar {
  --icon-image: url("icons/calendar.svg");
}
.mistake-icon .game-icon {
  width: 14px;
  height: 14px;
}
.game-icon.hint-icon {
  width: 18px;
  height: 18px;
}
