:root {
  --navy: #174a7e;
  --navy-deep: #0c3156;
  --ice: #e8faff;
  --ice-blue: #8ee4f7;
  --cream: #fff8e5;
  --honey: #e9aa38;
  --wood: #a95d27;
  --wood-mid: #ce8031;
  --wood-dark: #61371e;
  --ink: #24364b;
  --green: #36a315;
  --green-deep: #24740d;
  --coral: #df795f;
  --snow-shadow: 0 12px 24px rgba(22, 77, 108, .24);
  --wood-shadow: 0 7px 12px rgba(67, 59, 39, .28);
  --fox-mask: url("assets/fox-cutout.webp?v=20261020-2");
  --sopo-mask: url("assets/sopo-cutout.webp?v=20261020-3");
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #54c9ec;
  color: var(--ink);
  font-family: "Trebuchet MS", "Avenir Next", "Segoe UI", sans-serif;
}

body {
  overscroll-behavior: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 4px;
  box-shadow: 0 0 0 8px var(--navy);
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.app,
.screen {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.intro-screen {
  isolation: isolate;
  overflow: hidden;
  background: #39bcec;
}

.intro-picture,
.intro-picture img,
.scene-background,
.scene-background img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro-picture img,
.scene-background img {
  object-fit: cover;
  user-select: none;
}

.intro-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 47, 77, .7) 0%, transparent 32%),
    linear-gradient(0deg, rgba(7, 42, 67, .72) 0%, transparent 35%);
}

.intro-title-frame {
  position: absolute;
  z-index: 2;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  width: min(780px, calc(100vw - 32px));
  color: #fff;
  text-align: center;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .46);
  transform: translateX(-50%);
}

.eyebrow {
  margin: 0 0 8px;
  color: #8c451e;
  font-size: clamp(.72rem, 1.15vw, .94rem);
  font-weight: 900;
  letter-spacing: .1em;
}

.intro-title-frame .eyebrow {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .52);
}

.intro-title-frame h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: .9;
  letter-spacing: -.04em;
}

.intro-title-frame h1 span {
  color: #fff0b3;
  font-style: italic;
}

.intro-action {
  position: absolute;
  z-index: 2;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 18px;
  color: #fff;
  text-align: center;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .5);
  transform: translateX(-50%);
}

.intro-line {
  max-width: 25rem;
  margin: 0;
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  font-weight: 800;
}

.play-button,
.primary-button,
.secondary-button,
.text-button {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 172px;
  min-height: 64px;
  padding: 13px 26px;
  border: 3px solid #ffe5a4;
  border-radius: 14px;
  background: var(--navy);
  box-shadow: 0 8px 0 var(--navy-deep), 0 18px 30px rgba(5, 40, 66, .35);
  color: #fff;
  font-size: 1.22rem;
  transition: transform .16s ease, box-shadow .16s ease;
}

.play-button svg {
  width: 28px;
  fill: var(--honey);
}

.play-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 0 var(--navy-deep), 0 20px 34px rgba(5, 40, 66, .38);
}

.play-button:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 var(--navy-deep);
}

.game-screen {
  isolation: isolate;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  overflow: hidden;
  background: #62d1ef;
}

.scene-background {
  z-index: -2;
  overflow: hidden;
}

.scene-background img {
  object-position: center 70%;
  transform: scale(1.42);
  transform-origin: center bottom;
}

.scene-wash {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(13, 73, 118, .14), transparent 19%),
    linear-gradient(0deg, rgba(255, 255, 255, .05), transparent 28%);
}

.topbar {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
}

.wordmark {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  min-width: 132px;
  padding: 8px 14px 9px;
  border: 3px solid #e4ad4d;
  border-radius: 8px;
  background-image: url("assets/ui/ui-wood-grain.webp");
  background-size: 120px;
  background-color: #74391c;
  box-shadow: 0 4px 0 #74401f, 0 10px 18px rgba(22, 68, 87, .2);
  color: #fff;
  text-shadow: 0 2px 2px rgba(0, 0, 0, .5);
}

.wordmark span {
  font-family: Georgia, serif;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1;
}

.wordmark small {
  margin-top: 3px;
  color: #fff5cf;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .035em;
}

.control-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
}

.icon-control,
.help-control {
  display: block;
  width: 56px;
  min-width: 56px;
  height: 56px;
  min-height: 56px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: 0 5px 8px rgba(33, 69, 82, .28);
  cursor: pointer;
  text-decoration: none;
  transition: transform .14s ease, filter .14s ease;
  filter: drop-shadow(0 2px 1px rgba(66, 40, 19, .28));
}

.icon-control:hover {
  transform: translateY(-2px) scale(1.025);
}

.icon-control:active {
  transform: translateY(2px) scale(.96);
}

.icon-control:disabled {
  cursor: default;
  filter: saturate(.58) opacity(.78);
}

.control-art {
  display: block;
  width: 100%;
  height: 100%;
}

#pause-button {
  background-image: url("assets/ui/button-pause-normal.webp");
}

#pause-button:active {
  background-image: url("assets/ui/button-pause-pressed.webp");
}

#pause-button:disabled {
  background-image: url("assets/ui/button-pause-disabled.webp");
}

#sound-button[aria-pressed="true"] {
  background-image: url("assets/ui/button-volume-normal.webp");
}

#sound-button[aria-pressed="true"]:active {
  background-image: url("assets/ui/button-volume-pressed.webp");
}

#sound-button[aria-pressed="true"]:disabled {
  background-image: url("assets/ui/button-volume-disabled.webp");
}

#sound-button[aria-pressed="false"] {
  background-image: url("assets/ui/button-mute-normal.webp");
}

#sound-button[aria-pressed="false"]:active {
  background-image: url("assets/ui/button-mute-pressed.webp");
}

#sound-button[aria-pressed="false"]:disabled {
  background-image: url("assets/ui/button-mute-disabled.webp");
}

#restart-button {
  background-image: url("assets/ui/button-replay-normal.webp");
}

