:root {
  color-scheme: light;
  --paper: #f7eedc;
  --ink: #493628;
  --moss: #748542;
  --honey: #df9f32;
  --fog: #c6d0cc;
  --forest-shadow: #304936;
  --paper-light: #fffaf0;
  --paper-deep: #eadbbd;
  --line: rgba(108, 78, 49, .28);
  --shadow: rgba(64, 49, 34, .18);
  --display: Georgia, "Times New Roman", serif;
  --body: Georgia, "Times New Roman", serif;
  --ui: "Avenir Next", "Trebuchet MS", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--paper); }

body.labyrinth-page {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 9% 4%, rgba(255, 255, 255, .76), transparent 29rem),
    radial-gradient(ellipse at 96% 100%, rgba(220, 185, 109, .17), transparent 32rem),
    linear-gradient(115deg, rgba(255, 255, 255, .22), transparent 36%),
    var(--paper);
  font-family: var(--body);
}

body.labyrinth-page::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  opacity: .25;
  background-image:
    radial-gradient(rgba(102, 75, 48, .16) .55px, transparent .7px),
    radial-gradient(rgba(255, 255, 255, .65) .55px, transparent .75px);
  background-position: 0 0, 3px 2px;
  background-size: 5px 5px, 7px 7px;
  content: "";
  pointer-events: none;
}

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

button { font: inherit; }

img { display: block; max-width: 100%; }

.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;
}

.labyrinth-skip {
  position: fixed;
  z-index: 50;
  top: 10px;
  left: 10px;
  padding: 11px 15px;
  border-radius: 10px;
  color: var(--paper-light);
  background: var(--forest-shadow);
  box-shadow: 0 5px 14px rgba(32, 47, 32, .25);
  font: 700 13px/1 var(--ui);
  text-decoration: none;
  transform: translateY(-160%);
}

.labyrinth-skip:focus { transform: translateY(0); }

.labyrinth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1160px, calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.labyrinth-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font: 500 clamp(22px, 2.8vw, 33px)/1 var(--display);
  letter-spacing: -.05em;
  text-decoration: none;
}

.labyrinth-brand__mark {
  color: var(--moss);
  font-size: 27px;
  transform: rotate(-18deg);
}

.labyrinth-back,
.labyrinth-text-button {
  padding: 0;
  border: 0;
  color: var(--forest-shadow);
  background: transparent;
  font: 700 12px/1 var(--ui);
  text-decoration: none;
}

.labyrinth-text-button { cursor: pointer; }

.labyrinth-app {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 5vw, 58px) 0 72px;
}

.labyrinth-app:focus { outline: 0; }

.labyrinth-step {
  margin: 0;
  color: rgba(73, 54, 40, .72);
  font: 700 10px/1.2 var(--ui);
  letter-spacing: .12em;
}

.labyrinth-screen-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 10px 0 8px;
  color: var(--moss);
}

.labyrinth-screen-heading span { font-size: 22px; transform: rotate(-11deg); }

.labyrinth-screen-heading h1,
.labyrinth-map-heading h1,
.labyrinth-complete h1,
.labyrinth-encounter h2 {
  margin: 0;
  color: var(--ink);
  font: 500 clamp(35px, 5vw, 59px)/.98 var(--display);
  letter-spacing: -.045em;
  text-align: center;
}

.labyrinth-screen-lead {
  max-width: 590px;
  margin: 13px auto 0;
  color: rgba(73, 54, 40, .86);
  font-size: 16px;
  line-height: 1.48;
  text-align: center;
}

.labyrinth-hero-screen,
.labyrinth-level-screen,
.labyrinth-complete {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .58), transparent 38%),
    rgba(255, 248, 232, .76);
  box-shadow: 0 16px 35px rgba(83, 61, 36, .1);
}

.labyrinth-hero-screen::before,
.labyrinth-level-screen::before,
.labyrinth-complete::before {
  position: absolute;
  z-index: 0;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(116, 133, 66, .22);
  border-radius: 46% 54% 52% 48%;
  content: "";
  opacity: .65;
  pointer-events: none;
}

.labyrinth-hero-screen::before { right: -87px; bottom: -100px; }
.labyrinth-level-screen::before { left: -103px; top: -118px; }
.labyrinth-complete::before { right: -100px; top: -105px; }

.labyrinth-hero-screen,
.labyrinth-level-screen { padding: clamp(25px, 4vw, 44px); }

