/* booyahdash — dark arena theme.
 * Identity: charcoal arena, hot orange primary, alarm red for the zone.
 * Heavy display type for the title, plain system type everywhere else.
 * No gradients-as-decoration, no glassmorphism — flat colour, hard edges.
 */

:root {
  --bg: #0d0f12;
  --bg-soft: #14171c;
  --panel: #171a1f;
  --panel-edge: #262b33;
  --text: #f2f3f5;
  --muted: #9aa1ab;
  --orange: #ff6b1a;
  --orange-deep: #e04e00;
  --red: #ff2e4d;
  --gold: #ffd166;
  --green: #7dff6a;
  --blue: #4dd2ff;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--orange); }
a:hover { color: var(--gold); }

.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #0d0f12;
  border-bottom: 3px solid var(--orange);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.5px;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
}
.logo span { color: var(--orange); }
.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  flex: 1;
  min-width: 160px;
}
.topbar-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- buttons ---------- */
.btn {
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid var(--panel-edge);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { border-color: var(--orange); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-primary {
  background: var(--orange);
  border-color: var(--orange);
  color: #16100a;
}
.btn-primary:hover { background: var(--orange-deep); border-color: var(--orange-deep); }
.btn-ghost { background: transparent; }
.btn-big { font-size: 18px; padding: 14px 34px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }

/* ---------- layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; }
.game-section { padding-top: 20px; }

/* ---------- HUD ---------- */
.hud {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 12px 16px;
}
.hud-group { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hp-block { min-width: 170px; }
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.bar {
  height: 10px;
  background: #0a0c0e;
  border-radius: 5px;
  overflow: hidden;
}
.bar .fill { height: 100%; border-radius: 5px; transition: width 0.15s ease; }
.hp-bar .fill { background: var(--green); width: 100%; }
.hp-bar .fill.low { background: var(--red); }
.armor-bar .fill { background: var(--blue); width: 0; }
.dash-bar { width: 90px; }
.dash-bar .fill { background: var(--gold); width: 100%; }
.weapon-block { display: flex; flex-direction: column; line-height: 1.2; }
.weapon-name { font-weight: 800; font-size: 15px; }
.ammo-text { color: var(--muted); font-size: 13px; }
.hud-stat { display: flex; flex-direction: column; line-height: 1.2; text-align: right; }
.hud-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
.hud-stat strong { font-size: 16px; }
#zone-text.danger { color: var(--red); }

/* ---------- stage ---------- */
.stage {
  position: relative;
  background: #000;
  border: 1px solid var(--panel-edge);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  /* keeps the canvas tall enough to play on, without swallowing the page */
  min-height: 420px;
}
.stage canvas { display: block; width: 100%; }

.damage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 90px 30px rgba(255, 46, 77, 0.55);
  opacity: 0;
}
.damage-vignette.flash { animation: dmgflash 0.35s ease-out; }
@keyframes dmgflash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.banner {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 5;
}
.banner-title {
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900;
  font-size: clamp(30px, 6vw, 54px);
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.6), 0 0 28px rgba(255, 107, 26, 0.55);
}
.banner-sub { font-size: 15px; font-weight: 600; color: var(--text); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); }
.banner-pop { animation: bannerpop 0.35s ease-out; }
@keyframes bannerpop {
  0% { transform: translateX(-50%) scale(0.85); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.hint { color: var(--muted); font-size: 13px; margin: 10px 2px 0; }

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 9, 11, 0.82);
  z-index: 10;
  overflow-y: auto;
  padding: 20px;
}
.overlay-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-top: 4px solid var(--orange);
  border-radius: 12px;
  padding: 28px 30px;
  max-width: 560px;
  width: 100%;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.overlay-card h1, .overlay-card h2 { margin: 0 0 10px; }
