/* =========================================
VARIABLES
========================================= */

:root {
  --bg: #0b0710;
  --panel: #16091f;
  --panel-light: #1c0d27;
  --line: #321643;
  --line-light: #44205a;

  --purple: #a855f7;
  --purple-dark: #7c3aed;
  --purple-light: #c084fc;

  --green: #4fa37a;
  --green-light: #86efac;

  --red: #c9603f;
  --red-light: #fb8b6a;

  --text: #ffffff;
  --text-soft: #b9a9c3;
  --text-muted: #81718d;
  --digit: #f5eff8;
}

/* =========================================
RESET
========================================= */

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: max(24px, env(safe-area-inset-top)) 16px
    max(24px, env(safe-area-inset-bottom)) 16px;

  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(168, 85, 247, 0.16),
      transparent 38%
    ),
    radial-gradient(
      circle at 0% 100%,
      rgba(124, 58, 237, 0.1),
      transparent 35%
    ),
    var(--bg);

  color: var(--text);

  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow-x: hidden;
}

/* =========================================
MARCO PRINCIPAL
========================================= */

.frame {
  width: 100%;
  max-width: 520px;
  padding: 28px 22px 24px;

  position: relative;

  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 45%),
    var(--panel);

  border: 1px solid var(--line);
  border-radius: 20px;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(124, 58, 237, 0.08);

  overflow: hidden;
}

.frame::before {
  content: "";

  position: absolute;
  top: -100px;
  left: 50%;

  width: 260px;
  height: 180px;

  transform: translateX(-50%);

  background: rgba(168, 85, 247, 0.1);

  filter: blur(55px);

  pointer-events: none;
}

.frame::after {
  content: "";

  position: absolute;
  inset: 10px;

  border: 1px solid rgba(168, 85, 247, 0.07);
  border-radius: 14px;

  pointer-events: none;
}

/* =========================================
CRONÓMETRO
========================================= */

.cronometro {
  position: relative;
  z-index: 2;

  display: flex;
  flex-direction: column;
  align-items: center;

  gap: 14px;

  margin-bottom: 26px;
  padding: 16px 12px;

  background: rgba(255, 255, 255, 0.018);

  border: 1px solid rgba(168, 85, 247, 0.1);
  border-radius: 16px;
}

.cronometro h3 {
  margin: 0;

  color: var(--text);

  font-family: "Poppins", sans-serif;

  font-size: 14px;
  font-weight: 700;

  letter-spacing: 0.08em;
}

.minuto {
  min-width: 100px;

  text-align: center;

  color: var(--text);

  font-family: "Poppins", sans-serif;

  font-size: 28px;
  font-weight: 700;

  line-height: 1;

  letter-spacing: 0.04em;

  font-variant-numeric: tabular-nums;

  user-select: none;

  text-shadow: 0 0 20px rgba(168, 85, 247, 0.15);

  transition:
    color 0.2s ease,
    text-shadow 0.2s ease;
}

.minuto.corriendo {
  color: var(--purple-light);

  text-shadow: 0 0 22px rgba(168, 85, 247, 0.45);
}

/* =========================================
CONTROLES CRONÓMETRO
========================================= */

.controles-cronometro {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 9px;
}

.control {
  width: 42px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;

  border: 1px solid var(--line-light);

  background: rgba(255, 255, 255, 0.025);

  color: var(--text-soft);

  font-size: 14px;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.control:hover {
  color: white;

  background: rgba(168, 85, 247, 0.1);

  border-color: var(--purple);
}

.control:active {
  transform: scale(0.92);
}

.control.iniciar:hover {
  color: var(--green-light);

  border-color: var(--green);

  background: rgba(79, 163, 122, 0.1);
}

.control.pausar:hover {
  color: #fde68a;

  border-color: #b59b45;
}

.control.reset-tiempo:hover {
  color: #fca5a5;

  border-color: var(--red);
}

/* =========================================
FILA EQUIPOS
========================================= */

.fila {
  position: relative;
  z-index: 2;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto
    minmax(0, 1fr);

  align-items: start;

  gap: 14px;
}

/* =========================================
COLUMNA DE CADA EQUIPO
========================================= */

.columna-equipo {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 14px;
}

/* =========================================
EQUIPO
========================================= */

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

  gap: 15px;

  min-width: 0;

  padding: 18px 10px;

  background: rgba(255, 255, 255, 0.018);

  border: 1px solid rgba(255, 255, 255, 0.045);

  border-radius: 16px;

  transition:
    border-color 0.2s ease,
    background 0.2s ease;
}

