:root {
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: #24454d;
  background: #f7f7ee;
}
/* The home trail is decoration over saved progress, separate from the reviewer. */
#home { padding: 20px 30px 28px; background: #f7f5e9; }
.adventure-home { width: min(1120px, 100%); margin: auto; }
.adventure-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.adventure-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 900; color: #254c43; }
.adventure-brand img { width: 48px; height: 48px; border-radius: 14px; }
.adventure-brand small { display: block; font-size: 12px; font-weight: 500; margin-top: 4px; letter-spacing: .04em; }
#home .home-gear { width: auto; min-height: 48px; margin: 0; padding: 8px 14px; background: transparent; border: 1px solid #c9d6cb; box-shadow: none; border-radius: 14px; }
#home .home-gear strong { font-size: 15px; }
#home .home-gear small { font-size: 11px; font-weight: 500; }
.adventure-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 0 18px; }
.adventure-heading .eyebrow { font-size: 11px; letter-spacing: .2em; color: #8c6336; margin: 0 0 8px; }
.adventure-heading h1 { color: #244e40; font-family: Georgia, serif; font-size: clamp(29px, 4.3vw, 46px); font-weight: 500; margin: 0; }
.adventure-heading p:last-child { font-size: 16px; margin: 8px 0 0; color: #596c5b; }
.adventure-play { flex: none; border: 2px solid #fff6d5; border-radius: 24px; background: #f7ca58; color: #3c4b2e; min-width: 180px; padding: 16px 22px; box-shadow: 0 5px 0 #c99a39; font-size: 25px; font-weight: 900; }
.adventure-play small { display: block; font-size: 12px; margin-top: 6px; font-weight: 600; }
.adventure-map { position: relative; width: 100%; aspect-ratio: 3 / 2; border-radius: 30px; overflow: hidden; isolation: isolate; border: 5px solid white; box-shadow: 0 8px 25px #254a3820; background: #cbd993; }
.path-scenery, .path-road, .path-nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
.path-scenery { object-fit: cover; }
.path-road { overflow: visible; filter: drop-shadow(0 3px 1px #6f77384d); }
.path-road path { fill: none; stroke: #f5e8bc; stroke-width: 35; stroke-linecap: round; stroke-linejoin: round; }
.path-nodes { pointer-events: none; }
.path-node { position: absolute; transform: translate(-50%,-50%); width: clamp(34px, 5vw, 57px); height: clamp(34px, 5vw, 57px); display: grid; place-items: center; border-radius: 50%; border: 3px solid #fff6d8; box-shadow: 0 3px 0 #827b4c; font-size: clamp(16px, 2.5vw, 26px); font-weight: 900; }
.path-node.ahead { background: #e4e7ca; color: #626b50; }
.path-node.earned { background: #efd06d; color: #7e5c23; }
.path-node.current { pointer-events: auto; min-width: 48px; min-height: 48px; width: clamp(48px, 6vw, 70px); height: clamp(48px, 6vw, 70px); background: #ffdb59; color: #365b37; border: 4px solid white; box-shadow: 0 4px 0 #bd9130, 0 0 0 8px #ffec9a70; animation: trail-glow 2.4s ease-in-out infinite; z-index: 2; }
.path-navigation { position: absolute; z-index: 3; top: 15px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: #fffdf1ef; border-radius: 18px; padding: 3px; color: #38573d; white-space: nowrap; font-size: 15px; }
.path-navigation button { width: 44px; height: 44px; border: 0; border-radius: 15px; background: transparent; color: inherit; font-size: 27px; }
.path-navigation button:disabled { opacity: .25; }
.path-caption { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 10px 20px; border-radius: 18px; background: #fffdf0ef; color: #3c5d3e; font-size: 14px; white-space: nowrap; }
.path-caption > span { font-size: 24px; }
.path-loading { position: absolute; top: 45%; left: 15%; width: 70%; background: #ffffffe6; border-radius: 18px; text-align: center; padding: 14px; }
.path-summary { text-align: center; font-size: 13px; color: #63735c; margin: 15px 0; }
.path-locations { display:flex; justify-content:center; gap:8px; margin:14px 0 0; }
.path-locations button { min-height:44px; padding:8px 18px; border:1px solid #ced8c5; border-radius:20px; background:#f7f5e9; color:#4e6546; }
.path-locations button[aria-pressed="true"] { background:#dde9cc; border-color:#819d6c; font-weight:bold; }
.path-locations button:disabled { opacity:.5; }
.path-legacy { display:block; margin:0 auto 16px; min-height:44px; padding:7px 17px; color:#64745e; background:transparent; border:1px solid #d9dfd0; border-radius:16px; font-size:12px; }
#path-place { font-size:13px; font-weight:bold; }
@media (max-width:600px) { .path-locations button { padding:8px 12px; } #path-place { display:none; } }
.adventure-rooms { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#home .deck { margin: 0; min-height: 80px; padding: 12px 20px; border: 1px solid #d4ddc9; border-radius: 20px; box-shadow: 0 3px 0 #e0e3d5; background: #ebefdf; gap: 14px; }
#home .deck-music { background: #f0e9d8; border-color: #e1d7c0; }
#home .deck strong { font-size: 22px; }
#home .deck small { font-size: 13px; }
#home .deck-symbol { width: 48px; height: 48px; font-size: 30px; border-radius: 50%; }
.room-arrow { margin-left: auto; font-size: 24px; color: #728064; }
#done-path { color: #426e46; font-weight: bold; }
.adventure-home button:focus-visible { outline: 4px solid #155f73; outline-offset: 5px; }
@keyframes trail-glow { 50% { box-shadow: 0 4px 0 #bd9130, 0 0 0 14px #ffec9a50; } }
@media (min-width: 1000px) and (max-height: 850px) {
  #home { padding: 12px 28px 18px; }
  .adventure-home { max-width: 950px; }
  .adventure-heading { padding: 12px 0; }
  .adventure-heading h1 { font-size: 34px; }
  .adventure-map { aspect-ratio: 2.5 / 1; }
  .path-scenery { object-position: center 49%; }
  .path-node { width: 44px; height: 44px; font-size: 22px; }
  .path-node.current { width: 54px; height: 54px; }
  .path-navigation { top: 8px; }
  .path-caption { bottom: 8px; padding: 5px 14px; }
  .path-summary { margin: 10px 0; }
  #home .deck { min-height: 65px; padding: 8px 16px; }
}
@media (max-width: 600px) {
  #home { padding: 14px 12px 24px; }
  .adventure-brand { font-size: 17px; gap: 8px; }
  .adventure-brand img { width: 36px; height: 36px; }
  .adventure-brand small, #home .home-gear small { display: none; }
  .adventure-heading { display: block; padding: 24px 4px 18px; }
  .adventure-heading h1 { font-size: 34px; }
  .adventure-play { width: 100%; margin-top: 18px; padding: 10px 18px; min-height: 60px; }
  .adventure-play small { display: inline; margin-left: 12px; }
  .adventure-map { aspect-ratio: 1 / 1.2; border-radius: 23px; }
  .path-scenery { object-fit: cover; }
  .path-navigation { font-size: 13px; gap: 0; top: 9px; }
  .path-caption { font-size: 12px; padding: 7px 12px; }
  .adventure-rooms { gap: 9px; }
  #home .deck { padding: 13px 10px; gap: 8px; }
  #home .deck strong { font-size: 16px; }
  #home .deck small { font-size: 11px; }
  #home .deck-symbol { width: 30px; height: 38px; font-size: 25px; background: transparent; }
  .room-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .path-node.current { animation: none; } }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 12% 8%, #fff7da, transparent 32%), #f7f7ee; }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
.hidden { display: none !important; }

.screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.welcome { width: min(560px, 100%); text-align: center; background: #fff; border: 3px solid #e9e6d8; border-radius: 34px; padding: 28px; box-shadow: 0 12px 0 #e4e5d9; }
.app-mark { width: 82px; height: 82px; border-radius: 20px; }
h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; margin: 16px 0 8px; }
p { font-size: 18px; line-height: 1.45; }
.eyebrow { margin: 14px 0 0; color: #e38b44; font-weight: 900; font-size: 14px; letter-spacing: .13em; }
.home-intro { margin: 12px 0 24px; font-size: 21px; }
.primary, .secondary { border: 0; border-radius: 18px; min-height: 60px; padding: 12px 22px; font-size: 21px; font-weight: 800; width: 100%; margin-top: 14px; }
.primary { background: #197b88; color: white; box-shadow: 0 6px 0 #0e5965; }
.secondary { background: #e8f1ee; color: #185763; box-shadow: 0 6px 0 #c9dbd7; }
.primary:active, .secondary:active, .deck:active, .play:active { transform: translateY(3px); box-shadow: 0 2px 0 #9aa; }
.deck { display: flex; align-items: center; gap: 18px; width: 100%; min-height: 98px; margin-top: 16px; padding: 14px 20px; border: 0; border-radius: 25px; text-align: left; color: #21444b; box-shadow: 0 6px 0 #d7d9ce; }
.deck-challenge { background: #ffdda1; }
.deck-starter { background: #c7ece2; }
.home-gear { display: block; width: 100%; margin-top: 24px; min-height: 68px; padding: 10px 18px; border: 3px solid #81b3ab; border-radius: 17px; background: #e4f3ed; color: #185763; box-shadow: 0 4px 0 #badbd1; text-align: center; }
.home-gear strong { display: block; font-size: 20px; }
.home-gear small { display: block; margin-top: 3px; font-size: 14px; font-weight: 700; }
.home-gear[aria-expanded="true"] { background: #c5eadf; border-color: #2d9c83; box-shadow: none; }
.home-gear:focus-visible { outline: 4px solid #e8913d; outline-offset: 3px; }
.deck-symbol { flex: none; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 19px; background: #ffffffb8; color: #e98732; font-size: 38px; }
.deck-starter .deck-symbol { color: #318c83; }
.deck strong { display: block; font-size: clamp(23px, 4vw, 29px); }
.deck small { display: block; margin-top: 3px; font-size: 16px; color: #547075; }
.login-card label { display: block; text-align: left; font-weight: 800; margin-top: 22px; }
.login-card input { display: block; width: 100%; min-height: 58px; border: 2px solid #b7d1d3; border-radius: 14px; padding: 12px; margin-top: 8px; font-size: 22px; }
.error { color: #a32323; min-height: 1.5em; }
.quiet { color: #5d7379; font-size: 16px; }

#study { height: 100vh; height: 100dvh; width: 100%; margin: auto; display: flex; flex-direction: column; padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); gap: 8px; }
.study-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 70px; }
.play { flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 124px; height: 64px; border: 0; border-radius: 22px; background: #197b88; color: #fff; box-shadow: 0 5px 0 #0c5964; font-size: 24px; font-weight: 900; }
.play .speaker { font-size: 29px; }
.play.playing { animation: listening 1.1s ease-in-out infinite; }
.prompt { flex: 1; text-align: center; line-height: 1.2; }
#study-status { font-size: clamp(22px, 3vw, 32px); font-weight: 900; }
.prompt-hint { color: #698185; font-size: 16px; margin-top: 3px; }
#study.test-mode .prompt-hint { display: block; color: #89521a; font-size: 14px; font-weight: 900; }
#study.test-mode .trophy-count { background: #e6f4f1; }
.top-right { display: flex; align-items: center; gap: 9px; }
.trophy-count { display: flex; align-items: center; gap: 4px; min-width: 67px; justify-content: center; padding: 8px; border-radius: 18px; background: #fff0c5; font-size: 23px; font-weight: 900; color: #a2631b; }
.gear { flex: none; width: 54px; height: 54px; border: 0; border-radius: 16px; background: #e3ece9; color: #657b7c; font-size: 26px; user-select: none; -webkit-user-select: none; }
.reward-track { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 47px; border-radius: 18px; background: #fff; border: 2px solid #eee9d8; padding: 6px 14px; }
.reward-track-title { font-size: 16px; font-weight: 900; color: #96601f; white-space: nowrap; }
.reward-dots { display: flex; justify-content: center; gap: clamp(5px, 1vw, 10px); }
.reward-dot { width: clamp(15px, 2.5vw, 21px); height: clamp(15px, 2.5vw, 21px); border-radius: 50%; background: #e9e4d7; border: 2px solid #ded8c9; transition: transform .25s, background .25s; }
.reward-dot.filled { background: #f5bd4c; border-color: #e7a830; transform: scale(1.08); }
.reward-label { min-width: 52px; font-size: 17px; font-weight: 900; color: #8b672e; white-space: nowrap; }
.pictures { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: clamp(8px, 1.5vw, 15px); }
.picture { border: 4px solid #d6e7e3; border-radius: 22px; background: #fff; box-shadow: 0 3px 0 #e3e7dc; overflow: hidden; position: relative; padding: 3px; min-width: 0; min-height: 0; }
.picture img { position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.picture:focus-visible { outline: 5px solid #e8913d; outline-offset: 2px; }
.picture.correct { border-color: #42aa7b; background: #edfaee; box-shadow: 0 5px 0 #b5dcc3; }
.picture.wrong { border-color: #e99e57; background: #fff1df; box-shadow: 0 5px 0 #e9cfac; }
.picture.correct::after { content: "✓"; position: absolute; right: 12px; top: 8px; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #3ba777; color: white; font-size: 38px; font-weight: 900; box-shadow: 0 3px 0 #25825a; }
.feedback { min-height: 45px; display: grid; place-items: center; text-align: center; font-size: clamp(18px, 2.6vw, 26px); font-weight: 900; }
.feedback:empty { min-height: 0; }
.discovery { flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); padding: 16px; border-radius: 26px; background: #fff; border: 3px solid #efd9a9; }
.discovery > img { min-width: 0; min-height: 0; width: 100%; height: 100%; object-fit: contain; }
.done-mark { width: 80px; height: 80px; display: grid; place-items: center; margin: auto; border-radius: 50%; background: #ffdf94; color: #b67623; font-size: 56px; }

.reward-overlay, .overlay { position: fixed; inset: 0; display: grid; place-items: center; padding: 18px; }
.reward-overlay { z-index: 20; background: #205f69b8; }
.reward-card { position: relative; width: min(540px, 100%); max-height: calc(100dvh - 60px); overflow: auto; padding: 25px 24px 30px; text-align: center; background: radial-gradient(ellipse at 50% 30%, #fff0bd, #fffaf0 65%); border: 5px solid #ffd276; border-radius: 38px; box-shadow: 0 14px 0 #c59047, 0 25px 50px #163d4866; animation: trophy-pop .45s cubic-bezier(.2,1.4,.5,1) both; }
.reward-card img { display: block; width: clamp(190px, 40vw, 320px); max-width: 100%; height: auto; margin: 0 auto; transform-origin: 50% 85%; animation: trophy-lift 1s .15s ease-out both; }
.reward-card h2 { margin: 2px 0 6px; font-size: clamp(31px, 5vw, 43px); color: #2c5960; }
.reward-card p { margin: 4px 0; font-weight: 800; }
.reward-kicker { letter-spacing: .15em; color: #df8a35; font-size: 17px; }
#reward-tally { margin-top: 14px; padding: 6px 16px; display: inline-block; border-radius: 20px; background: #fff0c5; color: #9d6426; font-size: 21px; font-weight: 900; }
.reward-spark { position: absolute; color: #d39321; font-size: 52px; animation: sparkle 1.1s ease-in-out 2 alternate; }
.reward-spark-a { left: 23px; top: 55px; }
.reward-spark-b { right: 24px; top: 82px; animation-delay: .35s; }
.overlay { z-index: 30; background: #173b4bc9; }
.parent-box { width: min(460px, 100%); max-height: calc(100dvh - 36px); overflow: auto; background: white; border-radius: 25px; padding: 24px; text-align: center; }
.parent-box h2 { margin: 4px; font-size: 28px; }
.parent-box a { color: #175f6c; }
.test-controls { margin: 14px 0; padding: 12px; border-radius: 16px; background: #f2f8f6; text-align: left; }
.test-controls h3 { margin: 0 0 8px; font-size: 19px; }
.test-controls label { display: block; margin-top: 8px; font-weight: 800; }
.test-controls select, .test-controls input { display: block; width: 100%; min-height: 42px; border: 2px solid #bfd4d1; border-radius: 10px; background: white; padding: 5px 8px; font-size: 16px; }
.test-controls .primary { margin-top: 12px; min-height: 48px; font-size: 18px; }
#test-error { margin: 5px 0; min-height: 0; }
.sound-option { display: flex; gap: 12px; align-items: center; justify-content: center; min-height: 48px; font-size: 20px; }
.sound-option input { width: 24px; height: 24px; accent-color: #197b88; }

@keyframes trophy-pop { from { opacity: 0; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }
@keyframes sparkle { to { transform: scale(1.2) rotate(18deg); } }
@keyframes trophy-lift { 0% { transform: translateY(16px) scale(.8); } 45% { transform: translateY(-8px) scale(1.06) rotate(-4deg); } 70% { transform: rotate(3deg); } 100% { transform: none; } }
@keyframes listening { 50% { box-shadow: 0 5px 0 #0c5964, 0 0 0 9px #85c9c94d; } }

@media (max-width: 650px) {
  #study { gap: 7px; }
  .study-top { min-height: 62px; }
  .play { min-width: 70px; width: 70px; height: 58px; }
  .play-label { display: none; }
  .prompt-hint { font-size: 13px; }
  .trophy-count { min-width: 52px; font-size: 19px; }
  .gear { width: 48px; height: 48px; }
  .reward-track-title { font-size: 0; }
  .reward-track-title span { font-size: 20px; }
  .reward-track { gap: 8px; }
  .reward-dot { width: 14px; height: 14px; }
  .reward-label { min-width: 44px; font-size: 14px; }
}
@media (max-height: 650px) {
  #study { gap: 6px; padding: 8px; }
  .study-top { min-height: 54px; }
  .play { height: 48px; min-width: 90px; font-size: 20px; }
  .play .speaker { font-size: 23px; }
  .gear { height: 45px; width: 45px; }
  .trophy-count { font-size: 19px; padding: 4px; }
  #study-status { font-size: 22px; }
  .prompt-hint { display: none; }
  .reward-track { min-height: 34px; padding: 3px 10px; }
  .reward-track-title { font-size: 14px; }
  .reward-dot { width: 14px; height: 14px; }
  .reward-label { font-size: 14px; }
  .picture { border-radius: 18px; }
  .feedback { min-height: 30px; font-size: 18px; }
  .reward-card { padding: 12px; }
  .reward-card img { width: min(240px, 37dvh); }
}
.discovery { position: relative; overflow: hidden; }
#discovery-alternate, #discovery-animation { position: absolute; inset: 0; width: 100%; height: 100%; }
#discovery-image, #discovery-alternate { transition: opacity .7s ease; object-fit: contain; }
#discovery-alternate { opacity: 0; }
.discovery.alternate #discovery-image, .discovery.animated-scene #discovery-image { opacity: 0; }
.discovery.alternate #discovery-alternate { opacity: 1; }
#discovery-animation { display: grid; place-items: center; background: #f8f9f3; }
#discovery-animation svg { width: 100%; height: 100%; }
.sound-volume { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.sound-volume input { flex: 1; min-width: 0; }
.progress-panel { border-top: 2px solid #d6e7e3; margin-top: 24px; padding-top: 16px; }
.progress-panel summary { cursor: pointer; font-size: 21px; font-weight: bold; padding: 10px 0; }
.progress-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; font-size: 16px; }
.progress-grid dt { color: #496b70; }
.progress-grid dd { margin: 0; font-weight: bold; }
.progress-days { display: flex; flex-wrap: wrap; gap: 8px; }
.progress-days div { background: #eaf3ef; padding: 8px; border-radius: 8px; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (orientation: landscape) and (min-height: 651px) {
  .study-top { min-height: 56px; }
  .play { height: 54px; }
  .prompt-hint { display: none; }
  .reward-track { min-height: 34px; padding: 3px 12px; }
  .reward-dot { width: 17px; height: 17px; }
  .feedback { min-height: 30px; }
  .feedback:empty { min-height: 0; }
}

.deck-music{background:#f1e9fb;border-color:#d5c2ef}.deck-music .deck-symbol{color:#75429c}
