:root {
  --blue: #2f7dff;
  --orange: #ff7a2a;
  --bg: #05070d;
  --panel: rgba(12, 18, 30, 0.85);
  --stroke: rgba(120, 170, 230, 0.25);
  --text: #e8eef9;
  --muted: #8ea0bf;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif; user-select: none; -webkit-user-select: none; }
#app { position: fixed; inset: 0; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; font-variant-numeric: tabular-nums; }

#scoreboard {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0;
  background: var(--panel); border: 1px solid var(--stroke); border-radius: 12px;
  padding: 6px 14px; backdrop-filter: blur(8px); box-shadow: 0 6px 30px rgba(0,0,0,.5);
}
#scoreboard .team { display: flex; align-items: center; gap: 10px; padding: 4px 10px; }
#scoreboard .team .col { width: 10px; height: 22px; border-radius: 3px; }
#scoreboard .team.blue .col { background: var(--blue); box-shadow: 0 0 12px var(--blue); }
#scoreboard .team.orange .col { background: var(--orange); box-shadow: 0 0 12px var(--orange); }
#scoreboard .label { font-size: 12px; letter-spacing: 2px; color: var(--muted); }
#scoreboard .score { font-size: 30px; font-weight: 800; }
#timer { font-size: 22px; font-weight: 700; padding: 0 18px; border-left: 1px solid var(--stroke); border-right: 1px solid var(--stroke); }
#timer.ot { color: #ffd24a; }

#boost-wrap {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  width: 220px; display: flex; align-items: center; gap: 10px;
}
#boost-meter { flex: 1; height: 16px; background: rgba(255,255,255,.08); border: 1px solid var(--stroke); border-radius: 8px; overflow: hidden; }
#boost-fill { height: 100%; width: 34%; background: linear-gradient(90deg, #ffae3b, #ff5a1a); transition: width .08s linear; box-shadow: 0 0 14px rgba(255,140,40,.6); }
#boost-pct { width: 28px; text-align: right; font-size: 13px; color: var(--muted); }

#boost-wrap-p2 { position: absolute; bottom: 18px; left: 18px; width: 160px; display: flex; align-items: center; gap: 8px; }
#boost-meter-p2 { flex: 1; height: 12px; background: rgba(255,255,255,.08); border: 1px solid var(--stroke); border-radius: 6px; overflow: hidden; }
#boost-fill-p2 { height: 100%; width: 34%; background: linear-gradient(90deg, #ffae3b, #ff5a1a); }
#boost-pct-p2 { width: 24px; text-align: right; font-size: 11px; color: var(--muted); }

#cam-indicator {
  position: absolute; top: 14px; right: 16px; background: var(--panel); border: 1px solid var(--stroke);
  border-radius: 8px; padding: 6px 10px; font-size: 11px; letter-spacing: 2px; color: #9ad1ff;
}

#toast {
  position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%);
  font-size: 40px; font-weight: 900; letter-spacing: 3px; text-shadow: 0 0 24px rgba(0,0,0,.8);
  opacity: 0; transition: opacity .25s; text-align: center;
}
#toast.show { opacity: 1; }

#fps { position: absolute; bottom: 6px; right: 8px; font-size: 11px; color: var(--muted); }

/* ---------- Overlays ---------- */
.overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,16,30,.55), rgba(2,4,9,.92));
  z-index: 20; backdrop-filter: blur(4px);
}
.menu-card {
  width: min(760px, 92vw); background: var(--panel); border: 1px solid var(--stroke); border-radius: 18px;
  padding: 34px 38px; box-shadow: 0 20px 80px rgba(0,0,0,.6); text-align: center;
}
.title {
  font-size: 76px; font-weight: 900; letter-spacing: 14px; margin-left: 14px;
  background: linear-gradient(180deg, #ffd9a8, #ff7a2a 60%, #ff3b1a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 30px rgba(255,120,40,.5));
}
.subtitle { color: var(--muted); letter-spacing: 4px; font-size: 13px; margin: 2px 0 22px; text-transform: uppercase; }

.mode-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.diff-row { display: flex; gap: 8px; justify-content: center; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.diff-label { color: var(--muted); font-size: 13px; letter-spacing: 1px; }

.opts-row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.opt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.opt input { accent-color: var(--orange); }

.btn {
  background: linear-gradient(180deg, #2f7dff, #1d5fd0); color: #fff; border: none; border-radius: 10px;
  padding: 12px 22px; font-size: 15px; font-weight: 700; letter-spacing: 1px; cursor: pointer;
  transition: transform .08s, filter .15s; box-shadow: 0 6px 20px rgba(47,125,255,.35);
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn.mode { min-width: 150px; }
.btn.small { padding: 7px 14px; font-size: 13px; background: rgba(255,255,255,.06); box-shadow: none; border: 1px solid var(--stroke); }
.btn.small.selected { background: linear-gradient(180deg, #ff8a3a, #ff5a1a); box-shadow: 0 4px 14px rgba(255,110,40,.4); }
.btn.ghost { background: transparent; border: 1px solid var(--stroke); box-shadow: none; color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: rgba(120,170,230,.5); }

.controls-help { display: flex; gap: 30px; justify-content: center; text-align: left; margin-top: 6px; }
.ccol { min-width: 230px; }
.ccol h3 { font-size: 13px; letter-spacing: 2px; color: #9ad1ff; margin-bottom: 6px; }
.ccol p { font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.ccol b { color: var(--text); background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.footer-note { color: var(--muted); font-size: 12px; margin-top: 16px; font-style: italic; }

/* dynamic overlay text */
.big-text {
  font-size: 110px; font-weight: 900; letter-spacing: 8px; text-align: center;
  text-shadow: 0 0 50px rgba(0,0,0,.8);
}
#goal-banner .goal-text { font-size: 130px; font-weight: 900; letter-spacing: 10px;
  background: linear-gradient(180deg, #fff, #ffd24a); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 40px rgba(255,210,80,.6)); animation: pop .4s ease; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.goal-team { font-size: 28px; letter-spacing: 6px; margin-top: 4px; }
#match-over, #pause-screen { display: flex; flex-direction: column; gap: 18px; align-items: center; }

#countdown { animation: pop .3s ease; }

/* loading */
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--muted); letter-spacing: 4px; z-index: 50; font-size: 14px; }