#restart-button:active {
  background-image: url("assets/ui/button-replay-pressed.webp");
}

#restart-button:disabled {
  background-image: url("assets/ui/button-replay-disabled.webp");
}

#home-button {
  background-image: url("assets/ui/button-home-normal.webp");
}

#home-button:active {
  background-image: url("assets/ui/button-home-pressed.webp");
}

.help-control {
  display: grid;
  place-items: center;
}

.help-art {
  display: block;
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 2px 1px rgba(66, 40, 19, .28));
}

.play-area {
  position: relative;
  z-index: 4;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  padding: 2px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.board-card {
  position: relative;
  width: min(1000px, 100%);
  height: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 6px;
  pointer-events: none;
}

.board-card > * {
  pointer-events: auto;
}

.progress-strip {
  position: relative;
  z-index: 26;
  display: grid;
  grid-template-columns: minmax(118px, 1fr) auto minmax(134px, 1fr);
  gap: 10px;
  align-items: center;
  width: min(680px, 88%);
  min-height: 48px;
  margin: 0 auto;
  padding: 8px;
  border: 2px solid rgba(255, 255, 255, .86);
  border-radius: 14px;
  background: rgba(226, 248, 255, .9);
  box-shadow: 0 5px 12px rgba(21, 90, 121, .18);
}

.level-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  min-height: 48px;
  padding: 4px 10px;
  border: 2px solid #f5bf54;
  border-radius: 8px;
  background: var(--navy);
  box-shadow: 0 3px 0 var(--navy-deep);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.level-pill:hover {
  background: #1e5b95;
}

.level-pill span {
  font-size: .94rem;
  font-weight: 900;
  line-height: 1.05;
}

.level-pill small {
  max-width: 100%;
  overflow: hidden;
  color: #fff5cf;
  font-size: .7rem;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.task-star {
  display: block;
  width: clamp(22px, 2.5vw, 31px);
  height: clamp(22px, 2.5vw, 31px);
  background: url("assets/ui/ui-reward-star-empty.webp") center / contain no-repeat;
  filter: drop-shadow(0 2px 1px rgba(81, 74, 43, .2));
}

.task-star.is-earned {
  background-image: url("assets/ui/ui-reward-star.webp");
}

.world-props {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-width: 0;
}

.world-prop {
  position: relative;
  display: block;
  width: clamp(19px, 2.4vw, 29px);
  height: clamp(20px, 2.6vw, 31px);
  background: url("assets/ui/signpost-snow.webp?v=20261020-2") center / contain no-repeat;
  filter: saturate(.46) drop-shadow(0 2px 1px rgba(23, 74, 126, .24));
  opacity: .66;
}

.world-prop:nth-child(even) {
  clip-path: none;
}

.world-prop.is-current {
  filter: saturate(.9) drop-shadow(0 2px 2px rgba(23, 74, 126, .42));
  opacity: 1;
}

.world-prop.is-lit {
  filter: saturate(1.12) brightness(1.08) drop-shadow(0 2px 3px rgba(174, 111, 22, .4));
  opacity: 1;
}

#board-content {
  grid-row: 3;
  position: relative;
  z-index: 10;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-areas:
    "brief"
    "route"
    "response"
    "feedback";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(210px, 1fr) auto auto;
  gap: 3px;
  align-items: stretch;
  pointer-events: none;
}

#board-content > * {
  pointer-events: auto;
}

