/* Sparka — broadcast UI */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #070a14;
  --panel: #0e1424;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8ecf8;
  --dim: #8d97b3;
  --accent: #22c55e;
  --gold: #ffd23e;
}
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------------- screens ---------------- */
.screen {
  position: fixed; inset: 0; z-index: 40;
  display: none; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(20, 32, 60, 0.92), rgba(5, 7, 15, 0.96));
  backdrop-filter: blur(3px);
}
.screen.active { display: flex; }
.panel {
  width: min(620px, 94vw);
  max-height: 92vh; overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 2rem 2.2rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.panel.small { width: min(380px, 90vw); text-align: center; }

.brand { text-align: center; margin-bottom: 1.4rem; }
.brand-ball {
  width: 52px; height: 52px; margin: 0 auto 0.6rem;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ffffff, #cfd6e6 60%, #9aa3b8);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.18), inset -4px -6px 12px rgba(0,0,0,0.25);
  position: relative;
}
.brand-ball::after {
  content: ""; position: absolute; inset: 30%;
  background: #12151d; border-radius: 50%;
  clip-path: polygon(50% 0, 95% 35%, 78% 90%, 22% 90%, 5% 35%);
}
.brand h1 { font-size: 3rem; letter-spacing: 0.28em; font-weight: 900; text-indent: 0.28em; }
.tagline { color: var(--dim); letter-spacing: 0.12em; font-size: 0.85rem; text-transform: uppercase; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem 1.2rem; margin-bottom: 1.3rem; }
.grid label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.78rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; }
select {
  background: #0a0f1d; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 0.65rem 0.8rem; font-size: 0.95rem;
}

.controls { background: rgba(0, 0, 0, 0.25); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1.4rem; }
.controls h3 { font-size: 0.8rem; letter-spacing: 0.14em; color: var(--gold); text-transform: uppercase; margin-bottom: 0.7rem; }
.ctl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 1.4rem; font-size: 0.88rem; }
.ctl-grid span { color: var(--dim); margin-left: 0.45rem; }
kbd {
  background: #1c2438; border: 1px solid rgba(255, 255, 255, 0.14); border-bottom-width: 2px;
  border-radius: 5px; padding: 0.1rem 0.42rem; font-size: 0.8rem; font-family: inherit;
}
.gp-note { margin-top: 0.7rem; font-size: 0.78rem; color: var(--accent); }

.cta {
  display: block; width: 100%;
  background: linear-gradient(180deg, #2bd968, #16a34a);
  color: #052711; font-weight: 800; letter-spacing: 0.2em; font-size: 1.05rem;
  border: 0; border-radius: 12px; padding: 0.95rem;
  cursor: pointer; text-transform: uppercase;
  box-shadow: 0 10px 26px rgba(34, 197, 94, 0.28);
}
.cta:hover { filter: brightness(1.08); }
.ghost {
  display: block; width: 100%;
  background: transparent; color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0.8rem; font-size: 0.9rem; letter-spacing: 0.12em; cursor: pointer; text-transform: uppercase;
}
.ghost:hover { background: rgba(255, 255, 255, 0.05); }
.ghost.danger { color: #f87171; border-color: rgba(248, 113, 113, 0.35); }
.btncol { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1.2rem; }
.btnrow { display: flex; gap: 0.8rem; margin-top: 1.4rem; }
.panel h2 { text-align: center; letter-spacing: 0.24em; font-weight: 900; }

/* ---------------- HUD ---------------- */
.hudlayer { display: none; }
.hudlayer.active { display: block; }
.scoreboard {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(8, 12, 24, 0.88);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  z-index: 20;
  font-weight: 700; letter-spacing: 0.04em;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
.chip { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.tname { font-size: 1.02rem; }
.score { font-size: 1.2rem; padding: 0 0.4rem; background: rgba(0,0,0,0.4); border-radius: 8px; }
.clockbox { margin-left: 0.5rem; display: flex; align-items: baseline; gap: 0.4rem; }
.clockbox em { font-style: normal; font-size: 0.68rem; color: var(--gold); }
#sbClock { font-variant-numeric: tabular-nums; }

.goalticker {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0.9rem; z-index: 19;
  font-size: 0.78rem; color: var(--dim);
  text-shadow: 0 1px 4px #000;
}

.banner {
  position: fixed; top: 22vh; left: 50%; transform: translateX(-50%) scale(0.9);
  z-index: 25; text-align: center;
  font-size: 1.5rem; font-weight: 900; letter-spacing: 0.12em;
  color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.8);
  opacity: 0; transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}
.banner.show { opacity: 1; transform: translateX(-50%) scale(1); }
.banner .big { font-size: 3.4rem; color: var(--gold); }
.banner.warn { color: #ffdca8; }
.cardchip { display: inline-block; width: 0.85em; height: 1.2em; border-radius: 2px; vertical-align: -0.2em; }
.cardchip.yellow { background: #fbbf24; }
.cardchip.red { background: #ef4444; }

.hud-bottom {
  position: fixed; bottom: 16px; left: 0; right: 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 22px; z-index: 20; pointer-events: none;
}
.plcard {
  display: flex; align-items: center; gap: 0.6rem;
  background: rgba(8, 12, 24, 0.85);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0.55rem 0.9rem; min-width: 190px;
}
.plnum { font-size: 1.5rem; font-weight: 900; color: var(--gold); }
.plinfo { display: flex; flex-direction: column; line-height: 1.15; }
.plinfo small { color: var(--dim); }
.power {
  position: absolute; left: 0; right: 0; bottom: -9px; height: 5px;
  background: rgba(255, 255, 255, 0.12); border-radius: 3px; overflow: hidden;
  opacity: 0; transition: opacity 0.1s;
}
.plcard { position: relative; }
.power.visible { opacity: 1; }
#powerFill { height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #eab308, #ef4444); }

#radar { border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 8px 26px rgba(0,0,0,0.5); }

.hints {
  display: flex; gap: 0.7rem; align-items: center;
  background: rgba(8, 12, 24, 0.85);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 0.55rem 0.9rem; font-size: 0.8rem; color: var(--dim);
}
.gpdot { filter: grayscale(1) opacity(0.4); }
.gpdot.on { filter: none; }

/* ---------------- break screen ---------------- */
.bigscore { text-align: center; font-size: 1.6rem; font-weight: 900; margin: 0.9rem 0 1.2rem; letter-spacing: 0.06em; }
.stats { display: flex; flex-direction: column; gap: 0.5rem; }
.strow {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05); padding-bottom: 0.45rem;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.strow em {
  font-style: normal; font-weight: 500; color: var(--dim);
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
}
.tick.home { color: #ff9a8f; }
.tick.away { color: #9fc9ff; }