.labyrinth-hero-screen > *,
.labyrinth-level-screen > *,
.labyrinth-complete > * { position: relative; z-index: 1; }

.hero-choice-grid--storybook {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2.2vw, 25px);
  max-width: 760px;
  margin: clamp(22px, 4vw, 34px) auto 0;
}

.hero-choice {
  display: grid;
  grid-template-rows: minmax(145px, 1fr) auto;
  position: relative;
  min-width: 0;
  min-height: 286px;
  padding: 15px 15px 17px;
  overflow: hidden;
  border: 1px solid rgba(103, 76, 45, .2);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 250, 239, .74);
  box-shadow: 0 6px 14px rgba(76, 57, 35, .06);
  cursor: pointer;
  text-align: center;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.hero-choice:hover { transform: translateY(-4px); box-shadow: 0 13px 22px rgba(76, 57, 35, .14); }

.hero-choice.is-selected {
  border: 2px solid var(--moss);
  background: linear-gradient(155deg, rgba(232, 235, 204, .82), rgba(255, 250, 239, .82));
}

.hero-choice__portrait {
  display: grid;
  position: relative;
  min-height: 151px;
  overflow: hidden;
  border: 1px solid rgba(98, 78, 50, .18);
  border-radius: 11px;
  background:
    radial-gradient(ellipse at 50% 89%, rgba(109, 131, 81, .24), transparent 53%),
    linear-gradient(145deg, rgba(235, 238, 210, .9), rgba(250, 233, 190, .72));
  place-items: end center;
}

.hero-choice--fox .hero-choice__portrait { background: linear-gradient(145deg, rgba(250, 228, 184, .82), rgba(232, 237, 207, .82)); }

.hero-choice__portrait img {
  width: min(89%, 205px);
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 7px rgba(77, 57, 34, .2));
}

.hero-choice__copy { display: grid; gap: 6px; padding: 12px 6px 0; }

.hero-choice__copy strong,
.level-choice__copy strong {
  color: var(--ink);
  font: 500 25px/1 var(--display);
}

.hero-choice__copy span { font-size: 13px; line-height: 1.34; }

.hero-choice__check {
  display: grid;
  position: absolute;
  top: 25px;
  right: 25px;
  width: 31px;
  height: 31px;
  border: 1px solid var(--moss);
  border-radius: 50%;
  color: var(--paper-light);
  background: var(--moss);
  font: 800 18px/1 var(--ui);
  place-items: center;
}

.labyrinth-screen-note { margin: 18px 0 0; color: rgba(73, 54, 40, .68); font-size: 13px; text-align: center; }

.labyrinth-screen-topline { display: flex; align-items: center; gap: 13px; }

.labyrinth-round-back {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(137, 98, 50, .38);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(252, 238, 200, .9);
  box-shadow: 0 3px 7px rgba(75, 55, 31, .09);
  cursor: pointer;
  font: 500 26px/1 var(--display);
  place-items: center;
}

.level-choice-grid--storybook {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
  margin-top: clamp(23px, 3.4vw, 33px);
}

.level-choice {
  display: grid;
  position: relative;
  min-width: 0;
  padding: 10px 10px 15px;
  overflow: hidden;
  border: 1px solid rgba(103, 76, 45, .22);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 250, 239, .68);
  box-shadow: 0 6px 15px rgba(76, 57, 35, .06);
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.level-choice:hover { transform: translateY(-3px); box-shadow: 0 12px 20px rgba(76, 57, 35, .13); }
.level-choice.is-selected { border: 2px solid var(--moss); background: rgba(240, 239, 211, .84); }