.task-brief {
  grid-area: brief;
  position: relative;
  z-index: 18;
  display: grid;
  grid-template-columns: 190px minmax(0, 400px);
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.task-heading {
  position: relative;
  justify-self: center;
  width: 190px;
  max-width: 100%;
  margin: 0;
  padding: 7px 12px 6px;
  border: 2px solid #fff;
  border-radius: 22px 25px 20px 24px;
  background: rgba(226, 249, 255, .95);
  box-shadow: 0 7px 0 rgba(141, 205, 225, .42), 0 14px 25px rgba(18, 69, 97, .2);
  text-align: center;
}

.task-heading::before,
.task-heading::after {
  position: absolute;
  top: -8px;
  width: 36%;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.task-heading::before {
  left: -3px;
  transform: rotate(-4deg);
}

.task-heading::after {
  right: -4px;
  transform: rotate(5deg);
}

.task-heading h2 {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.68rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.task-heading h2 strong {
  color: #ad591d;
  font-size: 1.18em;
}

.direction-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  margin-top: 5px;
}

.direction-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(23, 74, 126, .2);
  border-radius: 7px;
  background: rgba(255, 255, 255, .72);
  color: var(--navy);
  font-size: .74rem;
  font-weight: 900;
}

.direction-chip b {
  font-size: 1rem;
  line-height: 1;
}

.route-zone {
  grid-area: route;
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4px 6px 26px;
}

.route-track {
  position: relative;
  z-index: 12;
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 4px;
}

.route-track.is-backward {
  flex-direction: row-reverse;
}

.route-step {
  display: flex;
  align-items: flex-end;
  flex: 0 1 auto;
  min-width: 0;
}

.route-track.is-backward .route-step {
  flex-direction: row-reverse;
}

.route-connector {
  display: flex;
  flex: 0 0 clamp(13px, 2vw, 27px);
  width: clamp(13px, 2vw, 27px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
  color: var(--navy-deep);
  text-shadow:
    -2px -2px 0 #fff,
    2px -2px 0 #fff,
    -2px 2px 0 #fff,
    2px 2px 0 #fff;
}

.route-connector b {
  font-size: clamp(1.42rem, 2.8vw, 2.25rem);
  line-height: .9;
}

.route-connector small {
  margin-top: 2px;
  color: var(--navy);
  font-size: clamp(.69rem, .72vw, .72rem);
  font-weight: 900;
  white-space: nowrap;
}

.sign {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: clamp(48px, 9vw, 104px);
  min-width: 48px;
  min-height: 48px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: url("assets/ui/signpost-snow.webp?v=20261020-2") center / 100% 100% no-repeat;
  box-shadow: none;
  color: #452312;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 218, 136, .32);
  filter: drop-shadow(0 8px 5px rgba(45, 74, 79, .25));
}

.sign-number {
  position: absolute;
  top: 37%;
  left: 50%;
  display: block;
  width: 100%;
  line-height: 1;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.sign::before {
  content: none;
}

.sign::after {
  content: none;
}

.sign--start {
  background-image: url("assets/ui/signpost-start-blue.webp");
  color: #174a7e;
  filter: drop-shadow(0 0 0 #174a7e) drop-shadow(0 8px 5px rgba(45, 74, 79, .25));
}

.sign--start .sign-number {
  color: #fff;
  text-shadow: 0 2px 2px rgba(6, 36, 67, .85);
}

.sign-slot {
  cursor: pointer;
}

.sign-slot:hover,
.sign-slot:focus-visible {
  filter: brightness(1.08) drop-shadow(0 8px 5px rgba(45, 74, 79, .25));
  transform: translateY(-3px);
}

.sign-slot.is-selected,
.sign-slot.is-dragover {
  outline: 4px solid #fff;
  outline-offset: 3px;
  filter: brightness(1.12) drop-shadow(0 8px 5px rgba(45, 74, 79, .25));
  transform: translateY(-5px) scale(1.04);
}

.sign-slot.is-wrong {
  outline: 5px solid #d98852;
  outline-offset: 2px;
}

.sign-label {
  position: absolute;
  top: calc(100% + 1px);
  right: -3px;
  bottom: auto;
  left: -3px;
  color: rgba(67, 37, 18, .72);
  font-family: "Trebuchet MS", sans-serif;
  font-size: clamp(.68rem, .78vw, .74rem);
  font-weight: 900;
  letter-spacing: .01em;
  line-height: 1;
  text-align: center;
}

.sign--start .sign-label {
  right: auto;
  left: 50%;
  width: max-content;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--navy);
  color: #fff;
  transform: translateX(-50%);
}

.route-track[data-sign-count="2"] .sign,
.route-track[data-sign-count="3"] .sign {
  width: clamp(82px, 21vw, 130px);
}

.route-track[data-sign-count="2"] .sign,
.route-track[data-sign-count="3"] .sign {
  font-size: clamp(2.4rem, 7vw, 3.6rem);
}

.route-track[data-sign-count="4"] .sign {
  width: clamp(74px, 18vw, 118px);
  font-size: clamp(2.1rem, 6vw, 3.25rem);
}

.route-track[data-sign-count="5"] .sign {
  width: clamp(62px, 15vw, 104px);
  font-size: clamp(1.75rem, 5vw, 2.85rem);
}

.route-track[data-sign-count="5"] .route-connector {
  flex-basis: clamp(10px, 1.4vw, 20px);
  width: clamp(10px, 1.4vw, 20px);
}

.fox-runner {
  position: absolute;
  z-index: 14;
  top: 0;
  left: 0;
  display: block;
  width: clamp(118px, 22vw, 160px);
  aspect-ratio: 1;
  overflow: visible;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.fox-runner.is-walking {
  transition: transform 1.05s cubic-bezier(.36, .05, .25, 1);
}

.fox-runner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  mask-image: var(--fox-mask);
  mask-mode: alpha;
  mask-position: center bottom;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  -webkit-mask-image: var(--fox-mask);
  -webkit-mask-position: center bottom;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
}

.response-group {
  grid-area: response;
  position: relative;
  z-index: 24;
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 70px;
  padding: 2px 4px 4px;
}

.candidate-area {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, max-content);
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  width: max-content;
  max-width: 100%;
  min-height: 0;
  padding: 0;
}

.candidate-area[data-choice-count="1"] {
  grid-template-columns: max-content;
}

.candidate-area[data-choice-count="2"],
.candidate-area[data-choice-count="3"] {
  grid-template-columns: repeat(3, max-content);
}

@media (min-width: 900px) {
  .candidate-area[data-choice-count="6"] {
    grid-template-columns: repeat(6, max-content);
  }
}

.candidate-label {
  grid-column: 1 / -1;
  margin: 0;
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 2px 4px rgba(10, 53, 77, .7);
}

.number-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(56px, 6.1vw, 72px);
  min-width: clamp(56px, 6.1vw, 72px);
  height: clamp(56px, 6.1vw, 72px);
  padding: 0 0 3px;
  border: 5px solid #f2bf48;
  border-radius: 10px;
  background-image: url("assets/ui/ui-wood-grain.webp");
  background-color: #f5d17c;
  background-size: 95px;
  box-shadow:
    inset 0 0 0 3px #9c5320,
    0 6px 0 #87502a,
    0 10px 15px rgba(46, 72, 72, .24);
  color: #402312;
  cursor: grab;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 3vw, 2.5rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 231, 165, .48);
  touch-action: none;
  user-select: none;
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

.number-token:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.number-token:active {
  cursor: grabbing;
  box-shadow:
    inset 0 0 0 3px #9c5320,
    0 2px 0 #87502a;
  transform: translateY(4px) scale(.97);
}

.number-token[aria-pressed="true"],
.number-token.is-picked {
  outline: 4px solid #fff;
  outline-offset: 3px;
  filter: brightness(1.13);
  transform: translateY(-4px) scale(1.08);
}

.number-token:disabled {
  cursor: default;
  filter: saturate(.8);
  opacity: .92;
}

.drag-ghost {
  position: fixed;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(56px, 6.1vw, 72px);
  height: clamp(56px, 6.1vw, 72px);
  border: 5px solid #f2bf48;
  border-radius: 10px;
  background-color: #f5d17c;
  box-shadow: 0 10px 18px rgba(33, 71, 83, .3);
  color: #402312;
  font-family: Georgia, serif;
  font-size: clamp(1.85rem, 3vw, 2.5rem);
  font-weight: 900;
  pointer-events: none;
  opacity: .95;
  transform: translate(-50%, -50%) scale(1.08);
}

.ok-button {
  justify-self: center;
  align-self: center;
  width: clamp(64px, 7vw, 82px);
  min-width: 64px;
  height: clamp(64px, 7vw, 82px);
  min-height: 64px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: url("assets/ui/button-check-normal.webp") center / contain no-repeat;
  box-shadow: 0 8px 14px rgba(31, 86, 37, .28);
  color: transparent;
  cursor: pointer;
  font-size: 0;
  text-indent: -9999px;
  transition: transform .14s ease, filter .14s ease;
}

.ok-button:hover {
  filter: brightness(1.05);
  transform: translateY(-2px) scale(1.02);
}

.ok-button:active {
  background-image: url("assets/ui/button-check-pressed.webp");
  transform: translateY(3px) scale(.96);
}

.ok-button:disabled {
  background-image: url("assets/ui/button-check-disabled.webp");
  box-shadow: 0 4px 9px rgba(46, 72, 72, .18);
  cursor: default;
  filter: saturate(.72);
}

.feedback-line {
  grid-area: feedback;
  align-self: center;
  display: grid;
  min-height: 2.3em;
  margin: 0;
  padding: 0 12px;
  color: #fff;
  font-size: clamp(.75rem, 1.05vw, .9rem);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-shadow:
    -1px -1px 0 rgba(22, 75, 99, .52),
    1px -1px 0 rgba(22, 75, 99, .52),
    -1px 1px 0 rgba(22, 75, 99, .52),
    1px 1px 0 rgba(22, 75, 99, .52);
}

.feedback-line.is-help {
  color: #3d3226;
  background: rgba(255, 248, 230, .94);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(61, 50, 38, .12);
  font-size: max(12px, .75rem);
  line-height: 1.3;
  text-shadow: none;
  white-space: normal;
  overflow-wrap: break-word;
}

.guide-card {
  position: relative;
  z-index: 22;
  display: grid;
  grid-template-columns: minmax(0, 220px) 190px;
  align-items: end;
  justify-content: center;
  justify-self: center;
  width: min(400px, 100%);
  margin: 0;
  pointer-events: none;
}

.guide-card > img {
  position: relative;
  z-index: 2;
  width: 180px;
  height: auto;
  aspect-ratio: 1402 / 1122;
  flex: 0 0 auto;
  object-fit: contain;
  mask-image: var(--sopo-mask);
  mask-mode: alpha;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
  filter: drop-shadow(0 7px 7px rgba(33, 72, 84, .28));
  -webkit-mask-image: var(--sopo-mask);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
}

.guide-card > div {
  position: relative;
  justify-self: end;
  width: 100%;
  max-width: 220px;
  min-width: 0;
  margin: 0;
  padding: 12px 18px 11px 14px;
  border: 3px solid #fff;
  border-radius: 18px;
  background: rgba(247, 253, 255, .96);
  box-shadow: 0 8px 18px rgba(24, 75, 98, .2);
}

.guide-name {
  margin: 0 0 3px;
  color: #ad5d22;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .055em;
}

.sopo-copy {
  margin: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.9rem, 1.35vw, 1.08rem);
  font-weight: 700;
  line-height: 1.24;
}

