/* PHARAH — Justice Rains From Above
   Palette: sky blue, Raptora navy + gold, sun-bleached sand.
   Type: strong geometric sans + flight-stencil accents. */

:root {
  --navy: #12233f;
  --navy-deep: #0a1526;
  --sky: #7ec8f2;
  --gold: #e8b13c;
  --gold-bright: #ffd870;
  --sand: #e6cf9e;
  --danger: #e8452c;
  --hud-white: #eef6ff;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-stencil: "Arial Black", "Avenir Next Heavy", "Segoe UI Black", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--navy-deep); }
body { font-family: var(--font-body); color: var(--hud-white); -webkit-user-select: none; user-select: none; }

#app { position: fixed; inset: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

.hidden { display: none !important; }

.stencil {
  font-family: var(--font-stencil);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.key {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid rgba(238, 246, 255, 0.55);
  border-radius: 4px;
  font-family: var(--font-stencil);
  font-size: 0.72em;
  letter-spacing: 0.08em;
  background: rgba(18, 35, 63, 0.6);
}
.key.tiny { font-size: 0.62em; padding: 0 5px; }

/* ============ screens ============ */
.screen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(232, 177, 60, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(10, 21, 38, 0.25) 0%, rgba(10, 21, 38, 0.78) 100%);
  z-index: 30;
}
.title-block { text-align: center; max-width: min(680px, 92vw); padding: 24px; }
.stencil-tag {
  font-family: var(--font-stencil);
  font-size: 11px; letter-spacing: 0.34em; color: var(--sky);
  border: 1px solid rgba(126, 200, 242, 0.4);
  display: inline-block; padding: 5px 14px; margin-bottom: 18px;
  background: rgba(18, 35, 63, 0.5);
}
.stencil-tag.red { color: #ff8d7a; border-color: rgba(232, 69, 44, 0.5); }
.stencil-tag.gold { color: var(--gold-bright); border-color: rgba(232, 177, 60, 0.55); }

.game-title {
  font-family: var(--font-stencil);
  font-size: clamp(56px, 12vw, 118px);
  letter-spacing: 0.12em;
  line-height: 0.95;
  color: var(--hud-white);
  text-shadow: 0 0 34px rgba(126, 200, 242, 0.55), 0 4px 0 rgba(18, 35, 63, 0.9);
}
.game-title.red-glow { text-shadow: 0 0 40px rgba(232, 69, 44, 0.7), 0 4px 0 rgba(18, 35, 63, 0.9); }
.game-title.gold-glow { text-shadow: 0 0 40px rgba(232, 177, 60, 0.65), 0 4px 0 rgba(18, 35, 63, 0.9); }
.game-subtitle { font-size: clamp(14px, 2.6vw, 22px); color: var(--gold); margin: 12px 0 18px; }
.title-brief { font-size: 15px; line-height: 1.55; color: rgba(238, 246, 255, 0.85); margin-bottom: 26px; }

.stencil-btn {
  font-family: var(--font-stencil);
  font-size: 20px; letter-spacing: 0.22em;
  color: var(--navy-deep);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: none; padding: 14px 42px; cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.stencil-btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.1); }
.stencil-btn:active { transform: translateY(1px); }

.controls-grid {
  margin: 28px auto 0; display: grid; gap: 8px;
  font-size: 13px; color: rgba(238, 246, 255, 0.75); max-width: 520px;
}
.radio-line { margin-top: 22px; font-size: 12px; font-style: italic; color: rgba(126, 200, 242, 0.7); }
.final-stats { margin: 6px 0 24px; font-family: var(--font-stencil); font-size: 15px; letter-spacing: 0.12em; color: var(--gold-bright); line-height: 2; }

/* ============ HUD ============ */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.hud-label { font-size: 10px; color: rgba(238, 246, 255, 0.65); margin-bottom: 3px; }

.hud-top-left { position: absolute; top: 18px; left: 20px; width: min(240px, 34vw); }
.bar {
  position: relative; height: 14px; margin-bottom: 10px;
  background: rgba(10, 21, 38, 0.72);
  border: 1px solid rgba(238, 246, 255, 0.28);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.bar > div:first-child { height: 100%; transition: width 0.12s linear; }
#armor-fill { width: 100%; background: linear-gradient(90deg, #4ea8ff, var(--sky)); }
#fuel-fill { width: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
#fuel-fill.low { background: linear-gradient(90deg, var(--danger), #ff8d7a); }
#fuel-warn {
  position: absolute; inset: 0; display: none;
  font-family: var(--font-stencil); font-size: 8px; letter-spacing: 0.12em;
  color: #fff; text-align: center; line-height: 14px;
}
.fuel-bar.low #fuel-warn { display: block; animation: blink 0.7s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

#clip-pips { display: flex; gap: 4px; margin-top: 2px; }
#clip-pips .pip {
  width: 18px; height: 8px;
  background: var(--sky);
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
  opacity: 0.95;
}
#clip-pips .pip.spent { background: rgba(238, 246, 255, 0.18); }
#clip-pips.reloading .pip { animation: pipreload 1.2s linear infinite; }
@keyframes pipreload { 0%,100% { opacity: 0.2; } 50% { opacity: 0.9; } }