.level-choice__art {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(105, 78, 46, .18);
  border-radius: 10px;
  background: linear-gradient(135deg, #aabf9c, #e5cf9d);
}

.level-choice__art img { width: 100%; height: 100%; object-fit: cover; }
.level-choice__copy { display: grid; gap: 6px; padding: 12px 7px 0; }
.level-choice__copy strong { font-size: clamp(20px, 2.2vw, 26px); }
.level-choice__copy small { color: rgba(73, 54, 40, .75); font: 700 11px/1 var(--ui); }
.level-choice__copy em { min-height: 29px; color: rgba(73, 54, 40, .78); font-size: 12px; font-style: normal; line-height: 1.25; }

.level-choice__stars { display: inline-flex; gap: 2px; color: #c6b89e; font-size: 19px; }
.level-choice__stars .is-filled { color: var(--honey); text-shadow: 0 1px 0 #9d6b22; }

.level-choice__done {
  position: absolute;
  top: 18px;
  right: 17px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  color: var(--forest-shadow);
  background: rgba(250, 238, 188, .91);
  font: 800 10px/1 var(--ui);
}

.labyrinth-endless-choice {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(176px, 238px) minmax(0, 1fr) auto;
  position: relative;
  isolation: isolate;
  align-items: center;
  gap: clamp(14px, 2.4vw, 28px);
  min-height: 145px;
  padding: 12px 17px 12px 12px;
  overflow: hidden;
  border: 1px solid rgba(103, 76, 45, .25);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 249, 231, .78);
  box-shadow: 0 7px 16px rgba(76, 57, 35, .08);
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.labyrinth-endless-choice::before {
  position: absolute;
  z-index: -1;
  top: 24px;
  right: 118px;
  left: 258px;
  height: 26px;
  border-top: 2px dashed rgba(126, 94, 49, .48);
  border-radius: 50%;
  content: "";
  opacity: .8;
  transform: rotate(-2deg);
}

.labyrinth-endless-choice:hover { transform: translateY(-3px); box-shadow: 0 13px 23px rgba(76, 57, 35, .14); }

.labyrinth-endless-choice.is-selected {
  border: 2px solid var(--moss);
  background: rgba(240, 239, 211, .86);
}

.labyrinth-endless-choice__art {
  display: grid;
  position: relative;
  align-self: stretch;
  min-height: 118px;
  overflow: hidden;
  border: 1px solid rgba(98, 75, 43, .23);
  border-radius: 11px;
  background: #bdcaa6;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 229, .42);
  place-items: center;
}

.labyrinth-endless-choice__art::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 246, 220, .18), transparent 48%, rgba(70, 85, 55, .16));
  content: "";
  pointer-events: none;
}

.labyrinth-endless-choice__art img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.88) sepia(.08); }