.tutorial-hand {
  position: fixed;
  z-index: 80;
  width: 78px;
  pointer-events: none;
  filter: drop-shadow(0 7px 7px rgba(15, 44, 61, .42));
}

.tutorial-hand img {
  display: block;
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.tutorial-hand span {
  display: block;
  width: max-content;
  max-width: 92px;
  margin: -3px auto 0;
  padding: 4px 8px;
  border: 2px solid #fff;
  border-radius: 7px;
  background: var(--navy);
  color: #fff;
  font-size: .7rem;
  font-weight: 900;
  text-align: center;
}

.demo-banner {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(500px, 76%);
  min-height: 48px;
  margin: 0 auto;
  padding: 8px 8px 8px 14px;
  border: 3px solid #fff;
  border-radius: 13px;
  background: rgba(18, 64, 97, .93);
  box-shadow: 0 7px 16px rgba(12, 58, 83, .24);
  color: #fff;
}

.demo-banner p {
  margin: 0;
  font-size: clamp(.76rem, 1.15vw, .93rem);
  font-weight: 800;
  line-height: 1.2;
}

.text-button {
  min-height: 48px;
  padding: 8px 11px;
  background: transparent;
  color: #fff;
  font-size: .82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-banner .text-button {
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, .7);
  border-radius: 8px;
}

.demo-banner .text-button:disabled {
  cursor: default;
  opacity: .5;
}

.rune-mark {
  position: fixed;
  z-index: 60;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: max(8px, env(safe-area-inset-left));
  width: 29px;
  height: 43px;
  object-fit: contain;
  opacity: .94;
  pointer-events: none;
  filter: drop-shadow(0 4px 4px rgba(7, 35, 53, .28));
}

.intro-rune {
  z-index: 4;
}

.overlay-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(18px, 4vw, 46px);
  border: 0;
  background: transparent;
  overflow: auto;
}

.overlay-dialog::backdrop {
  background: rgba(5, 35, 58, .76);
}

.dialog-card {
  position: relative;
  width: min(690px, 100%);
  margin: auto;
  padding: clamp(24px, 4vw, 42px);
  border: 5px solid #f3cf75;
  border-radius: 18px;
  background: #fffdf3;
  box-shadow: 0 24px 80px rgba(0, 20, 35, .46);
  color: var(--ink);
}

.dialog-card::before {
  position: absolute;
  top: -11px;
  right: 7%;
  left: 7%;
  height: 20px;
  border-radius: 50%;
  background: #f5fcff;
  box-shadow: 0 4px 6px rgba(71, 122, 143, .16);
  content: "";
  pointer-events: none;
}

.dialog-card h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.5vw, 3.35rem);
  line-height: .96;
  letter-spacing: -.025em;
}

.dialog-card p {
  line-height: 1.48;
}

