/* ==========================================================================
   Basketball Scoreboard
   Medidas tomadas del mockup de referencia (tablero de 1230px de ancho);
   todas las tallas internas se derivan de --u para que escalen juntas.

   Tipografías:
   - Inter (SIL Open Font License) · Google Fonts
   - Cursed Timer ULiL de Heaven Castro · uso personal y comercial
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cursed Timer ULiL';
  src: url('fonts/CursedTimerUlil.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #1b244a;
  --panel: #080001;
  --segment: #f94f6d;
  --ink: #eeeeee;
  --accent: #9aabd8;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  display: grid;
  place-items: center;
  min-height: 100svh;
  margin: 0;
  padding: 36px 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Tablero: dos columnas de 465u separadas por 300u ------------------------- */

.scoreboard {
  --board-w: min(92vw, 1230px);
  --u: calc(var(--board-w) / 1230);
  --panel-w: calc(465 * var(--u));

  display: grid;
  grid-template-columns: repeat(2, var(--panel-w));
  justify-content: space-between;
  width: var(--board-w);
}

/* Columna de cada equipo -------------------------------------------------- */

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team__name {
  margin: 0 0 calc(51 * var(--u));
  font-size: calc(122 * var(--u));
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  text-align: center;
}

/* Marcador: pantalla negra + dígitos LED ---------------------------------- */

.score-panel {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 465 / 360;
  background: var(--panel);
  border-radius: calc(12 * var(--u));
}

.score {
  display: flex;
  justify-content: center;
  font-family: 'Cursed Timer ULiL', 'Courier New', monospace;
  font-size: calc(269 * var(--u));
  line-height: 1;
  position: relative;
  letter-spacing: 0;
  color: var(--segment);
  white-space: nowrap;
  /* La fuente deja ~39u de hueco bajo la tinta; con top: 9u queda centrada
     igual que en el mockup (72u por encima y 75u por debajo del panel). */
  top: calc(9 * var(--u));
}

.digit {
  display: inline-block;
}

/* Controles --------------------------------------------------------------- */

.controls {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: calc(79 * var(--u));
}

.btn {
  display: grid;
  place-items: center;
  width: calc(135 * var(--u));
  height: calc(135 * var(--u));
  padding: 0;
  background: transparent;
  color: var(--accent);
  border: calc(6 * var(--u)) solid var(--accent);
  border-radius: calc(12 * var(--u));
  font-family: 'Cursed Timer ULiL', 'Courier New', monospace;
  font-size: calc(52 * var(--u));
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease, transform 80ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: rgb(154 171 216 / 0.12);
}

.btn:active {
  background: rgb(154 171 216 / 0.22);
  transform: scale(0.94);
}

.btn:focus-visible {
  outline: calc(3 * var(--u)) solid var(--accent);
  outline-offset: calc(4 * var(--u));
}

/* Accesibilidad ----------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* En pantallas estrechas se mantienen las dos columnas, pero con menos
   separación para que el marcador completo quepa de un vistazo. ------------ */

@media (max-width: 760px) {
  .scoreboard {
    --col: calc((92vw - 16px) / 2);
    --u: calc(var(--col) / 465);
    grid-template-columns: repeat(2, var(--col));
    column-gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .btn:active {
    transform: none;
  }
}


/* Botón de reseteo -------------------------------------------------------- */

.reset-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: calc(64 * var(--u));
}

.btn--reset {
  width: auto;
  height: auto;
  padding: calc(24 * var(--u)) calc(48 * var(--u));
  font-family: 'Inter', system-ui, sans-serif;
  font-size: calc(32 * var(--u));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}