@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600&family=Playfair+Display:ital,wght@1,500&display=swap');

:root {
  color-scheme: dark;
  --ink: #eef8f6;
  --muted: rgba(226, 241, 239, .58);
  --line: rgba(222, 246, 242, .18);
  --mint: #a9f9cf;
  --sun: #ffca73;
  --deep: #06111d;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--deep); color: var(--ink); font-family: Manrope, system-ui, sans-serif; }
button, a { font: inherit; }
button { color: inherit; }

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 620px;
  isolation: isolate;
  background:
    radial-gradient(circle at 67% 48%, rgba(255, 166, 91, .2), transparent 24%),
    linear-gradient(180deg, #071727 0%, #112c38 50%, #0b202a 100%);
}

#stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(1, 8, 14, .38), transparent 24%, transparent 74%, rgba(1, 8, 14, .2)),
    linear-gradient(180deg, rgba(1, 6, 12, .16), transparent 48%, rgba(1, 8, 12, .38));
  box-shadow: inset 0 0 140px rgba(0, 0, 0, .36);
}

.sky-glow {
  position: absolute;
  z-index: 0;
  width: 36vw;
  aspect-ratio: 1;
  left: 50%;
  top: 41%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 193, 106, .12);
  filter: blur(55px);
}

#game { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; touch-action: none; }

.topbar, .hud, footer, .panel, .flight-tip, .reticle { position: absolute; z-index: 6; }
.topbar { left: clamp(22px, 3.1vw, 54px); right: clamp(22px, 3.1vw, 54px); top: clamp(22px, 3.2vw, 48px); display: flex; justify-content: space-between; align-items: center; }
.brand { color: var(--ink); text-decoration: none; display: inline-flex; gap: 12px; align-items: center; font: 500 12px/1 DM Mono, monospace; letter-spacing: .13em; }
.brand b { color: var(--mint); font-weight: 500; }
.brand-mark { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid rgba(216, 251, 237, .42); border-radius: 50%; }
.brand-mark i { display: block; width: 7px; height: 7px; border: 1px solid var(--mint); transform: rotate(45deg); box-shadow: 0 0 12px rgba(169, 249, 207, .65); }

.sound { width: 38px; height: 38px; border: 1px solid var(--line); background: rgba(6, 17, 28, .23); border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 2px; cursor: pointer; backdrop-filter: blur(12px); }
.sound span { width: 2px; height: 8px; border-radius: 2px; background: var(--ink); opacity: .72; transition: height .25s; }
.sound span:nth-child(2) { height: 13px; }.sound span:nth-child(3) { height: 10px; }.sound span:nth-child(4) { height: 5px; }
.sound[aria-pressed="true"] span { animation: sound .65s ease-in-out infinite alternate; }
.sound[aria-pressed="true"] span:nth-child(2) { animation-delay: -.3s; }.sound[aria-pressed="true"] span:nth-child(3) { animation-delay: -.55s; }
@keyframes sound { to { height: 3px; opacity: .35; } }

.hud { top: clamp(84px, 11vw, 125px); left: clamp(22px, 3.1vw, 54px); right: clamp(22px, 3.1vw, 54px); display: flex; align-items: end; justify-content: space-between; opacity: 0; transform: translateY(-8px); transition: .5s ease; pointer-events: none; }
.hud.is-visible { opacity: 1; transform: none; }
.hud-block { display: grid; gap: 4px; min-width: 100px; }
.hud-label, .combo span { font: 400 9px/1.2 DM Mono, monospace; letter-spacing: .16em; color: var(--muted); }
.hud strong { font: 500 clamp(20px, 2.1vw, 30px)/1 DM Mono, monospace; letter-spacing: -.04em; }
.time-block { text-align: right; }
.hud-center { width: min(28vw, 340px); display: grid; gap: 8px; }
.combo { display: flex; justify-content: space-between; align-items: center; }
.combo strong { font-size: 13px; color: var(--mint); }
.progress { height: 1px; background: rgba(255,255,255,.17); overflow: hidden; }
.progress i { display: block; width: 100%; height: 100%; transform-origin: left; background: linear-gradient(90deg, var(--mint), var(--sun)); box-shadow: 0 0 9px var(--mint); }