.dialog-rune {
  position: absolute;
  bottom: 9px;
  left: 11px;
  width: 28px;
  height: 40px;
  object-fit: contain;
  opacity: .9;
  pointer-events: none;
}

.illustrated-card {
  display: grid;
  grid-template-columns: minmax(170px, .8fr) 1.2fr;
  align-items: center;
  gap: 24px;
  overflow: hidden;
}

.pause-scene {
  position: relative;
  align-self: stretch;
  min-height: 260px;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 16px;
  background: #9ddfed;
}

.pause-scene img {
  position: absolute;
  right: -14%;
  bottom: -7%;
  width: 118%;
}

.snow-dot {
  position: absolute;
  z-index: 2;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .18);
}

.dot-a {
  top: 18px;
  left: 28px;
  width: 7px;
  height: 7px;
}

.dot-b {
  top: 70px;
  right: 18px;
  width: 10px;
  height: 10px;
}

.dot-c {
  top: 120px;
  left: 12px;
  width: 5px;
  height: 5px;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 9px;
}

.primary-button {
  border: 2px solid #f2c45d;
  background: var(--navy);
  box-shadow: 0 5px 0 var(--navy-deep);
  color: #fff;
}

.secondary-button {
  border: 2px solid #9bb9c4;
  background: #fff;
  color: var(--navy);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(3px);
}

.dialog-card .text-button {
  color: var(--navy);
}

.close-button {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid #adc6cc;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.level-menu-list {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.level-choice {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 14px;
  border: 2px solid #c3d7dc;
  border-radius: 10px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  text-align: left;
}

.level-choice:not(:disabled):hover,
.level-choice.is-current {
  border-color: #d39a32;
  background: #fff8d8;
}

.level-choice:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.level-choice b:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
}

.level-choice small {
  display: block;
  color: #5a6b78;
}

.level-choice-stars {
  color: #c47f12;
  font-size: .8rem;
  letter-spacing: 1px;
}

.help-card {
  max-width: 790px;
}

.help-pictograms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.help-pictograms > div {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: 11px;
  background: #e9f8fc;
  text-align: center;
}

.help-pictograms strong {
  margin-top: 7px;
  color: var(--navy);
}

.help-pictograms small {
  margin-top: 4px;
  color: #586b78;
  font-size: .74rem;
}

.pictogram {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 52px;
  border: 2px solid #f2c454;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-weight: 900;
}

.drag-pictogram::before {
  width: 28px;
  height: 28px;
  border: 3px solid var(--navy);
  border-radius: 5px;
  content: "";
}

.drag-pictogram::after {
  position: absolute;
  right: 4px;
  bottom: 3px;
  color: var(--navy);
  content: "→";
  font-size: 1.2rem;
}

.tap-pictogram::before {
  width: 17px;
  height: 27px;
  border: 3px solid var(--navy);
  border-radius: 10px 10px 6px 6px;
  background: #f9d57e;
  content: "";
  transform: rotate(-24deg);
}

.ok-pictogram {
  border: 0;
  background: url("assets/ui/button-check-normal.webp") center / contain no-repeat;
  color: transparent;
}

.parent-note {
  padding: 13px 15px;
  border: 2px solid #ead7a9;
  border-radius: 9px;
  background: #fff8e6;
}

.help-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.celebration-card {
  width: min(760px, 100%);
  text-align: center;
}

.high-five-art {
  display: block;
  width: min(560px, 100%);
  max-height: 48vh;
  margin: -8px auto 0;
  object-fit: contain;
}

.celebration-card .primary-button {
  min-width: 190px;
}

.finale-card {
  width: min(760px, 100%);
  overflow: hidden;
  text-align: center;
}

.finale-sky {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #eafaff;
}

.finale-characters {
  display: flex;
  justify-content: center;
  margin: 8px auto -8px;
}

.finale-characters img {
  width: min(220px, 34%);
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 28%;
  border: 5px solid #fff;
  border-radius: 16px;
  box-shadow: var(--snow-shadow);
}

.finale-characters img + img {
  margin-left: -18px;
}

.finale-card button {
  display: block;
  margin: 11px auto 0;
}

.finale-audio-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.finale-audio-actions button {
  margin-top: 8px;
}

