/* v0.5.0 CRESCENT STRIKE theme -- colours sampled from the operator's logo
   (brand/crescent-strike-operator.jpg): ring cyan #33b6ec (peak #3cdbf9), deep blue #2299db,
   steel #566a75, silver #c3c9d0, charcoal #0f1418 with a #5f6b7b top-right highlight.
   LOCK and warnings stay red. Titles: Orbitron (OFL, fonts/OFL.txt), shipped locally. */
@font-face { font-family: "Orbitron"; src: url("fonts/Orbitron.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
:root {
  --hud: #3cdbf9;
  --hud-dim: rgba(60, 219, 249, 0.55);
  --warn: #ff4d4d;
  --ink: #e6edf3;
  --panel: rgba(12, 17, 22, 0.86);
  --accent: #33b6ec;
  --accent-hi: #3cdbf9;
  --deep: #2299db;
  --steel: #566a75;
  --silver: #c3c9d0;
  --charcoal: #0f1418;
  --title-font: "Orbitron", "Eurostile", "Bank Gothic", system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--charcoal); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
canvas#game, canvas#hud { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#hud { pointer-events: none; }
.hidden { display: none !important; }

.attribution { position: fixed; left: calc(8px + var(--safe-l)); bottom: calc(6px + var(--safe-b)); z-index: 30;
  display: flex; align-items: flex-end; gap: 8px; max-width: 70vw; pointer-events: none;
  font-size: 11px; line-height: 1.25; color: #fff; text-shadow: 0 0 3px #000, 0 0 2px #000; }
.attribution img { height: 18px; width: auto; flex: none; }

.status { position: fixed; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 25;
  background: var(--panel); padding: 6px 12px; border-radius: 6px; font-size: 13px; }

.overlay { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 24px calc(16px + var(--safe-r)) 24px calc(16px + var(--safe-l));
  /* brushed charcoal, lit from the top right -- the logo's own backdrop */
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(95, 107, 123, 0.55), rgba(95, 107, 123, 0) 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, rgba(0, 0, 0, 0.02) 1px 3px),
    linear-gradient(180deg, rgba(15, 20, 24, 0.72), rgba(8, 11, 14, 0.94));
  text-align: center; overflow-y: auto; }
h2 { font-family: var(--title-font); letter-spacing: 0.08em; }
/* v0.5.0: the operator's logo (emblem + wordmark), feathered to transparent at the edges so it
   sits on the brushed-charcoal title with no rectangle; 1x/2x WebP */
.logo { margin: 0; line-height: 0; }
.logo img { width: clamp(200px, 56vw, 340px); height: auto; }
/* a title taller than the screen scrolls from its TOP (centring clipped the logo off the top) */
#title { justify-content: flex-start; }
#title > :first-child { margin-top: auto; }
#title > :last-child { margin-bottom: auto; }
.result-brand { margin: 0; display: flex; align-items: center; gap: 8px; font-family: var(--title-font); font-weight: 800;
  letter-spacing: 0.16em; font-size: 13px; color: var(--silver); opacity: 0.95; }
.result-brand img { width: 28px; height: 28px; border-radius: 6px; }
@media (max-height: 460px) { .logo img { width: 150px; } }
@media (max-height: 760px) and (min-height: 461px) { .logo img { width: clamp(170px, 34vh, 260px); } }
.tagline { margin: 0; font-family: var(--title-font); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-hi); opacity: 0.9; }
.brief { max-width: 34em; margin: 4px 0; font-size: 14px; opacity: 0.9; }
.keys, .fine { font-size: 12px; opacity: 0.65; margin: 2px 0; }
.opts { display: flex; flex-wrap: wrap; gap: 12px 18px; justify-content: center; font-size: 14px; }
.opts label, .key-box label { display: flex; align-items: center; gap: 6px; }
select, input[type=password] { font: inherit; color: var(--ink); background: #161d24; border: 1px solid var(--steel); border-radius: 6px; padding: 6px 8px; }
.key-box { display: flex; flex-direction: column; align-items: stretch; gap: 6px; width: min(420px, 100%); background: var(--panel);
  border: 1px solid var(--steel); border-radius: 10px; padding: 12px; text-align: left; font-size: 13px; }
.key-box input[type=password] { width: 100%; }
.check { font-size: 13px; }
button { font: inherit; cursor: pointer; }
.big { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: #04121c; border: none; border-radius: 999px;
  padding: 14px 38px; font-size: 17px; font-family: var(--title-font); font-weight: 800; letter-spacing: 0.1em;
  box-shadow: 0 4px 0 #14527f, 0 0 18px rgba(51, 182, 236, 0.35); }
.big:active { transform: translateY(2px); box-shadow: 0 2px 0 #14527f; }
.link { background: none; border: none; color: var(--ink); opacity: 0.75; text-decoration: underline; }
h2 { margin: 0; font-size: 34px; letter-spacing: 0.08em; color: var(--accent); }
#result-text { white-space: pre-line; font-size: 15px; max-width: 30em; }

.top-buttons { position: fixed; top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); z-index: 30; display: flex; gap: 8px; }
.round { min-width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--hud-dim); background: rgba(0, 0, 0, 0.35);
  color: var(--hud); font-weight: 700; font-size: 13px; padding: 0 10px; }

.touch { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.stick-zone { position: absolute; left: 0; top: 0; bottom: 0; width: 55%; pointer-events: auto; }
.stick-base { position: absolute; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%;
  border: 2px solid var(--hud-dim); background: rgba(0, 0, 0, 0.18); }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: rgba(60, 219, 249, 0.35); border: 2px solid var(--hud); }
.right-controls { position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(40px + var(--safe-b)); display: flex;
  align-items: flex-end; gap: 14px; pointer-events: auto; }
.throttle { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--hud); font-size: 11px; font-weight: 700; }
.throttle input { writing-mode: vertical-lr; direction: rtl; width: 44px; height: 150px; accent-color: var(--hud); }
.fire { width: 88px; height: 88px; border-radius: 50%; border: 3px solid var(--warn); background: rgba(255, 77, 77, 0.25);
  color: #fff; font-weight: 900; font-size: 16px; letter-spacing: 0.08em; }
.fire.on { background: rgba(255, 77, 77, 0.6); }

.fatal { position: fixed; left: 0; right: 0; bottom: 0; z-index: 99; background: #b00020; color: #fff; padding: 10px 14px;
  font-size: 14px; white-space: pre-wrap; }

/* v0.2: where to fly */
.place-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 2px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.9; }
.place-pick select { font: 700 18px/1.2 system-ui, sans-serif; padding: 10px 14px; border-radius: 12px; min-width: min(320px, 86vw); text-align: center; }

/* v0.3: Battle Mode -- missile + flare buttons (stacked left of GUN), the title entry, the badge */
.battle-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.aux { width: 66px; height: 66px; border-radius: 50%; color: #fff; font-weight: 900; font-size: 14px; letter-spacing: 0.06em; }
.aux.msl { border: 3px solid var(--accent); background: rgba(51, 182, 236, 0.22); }
.aux.flr { border: 3px solid #ffa04a; background: rgba(255, 160, 74, 0.18); }
.aux.on { filter: brightness(1.8); }
/* v0.4: the MSL button glows red while you hold a lock, and pulses on SHOOT */
.aux.msl.locked { border-color: #ff4d4d; background: rgba(255, 77, 77, 0.38); box-shadow: 0 0 16px 4px rgba(255, 77, 77, 0.7); }
.aux.msl.shoot { animation: msl-shoot 0.42s ease-in-out infinite alternate; }
@keyframes msl-shoot { from { box-shadow: 0 0 10px 2px rgba(255, 77, 77, 0.55); } to { box-shadow: 0 0 26px 10px rgba(255, 77, 77, 0.95); } }
@media (prefers-reduced-motion: reduce) { .aux.msl.shoot { animation: none; } }
.battle-entry { font: 800 15px/1 system-ui, sans-serif; letter-spacing: 0.12em; padding: 10px 22px; border-radius: 999px;
  border: 2px solid var(--warn); background: rgba(255, 77, 77, 0.16); color: #fff; }
.battle-entry.on { background: rgba(255, 77, 77, 0.55); }
.battle-badge { position: fixed; left: calc(8px + var(--safe-l)); bottom: calc(8px + var(--safe-b)); z-index: 30; pointer-events: none;
  font-size: 11px; letter-spacing: 0.08em; color: #fff; opacity: 0.75; text-shadow: 0 0 3px #000; }

/* v0.5.2 lives + Google sign-in (same pattern as Potholes WTF) */
.lives { margin: 6px 0 8px; font-size: 15px; letter-spacing: 0.06em; color: var(--accent-hi); min-height: 1.2em; }
.big.signin { font-size: 16px; letter-spacing: 0.04em; }
.signin-why { margin: 8px auto 0; max-width: 26em; font-size: 13px; opacity: 0.85; }
.signin-err { margin: 6px 0 0; font-size: 13px; color: #ff6b6b; }
.account { margin: 8px 0 0; font-size: 13px; opacity: 0.85; }
.account a { color: var(--accent-hi); }