.overlay-card h1 {
  font-family: "Arial Black", Arial, sans-serif;
  font-weight: 900;
  font-size: clamp(40px, 8vw, 64px);
  line-height: 0.95;
  letter-spacing: 1px;
  color: var(--gold);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.5);
}
.overlay-card h2 {
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 30px;
  letter-spacing: 0.5px;
}
.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--orange);
}
.lede { color: #d6dae0; margin: 0 auto 18px; max-width: 440px; }
.best-score { color: var(--gold); font-weight: 700; margin: 14px 0 0; }
.booyah-title { color: var(--gold) !important; font-size: clamp(44px, 9vw, 72px) !important; }

.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
  text-align: left;
}
.controls-grid div {
  background: var(--bg-soft);
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.controls-grid span { color: var(--muted); font-size: 13px; }
kbd {
  font: 700 12px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: #0a0c0e;
  border: 1px solid var(--panel-edge);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 7px;
  width: fit-content;
  color: var(--gold);
}

.score-board { margin-top: 22px; text-align: left; }
.score-board h2 {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
  font-family: inherit;
}
.score-list { list-style: none; margin: 0; padding: 0; }
.score-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 7px 10px;
  border-bottom: 1px solid var(--panel-edge);
  font-size: 14px;
}
.score-list li:last-child { border-bottom: none; }
.score-list .rank { color: var(--orange); font-weight: 800; min-width: 28px; }
.score-list .s-score { font-weight: 800; color: var(--gold); }
.score-list .s-meta { color: var(--muted); font-size: 12px; margin-left: auto; text-align: right; }

.stat-list { margin: 6px 0 4px; text-align: left; }
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px solid var(--panel-edge);
  font-size: 15px;
}
.stat-row:last-child { border-bottom: none; }
.stat-row span { color: var(--muted); }
.stat-row strong { color: var(--text); }

/* ---------- touch controls ---------- */
.touch-ui { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.joy-base {
  position: fixed;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 7;
}
.joy-knob {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold);
  left: 32px;
  top: 32px;
}
.touch-btn {
  position: absolute;
  bottom: 22px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  font: 800 14px/1 inherit;
  color: #fff;
  pointer-events: auto;
  touch-action: none;
}
.fire-touch { right: 22px; background: rgba(255, 46, 77, 0.75); }
.fire-touch:active { background: var(--red); }
.dash-touch { right: 112px; bottom: 34px; width: 60px; height: 60px; background: rgba(255, 209, 102, 0.7); color: #16100a; }
.dash-touch:active { background: var(--gold); }

/* ---------- info sections ---------- */
.info-section { padding: 44px 0 8px; }
.info-section h2 {
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 28px;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}
.section-lede { color: var(--muted); max-width: 640px; margin: 0 0 18px; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.info-card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 20px;
}
.info-card h3 { margin: 8px 0 6px; font-size: 17px; }
.info-card p { margin: 0; color: #c6cbd2; font-size: 14.5px; }
.info-num {
  font-family: "Arial Black", Arial, sans-serif;
  color: var(--orange);
  font-size: 20px;
}
.weapon-dot, .enemy-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.weapon-stats { margin-top: 10px !important; color: var(--gold) !important; font-size: 13px !important; font-weight: 700; }

.faq details {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq summary { font-weight: 700; cursor: pointer; font-size: 15.5px; }
.faq summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.faq details p { color: var(--muted); margin: 8px 0 2px; }

/* ---------- footer ---------- */
.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  border-top: 1px solid var(--panel-edge);
  color: var(--muted);
  font-size: 14px;
}
.site-footer p { margin: 4px 0; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .tagline { display: none; }
  .logo { font-size: 22px; }
  .hud { padding: 10px 12px; gap: 10px; }
  .hud-group { gap: 12px; }
  .hp-block { min-width: 130px; flex: 1; }
  .hud-stat strong { font-size: 14px; }
  .overlay-card { padding: 22px 18px; }
  .controls-grid { grid-template-columns: repeat(2, 1fr); }
  .stage { min-height: 380px; }
  .touch-btn { width: 68px; height: 68px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .banner-pop, .damage-vignette.flash { animation: none; }
  .btn, .bar .fill { transition: none; }
}