.app.is-paused * {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (orientation: landscape) and (min-width: 900px) {
  .icon-control,
  .help-control {
    width: 64px;
    min-width: 64px;
    height: 64px;
    min-height: 64px;
  }

  .help-art {
    width: 64px;
    height: 64px;
  }

  .control-row {
    gap: 8px;
  }

  .route-track[data-sign-count="2"] .sign,
  .route-track[data-sign-count="3"] .sign {
    width: clamp(140px, 14vw, 155px);
    font-size: clamp(3rem, 5.4vw, 4rem);
  }

  .route-track[data-sign-count="4"] .sign {
    width: clamp(118px, 14vw, 145px);
    font-size: clamp(2.55rem, 4.5vw, 3.5rem);
  }

  .route-track[data-sign-count="5"] .sign {
    width: clamp(96px, 11.5vw, 120px);
    font-size: clamp(2.15rem, 3.8vw, 3rem);
  }

  .route-connector,
  .route-track[data-sign-count="5"] .route-connector {
    flex-basis: clamp(18px, 2vw, 30px);
    width: clamp(18px, 2vw, 30px);
  }

  .fox-runner {
    width: clamp(160px, 15vw, 180px);
  }

  .route-zone {
    padding-bottom: 24px;
  }

  .number-token,
  .drag-ghost {
    width: clamp(64px, 5.4vw, 74px);
    min-width: clamp(64px, 5.4vw, 74px);
    height: clamp(64px, 5.4vw, 74px);
    font-size: clamp(2.1rem, 2.8vw, 2.55rem);
  }

  .ok-button {
    width: clamp(72px, 6vw, 82px);
    min-width: 72px;
    height: clamp(72px, 6vw, 82px);
    min-height: 72px;
  }
}

@media (orientation: portrait) {
  .game-screen {
    grid-template-rows: 64px minmax(0, 1fr);
  }

  .topbar {
    align-items: flex-start;
    padding-top: max(5px, env(safe-area-inset-top));
  }

  .wordmark {
    display: none;
  }

  .control-row {
    gap: 4px;
  }

  .icon-control,
  .help-control {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
  }

  .help-art {
    width: 56px;
    height: 56px;
  }

  .play-area {
    padding-right: max(7px, env(safe-area-inset-right));
    padding-left: max(7px, env(safe-area-inset-left));
  }

  .board-card {
    gap: 4px;
  }

  .progress-strip {
    grid-template-columns: minmax(102px, 1fr) auto minmax(78px, .8fr);
    width: 100%;
    min-height: 50px;
    padding: 2px 4px;
  }

  .level-pill {
    min-height: 48px;
    padding: 3px 6px;
  }

  .task-star {
    width: clamp(21px, 5.8vw, 28px);
    height: clamp(21px, 5.8vw, 28px);
  }

  .world-prop {
    width: clamp(20px, 4.4vw, 24px);
    height: clamp(23px, 5vw, 27px);
  }

  .demo-banner {
    width: 100%;
    min-height: 54px;
    padding: 0 5px;
  }

  .demo-banner p {
    font-size: clamp(.74rem, 3vw, .88rem);
  }

  #board-content {
    grid-template-rows: auto minmax(160px, 240px) auto auto;
    align-content: center;
  }

  .task-brief {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .guide-card {
    grid-row: 1;
    grid-template-columns: minmax(0, 220px) clamp(120px, 34vw, 150px);
    width: max-content;
    max-width: 100%;
  }

  .guide-card > img {
    width: clamp(120px, 34vw, 150px);
    margin: 0;
  }

  .guide-card > div {
    padding: 7px 10px 6px 12px;
  }

  .guide-name {
    margin-bottom: 2px;
    font-size: .66rem;
  }

  .sopo-copy {
    font-size: clamp(.76rem, 3vw, .88rem);
    line-height: 1.14;
  }

  .task-heading {
    grid-row: 2;
    justify-self: center;
    width: auto;
    min-width: 190px;
    max-width: min(280px, 100%);
    padding: 4px 14px 3px;
  }

  .task-heading h2 {
    font-size: clamp(1.08rem, 4.6vw, 1.34rem);
  }

  .route-zone {
    padding: 2px 2px 22px;
  }

  .route-track[data-sign-count="2"] .sign,
  .route-track[data-sign-count="3"] .sign {
    width: clamp(86px, 22vw, 130px);
    font-size: clamp(2.35rem, 8vw, 3.35rem);
  }

  .route-track[data-sign-count="4"] .sign {
    width: clamp(76px, 19vw, 118px);
    font-size: clamp(2.1rem, 7vw, 3rem);
  }

  .route-track[data-sign-count="5"] .sign {
    width: clamp(62px, 15vw, 104px);
    font-size: clamp(1.7rem, 5.7vw, 2.65rem);
  }

  .route-connector,
  .route-track[data-sign-count="5"] .route-connector {
    flex-basis: clamp(8px, 2.4vw, 14px);
    width: clamp(8px, 2.4vw, 14px);
  }

  .route-connector small {
    display: none;
  }

  .fox-runner {
    width: clamp(120px, 28vw, 160px);
  }

  .response-group {
    min-height: 70px;
    column-gap: 8px;
  }

  .candidate-area[data-choice-count="6"] {
    grid-template-columns: repeat(3, max-content);
  }

  .candidate-area[data-choice-count="8"] {
    grid-template-columns: repeat(4, max-content);
  }

  .number-token,
  .drag-ghost {
    width: clamp(56px, 15vw, 68px);
    min-width: clamp(56px, 15vw, 68px);
    height: clamp(56px, 15vw, 68px);
    font-size: clamp(1.9rem, 7vw, 2.35rem);
  }

  .ok-button {
    width: clamp(60px, 16vw, 70px);
    min-width: 60px;
    height: clamp(60px, 16vw, 70px);
    min-height: 60px;
  }

  .feedback-line {
    min-height: 2.6em;
    font-size: clamp(.68rem, 2.7vw, .82rem);
  }
}

@media (orientation: portrait) and (max-width: 499px) {
  .pause-dialog {
    padding: 12px;
  }

  .pause-dialog .illustrated-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 18px 16px 30px;
    text-align: center;
  }

  .pause-dialog .pause-scene {
    justify-self: center;
    align-self: center;
    width: 130px;
    min-width: 130px;
    height: 130px;
    min-height: 130px;
  }

  .pause-dialog .dialog-copy {
    min-width: 0;
  }

  .pause-dialog .dialog-copy .eyebrow {
    margin-bottom: 5px;
  }

  .pause-dialog .dialog-copy h2 {
    margin-bottom: 8px;
  }

  .pause-dialog .dialog-copy p:not(.eyebrow) {
    max-width: 34ch;
    margin: 0 auto 12px;
    line-height: 1.3;
  }

  .pause-dialog .help-actions {
    justify-content: center;
    gap: 10px;
  }
}

@media (orientation: portrait) and (min-width: 450px) and (max-width: 599px) {
  .guide-card {
    grid-template-columns: minmax(0, 220px) clamp(150px, 30vw, 170px);
  }

  .guide-card > img {
    width: clamp(150px, 30vw, 170px);
  }
}

@media (orientation: portrait) and (min-width: 600px) {
  #board-content {
    grid-template-rows: auto minmax(200px, 290px) auto auto;
  }

  .guide-card {
    grid-template-columns: minmax(0, 220px) clamp(150px, 30vw, 170px);
  }

  .guide-card > img {
    width: clamp(150px, 30vw, 170px);
  }
}