.hud-top-right { position: absolute; top: 18px; right: 20px; text-align: right; width: min(240px, 34vw); }
#score { font-size: 30px; color: var(--hud-white); text-shadow: 0 0 14px rgba(126, 200, 242, 0.5); }
#streak { font-size: 12px; color: var(--gold-bright); margin-top: 2px; }
.barrage-block { margin-top: 14px; }
.barrage-bar > div:first-child { width: 0%; background: linear-gradient(90deg, #ff9a3c, var(--gold-bright)); }
#barrage-ready { font-size: 11px; color: var(--gold-bright); margin-top: 4px; animation: blink 0.9s steps(2) infinite; }

.hud-bottom-center {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  text-align: center; width: min(560px, 90vw);
}
#wave-banner { font-size: 20px; color: var(--hud-white); text-shadow: 0 0 18px rgba(126, 200, 242, 0.6); min-height: 26px; }
#radio-feed { min-height: 40px; margin-top: 6px; font-size: 12.5px; color: rgba(126, 200, 242, 0.92); font-style: italic; line-height: 1.5; }
#radio-feed .radio-line-item { animation: radiofade 4s forwards; }
@keyframes radiofade { 0% { opacity: 0; transform: translateY(4px); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
#ability-row { margin-top: 8px; display: flex; gap: 14px; justify-content: center; }
.ability { font-family: var(--font-stencil); font-size: 10px; letter-spacing: 0.12em; color: rgba(238, 246, 255, 0.8); padding: 4px 10px; border: 1px solid rgba(238,246,255,0.22); background: rgba(10,21,38,0.55); }
.ability.cooldown { color: rgba(238, 246, 255, 0.3); border-style: dashed; }
.ability.ready-flash { color: var(--gold-bright); border-color: var(--gold); }

/* altitude tape */
#altitude-tape {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 180px;
  background: rgba(10, 21, 38, 0.6);
  border: 1px solid rgba(238, 246, 255, 0.25);
}
#altitude-marker { position: absolute; left: -3px; width: 14px; height: 3px; background: var(--gold-bright); bottom: 0; }
.tape-label { position: absolute; top: -18px; right: -4px; font-size: 9px; color: rgba(238,246,255,0.5); }
#thermal-hint {
  position: absolute; left: 50%; top: 62%; transform: translateX(-50%);
  font-size: 11px; color: var(--gold-bright); text-shadow: 0 0 10px rgba(232,177,60,0.6);
}

/* crosshair + hitmarker */
#crosshair { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.ch-dot { position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; background: var(--hud-white); border-radius: 50%; }
.ch-ring { position: absolute; left: -13px; top: -13px; width: 26px; height: 26px; border: 1.5px solid rgba(238, 246, 255, 0.8); border-radius: 50%; transition: transform 0.08s; }
#crosshair.firing .ch-ring { transform: scale(1.35); border-color: var(--gold-bright); }
#hitmarker {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px;
  transform: translate(-50%, -50%) rotate(45deg); opacity: 0; pointer-events: none;
}
#hitmarker::before, #hitmarker::after { content: ""; position: absolute; background: var(--gold-bright); }
#hitmarker::before { left: 14px; top: 0; width: 2px; height: 30px; }
#hitmarker::after { top: 14px; left: 0; height: 2px; width: 30px; }
#hitmarker.pop { animation: hitpop 0.28s ease-out; }
@keyframes hitpop { 0% { opacity: 1; transform: translate(-50%,-50%) rotate(45deg) scale(0.7); } 100% { opacity: 0; transform: translate(-50%,-50%) rotate(45deg) scale(1.25); } }

#damage-vignette {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(232, 69, 44, 0.5) 100%);
  transition: opacity 0.25s;
}

