:root {
  --sky: #081c34;
  --glass: rgba(5, 19, 37, .72);
  --glass-2: rgba(9, 29, 51, .82);
  --border: rgba(168, 213, 255, .18);
  --text: #f4f8ff;
  --muted: #a8b8cd;
  --cyan: #16c9ff;
  --blue: #3ca9ff;
  --gold: #ffc34d;
  --danger: #ff5578;
  --radius-lg: 22px;
  --blur: 20px;
  --shadow: 0 20px 55px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: #061526; color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.game-shell { position: relative; min-height: 100svh; overflow: hidden; background: #102b4c; isolation: isolate; }
.world-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.cinematic-vignette { position: fixed; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(circle at 55% 50%, transparent 35%, rgba(0,0,0,.16) 72%, rgba(0,0,0,.5)); }

.glass {
  background: linear-gradient(135deg, rgba(10,28,49,.78), rgba(3,16,31,.58));
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(var(--blur)) saturate(135%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(135%);
}

.hud-root { position: relative; z-index: 5; min-height: 100svh; pointer-events: none; }
.hud-root > * { pointer-events: auto; }

.brand { position: fixed; top: 18px; left: 24px; display: flex; gap: 13px; align-items: center; z-index: 10; }
.brand-mark { width: 68px; height: 68px; display: grid; place-items: center; font-size: 48px; color: #fff; filter: drop-shadow(0 0 16px rgba(68,193,255,.45)); }
.brand-name { font-weight: 800; font-size: clamp(35px, 4vw, 58px); line-height: .9; letter-spacing: -2px; }
.brand-name span { color: var(--cyan); }
.brand-sub { margin-top: 10px; font-size: 13px; letter-spacing: 3px; color: #d6e4f5; }

.topline { position: fixed; top: 27px; left: 50%; transform: translateX(-50%); font-size: 15px; letter-spacing: 5px; color: #eef6ff; opacity: .96; white-space: nowrap; }
.topline b { color: #7edcff; padding: 0 14px; }

.pause { position: fixed; top: 19px; right: 23px; width: 76px; height: 76px; border-radius: 18px; border-color: rgba(105,207,255,.15); color: #fff; font-size: 36px; font-weight: 800; line-height: 1; cursor: pointer; }

.left-stack { position: fixed; left: 23px; top: 124px; width: 307px; display: grid; gap: 8px; }
.mission-card { min-height: 104px; border-radius: 18px; padding: 12px 14px 10px; display: grid; grid-template-columns: 62px 1fr; gap: 9px; }
.mission-thumb { width: 62px; height: 62px; border-radius: 8px; background: linear-gradient(135deg, #86d8ff, #1771aa 50%, #1f4e46); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.mission-copy { display: grid; align-content: center; gap: 3px; }
.mission-copy strong { font-size: 16px; letter-spacing: 1px; }
.mission-copy span { font-size: 16px; color: #fff; }
.mission-label { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 12px; color: #dce7f4; }
.progress, .word-progress { height: 8px; background: rgba(94,155,204,.15); border-radius: 99px; overflow: hidden; }
.progress { grid-column: 1 / -1; }
.progress i, .word-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #17e3a7, #1de7ff); box-shadow: 0 0 12px rgba(25,229,199,.55); }

.stat { height: 78px; border-radius: 18px; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.stat-icon { width: 47px; height: 47px; border: 1px solid rgba(120,205,255,.65); border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: #dff7ff; box-shadow: inset 0 0 18px rgba(23,189,255,.08), 0 0 14px rgba(23,189,255,.13); }
.stat-icon.gold { border-color: rgba(255,195,77,.75); color: var(--gold); }
.stat span { display: block; font-size: 14px; letter-spacing: .7px; color: #d3deed; }
.stat strong { display: block; margin-top: 2px; font-size: 31px; line-height: 1; letter-spacing: -.5px; }

.center-hint { position: fixed; inset: 0; z-index: 4; pointer-events: none; }
.ring { position: absolute; border: 4px solid rgba(255,188,54,.95); border-radius: 50%; display: grid; place-items: center; color: white; font-weight: 800; text-shadow: 0 2px 12px #000; box-shadow: 0 0 10px rgba(255,190,52,.9), inset 0 0 14px rgba(255,196,71,.35); background: rgba(255,173,32,.04); }
.ring::before { content: ""; position: absolute; inset: -9px; border: 1px solid rgba(255,221,133,.35); border-radius: 50%; }
.ring-xl { width: 190px; height: 190px; left: 39%; top: 28%; font-size: 58px; }
.ring-md { width: 104px; height: 104px; left: 54%; top: 33%; font-size: 38px; }
.ring-sm { width: 82px; height: 82px; left: 64%; top: 37%; font-size: 28px; }
.flight-arrows { position: absolute; left: 44%; top: 49%; color: #28e4ff; text-align: center; font-size: 47px; line-height: .55; text-shadow: 0 0 18px #00dfff; }

.keyboard-panel { position: fixed; left: 23px; bottom: 69px; width: 507px; border-radius: 21px; padding: 18px 16px; }
.keyboard { display: grid; gap: 9px; }
.key-row { display: flex; justify-content: center; gap: 7px; }
.key { width: 42px; height: 48px; display: grid; place-items: center; border-radius: 6px; border: 1px solid rgba(106,180,228,.25); background: rgba(4,23,41,.6); color: #eff8ff; font-weight: 750; font-size: 20px; box-shadow: inset 0 1px rgba(255,255,255,.05); transition: transform .08s, box-shadow .08s, background .08s, border-color .08s; }
.key.active, .key.correct { transform: translateY(-2px); border-color: #21dcff; background: rgba(13,167,222,.48); box-shadow: 0 0 18px rgba(0,210,255,.8), inset 0 0 12px rgba(45,229,255,.22); }
.key.wrong { border-color: var(--danger); background: rgba(255,60,93,.35); animation: shake .18s linear 2; }

.word-panel { position: fixed; right: 23px; bottom: 69px; width: 454px; min-height: 198px; border-radius: 22px; padding: 22px 28px; display: flex; justify-content: space-between; }
.eyebrow { color: #a8bbd0; font-weight: 700; letter-spacing: 1px; font-size: 13px; }
.word { margin: 10px 0 13px; font-size: 46px; font-weight: 800; letter-spacing: -1px; }
.word-progress { width: 267px; }
.word-panel p { margin: 18px 0 0; color: #edf5ff; font-size: 15px; }
.word-index { align-self: end; color: #a9c1d9; font-size: 13px; }

.bottom-tag { position: fixed; bottom: 54px; left: 50%; transform: translateX(-50%); font-size: 14px; letter-spacing: 5px; white-space: nowrap; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.55); }

.ready-layer, .modal-layer { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(2,10,19,.22); }
.ready-card, .modal, .results { width: min(560px, calc(100vw - 32px)); border-radius: 28px; padding: 34px; text-align: center; }
.ready-card h1, .modal h2, .results h2 { margin: 7px 0 10px; font-size: 42px; letter-spacing: -1.5px; }
.ready-card p, .modal p { color: #c3d2e3; margin: 0 auto 24px; max-width: 430px; }
.ready-card small { display: block; color: #90a6be; margin-top: 15px; }
.primary, .secondary { border-radius: 12px; padding: 13px 22px; cursor: pointer; font-weight: 800; border: 1px solid transparent; }
.primary { color: #03111e; background: linear-gradient(135deg, #fff, #67dcff); box-shadow: 0 10px 28px rgba(29,210,255,.22); }
.secondary { color: #eaf5ff; background: rgba(255,255,255,.05); border-color: var(--border); }
.wide { min-width: 240px; }
.modal-actions { display: flex; justify-content: center; gap: 10px; }

.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 26px 0 16px; }
.result-grid > div { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(0,0,0,.12); }
.result-grid span { display: block; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.result-grid strong { display: block; margin-top: 4px; font-size: 28px; }
.reward-line { margin-bottom: 20px; color: #7de9ff; font-weight: 800; }

@keyframes shake { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

@media (max-width: 1100px) {
  .left-stack { width: 270px; }
  .keyboard-panel { width: 390px; }
  .key { width: 32px; height: 42px; }
  .word-panel { width: 370px; }
  .ring-xl { left: 37%; }
}
@media (max-width: 760px) {
  .brand { top: 10px; left: 12px; }
  .brand-mark { width: 42px; height: 42px; font-size: 28px; }
  .brand-name { font-size: 29px; }
  .brand-sub { font-size: 8px; letter-spacing: 2px; margin-top: 5px; }
  .topline { display: none; }
  .pause { top: 10px; right: 10px; width: 52px; height: 52px; font-size: 26px; }
  .left-stack { top: 75px; left: 10px; width: calc(100vw - 20px); grid-template-columns: 1fr 1fr; }
  .mission-card { grid-column: 1 / -1; }
  .stat { height: 58px; }
  .stat-icon { width: 36px; height: 36px; font-size: 18px; }
  .stat strong { font-size: 22px; }
  .keyboard-panel { left: 10px; right: 10px; bottom: 10px; width: auto; padding: 9px; }
  .key { width: calc((100vw - 65px) / 10); height: 35px; font-size: 15px; }
  .key-row { gap: 3px; }
  .word-panel { right: 10px; left: 10px; bottom: 170px; width: auto; min-height: 130px; padding: 16px; }
  .word { font-size: 34px; }
  .word-progress { width: 62vw; }
  .bottom-tag { display: none; }
  .ring-xl { width: 130px; height: 130px; left: 30%; top: 45%; }
  .ring-md { width: 76px; height: 76px; left: 56%; top: 49%; }
  .ring-sm { width: 60px; height: 60px; left: 68%; top: 55%; }
  .flight-arrows { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* Production interaction polish */
.hud-root { user-select: none; -webkit-user-select: none; }
.key { will-change: transform, box-shadow; }
.ring { will-change: transform, opacity; }
button { -webkit-tap-highlight-color: transparent; }
@media (hover: hover) {
  .primary:hover { transform: translateY(-1px); }
  .secondary:hover, .pause:hover { border-color: rgba(120,220,255,.45); background: rgba(255,255,255,.08); }
}
@media (max-width: 420px) {
  .left-stack { grid-template-columns: 1fr 1fr; }
  .mission-card { min-height: 92px; }
  .mission-thumb { width: 52px; height: 52px; }
  .mission-copy strong, .mission-copy span { font-size: 13px; }
  .stat { padding: 7px 9px; gap: 8px; }
  .stat span { font-size: 10px; }
  .stat strong { font-size: 20px; }
  .key { height: 32px; font-size: 13px; }
  .keyboard-panel { bottom: 7px; }
}

