:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --muted: #b9caef;
  --navy: #07173d;
  --deep: #040b24;
  --cyan: #20dff5;
  --cyan-dark: #087b9f;
  --yellow: #ffdf37;
  --yellow-dark: #b66d08;
  --coral: #ff6574;
  --coral-dark: #9d294a;
  font-family: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; min-width: 1000px; min-height: 650px; overflow: hidden; }
body { margin: 0; color: var(--ink); background: var(--deep); }
button { color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 4px solid white; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.lesson { height: 100%; padding: 14px; }
.arcade { position: relative; height: 100%; min-height: 620px; overflow: hidden; isolation: isolate; border: 2px solid #3172a9; border-radius: 26px; background: linear-gradient(rgba(3,10,35,.16),rgba(3,9,31,.48)),url("art/arcade-backdrop-01.webp") center/cover no-repeat; box-shadow: inset 0 0 80px rgba(1,5,24,.5),0 8px 0 #04112e,0 25px 60px rgba(1,5,20,.5); }
.arcade::before { position: absolute; z-index: -1; inset: 0; content: ""; background: radial-gradient(circle at 63% 58%,rgba(28,222,245,.12),transparent 35%); }
.stars i { position: absolute; z-index: 0; width: 8px; height: 8px; border-radius: 50%; background: white; box-shadow: 0 0 14px var(--cyan); animation: twinkle 1.8s ease-in-out infinite alternate; }
.stars i:nth-child(1){left:9%;top:15%}.stars i:nth-child(2){left:39%;top:25%;animation-delay:300ms}.stars i:nth-child(3){right:23%;top:16%;animation-delay:700ms}.stars i:nth-child(4){right:9%;top:39%;animation-delay:1s}.stars i:nth-child(5){left:27%;bottom:15%;animation-delay:500ms}.stars i:nth-child(6){right:35%;bottom:11%;animation-delay:900ms}

.hud { position: absolute; z-index: 20; left: 20px; right: 20px; top: 17px; height: 68px; display: grid; grid-template-columns: 215px 1fr auto; align-items: center; gap: 20px; }
.mission-chip,.difficulty-card,.scoreboard { border: 2px solid rgba(80,222,255,.55); background: linear-gradient(180deg,rgba(10,32,78,.94),rgba(5,19,54,.96)); box-shadow: inset 0 1px rgba(255,255,255,.12),0 6px 0 rgba(1,8,29,.76),0 0 22px rgba(28,213,245,.12); backdrop-filter: blur(9px); }
.mission-chip { height: 68px; display: flex; flex-direction: column; justify-content: center; padding: 10px 16px; border-radius: 17px; }
.mission-chip span,.difficulty-card span,.scoreboard span,.set-card span { color: var(--muted); font-size: 10px; font-weight: 1000; letter-spacing: .11em; text-transform: uppercase; }
.mission-chip strong { margin-top: 3px; font-size: 17px; }
.difficulty-card { justify-self: center; width: min(350px,100%); display: grid; grid-template-columns: 1fr auto; gap: 6px 13px; padding: 9px 15px; border-radius: 16px; }
.difficulty-card > i { grid-column: 1/-1; height: 8px; overflow: hidden; border-radius: 99px; background: #152b5e; box-shadow: inset 0 1px 3px #02081c; }
.difficulty-card > i b { display: block; width: 18%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--cyan),var(--yellow),var(--coral)); box-shadow: 0 0 12px var(--cyan); transition: width 220ms ease-out; }
.difficulty-card strong { color: var(--yellow); font-size: 12px; }
.scoreboard { height: 68px; display: flex; align-items: stretch; padding: 6px; border-radius: 17px; }
.scoreboard > div { min-width: 72px; display: grid; place-content: center; padding: 0 11px; text-align: center; }
.scoreboard > div + div { border-left: 1px solid rgba(114,204,238,.3); }
.scoreboard strong { display: block; margin-top: 2px; font-size: 21px; line-height: 1; }.scoreboard strong i { color: var(--yellow); font-style: normal; font-size: 16px; }

.game-layout { position: absolute; z-index: 3; left: 20px; right: 20px; top: 102px; bottom: 21px; display: grid; grid-template-columns: 255px minmax(0,1fr); gap: 18px; }
.mascot-bay { position: relative; min-height: 0; overflow: hidden; border: 2px solid rgba(69,218,248,.48); border-radius: 24px; background: linear-gradient(180deg,rgba(8,27,72,.73),rgba(4,15,48,.92)); box-shadow: inset 0 1px rgba(255,255,255,.09),0 7px 0 rgba(2,8,29,.72); }
.mascot-halo { position: absolute; left: 50%; top: 15px; width: 220px; height: 220px; transform: translateX(-50%); border: 2px solid rgba(32,223,245,.28); border-radius: 50%; background: radial-gradient(circle,rgba(32,223,245,.2),transparent 64%); box-shadow: 0 0 35px rgba(32,223,245,.18); animation: halo-pulse 2.2s ease-in-out infinite alternate; }
.mascot { position: absolute; z-index: 2; left: 50%; top: 18px; width: 225px; height: 225px; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 11px 6px rgba(0,0,0,.35)); transform-origin: 50% 75%; }
.mascot.is-cheering { animation: mascot-cheer 620ms cubic-bezier(.2,.86,.3,1.2); }.mascot.is-thinking { animation: mascot-oops 440ms ease-out; }
.speech-bubble { position: absolute; z-index: 4; left: 13px; right: 13px; top: 232px; min-height: 75px; display: grid; place-items: center; padding: 13px 16px; border: 3px solid #fff3a5; border-radius: 18px; color: #302008; background: linear-gradient(#fffde0,#ffd95f); box-shadow: 0 5px 0 #9d5911,0 9px 25px rgba(0,0,0,.25); font-size: 14px; font-weight: 1000; line-height: 1.25; text-align: center; }
.speech-bubble::before { position: absolute; left: 49px; top: -15px; width: 24px; height: 24px; content: ""; transform: rotate(45deg); border-left: 3px solid #fff3a5; border-top: 3px solid #fff3a5; background: #fffde0; }
.set-card { position: absolute; left: 13px; right: 13px; bottom: 14px; min-height: 122px; padding: 15px; border: 1px solid rgba(109,219,250,.4); border-radius: 16px; background: rgba(3,13,45,.78); box-shadow: inset 0 1px rgba(255,255,255,.06); }
.set-card strong { display: block; margin-top: 4px; color: var(--yellow); font-size: 17px; }.set-card p { margin: 8px 0 0; color: #dce8ff; font-size: 13px; font-weight: 800; line-height: 1.5; }

.play-panel { min-width: 0; display: grid; grid-template-rows: auto minmax(310px,1fr) 38px auto; align-content: stretch; gap: 8px; padding: 20px 24px 18px; border: 2px solid rgba(74,221,250,.58); border-radius: 25px; background: linear-gradient(180deg,rgba(7,25,69,.94),rgba(3,13,44,.97)); box-shadow: inset 0 1px rgba(255,255,255,.1),0 8px 0 rgba(1,7,28,.76),0 22px 45px rgba(1,5,25,.38); backdrop-filter: blur(10px); }
.challenge-copy { min-height: 80px; text-align: center; }.challenge-copy > span { color: var(--yellow); font-size: 10px; font-weight: 1000; letter-spacing: .13em; text-transform: uppercase; }.challenge-copy h1 { margin: 5px 0 4px; font-size: clamp(28px,3vw,43px); line-height: 1; letter-spacing: -.04em; text-shadow: 0 4px 0 #031030; }.challenge-copy p { margin: 0; color: var(--muted); font-size: 14px; }
.zap-stage { position: relative; min-height: 310px; overflow: hidden; border: 2px solid #248eb8; border-radius: 23px; background: radial-gradient(circle at 50% 23%,rgba(32,223,245,.17),transparent 33%),linear-gradient(180deg,rgba(2,12,44,.72),rgba(8,29,75,.82)); box-shadow: inset 0 0 45px rgba(1,5,27,.75),0 5px 0 #020923; }
.zap-stage::after { position: absolute; z-index: 0; left: 8%; right: 8%; bottom: -36%; height: 60%; content: ""; transform: perspective(360px) rotateX(63deg); border: 3px solid rgba(48,225,247,.32); border-radius: 50%; box-shadow: inset 0 0 0 16px rgba(47,211,238,.06),0 0 35px rgba(41,211,245,.25); }
.listen-button { position: absolute; z-index: 9; right: 13px; top: 12px; min-height: 44px; padding: 0 14px; border: 2px solid #65eaff; border-radius: 13px; color: white; background: #0c4777; box-shadow: 0 4px 0 #052744; font-size: 12px; font-weight: 1000; }.listen-button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 6px 0 #052744; }.listen-button:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 #052744; }
.target-console { position: absolute; z-index: 4; left: 50%; top: 13px; min-width: 250px; min-height: 90px; display: grid; place-content: center; padding: 9px 28px 12px; transform: translateX(-50%); border: 2px solid #ffc928; border-radius: 18px; background: linear-gradient(180deg,#203875,#0e2258); box-shadow: inset 0 2px rgba(255,255,255,.15),0 6px 0 #061234,0 0 25px rgba(255,215,45,.22); text-align: center; }
.target-console span { color: #a8c7ea; font-size: 9px; font-weight: 1000; letter-spacing: .14em; text-transform: uppercase; }.target-console strong { display: block; margin-top: 1px; font-size: 42px; line-height: 1; letter-spacing: .01em; text-shadow: 0 0 18px rgba(255,227,80,.55); transition: opacity 170ms ease-out,filter 170ms ease-out; }.target-console strong.is-concealed { opacity: .09; filter: blur(4px); }
.timer-rail { position: absolute; z-index: 5; left: 10%; right: 10%; top: 114px; height: 10px; overflow: hidden; border: 1px solid #2d7ea5; border-radius: 99px; background: #061633; box-shadow: inset 0 2px 4px #01071d; }.timer-rail b { display: block; width: 100%; height: 100%; transform-origin: left; border-radius: inherit; background: linear-gradient(90deg,var(--cyan),var(--yellow),var(--coral)); box-shadow: 0 0 12px var(--cyan); }.timer-rail b.is-running { animation: timer-drain linear forwards; }.timer-rail.is-paused b { animation: none; transform: scaleX(0); }
.word-field { position: absolute; z-index: 3; inset: 132px 22px 18px; display: flex; align-items: center; justify-content: center; gap: clamp(9px,1.4vw,18px); pointer-events: none; }.word-field.is-live { pointer-events: auto; }
.word-bubble { position: relative; width: min(220px,24%); min-width: 150px; height: 105px; flex: 0 1 220px; border: 0; background: none; filter: drop-shadow(0 8px 6px rgba(0,0,0,.32)); animation: bubble-arrive 430ms cubic-bezier(.2,.85,.25,1.25) var(--delay) both,bubble-float 1.8s ease-in-out calc(var(--delay) + 430ms) infinite alternate; transition: transform 130ms ease-out,filter 130ms ease-out; }
.word-bubble::before { position: absolute; inset: -36% -10%; content: ""; background-image: url("art/word-bubbles.png"); background-repeat: no-repeat; background-size: 100% 300%; background-position: top center; pointer-events: none; }.word-bubble.bubble-1::before { background-position: center; }.word-bubble.bubble-2::before { background-position: bottom center; }
.word-bubble span { position: relative; z-index: 2; display: block; color: #062246; font-size: clamp(28px,3.1vw,44px); font-weight: 1000; letter-spacing: -.025em; text-shadow: 0 2px rgba(255,255,255,.55); }
.word-bubble:hover { transform: translateY(-6px) scale(1.04); filter: drop-shadow(0 12px 9px rgba(0,0,0,.32)) brightness(1.08); }.word-bubble:active { transform: translateY(3px) scale(.98); }.word-bubble.is-zapped { pointer-events: none; animation: bubble-zap 380ms ease-out both; }
.resolved-word { min-width: 330px; display: grid; place-content: center; padding: 24px 35px; border: 3px solid #5ce8fa; border-radius: 24px; background: linear-gradient(180deg,#173b76,#0a2456); box-shadow: inset 0 2px rgba(255,255,255,.15),0 7px 0 #041330,0 0 35px rgba(40,220,247,.23); text-align: center; }.resolved-word.is-correct { border-color: var(--yellow); box-shadow: inset 0 2px rgba(255,255,255,.15),0 7px 0 #4e3404,0 0 42px rgba(255,222,55,.35); }.resolved-word span { color: var(--muted); font-size: 10px; font-weight: 1000; letter-spacing: .13em; text-transform: uppercase; }.resolved-word strong { margin-top: 3px; color: white; font-size: 56px; line-height: 1; }
.zap-burst { position: absolute; z-index: 8; left: 50%; top: 57%; width: 430px; height: 430px; opacity: 0; transform: translate(-50%,-50%) scale(.15) rotate(-12deg); object-fit: contain; pointer-events: none; }.arcade.is-celebrating .zap-burst { animation: zap-burst 520ms ease-out both; }

.feedback { min-height: 38px; display: grid; place-items: center; color: #dffcff; font-size: 14px; font-weight: 900; text-align: center; }.feedback.is-error { color: #ffbdc7; }
.action-area { min-height: 66px; display: flex; align-items: end; justify-content: center; }
.primary,.explain-choice { min-height: 59px; border: 2px solid #75ecff; border-radius: 16px; background: linear-gradient(180deg,#1477a0,#09517c); box-shadow: inset 0 2px rgba(255,255,255,.12),0 6px 0 #042b4b; font-weight: 1000; transition: transform 130ms ease-out,box-shadow 130ms ease-out,filter 130ms ease-out; }.primary { min-width: 265px; padding: 0 25px; font-size: 16px; }.primary.is-yellow { border-color: #fff3a2; color: #392306; background: linear-gradient(#fff18a,#ffc526); box-shadow: inset 0 2px white,0 6px 0 #9b5908; }
.primary:hover,.explain-choice:hover { transform: translateY(-2px); filter: brightness(1.1); }.primary:active,.explain-choice:active { transform: translateY(4px); box-shadow: 0 2px 0 #042b4b; }
.explain-grid { width: min(820px,100%); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }.explain-choice { padding: 7px 12px; }.explain-choice span { display: block; font-size: 13px; }.explain-choice small { display: block; margin-top: 4px; color: #c7ddf4; font-size: 10px; font-weight: 800; }
.toast { position: absolute; z-index: 40; left: 50%; bottom: 31px; max-width: 75%; padding: 11px 19px; opacity: 0; transform: translate(-50%,12px); border: 2px solid #fff6a9; border-radius: 99px; color: #2f2206; background: #ffdc57; box-shadow: 0 5px 0 #7b4809,0 12px 28px rgba(0,0,0,.35); pointer-events: none; font-size: 13px; font-weight: 1000; transition: opacity 150ms ease-out,transform 150ms ease-out; }.toast.is-showing { opacity: 1; transform: translate(-50%,0); }
.arcade.is-miss .play-panel { animation: gentle-shake 410ms ease-out; }.arcade.is-celebrating .play-panel { box-shadow: inset 0 1px rgba(255,255,255,.1),0 8px 0 rgba(1,7,28,.76),0 0 58px rgba(255,218,53,.27); }

@keyframes twinkle { to { opacity: .35; transform: scale(.55); } }
@keyframes halo-pulse { to { transform: translateX(-50%) scale(1.08); opacity: .65; } }
@keyframes mascot-cheer { 0%,100%{transform:translateX(-50%) translateY(0) rotate(0)} 38%{transform:translateX(-50%) translateY(-18px) rotate(-4deg) scale(1.05)} 70%{transform:translateX(-50%) translateY(-5px) rotate(4deg)} }
@keyframes mascot-oops { 0%,100%{transform:translateX(-50%) rotate(0)} 28%{transform:translateX(calc(-50% - 5px)) rotate(-4deg)} 65%{transform:translateX(calc(-50% + 5px)) rotate(4deg)} }
@keyframes timer-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes bubble-arrive { from { opacity: 0; transform: translateY(44px) scale(.72) rotate(-5deg); } 75% { transform: translateY(-5px) scale(1.05) rotate(1deg); } }
@keyframes bubble-float { to { transform: translateY(-13px) rotate(1.2deg); } }
@keyframes bubble-zap { 0%{opacity:1;transform:scale(1)} 38%{transform:scale(1.18);filter:brightness(1.6) drop-shadow(0 0 22px #fff)} 100%{opacity:0;transform:scale(.15) rotate(18deg)} }
@keyframes zap-burst { 0%{opacity:0;transform:translate(-50%,-50%) scale(.15) rotate(-12deg)} 42%{opacity:1;transform:translate(-50%,-50%) scale(1.08) rotate(4deg)} 100%{opacity:0;transform:translate(-50%,-50%) scale(1.3) rotate(10deg)} }
@keyframes gentle-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px)} 50%{transform:translateX(5px)} 75%{transform:translateX(-3px)} }

@media (max-width: 1120px) { .game-layout { grid-template-columns: 225px minmax(0,1fr); }.mascot { width: 205px; height: 205px; }.speech-bubble { top: 214px; }.word-bubble { min-width: 135px; }.scoreboard > div { min-width: 62px; padding: 0 8px; } }
@media (max-height: 760px) { .hud { top: 11px; height: 62px; }.mission-chip,.scoreboard { height: 62px; }.game-layout { top: 86px; bottom: 15px; }.mascot { top: 4px; width: 190px; height: 190px; }.speech-bubble { top: 187px; min-height: 65px; }.set-card { min-height: 105px; }.play-panel { padding-top: 14px; grid-template-rows: auto minmax(275px,1fr) 32px auto; }.challenge-copy { min-height: 68px; }.challenge-copy h1 { font-size: 31px; }.zap-stage { min-height: 275px; }.word-field { inset: 125px 22px 18px; }.action-area { min-height: 58px; }.primary,.explain-choice { min-height: 53px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
