/* The path (Oct 2026): one road of units on the home page, the treasure, Free play, and the little row of a
   unit's stops on a stop's start and finish cards. Loaded after the older sheets. */

:root {
  --stop-letters: #ff7a59; --stop-letters-2: #d9583a;
  --stop-numbers: #4d96ff; --stop-numbers-2: #2f6fd6;
  --stop-puzzles: #9b5de5; --stop-puzzles-2: #7742c2;
  --stop-game: #ffc93c; --stop-game-2: #d9a21b;
  --stop-story: #3cc46e; --stop-story-2: #2a9a54;
  --stop-treasure: #ffb347; --stop-treasure-2: #d98a2a;
  --stop-locked: #e9e4d6; --stop-locked-2: #cfc7b1;
  --path-ink: #24464b;
}

/* ---- the home page -------------------------------------------------------------------------- */
.kid-home .playground { max-width: 760px; padding-top: 0; }
.path-home { position: relative; padding-bottom: 40px; }

.path-top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -8px 8px; padding: 10px 8px; background: color-mix(in srgb, var(--bg, #fbf7ee) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.path-goal {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 16px; border-radius: 999px;
  background: #fffdf6; color: var(--path-ink); box-shadow: 0 4px 0 #e6dcc0; font-weight: 600; font-size: 18px;
}
.goal-dots { display: inline-flex; gap: 7px; }
.goal-dots i {
  display: block; width: 22px; height: 22px; border-radius: 50%; background: #efe8d4; box-shadow: inset 0 2px 0 #e0d6bb;
  transition: background .3s, transform .3s;
}
.goal-dots i.on { background: #ffc93c; box-shadow: inset 0 -3px 0 #d9a21b; }
.path-goal[data-done="true"] { background: #fff3cf; }
.path-goal[data-done="true"] .goal-dots i.on { animation: goal-pop .6s ease-out both; }
@keyframes goal-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

.free-play {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 4px 18px 4px 4px;
  border-radius: 999px; background: #2e8076; color: #fffdf2; text-decoration: none; font-weight: 600; font-size: 19px;
  box-shadow: 0 5px 0 #1f5e56; transition: transform .12s, box-shadow .12s;
}
.free-play:active { transform: translateY(4px); box-shadow: 0 1px 0 #1f5e56; }
.free-play-art { display: block; width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: #1f5e56; }
.free-play-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.free-play-count:empty { display: none; }
.free-play-count {
  position: absolute; top: -6px; right: -6px; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px;
  border-radius: 999px; background: #ffc93c; color: #5a3b00; border: 3px solid #fffdf6; font-size: 14px; font-weight: 700;
}
.free-play[data-count="0"] { background: #9fb9b4; box-shadow: 0 5px 0 #7d9893; }

.path-road { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.path-loading { display: grid; place-items: center; padding: 60px 0; }

.path-unit { --amp: min(118px, 24vw); list-style: none; }
.unit-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px 16px 24px;
  border-radius: 26px; background: var(--unit); color: #fff; box-shadow: 0 6px 0 color-mix(in srgb, var(--unit) 72%, #000);
}
.unit-words { display: grid; gap: 2px; min-width: 0; }
.unit-eyebrow { font-family: var(--font-caps); font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.unit-title { margin: 0; font-size: clamp(22px, 4.4vw, 30px); font-weight: 600; letter-spacing: -.4px; line-height: 1.1; color: #fff; }
.unit-count {
  flex: none; display: grid; place-items: center; min-width: 58px; height: 40px; padding: 0 12px; border-radius: 999px;
  background: #ffffff33; font-weight: 700; font-size: 17px;
}
.unit-trophy { font-family: var(--font-emoji); font-size: 24px; }
.path-unit[data-state="ahead"] .unit-banner { filter: saturate(.55); opacity: .82; }

.unit-road { position: relative; }
.unit-stops { list-style: none; margin: 0; padding: 30px 0 36px; display: grid; justify-items: center; gap: 22px; }
/* a friend waves from beside the road, on the side the road swings away from */
.unit-friend { position: absolute; top: 120px; width: 150px; pointer-events: none; opacity: .95; }
.unit-friend[data-side="left"] { left: 2%; }
.unit-friend[data-side="right"] { right: 2%; }
.unit-friend svg { display: block; width: 100%; height: auto; }
.path-unit[data-state="ahead"] .unit-friend { filter: saturate(.5); opacity: .55; }

.road-stop {
  position: relative; display: grid; justify-items: center; gap: 6px;
  transform: translateX(calc(var(--x, 0) * var(--amp)));
}
.stop-node {
  --face: var(--stop-letters); --edge: var(--stop-letters-2);
  position: relative; display: grid; place-items: center; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 50%;
  background: var(--face); box-shadow: 0 7px 0 var(--edge), 0 12px 22px #2a4a4420; color: #fff; text-decoration: none;
  cursor: pointer; font: inherit; transition: transform .12s, box-shadow .12s; -webkit-tap-highlight-color: transparent;
}
.stop-node:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--edge); }
.stop-node:focus-visible { outline: 4px solid #2e8076; outline-offset: 6px; }
.road-stop[data-flavor="numbers"] .stop-node { --face: var(--stop-numbers); --edge: var(--stop-numbers-2); }
.road-stop[data-flavor="puzzles"] .stop-node { --face: var(--stop-puzzles); --edge: var(--stop-puzzles-2); }
.road-stop[data-flavor="game"] .stop-node { --face: var(--stop-game); --edge: var(--stop-game-2); }
.road-stop[data-flavor="story"] .stop-node { --face: var(--stop-story); --edge: var(--stop-story-2); }
.road-stop[data-flavor="treasure"] .stop-node { --face: var(--stop-treasure); --edge: var(--stop-treasure-2); }
.road-stop[data-status="locked"] .stop-node { --face: var(--stop-locked); --edge: var(--stop-locked-2); box-shadow: 0 7px 0 var(--edge); }

.stop-face { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; pointer-events: none; }
.stop-glyph { font-size: 29px; font-weight: 700; letter-spacing: -1px; line-height: 1; text-shadow: 0 2px 0 #0002; }
.stop-svg { display: grid; place-items: center; width: 58%; height: 58%; }
.stop-svg svg { display: block; width: 100%; height: 100%; }
.stop-img { display: block; width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 50%; object-fit: cover; border: 3px solid #fffdf6; }
.road-stop[data-status="locked"] .stop-face { opacity: .45; filter: grayscale(1); }
.road-stop[data-status="locked"] .stop-glyph { color: #8e8670; text-shadow: none; }

.stop-check, .stop-lock {
  position: absolute; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; pointer-events: none;
}
.stop-check { top: -4px; right: -4px; background: #2e8076; color: #fff; border: 3px solid #fffdf6; font-size: 15px; font-weight: 700; }
.stop-lock { bottom: -6px; right: -6px; background: #fffdf6; color: #a69d84; box-shadow: 0 2px 0 #e0d7bf; }
.stop-lock .stop-svg { width: 18px; height: 18px; }

.stop-stars { display: inline-flex; gap: 2px; font-size: 16px; line-height: 1; color: #e7dfc8; }
.stop-stars i { font-style: normal; }
.stop-stars i.on { color: #ffb400; text-shadow: 0 1px 0 #c98800; }

/* the stop to play: bigger, breathing, with a bubble and the child's own avatar beside it */
.road-stop[data-status="current"] { z-index: 2; margin-top: 66px; }
.road-stop[data-status="current"] .stop-node {
  width: 104px; height: 104px; animation: stop-breathe 2.4s ease-in-out infinite;
  box-shadow: 0 8px 0 var(--edge), 0 0 0 9px color-mix(in srgb, var(--face) 28%, transparent), 0 16px 30px #2a4a4430;
}
.road-stop[data-status="current"] .stop-glyph { font-size: 36px; }
@keyframes stop-breathe { 0%, 100% { scale: 1; } 50% { scale: 1.06; } }
.stop-bubble {
  position: absolute; bottom: calc(100% + 10px); left: 50%; translate: -50% 0; display: grid; justify-items: center; gap: 0;
  min-width: 150px; max-width: 240px; padding: 8px 16px 10px; border-radius: 18px; background: #fffdf6; color: var(--path-ink);
  box-shadow: 0 4px 0 #e2d8bc, 0 10px 22px #2a4a4418; text-align: center; pointer-events: none; animation: bubble-bob 2.4s ease-in-out infinite;
}
.stop-bubble::after {
  content: ""; position: absolute; top: 100%; left: 50%; width: 18px; height: 18px; margin: -10px 0 0 -9px;
  background: #fffdf6; transform: rotate(45deg); box-shadow: 4px 4px 0 #e2d8bc;
}
.stop-bubble strong { font-size: 22px; font-weight: 700; color: #2e8076; letter-spacing: .3px; text-transform: uppercase; }
.stop-bubble span { font-size: 15px; line-height: 1.2; }
@keyframes bubble-bob { 0%, 100% { translate: -50% 0; } 50% { translate: -50% -4px; } }
.stop-me {
  position: absolute; top: 50%; right: calc(50% + 62px); translate: 0 -50%; display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 50%; background: #fffdf6; box-shadow: 0 3px 0 #e2d8bc; font-family: var(--font-emoji); font-size: 28px; pointer-events: none;
}
.road-stop.nudge .stop-node { animation: stop-nudge .8s ease-out; }
@keyframes stop-nudge { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-16px); } 50% { transform: translateY(0); } 70% { transform: translateY(-7px); } }

@media (max-width: 520px) {
  .path-unit { --amp: min(92px, 23vw); }
  .unit-friend { top: 150px; width: 70px; }
  .unit-friend[data-side="left"] { left: -4px; }
  .unit-friend[data-side="right"] { right: -4px; }
  .stop-node { width: 76px; height: 76px; }
  .road-stop[data-status="current"] .stop-node { width: 94px; height: 94px; }
  .stop-me { right: calc(50% + 54px); width: 42px; height: 42px; font-size: 24px; }
  .free-play-word { font-size: 17px; }
  .path-goal { padding: 6px 12px; font-size: 16px; }
  .goal-dots i { width: 19px; height: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .road-stop[data-status="current"] .stop-node, .stop-bubble, .path-goal[data-done="true"] .goal-dots i.on { animation: none; }
}
html[data-quiet="true"] .road-stop[data-status="current"] .stop-node, html[data-quiet="true"] .stop-bubble { animation: none; }

.path-end {
  display: grid; justify-items: center; gap: 6px; margin: 10px 0 30px; padding: 26px 20px; border-radius: 26px;
  background: #fff3cf; color: var(--path-ink); text-align: center; box-shadow: 0 6px 0 #e7dcbd; font-size: 18px;
}
.path-end strong { font-size: 26px; }
.path-end-trophy { font-family: var(--font-emoji); font-size: 54px; line-height: 1; }

/* ---- the treasure ------------------------------------------------------------------------------ */
.treasure { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: #10302dcc; }
.treasure[hidden] { display: none; }
.treasure-card {
  position: relative; display: grid; justify-items: center; gap: 10px; width: min(420px, 100%); padding: 26px 24px 28px;
  border-radius: 32px; background: #fffdf6; text-align: center; box-shadow: 0 10px 0 #e2d8bc, 0 30px 60px #0005; overflow: hidden;
}
.treasure-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.treasure-chest { width: 170px; height: 170px; }
.treasure-chest svg { display: block; width: 100%; height: 100%; overflow: visible; }
.treasure-lid { transform-box: view-box; transform-origin: 10px 28px; transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.treasure-glow { opacity: 0; transform-box: view-box; transform-origin: 32px 30px; transform: scale(.4); transition: opacity .4s .15s, transform .5s .15s; }
.treasure[data-state="closed"] .treasure-chest { animation: chest-wiggle .45s ease-in-out infinite; }
.treasure[data-state="open"] .treasure-lid { transform: rotate(-32deg) translate(-2px, -6px); }
.treasure[data-state="open"] .treasure-glow { opacity: 1; transform: scale(1); }
@keyframes chest-wiggle { 0%, 100% { rotate: 0deg; } 25% { rotate: -5deg; } 75% { rotate: 5deg; } }
.treasure-card h2 { margin: 4px 0 0; color: var(--path-ink); font-size: 32px; letter-spacing: -.5px; }
.treasure-text { margin: 0 0 8px; color: #5a7770; font-size: 18px; }

/* ---- Free play --------------------------------------------------------------------------------- */
.free-play-page .browse-nav { display: none; }
.free-play-hello { display: flex; align-items: center; gap: 16px; }
.free-play-hello h1 { margin: 0; }
.back-to-path {
  display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px 0 14px; border-radius: 999px;
  background: #fffdf6; color: var(--path-ink); text-decoration: none; font-weight: 600; font-size: 18px; box-shadow: 0 4px 0 #e2d8bc;
}
.back-to-path .ui-icon { width: 24px; height: 24px; }
.room-tile[hidden], .room-grid[hidden], .free-play-empty[hidden], .free-play-more[hidden] { display: none; }
.book-tile { --door-bg: #e3f1e2; }
.book-art { display: grid; place-items: center; }
.book-art svg { width: 58%; height: auto; }
.free-play-empty { display: grid; justify-items: center; gap: 14px; padding: 50px 16px; text-align: center; color: var(--path-ink); font-size: 22px; }
.free-play-empty p { margin: 0; }
.free-play-more { margin: 18px 0 0; text-align: center; color: #5a7770; font-size: 17px; }

/* ---- a stop's start and finish cards: the unit's little row ------------------------------------------ */
.path-stop-note { display: grid; gap: 8px; margin: 2px 0 6px; }
.path-unit-name { margin: 0; color: #5a7770; font-size: 15px; font-weight: 600; }
.unit-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.finish-step .unit-strip { justify-content: center; margin: 2px 0 6px; }
.strip-stop { position: relative; display: block; }
.strip-badge {
  --face: var(--stop-letters); --edge: var(--stop-letters-2);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--face);
  box-shadow: 0 3px 0 var(--edge); color: #fff;
}
.strip-stop[data-flavor="numbers"] .strip-badge { --face: var(--stop-numbers); --edge: var(--stop-numbers-2); }
.strip-stop[data-flavor="puzzles"] .strip-badge { --face: var(--stop-puzzles); --edge: var(--stop-puzzles-2); }
.strip-stop[data-flavor="game"] .strip-badge { --face: var(--stop-game); --edge: var(--stop-game-2); }
.strip-stop[data-flavor="story"] .strip-badge { --face: var(--stop-story); --edge: var(--stop-story-2); }
.strip-stop[data-flavor="treasure"] .strip-badge { --face: var(--stop-treasure); --edge: var(--stop-treasure-2); }
.strip-stop.locked .strip-badge { --face: var(--stop-locked); --edge: var(--stop-locked-2); }
.strip-stop.locked .strip-badge > * { opacity: .4; filter: grayscale(1); }
.strip-badge .stop-glyph { font-size: 12px; letter-spacing: 0; }
.strip-badge .stop-svg { width: 62%; height: 62%; }
.strip-badge .stop-img { width: 100%; height: 100%; border-width: 2px; }
.strip-stop.next .strip-badge, .strip-stop.just .strip-badge, .strip-stop.current .strip-badge {
  width: 46px; height: 46px; box-shadow: 0 3px 0 var(--edge), 0 0 0 4px color-mix(in srgb, var(--face) 30%, transparent);
}
.strip-stop.next .strip-badge .stop-glyph, .strip-stop.just .strip-badge .stop-glyph { font-size: 16px; }
.strip-stop.next .strip-badge { animation: stop-breathe 2.4s ease-in-out infinite; }
.strip-tick {
  position: absolute; top: -5px; right: -5px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: #2e8076; color: #fff; border: 2px solid #fffdf6; font-size: 10px; font-weight: 700;
}
#game-root[data-path-stop] .finish-card .finish-next { font-size: 26px; }
/* a stop's start card shows its unit's row instead of the quest trail and the level trail */
.quest-trail[hidden], .level-trail[hidden], .intro-listen-note[hidden], details.level-options[hidden] { display: none; }
.free-play-page .room-grid { margin-top: 14px; }
