:root {
  color-scheme: light;
  --ink: #183c43;
  --muted: #60777b;
  --teal: #087f82;
  --teal-dark: #056366;
  --teal-soft: #e7f6f3;
  --gold: #f6bd45;
  --gold-dark: #ad6b19;
  --coral: #e7614f;
  --paper: rgba(255, 255, 252, .96);
  --line: #d5e6e2;
  --moon-x: -176px;
  --moon-y: 0px;
  font-family: ui-rounded, "SF Pro Rounded", "Avenir Next Rounded", "Nunito", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; }
body { overflow: hidden; color: var(--ink); background: #eef6f3; }
button { color: inherit; font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:focus-visible { outline: 4px solid rgba(8,127,130,.3); 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; }

.game { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 650px; overflow: hidden; isolation: isolate; }
.world-art { position: absolute; z-index: -5; inset: -26px; width: calc(100% + 52px); height: calc(100% + 52px); object-fit: cover; filter: blur(3px) saturate(.62); opacity: .32; transform: scale(1.03); }
.world-wash { position: absolute; z-index: -4; inset: 0; background: linear-gradient(115deg, rgba(239,248,245,.92), rgba(255,249,236,.82) 52%, rgba(235,247,244,.94)); }
.world-wash::after { position: absolute; inset: 0; content: ""; background: radial-gradient(circle at 50% 48%, rgba(255,255,255,.08), rgba(235,246,242,.55) 76%); }

.hud { position: absolute; z-index: 12; top: 24px; left: 28px; right: 28px; display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.mission-chip { display: grid; gap: 3px; padding: 10px 15px; border-radius: 16px; background: rgba(255,255,255,.82); box-shadow: 0 8px 28px rgba(29,77,72,.08); backdrop-filter: blur(12px); }
.mission-chip span { color: var(--teal); font-size: 10px; font-weight: 950; letter-spacing: .09em; text-transform: uppercase; }
.mission-chip strong { font-size: 14px; }
.practice-stats { display: flex; gap: 5px; padding: 6px; border-radius: 18px; background: rgba(255,255,255,.86); box-shadow: 0 8px 28px rgba(29,77,72,.08); backdrop-filter: blur(12px); }
.practice-stats > div { min-width: 68px; padding: 6px 10px; text-align: center; }
.practice-stats span { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.practice-stats strong { display: block; margin-top: 2px; font-size: 20px; line-height: 1; }
.practice-stats .difficulty-stat { width: 142px; text-align: left; }
.difficulty-stat span { display: flex; justify-content: space-between; }
.difficulty-stat i { display: block; height: 7px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: #dcebe7; }
.difficulty-stat i b { display: block; width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #46c3a6); transition: width 220ms ease-out; }

.play-surface { position: relative; z-index: 3; width: min(900px, calc(100% - 320px)); min-width: 720px; min-height: 690px; padding: 34px 46px 26px; border: 1px solid rgba(211,230,224,.96); border-radius: 36px; background: var(--paper); box-shadow: 0 28px 90px rgba(31,76,68,.16), inset 0 2px rgba(255,255,255,.8); backdrop-filter: blur(18px); }
.mission-copy { max-width: 720px; min-height: 94px; margin: 0 auto 3px; text-align: center; }
.phase-label { display: inline-block; margin-bottom: 7px; color: var(--gold-dark); font-size: 10px; font-weight: 950; letter-spacing: .11em; text-transform: uppercase; }
.mission-copy h1 { margin: 0; font-size: clamp(29px, 2.8vw, 41px); font-weight: 950; line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }
.mission-copy p { margin: 8px 0 0; color: var(--muted); font-size: 15px; font-weight: 670; line-height: 1.35; }

.lab { display: grid; grid-template-columns: minmax(440px, 1fr) 246px; align-items: center; gap: 30px; min-height: 470px; }
.orbit-lab { position: relative; height: 460px; overflow: visible; }
.sun { position: absolute; z-index: 8; left: -21px; top: 50%; width: 92px; height: 126px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; transform: translateY(-50%); }
.sun > span { width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #fffde3 0 9%, #ffe078 26%, #f3b933 69%, #d98725 100%); box-shadow: 0 0 0 10px rgba(246,189,69,.1), 0 0 42px rgba(246,189,69,.48); }
.sun > span::after { position: absolute; left: 4px; top: 21px; width: 84px; height: 84px; content: ""; background: repeating-conic-gradient(rgba(246,189,69,.45) 0 4deg, transparent 4deg 28deg); clip-path: polygon(46% 0,54% 0,53% 38%,100% 46%,100% 54%,53% 53%,54% 100%,46% 100%,47% 53%,0 54%,0 46%,47% 47%); animation: sunSpin 22s linear infinite; }
.sun strong { margin-top: 9px; padding: 4px 10px; border-radius: 999px; color: #6b4508; background: #fff4c8; font-size: 10px; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.sun.is-focus > span { animation: sunPop 650ms ease-out 2; }
.sunbeams { position: absolute; z-index: 0; left: 47px; right: 5px; top: 50%; height: 310px; transform: translateY(-50%); opacity: .45; overflow: hidden; pointer-events: none; }
.sunbeams i { position: absolute; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, rgba(246,189,69,.9), rgba(246,189,69,.08) 74%, transparent); }
.sunbeams i:nth-child(1) { top: 16%; }.sunbeams i:nth-child(2) { top: 50%; }.sunbeams i:nth-child(3) { top: 84%; }
.sunbeams.is-flowing i { background-image: repeating-linear-gradient(90deg, var(--gold) 0 14px, transparent 14px 26px); animation: beamFlow 420ms linear infinite; }

.orbit-stage { position: absolute; z-index: 4; left: 60%; top: 50%; width: 400px; height: 400px; transform: translate(-50%,-50%); }
.orbit-ring { position: absolute; inset: 20px; border: 2px dashed rgba(8,127,130,.28); border-radius: 50%; background: radial-gradient(circle, rgba(231,246,243,.6), transparent 68%); }
.orbit-ring i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: rgba(8,127,130,.42); box-shadow: 0 0 0 5px rgba(8,127,130,.06); }
.orbit-ring i:nth-child(1) { left: -5px; top: calc(50% - 4px); }.orbit-ring i:nth-child(2) { left: calc(50% - 4px); top: -5px; }.orbit-ring i:nth-child(3) { right: -5px; top: calc(50% - 4px); }.orbit-ring i:nth-child(4) { left: calc(50% - 4px); bottom: -5px; }
.earth { position: absolute; z-index: 5; left: 50%; top: 50%; width: 94px; height: 94px; border-radius: 50%; transform: translate(-50%,-50%); background: radial-gradient(circle at 34% 29%, #8ee9ec, #258ea7 55%, #116476 100%); box-shadow: inset -12px -10px 18px rgba(10,58,70,.26), 0 0 0 7px rgba(8,127,130,.07), 0 15px 28px rgba(28,73,75,.2); }
.earth > span, .earth > span::before { position: absolute; content: ""; border-radius: 55% 45% 62% 38%; background: #84d38f; }
.earth > span { left: 14px; top: 24px; width: 31px; height: 20px; transform: rotate(-18deg); }.earth > span::before { left: 40px; top: 12px; width: 25px; height: 35px; }
.earth small { position: absolute; right: -26px; top: -18px; min-width: 43px; padding: 4px 7px; border-radius: 9px 9px 9px 2px; color: var(--teal-dark); background: #fff; box-shadow: 0 5px 14px rgba(30,73,73,.12); font-size: 10px; font-weight: 950; text-align: center; }
.moon-token { position: absolute; z-index: 12; left: 50%; top: 50%; width: 66px; height: 66px; padding: 0; border: 0; border-radius: 50%; background: #1a2e3a; box-shadow: 0 11px 25px rgba(34,64,66,.28), 0 0 0 2px rgba(255,255,255,.65); transform: translate(calc(-50% + var(--moon-x)), calc(-50% + var(--moon-y))); transition: box-shadow 140ms ease-out, scale 140ms ease-out; touch-action: none; user-select: none; }
.moon-token:hover, .moon-token:focus-visible, .moon-token.is-focus { box-shadow: 0 14px 30px rgba(34,64,66,.3), 0 0 0 6px rgba(8,127,130,.18), -10px 0 25px rgba(246,189,69,.2); }
.moon-token.is-dragging { scale: 1.1; cursor: grabbing; box-shadow: 0 16px 34px rgba(34,64,66,.33), 0 0 0 8px rgba(8,127,130,.14); }
.moon-lit-half { position: absolute; inset: 0 50% 0 0; overflow: hidden; border-radius: 66px 0 0 66px; background: radial-gradient(circle at 62% 35%, #fffcea, #f0d58b 58%, #c99a4b 100%); box-shadow: -8px 0 18px rgba(246,189,69,.25); }
.moon-craters::before, .moon-craters::after { position: absolute; content: ""; border: 2px solid rgba(47,58,62,.24); border-radius: 50%; }
.moon-craters::before { left: 12px; top: 12px; width: 12px; height: 12px; }.moon-craters::after { left: 24px; bottom: 11px; width: 8px; height: 8px; }
.drag-hint { position: absolute; z-index: 13; left: 50%; top: 50%; padding: 7px 11px; border-radius: 11px 11px 11px 3px; color: var(--teal-dark); background: #fff; box-shadow: 0 7px 18px rgba(28,73,73,.16); font-size: 11px; font-weight: 950; transform: translate(calc(-50% + var(--moon-x) + 40px), calc(-50% + var(--moon-y) - 48px)); transition: opacity 180ms ease-out; pointer-events: none; }
.game.has-dragged .drag-hint { opacity: 0; }

.lamp-view { position: relative; min-height: 402px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px 18px 18px; border-radius: 28px; background: linear-gradient(170deg, #193c49, #0f2934); box-shadow: 0 15px 34px rgba(31,76,68,.18), inset 0 1px rgba(255,255,255,.12); color: #fff; }
.view-label { color: #a8e6dd; font-size: 10px; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.moon-view { width: 204px; height: 204px; margin: 18px 0 10px; filter: drop-shadow(0 0 18px rgba(246,223,158,.16)); transition: filter 180ms ease-out, transform 180ms ease-out; }
.moon-view.is-full { filter: drop-shadow(0 0 30px rgba(255,226,137,.58)); }
#tonightMoon { display: block; width: 100%; height: 100%; overflow: visible; }
.moon-dark { fill: url(#moonDark); }.moon-light { fill: url(#moonGlow); }.moon-rim { fill: none; stroke: rgba(255,255,255,.24); stroke-width: 2; }.hero-craters { fill: rgba(54,58,51,.17); stroke: rgba(255,255,255,.08); stroke-width: 1.5; pointer-events: none; }
.lamp-view h2 { margin: 0; font-size: 27px; line-height: 1.05; letter-spacing: -.035em; text-align: center; }
.lamp-view > p { margin: 6px 0 0; color: #a9c4c7; font-size: 12px; font-weight: 700; }.lamp-view > p strong { color: #fff1ba; }
.target-orbit { position: absolute; z-index: 5; right: 10px; top: 9px; width: 78px; padding: 7px; border: 2px solid rgba(255,210,99,.68); border-radius: 16px; background: #102c37; box-shadow: 0 8px 18px rgba(0,0,0,.22); text-align: center; }
.target-orbit span { display: block; color: #ffe39b; font-size: 8px; font-weight: 950; letter-spacing: .07em; text-transform: uppercase; }
.target-orbit svg { display: block; width: 60px; height: 60px; }
.sequence { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; color: #718f94; font-size: 8px; font-weight: 950; letter-spacing: .04em; text-transform: uppercase; }
.sequence i { width: 13px; height: 2px; background: #41616a; }.sequence .done { color: #87ddad; }

.action-dock { min-height: 70px; display: grid; place-items: center; margin-top: 3px; }
.source-probe { display: flex; align-items: center; justify-content: center; gap: 10px; }
.source-probe > span { margin-right: 5px; color: var(--muted); font-size: 13px; font-weight: 850; }
.source-probe button { min-width: 112px; min-height: 48px; padding: 10px 15px; border: 2px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 4px 0 #d9e7e3; font-weight: 900; transition: transform 130ms ease-out, box-shadow 130ms ease-out, border-color 130ms ease-out; }
.source-probe button:hover { transform: translateY(-2px); border-color: #75bab1; box-shadow: 0 6px 0 #c9dfda; }
.primary { min-width: 260px; min-height: 54px; padding: 12px 22px; border: 1px solid #057174; border-radius: 16px; color: #fff; background: linear-gradient(180deg, #1ca4a2, var(--teal)); box-shadow: 0 6px 0 var(--teal-dark), 0 13px 26px rgba(8,127,130,.17); font-size: 15px; font-weight: 950; transition: transform 130ms ease-out, box-shadow 130ms ease-out; }
.primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--teal-dark), 0 15px 28px rgba(8,127,130,.2); }.primary:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--teal-dark); }
.feedback { min-height: 18px; margin: 8px 0 0; color: var(--coral); font-size: 12px; font-weight: 850; text-align: center; }
.play-surface.is-miss { animation: gentleShake 320ms ease-out; }

.sticker-art, .sticker-prop { overflow: hidden; padding: 7px; border: 1px solid rgba(29,74,68,.1); border-radius: 26px; background: #fffdf7; box-shadow: 0 11px 28px rgba(25,62,59,.16); }
.sticker-art img, .sticker-prop img { display: block; width: 100%; border-radius: 19px; }
.mascot { position: absolute; z-index: 5; left: max(18px, calc(50% - 690px)); bottom: 34px; width: 184px; pointer-events: none; transform-origin: 50% 100%; }
.mascot p { position: absolute; top: -8px; left: 132px; width: 138px; margin: 0; padding: 10px 12px; border-radius: 15px 15px 15px 5px; color: var(--teal-dark); background: rgba(255,255,255,.95); box-shadow: 0 9px 23px rgba(29,74,68,.12); font-size: 11px; font-weight: 900; line-height: 1.25; }
.mascot.is-happy { animation: mascotPop 600ms cubic-bezier(.2,.85,.25,1.2); }.mascot.is-sad { animation: mascotNudge 350ms ease-out; }.mascot.is-thinking .sticker-art { animation: mascotThink 1.8s ease-in-out infinite; }
.lamp-sticker { position: absolute; z-index: 1; right: max(12px, calc(50% - 690px)); bottom: 42px; width: 170px; transform: rotate(3deg); opacity: .78; }
.chart-sticker { position: absolute; z-index: 0; right: max(24px, calc(50% - 660px)); top: 95px; width: 128px; transform: rotate(-4deg); opacity: .52; }

.toast { position: absolute; z-index: 50; top: 24px; left: 50%; max-width: 430px; padding: 11px 18px; border-radius: 999px; color: #fff; background: #173f45; box-shadow: 0 14px 34px rgba(18,56,59,.2); font-size: 12px; font-weight: 900; opacity: 0; pointer-events: none; transform: translate(-50%,-12px) scale(.96); transition: opacity 180ms ease-out, transform 180ms ease-out; }
.toast.show { opacity: 1; transform: translate(-50%,0) scale(1); }
.celebration { position: absolute; z-index: 45; inset: 0; overflow: hidden; pointer-events: none; }
.celebration i { position: absolute; top: 48%; left: 50%; color: var(--gold); font-style: normal; font-size: 25px; opacity: 0; }
.celebration.show i { animation: confetti 850ms cubic-bezier(.15,.72,.25,1) forwards; }
.celebration i:nth-child(1){--x:-310px;--y:-240px}.celebration i:nth-child(2){--x:-245px;--y:-285px;color:var(--teal)}.celebration i:nth-child(3){--x:-170px;--y:-260px;color:var(--coral)}.celebration i:nth-child(4){--x:-80px;--y:-310px}.celebration i:nth-child(5){--x:25px;--y:-275px;color:var(--teal)}.celebration i:nth-child(6){--x:120px;--y:-315px;color:var(--coral)}.celebration i:nth-child(7){--x:190px;--y:-250px}.celebration i:nth-child(8){--x:270px;--y:-285px;color:var(--teal)}.celebration i:nth-child(9){--x:325px;--y:-220px;color:var(--coral)}.celebration i:nth-child(10){--x:70px;--y:-225px}

@keyframes sunSpin { to { transform: rotate(360deg); } }
@keyframes beamFlow { to { background-position: 40px 0; } }
@keyframes sunPop { 50% { transform: scale(1.1); box-shadow: 0 0 0 18px rgba(246,189,69,.16), 0 0 64px rgba(246,189,69,.58); } }
@keyframes gentleShake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px) rotate(-.2deg)} 68%{transform:translateX(6px) rotate(.2deg)} }
@keyframes mascotPop { 0%,100%{transform:translateY(0) rotate(0)} 35%{transform:translateY(-17px) rotate(-3deg)} 65%{transform:translateY(0) rotate(2deg)} }
@keyframes mascotNudge { 35%{transform:rotate(-4deg)} 70%{transform:rotate(3deg)} }
@keyframes mascotThink { 50%{transform:translateY(-5px) rotate(1deg)} }
@keyframes confetti { 0%{opacity:0;transform:translate(-50%,-50%) scale(.4)} 12%{opacity:1} 100%{opacity:0;transform:translate(calc(-50% + var(--x)),calc(-50% + var(--y))) rotate(480deg) scale(1.1)} }

@media (max-width: 1220px) {
  .play-surface { width: min(860px, calc(100% - 240px)); min-width: 710px; padding-inline: 34px; }
  .lab { grid-template-columns: minmax(420px,1fr) 230px; gap: 18px; }
  .mascot { left: 12px; bottom: 24px; width: 126px; }.mascot p { top: -20px; left: 20px; width: 130px; border-radius: 15px 15px 5px 15px; }
  .lamp-sticker { right: 8px; width: 126px; }.chart-sticker { display: none; }
}

@media (max-width: 820px) {
  body { overflow: auto; }
  .game { min-height: 980px; height: auto; padding: 78px 14px 160px; }
  .hud { top: 14px; left: 14px; right: 14px; }.practice-stats .difficulty-stat { width: 112px; }.practice-stats > div { min-width: 54px; padding-inline: 7px; }
  .play-surface { width: 100%; min-width: 0; min-height: 0; padding: 28px 18px 24px; border-radius: 28px; }
  .mission-copy { min-height: 112px; }.mission-copy h1 { font-size: 30px; }
  .lab { grid-template-columns: 1fr; gap: 12px; }.orbit-lab { height: 410px; }.orbit-stage { left: 54%; transform: translate(-50%,-50%) scale(.9); }
  .lamp-view { min-height: 310px; }.moon-view { width: 160px; height: 160px; margin: 10px 0 7px; }
  .source-probe { flex-wrap: wrap; }.source-probe > span { width: 100%; margin: 0; text-align: center; }
  .mascot { position: absolute; left: 16px; bottom: 20px; width: 118px; }.lamp-sticker { bottom: 22px; width: 112px; }
}

@media (max-height: 760px) and (min-width: 821px) {
  .play-surface { min-height: 630px; padding-top: 25px; padding-bottom: 18px; }.mission-copy { min-height: 82px; }.lab { min-height: 420px; }.orbit-lab { height: 415px; }.orbit-stage { transform: translate(-50%,-50%) scale(.91); }.lamp-view { min-height: 368px; }.moon-view { width: 180px; height: 180px; margin: 12px 0 8px; }.action-dock { min-height: 58px; }
}

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