.panel { width: min(545px, calc(100% - 44px)); left: clamp(22px, 8.5vw, 140px); top: 50%; transform: translateY(-47%); opacity: 0; visibility: hidden; transition: opacity .65s ease, transform .65s ease, visibility .65s; }
.panel.is-open { opacity: 1; visibility: visible; transform: translateY(-50%); }
.eyebrow { margin: 0 0 19px; font: 500 10px/1 DM Mono, monospace; letter-spacing: .2em; color: var(--mint); }
.panel h1, .panel h2 { margin: 0; font: 500 clamp(58px, 7.3vw, 112px)/.81 Manrope, sans-serif; letter-spacing: -.075em; text-transform: uppercase; }
.panel h1 em, .panel h2 em { display: inline-block; color: var(--sun); font: 500 clamp(54px, 7vw, 106px)/.9 Playfair Display, Georgia, serif; text-transform: none; letter-spacing: -.055em; transform: translateX(9%); }
.lede { max-width: 430px; margin: 30px 0 31px; color: rgba(234, 247, 244, .68); font-size: 14px; line-height: 1.7; }
.actions { display: flex; align-items: center; gap: 22px; }
.actions p { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
kbd { border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; color: rgba(238,248,246,.76); font: 400 9px DM Mono, monospace; background: rgba(255,255,255,.04); }
.primary, .secondary { border-radius: 999px; cursor: pointer; transition: transform .2s, background .2s, border-color .2s; }
.primary { border: 0; min-width: 178px; padding: 7px 8px 7px 21px; background: var(--ink); color: #07141c; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; }
.primary i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #0c2430; color: var(--mint); font-style: normal; font-size: 16px; }
.primary:hover { transform: translateY(-2px); background: white; }
.secondary { border: 1px solid var(--line); background: rgba(6, 17, 29, .4); padding: 15px 22px; font-size: 12px; backdrop-filter: blur(12px); }
.secondary:hover { border-color: rgba(255,255,255,.45); transform: translateY(-2px); }
.edition { width: min(360px, 80%); margin-top: 47px; border-top: 1px solid var(--line); padding-top: 12px; display: flex; justify-content: space-between; color: var(--muted); font: 400 8px DM Mono, monospace; letter-spacing: .12em; }
.edition b { color: var(--ink); font-weight: 400; }

.results { width: min(610px, calc(100% - 44px)); }
.results h2 { font-size: clamp(54px, 6.2vw, 92px); }
.results h2 em { font-size: clamp(52px, 6vw, 88px); }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 31px 0 28px; background: var(--line); border: 1px solid var(--line); }
.result-grid div { background: rgba(5, 16, 27, .7); padding: 17px 18px 19px; backdrop-filter: blur(16px); }
.result-grid span { display: block; margin-bottom: 9px; font: 400 8px DM Mono, monospace; letter-spacing: .14em; color: var(--muted); }
.result-grid strong { font: 500 22px DM Mono, monospace; }

.reticle { left: 50%; top: 55%; width: 54px; height: 54px; transform: translate(-50%,-50%); border: 1px solid rgba(207,255,237,.18); border-radius: 50%; opacity: 0; transition: opacity .4s; }
.reticle::before, .reticle::after { content:""; position:absolute; background: rgba(207,255,237,.38); }
.reticle::before { width: 10px; height: 1px; left: -6px; top: 26px; box-shadow: 55px 0 rgba(207,255,237,.38); }
.reticle::after { width: 1px; height: 10px; top: -6px; left: 26px; box-shadow: 0 55px rgba(207,255,237,.38); }
.reticle span { position: absolute; inset: 23px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 11px var(--mint); }
.reticle.is-visible { opacity: 1; }
.flight-tip { left: 50%; bottom: 13%; transform: translateX(-50%); margin: 0; font: 400 9px DM Mono, monospace; letter-spacing: .14em; color: rgba(234,247,244,.53); opacity: 0; transition: opacity .4s; text-transform: uppercase; }
.flight-tip.is-visible { animation: tip 4s forwards; }
@keyframes tip { 0%,80% { opacity: 1; } 100% { opacity: 0; } }

footer { left: clamp(22px, 3.1vw, 54px); right: clamp(22px, 3.1vw, 54px); bottom: max(24px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; color: rgba(225,240,238,.38); font: 400 8px DM Mono, monospace; letter-spacing: .12em; }
.flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: rgba(179,255,221,.24); opacity: 0; }
.flash.pop { animation: flash .38s ease-out; }
@keyframes flash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 720px) {
  #stage { min-height: 520px; }
  .panel { left: 22px; top: 53%; }
  .panel h1, .panel h2 { font-size: clamp(52px, 16vw, 78px); }
  .panel h1 em, .panel h2 em { font-size: clamp(50px, 15vw, 74px); transform: translateX(2%); }
  .lede { margin: 23px 0; font-size: 13px; max-width: 90%; }
  .edition, .coordinates, .actions p { display: none; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .result-grid div:last-child { grid-column: 1 / -1; }
  .hud-center { display: none; }
  .hud { top: 82px; }
  .result-actions { flex-wrap: wrap; }
  footer { justify-content: flex-end; }
  footer > span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

