/* ===== Jueces FutBot · Panel del administrador ===== */
:root {
  --fondo: #f3f5f1;
  --tarjeta: #ffffff;
  --texto: #18211a;
  --tenue: #5d6b60;
  --borde: #dfe5dc;
  --cancha: #1f7a3d;
  --cancha-oscura: #145a2b;
  --cancha-suave: #e3f2e7;
  --amarillo: #f2b705;
  --rojo: #c0392b;
  --rojo-suave: #fbe9e7;
  --sombra: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  --radio: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #0f1511;
    --tarjeta: #18201a;
    --texto: #e7efe8;
    --tenue: #93a397;
    --borde: #2a352d;
    --cancha: #3fb565;
    --cancha-oscura: #2f9a52;
    --cancha-suave: #1d3324;
    --rojo: #ef6f61;
    --rojo-suave: #3a1f1c;
    --sombra: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--cancha); }
h1, h2, .grande, .indicador span, .final strong, .lugar, .marca strong {
  font-family: "Barlow Condensed", Inter, sans-serif;
  letter-spacing: .01em;
}
h1 { font-size: 2.2rem; line-height: 1.1; margin: 0 0 .25rem; }
h2 { font-size: 1.35rem; margin: 0 0 1rem; }
small { font-size: .82rem; }
.tenue { color: var(--tenue); }

/* Barra superior */
.barra {
  background: var(--cancha-oscura);
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 60px, transparent 60px 120px);
  color: #fff;
  display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding: .85rem clamp(16px, 4vw, 40px);
}
.marca { display: flex; gap: .7rem; align-items: center; }
.marca strong { font-size: 1.45rem; display: block; line-height: 1; }
.marca small { opacity: .8; }
.balon {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 50%, #111 0 22%, #fff 23% 100%);
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.15), 0 0 0 2px rgba(255,255,255,.4);
}
.barra nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.barra nav a {
  color: #fff; text-decoration: none; padding: .4rem .8rem; border-radius: 999px;
  font-weight: 500; opacity: .85;
}
.barra nav a:hover { opacity: 1; background: rgba(255,255,255,.1); }
.barra nav a.activo { background: #fff; color: var(--cancha-oscura); opacity: 1; }
.barra nav a.salir { opacity: .65; }

main { max-width: 1180px; margin: 0 auto; padding: 1.5rem clamp(16px, 4vw, 40px) 3rem; }

.encabezado {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: flex-end;
  margin-bottom: 1.25rem;
}
.encabezado p { margin: 0; max-width: 62ch; }

.tarjeta {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio);
  box-shadow: var(--sombra); padding: 1.25rem; margin-bottom: 1.25rem;
}
.acceso { max-width: 420px; margin: 3rem auto; }

/* Indicadores */
.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.indicador {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1rem 1.25rem; box-shadow: var(--sombra);
}
.indicador span { display: block; font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--cancha); }
.indicador small { color: var(--tenue); }

.en-vivo { display: flex; align-items: center; gap: .45rem; color: var(--tenue); font-size: .9rem; }
.punto { width: 9px; height: 9px; border-radius: 50%; background: var(--cancha); animation: latido 1.6s infinite; }
@keyframes latido { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* Avance de jueces */
.jueces { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.juez-cab { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.estado { font-size: .72rem; color: var(--tenue); }
.estado.si { color: var(--cancha); font-weight: 600; }
.barra-avance { height: 8px; background: var(--cancha-suave); border-radius: 999px; overflow: hidden; margin-bottom: .3rem; }
.barra-avance span { display: block; height: 100%; background: var(--cancha); border-radius: 999px; transition: width .4s; }
.juez small { color: var(--tenue); }

/* Tablas */
.tabla-envoltura { overflow-x: auto; margin: 0 -1.25rem; padding: 0 1.25rem; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th {
  text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--tenue); font-weight: 600; padding: .5rem .6rem; border-bottom: 2px solid var(--borde);
  white-space: nowrap;
}
.tabla td { padding: .7rem .6rem; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla .num { text-align: center; }
.tabla .grande { font-size: 1.5rem; font-weight: 700; }
.tabla tr.parcial td { color: var(--tenue); }
.tabla input { width: 100%; min-width: 120px; }
.tabla input.pin { min-width: 90px; max-width: 120px; font-variant-numeric: tabular-nums; letter-spacing: .15em; }
.vacio { text-align: center; color: var(--tenue); padding: 2rem 1rem !important; }
.acciones form { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }

.lugar {
  display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  font-size: 1.3rem; font-weight: 700; background: var(--cancha-suave); color: var(--cancha);
}
.lugar.l1 { background: var(--amarillo); color: #3d2e00; }
.lugar.l2 { background: #c9d1d6; color: #2b3338; }
.lugar.l3 { background: #d9a273; color: #3b220c; }

.chips { display: flex; gap: .3rem; }
.chip {
  min-width: 2rem; height: 2rem; padding: 0 .35rem; border-radius: 8px;
  display: inline-grid; place-items: center; font-size: .85rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chip.pendiente { border: 1.5px dashed var(--borde); color: var(--tenue); font-weight: 500; }
.chip.hecho { background: var(--cancha); color: #fff; }
.chip.descartado { background: var(--cancha-suave); color: var(--tenue); text-decoration: line-through; }

.etiqueta {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px;
  background: var(--fondo); color: var(--tenue); border: 1px solid var(--borde); white-space: nowrap;
}
.etiqueta.cuenta { background: var(--cancha-suave); color: var(--cancha); border-color: transparent; }
.etiqueta.tachada { text-decoration: line-through; }
.comentario { color: var(--tenue); font-style: italic; }

.final { text-align: right; }
.final strong { display: block; font-size: 3.2rem; line-height: 1; color: var(--cancha); }
.final small { color: var(--tenue); }
.formula { margin: 1rem 0 0; color: var(--tenue); }
.regresar { text-decoration: none; font-weight: 500; }

/* Formularios y botones */
.formulario { display: grid; gap: .9rem; }
.formulario label { display: grid; gap: .35rem; font-weight: 500; font-size: .9rem; }
input, textarea {
  font: inherit; color: inherit; background: var(--fondo);
  border: 1px solid var(--borde); border-radius: 10px; padding: .55rem .7rem;
}
input:focus, textarea:focus { outline: 2px solid var(--cancha); outline-offset: 1px; }
.boton {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
  border: 1px solid var(--borde); background: var(--tarjeta); color: var(--texto);
  border-radius: 10px; padding: .6rem 1.1rem;
}
.boton:hover { border-color: var(--cancha); }
.boton.primario { background: var(--cancha); border-color: var(--cancha); color: #fff; justify-self: start; }
.boton.primario:hover { background: var(--cancha-oscura); }
.boton.chico { padding: .3rem .7rem; font-size: .82rem; border-radius: 8px; white-space: nowrap; }
.boton.peligro { color: var(--rojo); }
.boton.peligro:hover { border-color: var(--rojo); background: var(--rojo-suave); }

.aviso { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; background: var(--cancha-suave); color: var(--cancha); }
.aviso.error { background: var(--rojo-suave); color: var(--rojo); }

@media (max-width: 640px) {
  h1 { font-size: 1.8rem; }
  .final { text-align: left; }
  .tabla .grande { font-size: 1.25rem; }
}
.tabla th.criterio { white-space: normal; min-width: 6.5rem; max-width: 9rem; }