@media (orientation: portrait) and (max-height: 749px) {
  #board-content {
    grid-template-rows: auto minmax(160px, 240px) auto auto;
  }

  .guide-card > div {
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .sopo-copy {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.1;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .feedback-line {
    min-height: 2.2em;
  }
}

@media (orientation: portrait) and (max-width: 379px) {
  .route-track[data-sign-count="5"] .sign {
    width: 58px;
    min-width: 58px;
  }

  .route-connector,
  .route-track[data-sign-count="5"] .route-connector {
    flex-basis: 8px;
    width: 8px;
  }

  .response-group {
    column-gap: 6px;
    padding-right: 6px;
    padding-left: 6px;
  }
}

@media (orientation: landscape) and (max-height: 720px) {
  .game-screen {
    grid-template-rows: 60px minmax(0, 1fr);
  }

  .topbar {
    padding-top: 4px;
  }

  .icon-control,
  .help-control {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
  }

  .help-art {
    width: 56px;
    height: 56px;
  }

  .control-row {
    gap: 5px;
  }

  .wordmark {
    top: 7px;
    min-width: 116px;
    padding: 7px 10px;
  }

  .wordmark span {
    font-size: .88rem;
  }

  .wordmark small {
    font-size: .7rem;
  }

  .play-area {
    padding-bottom: 4px;
  }

  .board-card {
    gap: 4px;
  }

  .progress-strip {
    width: min(820px, 100%);
    min-height: 50px;
    padding: 2px 5px;
  }

  .level-pill {
    min-height: 48px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .demo-banner {
    width: min(620px, 100%);
    min-height: 50px;
    padding: 0 5px;
  }

  .demo-banner p {
    font-size: .76rem;
    line-height: 1.1;
  }

  #board-content {
    grid-template-rows: auto minmax(180px, 1fr) auto auto;
    gap: 2px;
  }

  .task-brief {
    grid-template-columns: 170px minmax(0, 370px);
    gap: 12px;
  }

  .task-heading {
    width: 170px;
    padding: 3px 8px 2px;
  }

  .task-heading h2 {
    font-size: 1rem;
  }

  .direction-line {
    margin-top: 2px;
  }

  .direction-chip {
    min-height: 18px;
    padding: 0 5px;
    font-size: .66rem;
  }

  .guide-card {
    grid-template-columns: minmax(0, 220px) clamp(150px, 16vw, 160px);
    width: min(380px, 100%);
  }

  .guide-card > img {
    width: clamp(150px, 16vw, 160px);
  }

  .guide-card > div {
    padding: 5px 8px 4px 10px;
  }

  .guide-name {
    margin-bottom: 1px;
    font-size: .64rem;
  }

  .sopo-copy {
    font-size: clamp(.7rem, 1.35vw, .82rem);
    line-height: 1.1;
  }

  .route-zone {
    padding: 0 2px 24px;
  }

  .route-track[data-sign-count="2"] .sign,
  .route-track[data-sign-count="3"] .sign {
    width: clamp(88px, 10.5vw, 110px);
    font-size: clamp(2.5rem, 4.8vw, 3rem);
  }

  .route-track[data-sign-count="4"] .sign {
    width: clamp(82px, 9.2vw, 98px);
    font-size: clamp(2.2rem, 4vw, 2.65rem);
  }

  .route-track[data-sign-count="5"] .sign {
    width: clamp(68px, 7.6vw, 84px);
    font-size: clamp(1.8rem, 3.4vw, 2.2rem);
  }

  .route-connector,
  .route-track[data-sign-count="5"] .route-connector {
    flex-basis: 10px;
    width: 10px;
  }

  .fox-runner {
    width: clamp(118px, 18vw, 160px);
  }

  .response-group {
    min-height: 60px;
  }

  .candidate-area[data-choice-count="6"] {
    grid-template-columns: repeat(6, max-content);
  }

  .candidate-area[data-choice-count="8"] {
    grid-template-columns: repeat(8, max-content);
  }

  .number-token,
  .drag-ghost {
    width: 58px;
    min-width: 58px;
    height: 58px;
    font-size: 1.9rem;
  }

  .ok-button {
    width: 66px;
    min-width: 66px;
    height: 66px;
    min-height: 66px;
  }

  .feedback-line {
    min-height: 2.2em;
    font-size: .72rem;
  }
}

@media (orientation: landscape) and (max-height: 460px) {
  .game-screen {
    grid-template-rows: 56px minmax(0, 1fr);
  }

  .topbar {
    padding-top: 0;
  }

  .play-area {
    padding: 0 6px 2px;
  }

  .board-card {
    width: min(900px, 100%);
    gap: 2px;
  }

  .progress-strip {
    width: min(760px, 100%);
    min-height: 48px;
    padding: 0 3px;
    border-width: 1px;
  }

  .demo-banner {
    width: min(620px, 100%);
    min-height: 54px;
    height: 54px;
    padding: 0 4px;
  }

  .demo-banner p {
    font-size: .68rem;
    line-height: 1.05;
  }

  #board-content {
    grid-template-areas:
      "heading side"
      "route side"
      "feedback feedback";
    grid-template-columns: minmax(0, 1fr) minmax(280px, 40%);
    grid-template-rows: auto minmax(140px, 1fr) auto;
    gap: 1px 8px;
  }

  .task-brief {
    display: contents;
  }

  .task-heading {
    grid-area: heading;
    justify-self: center;
    width: min(220px, 100%);
    max-width: 100%;
    padding: 2px 8px 1px;
    border-width: 1px;
  }

  .task-heading h2 {
    font-size: .92rem;
  }

  .direction-line {
    display: flex;
  }

  .guide-card {
    grid-area: side;
    grid-template-columns: minmax(0, 1fr) 84px;
    align-self: start;
    justify-self: end;
    width: 100%;
    max-width: 340px;
  }

  .guide-card > img {
    width: 84px;
  }

  .guide-card > div {
    padding: 4px 6px;
    border-width: 2px;
  }

  .guide-name {
    font-size: .6rem;
  }

  .sopo-copy {
    display: -webkit-box;
    overflow: hidden;
    font-size: .66rem;
    line-height: 1.05;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .route-zone {
    grid-area: route;
    min-height: 140px;
    padding: 0 2px 8px;
  }

  .route-track[data-sign-count="2"] .sign,
  .route-track[data-sign-count="3"] .sign {
    width: 64px;
    font-size: 2rem;
  }

  .route-track[data-sign-count="4"] .sign {
    width: 58px;
    font-size: 1.85rem;
  }

  .route-track[data-sign-count="5"] .sign {
    width: 50px;
    font-size: 1.55rem;
  }

  .route-connector,
  .route-track[data-sign-count="5"] .route-connector {
    flex-basis: 8px;
    width: 8px;
  }

  .route-connector b {
    font-size: 1.2rem;
  }

  .route-connector small,
  .sign-label {
    display: none;
  }

  .fox-runner {
    width: 70px;
  }

  .response-group {
    grid-area: side;
    align-self: end;
    min-height: 0;
    column-gap: 6px;
    padding: 2px 6px 4px;
  }

  .candidate-area {
    gap: 2px 5px;
  }

  .candidate-label {
    font-size: .62rem;
  }

  .candidate-area[data-choice-count="6"] {
    grid-template-columns: repeat(3, max-content);
  }

  .candidate-area[data-choice-count="7"],
  .candidate-area[data-choice-count="8"] {
    grid-template-columns: repeat(4, max-content);
  }

  .number-token,
  .drag-ghost {
    width: 48px;
    min-width: 48px;
    height: 48px;
    border-width: 4px;
    font-size: 1.55rem;
  }

  .ok-button {
    width: 54px;
    min-width: 54px;
    height: 54px;
    min-height: 54px;
  }

  .feedback-line {
    grid-area: feedback;
    min-height: 16px;
    padding: 0 4px;
    font-size: .64rem;
    line-height: 1.05;
  }

  .overlay-dialog {
    padding: 8px 12px;
  }

  .dialog-card {
    padding: 10px 16px 42px;
  }

  .dialog-card h2 {
    margin-bottom: 3px;
    font-size: 1.45rem;
  }

  .dialog-card .eyebrow {
    margin-bottom: 3px;
    font-size: .7rem;
  }

  .overlay-dialog .primary-button,
  .overlay-dialog .secondary-button {
    min-height: 48px;
    padding: 7px 14px;
  }

  .close-button {
    top: 8px;
    right: 8px;
  }

  .illustrated-card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 14px;
    padding: 10px 16px 42px;
  }

  .pause-scene {
    width: 104px;
    min-height: 104px;
    height: 104px;
    align-self: start;
  }

  .pause-dialog .dialog-copy p:not(.eyebrow) {
    margin: 4px 0 8px;
    font-size: .8rem;
    line-height: 1.2;
  }

  .levels-dialog .dialog-card {
    padding: 10px 58px 12px;
  }

  .level-menu-list {
    gap: 4px;
    margin-top: 4px;
  }

  .level-choice {
    min-height: 48px;
    padding: 2px 8px;
  }

  .help-card {
    padding: 10px 16px 42px;
  }

  .help-pictograms {
    gap: 6px;
    margin: 5px 0;
  }

  .help-pictograms > div {
    min-height: 66px;
    padding: 3px;
  }

  .pictogram {
    width: 42px;
    height: 34px;
  }

  .help-pictograms strong {
    margin-top: 2px;
    font-size: .78rem;
  }

  .help-pictograms small {
    margin-top: 1px;
    font-size: .7rem;
    line-height: 1.1;
  }

  .parent-note {
    margin: 4px 0 6px;
    padding: 5px 8px;
    font-size: .74rem;
    line-height: 1.18;
  }

  .help-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .help-actions .text-button {
    font-size: .76rem;
  }

  .high-five-art {
    max-height: 32vh;
  }

  .finale-card {
    padding: 10px 48px 42px;
  }

  .finale-card h2 {
    font-size: clamp(1.25rem, 2.3vw, 1.55rem);
  }

  .finale-characters {
    margin: 2px auto;
  }

  .finale-characters img {
    width: 88px;
    border-width: 3px;
  }

  .finale-card p:not(.eyebrow) {
    margin: 2px 0 4px;
    font-size: .78rem;
    line-height: 1.18;
  }

  .finale-audio-actions {
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 3px;
  }

  .finale-card button {
    margin-top: 4px;
  }
}