.equipo:hover {
  background: rgba(168, 85, 247, 0.025);

  border-color: rgba(168, 85, 247, 0.15);
}

/* =========================================
NOMBRE
========================================= */

.nombre {
  width: 100%;

  padding: 8px 6px;

  background: transparent;

  border: none;

  border-bottom: 1px solid transparent;

  color: var(--text);

  font-family: "Inter", sans-serif;

  font-size: 14px;
  font-weight: 600;

  text-align: center;

  transition: border-color 0.2s ease;
}

.nombre:focus {
  outline: none;

  border-bottom-color: var(--purple);
}

/* =========================================
MARCADOR
========================================= */

.marca {
  font-family: "Poppins", sans-serif;

  font-size: clamp(54px, 15vw, 76px);

  font-weight: 800;

  line-height: 0.95;

  font-variant-numeric: tabular-nums;

  min-width: 1ch;
}

.columna-equipo:first-child .marca {
  color: var(--green-light);

  text-shadow: 0 0 25px rgba(79, 163, 122, 0.2);
}

.columna-equipo:last-child .marca {
  color: var(--red-light);

  text-shadow: 0 0 25px rgba(201, 96, 63, 0.2);
}

/* =========================================
SEPARADOR
========================================= */

.separador {
  color: var(--purple);

  font-family: "Poppins", sans-serif;

  font-size: 38px;

  font-weight: 700;

  line-height: 1;

  opacity: 0.7;

  padding-top: 55px;
}

/* =========================================
BOTONES MARCADOR
========================================= */

.botones {
  display: flex;

  justify-content: center;

  gap: 8px;
}