.labyrinth-endless-choice__route {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.labyrinth-endless-choice__route i {
  position: absolute;
  display: block;
  height: 0;
  border-top: 2px dashed rgba(93, 65, 37, .76);
  border-radius: 50%;
}

.labyrinth-endless-choice__route i:nth-child(1) { top: 28%; left: 9%; width: 47%; transform: rotate(7deg); }
.labyrinth-endless-choice__route i:nth-child(2) { top: 52%; right: 10%; width: 44%; transform: rotate(-52deg); }
.labyrinth-endless-choice__route i:nth-child(3) { bottom: 18%; left: 17%; width: 52%; transform: rotate(9deg); }

.labyrinth-endless-choice__compass {
  display: grid;
  position: absolute;
  z-index: 2;
  right: 9px;
  bottom: 8px;
  width: 35px;
  height: 35px;
  border: 1px solid rgba(121, 84, 39, .48);
  border-radius: 50%;
  color: #a76c20;
  background: rgba(255, 245, 212, .86);
  box-shadow: 0 2px 5px rgba(60, 51, 33, .2);
  font: 20px/1 var(--display);
  place-items: center;
}

.labyrinth-endless-choice__copy {
  display: grid;
  position: relative;
  z-index: 1;
  gap: 5px;
  min-width: 0;
  padding: 7px 0;
}

.labyrinth-endless-choice__copy strong { color: var(--ink); font: 500 clamp(23px, 2.6vw, 31px)/1.02 var(--display); }
.labyrinth-endless-choice__copy em { color: var(--forest-shadow); font: 800 12px/1.25 var(--ui); font-style: normal; }
.labyrinth-endless-choice__copy small { color: rgba(73, 54, 40, .74); font: 500 12px/1.3 var(--ui); }

.labyrinth-endless-choice__stamp {
  display: grid;
  position: relative;
  z-index: 1;
  min-width: 108px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px dashed rgba(131, 90, 42, .7);
  border-radius: 8px 10px 8px 9px;
  color: #805528;
  background: rgba(255, 239, 196, .6);
  box-shadow: inset 0 0 0 2px rgba(255, 251, 233, .45);
  font: 800 10px/1.22 var(--ui);
  place-items: center;
  text-align: center;
  transform: rotate(2deg);
}

.labyrinth-map-chapter { margin: 2px 0; color: var(--moss); font: 800 10px/1.1 var(--ui); letter-spacing: .06em; text-transform: uppercase; }
.labyrinth-map-chapter strong { color: var(--ink); font: 500 18px/1 var(--display); }

.labyrinth-level-ready {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 25px;
  padding: 13px 15px 13px 17px;
  border: 1px solid rgba(108, 78, 49, .22);
  border-radius: 14px;
  background: rgba(236, 230, 202, .7);
}

.labyrinth-level-ready p { min-width: 0; margin: 0 auto 0 0; font-size: 15px; line-height: 1.2; }
.labyrinth-level-ready p span { color: rgba(73, 54, 40, .7); font-size: 12px; }

.hero-token {
  display: grid;
  width: 43px;
  height: 43px;
  overflow: hidden;
  border: 2px solid rgba(255, 250, 239, .92);
  border-radius: 50%;
  background: var(--paper-deep);
  box-shadow: 0 3px 8px rgba(55, 43, 29, .2);
  place-items: center;
}

.hero-token img { width: 125%; height: 125%; object-fit: contain; object-position: center bottom; }

.labyrinth-primary,
.labyrinth-secondary {
  min-height: 48px;
  padding: 0 21px;
  border-radius: 11px;
  cursor: pointer;
  font: 800 13px/1 var(--ui);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.labyrinth-primary {
  border: 1px solid #576a37;
  color: var(--paper-light);
  background: linear-gradient(135deg, #849953, #62763e);
  box-shadow: inset 0 1px rgba(255, 255, 255, .26), 0 5px 10px rgba(61, 78, 42, .2);
}

.labyrinth-primary:hover { background: linear-gradient(135deg, #94a961, #6d8347); transform: translateY(-1px); }

.labyrinth-secondary {
  border: 1px solid rgba(130, 95, 48, .5);
  color: var(--ink);
  background: rgba(255, 250, 239, .76);
  box-shadow: 0 3px 8px rgba(82, 60, 34, .08);
}

.labyrinth-secondary:hover { background: #fff4d8; transform: translateY(-1px); }

/* The illustrated map is the hero: the logical grid is transparent above it. */
.labyrinth-playfield {
  display: grid;
  width: min(1040px, 100%);
  gap: 12px;
  margin: 0 auto;
}

.labyrinth-map-load-failure {
  display: grid;
  width: min(680px, 100%);
  min-height: 360px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 58px);
  border: 1px solid rgba(104, 76, 44, .3);
  border-radius: 23px;
  background:
    radial-gradient(circle at 15% 85%, rgba(146, 168, 104, .22), transparent 30%),
    radial-gradient(circle at 88% 14%, rgba(246, 197, 103, .21), transparent 27%),
    rgba(255, 249, 230, .88);
  box-shadow: 0 16px 30px rgba(61, 47, 32, .14);
  place-items: center;
  text-align: center;
}

.labyrinth-map-load-failure__card { max-width: 410px; }
.labyrinth-map-load-failure h1 { margin: 8px 0 10px; font-size: clamp(32px, 6vw, 52px); }
.labyrinth-map-load-failure p:not(.labyrinth-step) { margin: 0 0 20px; line-height: 1.45; }

.labyrinth-storybook-map {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 360px;
  overflow: hidden;
  isolation: isolate;
  border: 5px solid rgba(97, 72, 42, .3);
  border-radius: 23px;
  background-color: #b9c8b5;
  background-image: linear-gradient(135deg, #a6bc98, #d8c58c);
  box-shadow: 0 16px 30px rgba(61, 47, 32, .22), inset 0 0 0 2px rgba(255, 246, 214, .4);
}

.labyrinth-map-art {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.labyrinth-route-art {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.labyrinth-route-art__shadow-segment { fill: rgba(96, 72, 38, .44); }
.labyrinth-route-art__sand-segment { fill: #edcb7f; }
.labyrinth-route-art__highlight-segment { fill: rgba(255, 236, 174, .54); }

.labyrinth-storybook-map::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: .28;
  background:
    radial-gradient(rgba(255, 255, 255, .54) .6px, transparent .8px) 0 0 / 5px 5px,
    linear-gradient(130deg, rgba(255, 255, 255, .15), transparent 48%);
  content: "";
  pointer-events: none;
}

.labyrinth-game-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 4px;
  border: 1px solid rgba(105, 78, 47, .33);
  border-radius: 999px;
  background: rgba(255, 247, 223, .86);
  box-shadow: 0 3px 10px rgba(46, 54, 35, .15);
  backdrop-filter: blur(2px);
}

.labyrinth-hud-hero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-right: 6px;
  border-right: 1px solid rgba(105, 78, 47, .2);
  color: var(--ink);
  font: 700 12px/1 var(--ui);
}

.labyrinth-hud-hero img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  object-position: center bottom;
  border: 1px solid rgba(95, 73, 47, .23);
  border-radius: 50%;
  background: #eadfbe;
}

.labyrinth-heart-counter,
.labyrinth-hints-counter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(247, 231, 205, .66);
}

.labyrinth-heart { color: #d4b59d; font: 22px/1 var(--display); }
.labyrinth-heart.is-full { color: #c75d4f; text-shadow: 0 1px rgba(103, 51, 39, .27); }

.labyrinth-hints-counter { gap: 5px; margin-left: auto; color: var(--ink); font: 800 13px/1 var(--ui); }
.labyrinth-hints-counter > span { color: var(--honey); font-size: 22px; line-height: 1; text-shadow: 0 1px #9e6e25; }

.labyrinth-pause-button {
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(105, 78, 47, .36);
  border-radius: 50%;
  color: var(--ink);
  background: #f9ebcb;
  cursor: pointer;
  font: 700 18px/1 var(--ui);
  place-items: center;
}

.labyrinth-map-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 330px);
  align-items: end;
  gap: 14px;
}

.labyrinth-map-heading { min-width: 0; }

.labyrinth-map-heading .labyrinth-text-button { margin-bottom: 5px; font-size: 10px; }
.labyrinth-map-heading .labyrinth-step { color: var(--moss); font-size: 8px; }
.labyrinth-map-heading h1 { font-size: clamp(21px, 2.7vw, 31px); text-align: left; }

.labyrinth-move-counter {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 5px 0 0;
  color: rgba(73, 54, 40, .78);
  font: 700 10px/1 var(--ui);
}

.labyrinth-move-counter strong { color: var(--ink); font: 500 22px/1 var(--display); }

.labyrinth-status {
  margin: 0;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--forest-shadow);
  background: rgba(255, 248, 226, .65);
  font: 700 11px/1.25 var(--ui);
}

.labyrinth-board {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.labyrinth-tile,
.labyrinth-fog-cell,
.labyrinth-start-sign,
.labyrinth-trail-footprint {
  position: absolute;
  left: calc(var(--grid-x) * 1%);
  top: calc(var(--grid-y) * 1%);
}

.labyrinth-tile {
  display: grid;
  z-index: 2;
  width: clamp(46px, 7.4vw, 72px);
  height: clamp(46px, 7.4vw, 72px);
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  transform: translate(-50%, -50%);
  place-items: center;
}

.labyrinth-tile.is-hero,
.labyrinth-tile.is-goal { z-index: 5; }

/* Only at the final step the marker yields the tap to the veiled treasure below it. */
.labyrinth-tile.is-hero.is-yielding-tap { pointer-events: none; }
.labyrinth-tile.is-fogged { pointer-events: none; }

.labyrinth-tile.is-discovered:hover::after,
.labyrinth-tile:focus-visible::after {
  position: absolute;
  inset: 17%;
  border: 2px solid rgba(223, 159, 50, .75);
  border-radius: 45%;
  content: "";
  pointer-events: none;
}

.labyrinth-fog-cell {
  z-index: 4;
  width: clamp(112px, 23%, 255px);
  height: clamp(94px, 18%, 205px);
  border-radius: 42% 58% 50% 48%;
  opacity: .92;
  background:
    radial-gradient(ellipse at 28% 35%, rgba(249, 247, 236, .9) 0 25%, transparent 51%),
    radial-gradient(ellipse at 71% 45%, rgba(236, 240, 231, .86) 0 28%, transparent 54%),
    radial-gradient(ellipse at 42% 77%, rgba(212, 221, 215, .93) 0 28%, transparent 58%),
    rgba(198, 208, 204, .73);
  box-shadow: inset 0 0 17px rgba(92, 119, 106, .17), 0 0 13px rgba(245, 245, 234, .48);
  filter: blur(3px);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity .38s ease, transform .38s ease;
}

.labyrinth-start-sign {
  z-index: 6;
  padding: 4px 8px;
  border: 1px solid rgba(79, 57, 34, .45);
  border-radius: 4px;
  color: #fff0cc;
  background: linear-gradient(135deg, #926439, #6f482c);
  box-shadow: 0 2px 4px rgba(39, 34, 25, .25);
  font: 700 clamp(8px, 1.15vw, 12px)/1 var(--display);
  pointer-events: none;
  transform: translate(-106%, -128%) rotate(-7deg);
}

.labyrinth-trail-footprint {
  z-index: 3;
  color: rgba(80, 62, 40, .52);
  font: 900 clamp(12px, 1.6vw, 19px)/1 var(--display);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-20deg);
}

.labyrinth-board-hero {
  position: relative;
  z-index: 7;
  width: clamp(35px, 6.1vw, 57px);
  height: clamp(35px, 6.1vw, 57px);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 3px 3px rgba(44, 37, 25, .36));
  pointer-events: none;
}

.goal-token {
  display: grid;
  position: relative;
  z-index: 7;
  width: clamp(35px, 6.3vw, 59px);
  height: clamp(35px, 6.3vw, 59px);
  border: 2px solid rgba(128, 84, 30, .38);
  border-radius: 12px;
  color: #70471e;
  background: radial-gradient(circle at 34% 25%, #fff2a6, #e5ad3e 58%, #ac6b25 100%);
  box-shadow: 0 0 0 6px rgba(255, 231, 143, .25), 0 4px 9px rgba(64, 48, 25, .3);
  font: clamp(22px, 3vw, 34px)/1 var(--display);
  place-items: center;
}

.labyrinth-map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.labyrinth-map-help {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 210px;
  padding: 8px 10px;
  border: 1px solid rgba(103, 76, 45, .2);
  border-radius: 10px;
  background: rgba(255, 248, 226, .82);
  box-shadow: 0 3px 8px rgba(48, 64, 41, .11);
}

.labyrinth-map-help span { font-size: 21px; }
.labyrinth-map-help p { margin: 0; font: 700 10px/1.22 var(--ui); }
.labyrinth-map-help { pointer-events: none; }

.labyrinth-controls {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  gap: 5px;
}

.labyrinth-controls button {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(101, 75, 45, .45);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 247, 223, .92);
  box-shadow: inset 0 1px rgba(255, 255, 255, .76), 0 3px 7px rgba(48, 64, 41, .16);
  cursor: pointer;
  font: 500 26px/1 var(--display);
  place-items: center;
}

.labyrinth-controls button:hover { background: #f5dfab; transform: translateY(-1px); }

.labyrinth-encounter-backdrop {
  display: grid;
  position: fixed;
  z-index: 30;
  inset: 0;
  padding: 12px;
  background: rgba(48, 73, 54, .58);
  backdrop-filter: blur(3px);
  place-items: center;
}

.labyrinth-encounter {
  width: min(100%, 445px);
  max-height: calc(100dvh - 24px);
  padding: clamp(21px, 4vw, 33px);
  overflow: auto;
  border: 1px solid rgba(112, 79, 38, .55);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 52% 0%, rgba(255, 255, 255, .65), transparent 48%),
    linear-gradient(135deg, rgba(255, 252, 238, .98), rgba(244, 230, 190, .96));
  box-shadow: 0 21px 52px rgba(21, 37, 26, .36);
  text-align: center;
}

.labyrinth-encounter__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--moss);
  font: 800 9px/1 var(--ui);
  letter-spacing: .12em;
}

.labyrinth-encounter__topline span:last-child { color: var(--honey); font-size: 20px; }

.labyrinth-encounter__icon {
  display: grid;
  width: 61px;
  height: 61px;
  margin: 13px auto 6px;
  border: 1px solid rgba(128, 84, 30, .25);
  border-radius: 50%;
  color: #825924;
  background: radial-gradient(circle at 35% 28%, #fff3b9, #e8bc66);
  box-shadow: 0 4px 8px rgba(81, 57, 26, .14);
  font: 33px/1 var(--display);
  place-items: center;
}

.labyrinth-encounter h2 { margin: 5px 0 10px; font-size: clamp(31px, 7vw, 45px); }

.labyrinth-encounter > p:not(.labyrinth-encounter__feedback) {
  margin: 0;
  font-size: 16px;
  line-height: 1.42;
}

.labyrinth-answer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}

.labyrinth-answer {
  min-height: 48px;
  border: 1px solid rgba(108, 129, 75, .61);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 251, 238, .92);
  box-shadow: 0 3px 7px rgba(79, 64, 36, .08);
  cursor: pointer;
  font: 500 23px/1 var(--display);
}

.labyrinth-answer:hover { background: #e7e8c6; transform: translateY(-1px); }
.labyrinth-encounter__continue { width: 100%; margin-top: 20px; }
.labyrinth-encounter__feedback { margin: 12px 0 0; color: #994d3d; font: 700 12px/1.35 var(--ui); }

.labyrinth-control-guide { display: grid; gap: 8px; margin: 14px 0 18px; text-align: left; }
.labyrinth-control-guide p { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(229, 221, 184, .46); font-size: 13px; line-height: 1.3; }
.labyrinth-control-guide strong { color: var(--forest-shadow); font-family: var(--ui); font-size: 11px; }
.labyrinth-treasure-count { margin-top: 14px !important; color: var(--moss); font: 700 12px/1 var(--ui) !important; }

.labyrinth-complete {
  max-width: 850px;
  margin: 0 auto;
  padding: clamp(29px, 5vw, 50px);
  text-align: center;
}

.labyrinth-complete__friends {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
  max-width: 535px;
  margin: 0 auto 14px;
}

.labyrinth-complete__friends > img {
  width: min(100%, 142px);
  height: 142px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 9px 7px rgba(73, 55, 32, .18));
}

.labyrinth-complete__friends > img:last-child { justify-self: end; }

.labyrinth-complete__stars { display: inline-flex; gap: 3px; padding-bottom: 28px; color: #cdbd9a; font: 40px/1 var(--display); }
.labyrinth-complete__stars i { font-style: normal; }
.labyrinth-complete__stars .is-earned { color: var(--honey); text-shadow: 0 2px #a56c20, 0 5px 9px rgba(164, 104, 26, .2); }

.labyrinth-complete__lead { max-width: 490px; margin: 13px auto 20px; font-size: 16px; line-height: 1.45; }

.labyrinth-complete__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 520px;
  margin: 0 auto;
  border: 1px solid rgba(107, 79, 48, .2);
  border-radius: 13px;
  background: rgba(246, 236, 208, .56);
}

.labyrinth-complete__stats div { padding: 13px 8px; }
.labyrinth-complete__stats div + div { border-left: 1px dashed rgba(107, 79, 48, .25); }
.labyrinth-complete__stats dt { color: rgba(73, 54, 40, .7); font: 800 9px/1 var(--ui); letter-spacing: .07em; text-transform: uppercase; }
.labyrinth-complete__stats dd { margin: 5px 0 0; color: var(--ink); font: 500 25px/1 var(--display); }

.labyrinth-complete__actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--honey);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .labyrinth-header,
  .labyrinth-app { width: min(100% - 28px, 600px); }

  .labyrinth-header { min-height: 62px; }
  .labyrinth-brand { font-size: 24px; }
  .labyrinth-back { font-size: 11px; }
  .labyrinth-app { padding-top: 22px; }

  .labyrinth-hero-screen,
  .labyrinth-level-screen { padding: 23px 16px; }

  .labyrinth-screen-heading { gap: 10px; }
  .labyrinth-screen-heading h1 { font-size: clamp(32px, 10vw, 43px); }
  .labyrinth-screen-lead { font-size: 14px; }

  .hero-choice-grid--storybook { gap: 10px; margin-top: 20px; }
  .hero-choice { min-height: 228px; padding: 9px 9px 12px; }
  .hero-choice__portrait { min-height: 120px; }
  .hero-choice__copy { padding-top: 9px; }
  .hero-choice__copy strong { font-size: 22px; }
  .hero-choice__copy span { font-size: 11px; }
  .hero-choice__check { top: 16px; right: 16px; width: 27px; height: 27px; font-size: 15px; }

  .level-choice-grid--storybook { grid-template-columns: 1fr; gap: 12px; }
  .level-choice { grid-template-columns: 128px 1fr; min-height: 124px; padding: 8px; }
  .level-choice__art { grid-row: 1; align-self: center; }
  .level-choice__copy { align-content: center; padding: 4px 6px; }
  .level-choice__copy strong { font-size: 23px; }
  .level-choice__copy em { min-height: 0; }

  .labyrinth-endless-choice {
    grid-template-areas:
      "art copy"
      "art stamp";
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 5px 10px;
    height: 128px;
    min-height: 128px;
    padding: 8px;
  }
  .labyrinth-endless-choice::before { top: 18px; right: 14px; left: 126px; height: 18px; }
  .labyrinth-endless-choice__art { grid-area: art; min-height: 108px; }
  .labyrinth-endless-choice__copy { grid-area: copy; gap: 3px; align-self: end; padding: 2px 4px 0 0; }
  .labyrinth-endless-choice__copy strong { font-size: 22px; }
  .labyrinth-endless-choice__copy em { font-size: 10px; }
  .labyrinth-endless-choice__copy small { display: none; }
  .labyrinth-endless-choice__stamp { grid-area: stamp; justify-self: start; min-width: 0; min-height: 31px; padding: 5px 8px; font-size: 9px; }
  .labyrinth-endless-choice__compass { right: 6px; bottom: 6px; width: 30px; height: 30px; font-size: 17px; }
  .labyrinth-map-chapter { margin: 1px 0; font-size: 8px; }
  .labyrinth-map-chapter strong { font-size: 15px; }
  .labyrinth-level-ready { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-top: 16px; padding: 11px; }
  .labyrinth-level-ready .labyrinth-primary { grid-column: 1 / -1; width: 100%; }

  .labyrinth-storybook-map { min-height: 0; border-width: 4px; border-radius: 17px; }
  .labyrinth-playfield { gap: 8px; }
  .labyrinth-game-hud { gap: 4px; min-height: 39px; padding: 2px; }
  .labyrinth-hud-hero { gap: 3px; padding-right: 3px; font-size: 10px; }
  .labyrinth-hud-hero img { width: 30px; height: 30px; }
  .labyrinth-heart-counter { gap: 0; min-height: 30px; padding: 0 5px; }
  .labyrinth-heart { font-size: 18px; }
  .labyrinth-hints-counter { min-height: 30px; padding: 0 6px; font-size: 11px; }
  .labyrinth-hints-counter > span { font-size: 18px; }
  .labyrinth-pause-button { flex-basis: 44px; width: 44px; height: 44px; font-size: 15px; }

  .labyrinth-map-summary { grid-template-columns: 1fr; gap: 4px; }
  .labyrinth-map-heading { max-width: none; }
  .labyrinth-map-heading .labyrinth-text-button { margin-bottom: 3px; font-size: 8px; }
  .labyrinth-map-heading .labyrinth-step { font-size: 6px; }
  .labyrinth-map-heading h1 { font-size: 18px; }
  .labyrinth-move-counter { margin-top: 3px; font-size: 8px; }
  .labyrinth-move-counter strong { font-size: 17px; }
  .labyrinth-status { max-width: none; padding: 5px 6px; font-size: 8px; }

  .labyrinth-map-footer { align-items: flex-end; gap: 8px; }
  .labyrinth-map-help { max-width: 124px; padding: 5px 6px; }
  .labyrinth-map-help span { font-size: 16px; }
  .labyrinth-map-help p { font-size: 8px; }
  .labyrinth-controls { grid-template-columns: repeat(3, 44px); gap: 4px; }
  .labyrinth-controls button { width: 44px; height: 44px; font-size: 23px; }
  .labyrinth-start-sign { padding: 3px 5px; font-size: 8px; }
  .labyrinth-board-hero { width: clamp(29px, 10vw, 44px); height: clamp(29px, 10vw, 44px); }
  .goal-token { width: clamp(29px, 10vw, 45px); height: clamp(29px, 10vw, 45px); font-size: 22px; }

  .labyrinth-encounter { padding: 20px 17px; border-radius: 17px; }
  .labyrinth-encounter__icon { width: 53px; height: 53px; margin-top: 9px; font-size: 29px; }
  .labyrinth-encounter h2 { font-size: clamp(29px, 9vw, 38px); }
  .labyrinth-encounter > p:not(.labyrinth-encounter__feedback) { font-size: 14px; }
  .labyrinth-answer { min-height: 44px; font-size: 21px; }
  .labyrinth-primary,
  .labyrinth-secondary { min-height: 46px; }

  .labyrinth-complete { padding: 28px 16px; }
  .labyrinth-complete__friends { gap: 7px; margin-bottom: 9px; }
  .labyrinth-complete__friends > img { height: 100px; }
  .labyrinth-complete__stars { padding-bottom: 16px; font-size: 29px; }
  .labyrinth-complete__lead { font-size: 14px; }
  .labyrinth-complete__stats dd { font-size: 21px; }
  .labyrinth-complete__actions { display: grid; grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .labyrinth-header,
  .labyrinth-app { width: min(100% - 20px, 600px); }
  .labyrinth-brand { font-size: 21px; }
  .labyrinth-back { font-size: 10px; }
  .hero-choice__copy strong { font-size: 20px; }
  .hero-choice__copy span { font-size: 10px; }
  .labyrinth-hud-hero span { display: none; }
  .labyrinth-map-heading { max-width: 143px; }
  .labyrinth-status { max-width: 145px; }
  .labyrinth-map-help { max-width: 116px; }
}

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