@media (orientation: landscape) and (min-height: 461px) and (max-height: 650px) {
  .finale-dialog {
    padding: 12px 18px;
  }

  .finale-card {
    padding: 14px 28px 34px;
  }

  .finale-card .eyebrow {
    margin-bottom: 6px;
  }

  .finale-card h2 {
    margin-bottom: 8px;
    font-size: 2rem;
    line-height: 1.05;
  }

  .finale-characters {
    height: 150px;
    margin: 2px auto 4px;
  }

  .finale-characters img {
    width: 150px;
    height: 150px;
    border-width: 4px;
  }

  .finale-card p:not(.eyebrow) {
    margin: 4px 0 6px;
    line-height: 1.25;
  }

  .finale-audio-actions {
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 4px;
  }

  .finale-audio-actions button {
    min-height: 48px;
    margin-top: 0;
    padding: 7px 10px;
    font-size: .9rem;
    white-space: nowrap;
  }

  .finale-card > .text-button {
    min-height: 48px;
    margin-top: 6px;
  }
}

@media (max-width: 599px) {
  .level-choice {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .level-choice-stars {
    display: none;
  }

  .help-card {
    max-height: calc(100dvh - 36px);
    overflow-y: auto;
  }

  .help-pictograms {
    grid-template-columns: 1fr;
  }

  .help-pictograms > div {
    min-height: 82px;
    flex-direction: row;
    gap: 10px;
  }

  .help-pictograms strong {
    margin-top: 0;
  }

  .intro-action {
    width: min(92vw, 560px);
    flex-direction: column;
    gap: 12px;
  }
}