button.paso {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;

  border: 1px solid var(--line-light);

  background: rgba(255, 255, 255, 0.025);

  color: var(--text-soft);

  font-size: 19px;

  cursor: pointer;

  transition:
    transform 0.12s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

button.paso:hover {
  color: white;

  background: rgba(168, 85, 247, 0.1);

  border-color: var(--purple);
}

button.paso:active {
  transform: scale(0.9);
}

.columna-equipo:first-child button.paso.mas:hover {
  color: var(--green-light);

  border-color: var(--green);

  background: rgba(79, 163, 122, 0.1);
}

.columna-equipo:last-child button.paso.mas:hover {
  color: var(--red-light);

  border-color: var(--red);

  background: rgba(201, 96, 63, 0.1);
}

/* =========================================
HISTORIAL DE CADA EQUIPO
========================================= */

.historial-equipo {
  position: relative;
  z-index: 2;

  width: 100%;

  padding: 12px;

  background: rgba(255, 255, 255, 0.018);

  border: 1px solid rgba(168, 85, 247, 0.1);

  border-radius: 16px;
}

/* =========================================
TÍTULO HISTORIAL
========================================= */

.historial-titulo {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 6px;

  margin-bottom: 10px;
}

.historial-titulo > span:first-child {
  min-width: 0;

  overflow: hidden;

  color: var(--text);

  font-family: "Poppins", sans-serif;

  font-size: 12px;
  font-weight: 600;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.contador-anotaciones {
  min-width: 22px;
  height: 22px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 6px;

  flex-shrink: 0;

  border-radius: 20px;

  background: rgba(168, 85, 247, 0.1);

  border: 1px solid rgba(168, 85, 247, 0.2);

  color: var(--purple-light);

  font-size: 10px;
  font-weight: 700;
}

/* =========================================
LISTA ANOTACIONES
========================================= */

.lista-anotaciones {
  display: flex;

  flex-direction: column;

  gap: 6px;

  max-height: 220px;

  overflow-y: auto;

  scrollbar-width: thin;

  scrollbar-color: var(--line-light) transparent;
}

.lista-anotaciones::-webkit-scrollbar {
  width: 4px;
}

.lista-anotaciones::-webkit-scrollbar-thumb {
  background: var(--line-light);

  border-radius: 10px;
}

/* =========================================
ANOTACIÓN
========================================= */

.anotacion {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 7px;

  min-height: 38px;

  padding: 7px 8px;

  background: rgba(255, 255, 255, 0.025);

  border: 1px solid rgba(255, 255, 255, 0.045);

  border-radius: 9px;

  animation: anotacionEntrada 0.2s ease-out;
}

.anotacion-equipo {
  display: flex;

  align-items: center;

  gap: 6px;

  min-width: 0;
}

.punto-color {
  width: 6px;
  height: 6px;

  flex-shrink: 0;

  border-radius: 50%;
}

.anotacion.local .punto-color {
  background: var(--green-light);

  box-shadow: 0 0 8px rgba(134, 239, 172, 0.45);
}

.anotacion.visitante .punto-color {
  background: var(--red-light);

  box-shadow: 0 0 8px rgba(251, 139, 106, 0.45);
}

.anotacion-nombre {
  min-width: 0;

  color: var(--text);

  font-size: 11px;
  font-weight: 600;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;
}

.anotacion-numero {
  flex-shrink: 0;

  color: var(--text-muted);

  font-size: 9px;
}

.anotacion-tiempo {
  flex-shrink: 0;

  color: var(--purple-light);

  font-family: "Poppins", monospace;

  font-size: 10px;
  font-weight: 600;

  font-variant-numeric: tabular-nums;
}

/* =========================================
HISTORIAL VACÍO
========================================= */

.historial-vacio {
  padding: 10px 3px;

  color: var(--text-muted);

  font-size: 10px;

  text-align: center;
}

/* =========================================
ACCIONES
========================================= */

.acciones {
  position: relative;
  z-index: 2;

  display: flex;

  justify-content: center;

  margin-top: 22px;
}

.reiniciar {
  padding: 10px 18px;

  border-radius: 10px;

  border: 1px solid var(--line-light);

  background: rgba(255, 255, 255, 0.02);

  color: var(--text-soft);

  font-family: "Inter", sans-serif;

  font-size: 13px;
  font-weight: 500;

  cursor: pointer;

  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.reiniciar:hover {
  color: white;

  background: rgba(168, 85, 247, 0.08);

  border-color: var(--purple);
}

.reiniciar:active {
  transform: scale(0.97);
}

/* =========================================
ANIMACIONES
========================================= */

@keyframes anotacionEntrada {
  from {
    opacity: 0;

    transform: translateY(-5px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

@keyframes aparecer {
  from {
    opacity: 0;

    transform: translateY(8px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

.frame {
  animation: aparecer 0.35s ease-out;
}

/* =========================================
RESPONSIVE
========================================= */

@media (max-width: 430px) {
  body {
    padding-left: 10px;
    padding-right: 10px;
  }

  .frame {
    padding: 22px 12px 20px;

    border-radius: 18px;
  }

  .fila {
    gap: 6px;
  }

  .columna-equipo {
    gap: 10px;
  }

  .equipo {
    padding: 15px 5px;
  }

  .marca {
    font-size: 58px;
  }

  .separador {
    font-size: 32px;

    padding-top: 48px;
  }

  button.paso {
    width: 38px;
    height: 38px;
  }

  .historial-equipo {
    padding: 9px;
  }

  .anotacion {
    padding: 6px;
  }
}

@media (max-width: 340px) {
  .marca {
    font-size: 50px;
  }

  .nombre {
    font-size: 12px;
  }

  .separador {
    font-size: 28px;

    padding-top: 44px;
  }

  .anotacion-nombre {
    font-size: 10px;
  }

  .anotacion-tiempo {
    font-size: 9px;
  }
}
