:root {
  --bg: #000000;
  --panel: rgba(10, 12, 18, 0.82);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8ecf4;
  --muted: #7c8698;
  --cyan: #22e6ff;
  --purple: #b14cff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ stage
   One fixed widescreen composition. JS sizes it to the largest ~16:9 box
   that fits the window and sets its font-size, so every piece of interface
   scales with the pitch instead of drifting off the edges. */

#stage {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  font-size: 14px; /* replaced by JS */
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* ---------------------------------------------------------- scoreboard -- */

#scoreboard {
  position: absolute;
  top: 0.85em;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.35em;
  padding: 0.7em 1.25em;
  border: 1px solid var(--line);
  border-radius: 1em;
  background: var(--panel);
  backdrop-filter: blur(14px);
  white-space: nowrap;
}

.team {
  display: flex;
  align-items: center;
  gap: 0.7em;
}

.team .name {
  font-size: 0.76em;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: var(--muted);
}

.team .score {
  font-size: 1.85em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 0.9em;
  text-align: center;
}

.team .dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
}

.team-purple .dot {
  background: var(--purple);
  box-shadow: 0 0 0.9em var(--purple);
}

.team-purple .score {
  color: var(--purple);
}

.team-cyan .dot {
  background: var(--cyan);
  box-shadow: 0 0 0.9em var(--cyan);
}

.team-cyan .score {
  color: var(--cyan);
}

#clock {
  font-size: 1.05em;
  font-weight: 600;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  padding: 0 0.9em;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

/* --------------------------------------------------------- charge bar -- */

#charge-wrap {
  position: absolute;
  bottom: 4.4em;
  left: 50%;
  transform: translateX(-50%);
  width: 20em;
  opacity: 0;
  transition: opacity 0.14s ease;
}

#charge-wrap.active {
  opacity: 1;
}

#charge-bar {
  position: relative;
  height: 0.42em;
  border-radius: 0.3em;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

/* The well-struck band for the current distance. Slides as you move. */
#charge-ideal {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: rgba(255, 255, 255, 0.34);
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  border-right: 1px solid rgba(255, 255, 255, 0.7);
  transition: left 0.1s linear, width 0.1s linear;
}

#charge-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  border-radius: 0.3em;
  background: linear-gradient(90deg, var(--cyan), #ffffff);
  box-shadow: 0 0 1em var(--cyan);
}

#charge-bar.sweet #charge-fill {
  background: linear-gradient(90deg, #7dff9b, #ffffff);
  box-shadow: 0 0 1.1em #7dff9b;
}

/* ---------------------------------------------------------- shoot cue -- */

#shoot-cue {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: var(--cyan);
  text-shadow: 0 0 0.8em rgba(34, 230, 255, 0.9);
  opacity: 0;
  transition: opacity 0.1s ease;
  white-space: nowrap;
}

#shoot-cue.show {
  opacity: 0.9;
}

#charge-label {
  margin-top: 0.55em;
  text-align: center;
  font-size: 0.62em;
  letter-spacing: 0.28em;
  color: var(--muted);
}

/* ------------------------------------------------------- controls bar -- */

#hint {
  position: absolute;
  bottom: 0.85em;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.85em;
  padding: 0.55em 1.15em;
  border: 1px solid var(--line);
  border-radius: 0.75em;
  background: var(--panel);
  backdrop-filter: blur(14px);
  font-size: 0.78em;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
  max-width: calc(100% - 2em);
}

#hint b {
  color: var(--text);
  font-weight: 600;
}

#hint .sep {
  width: 1px;
  height: 1em;
  background: var(--line);
  flex: none;
}

/* ------------------------------------------------------------ overlay -- */

#overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.panel {
  text-align: center;
  padding: 2.6em 3em;
  border: 1px solid var(--line);
  border-radius: 1.3em;
  background: var(--panel);
}

.panel h1 {
  font-size: 3.1em;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.panel .sub {
  margin-top: 0.9em;
  font-size: 0.82em;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}

.panel .rules {
  margin: 1.8em 0 2em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55em;
  max-width: 26em;
}

.panel .rules span {
  font-size: 0.76em;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 0.6em;
  padding: 0.45em 0.75em;
  white-space: nowrap;
}

.panel .rules b {
  color: var(--text);
}

#start-btn {
  font: inherit;
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #04070d;
  background: var(--cyan);
  border: none;
  border-radius: 0.7em;
  padding: 1.1em 3.2em;
  cursor: pointer;
  box-shadow: 0 0 1.8em rgba(34, 230, 255, 0.42);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 2.4em rgba(34, 230, 255, 0.6);
}

/* -------------------------------------------------------- goal flash -- */

#flash {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5em;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#flash.show {
  opacity: 1;
}