#barrage-overlay {
  position: absolute; left: 0; right: 0; top: 12%; text-align: center; z-index: 22; pointer-events: none;
  font-size: clamp(16px, 3vw, 26px); color: var(--gold-bright);
  text-shadow: 0 0 22px rgba(232, 177, 60, 0.8);
  animation: blink 0.5s steps(2) infinite;
}

/* ============ touch ============ */
#touch-ui { position: absolute; inset: 0; z-index: 25; pointer-events: none; }
#stick-zone { position: absolute; left: 0; bottom: 0; width: 45%; height: 55%; pointer-events: auto; }
#stick-base {
  position: absolute; left: 60px; bottom: 70px; width: 110px; height: 110px;
  border: 2px solid rgba(238, 246, 255, 0.35); border-radius: 50%;
  background: rgba(10, 21, 38, 0.35); display: none;
}
#stick-nub { position: absolute; left: 35px; top: 35px; width: 40px; height: 40px; border-radius: 50%; background: rgba(126, 200, 242, 0.7); }
#touch-buttons { position: absolute; right: 14px; bottom: 60px; display: grid; grid-template-columns: repeat(2, auto); gap: 10px; pointer-events: auto; }
.touch-btn {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid rgba(238, 246, 255, 0.45);
  background: rgba(18, 35, 63, 0.6); color: var(--hud-white);
  font-family: var(--font-stencil); font-size: 10px; letter-spacing: 0.06em;
}
.touch-btn.big { width: 78px; height: 78px; }
.touch-btn.fire { border-color: var(--gold); color: var(--gold-bright); }
.touch-btn.ult { border-color: #ff9a3c; color: #ff9a3c; }
.touch-btn:active { background: rgba(126, 200, 242, 0.4); }

#mute-btn {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 40; width: 34px; height: 34px; line-height: 32px; text-align: center;
  border: 1px solid rgba(238, 246, 255, 0.3); border-radius: 50%;
  color: rgba(238, 246, 255, 0.75); cursor: pointer; background: rgba(10, 21, 38, 0.5);
  font-size: 15px;
}
#mute-btn.muted { color: rgba(238, 246, 255, 0.25); text-decoration: line-through; }

#boot-msg {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--navy-deep);
  font-family: var(--font-stencil); letter-spacing: 0.3em; font-size: 13px; color: var(--sky);
}

/* ============ mobile reflow ============ */
@media (max-width: 700px) {
  .hud-top-left { width: 42vw; top: 12px; left: 12px; }
  .hud-top-right { width: 42vw; top: 12px; right: 12px; }
  #score { font-size: 22px; }
  .hud-bottom-center { bottom: 150px; width: 92vw; }
  #wave-banner { font-size: 15px; }
  #radio-feed { font-size: 11px; min-height: 30px; }
  #ability-row { display: none; }
  #altitude-tape { display: none; }
  .controls-grid { font-size: 11px; }
  #mute-btn { top: auto; bottom: 14px; }
  .game-title { letter-spacing: 0.06em; }
  #thermal-hint { top: 55%; }
}
