/* /includes/style.css */
* { box-sizing: border-box; }

/* Fondo exterior */
html{
  min-height: 100%;
  background: radial-gradient(1200px 700px at 20% 0%, #dfe7f5 0%, #cfd8ea 45%, #c3cde2 100%);
}

/* Base layout */
body{
  font-family: system-ui, Arial, sans-serif;
  margin: 0;
  padding: 28px 14px;
  color: #111;
  background: transparent; /* el fondo está en html */
  padding-bottom: calc(72px + env(safe-area-inset-bottom)); /* aire abajo */
}

/* Centrar “hoja” (elementos principales directos del body) */
body > nav,
body > hr,
body > .card,
body > h1,
body > h2,
body > .table-wrap,
body > .notice,
body > .rules{
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

body > nav{ margin-top: 18px; }
body > hr{ max-width: 1100px; }

hr{
  border:0;
  border-top:1px solid #e9e9e9;
  margin: 16px 0 22px;
}

/* Nav */
nav{
  display:flex;
  flex-wrap:wrap;
  gap: 10px 14px;
  align-items:center;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
}

nav a{
  text-decoration:none;
  color:#111;
  padding: 6px 10px;
  border-radius: 10px;
}
nav a:hover{ background:#f2f2f2; }

/* Títulos */
.section-title{
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.15;
}

h1{ font-size: 30px; margin: 16px 0 12px; }
h2{ font-size: 22px; margin: 18px 0 10px; }

/* Cards */
.card{
  background:#fff;
  border:1px solid #e6e6e6;
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
}

/* Mensajes */
.ok{
  background:#e7f7ec;
  border:1px solid #bde5c8;
  padding:10px 12px;
  border-radius:12px;
  margin: 0 0 12px;
}
.bad{
  background:#fdeaea;
  border:1px solid #f3b3b3;
  padding:10px 12px;
  border-radius:12px;
  margin: 0 0 12px;
}

/* Formularios */
.field { min-width: 0; } /* evita desbordes en grid */

.field label{
  display:block;
  font-weight: 650;
  margin: 0 0 6px;
  line-height: 1.2;
}

input[type="text"],
input[type="password"],
input[type="date"]{
  width:100%;
  padding: 10px 12px;
  border:1px solid #cfcfcf;
  border-radius: 12px;
  background:#fff;
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus{
  border-color:#7a7a7a;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

/* Botones */
.btn{
  margin-top: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: #efefef;
}
.btn:hover{ background:#e6e6e6; }

/* Ayuda debajo de inputs */
.small-help{
  display:block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color:#555;
  white-space: normal;
  padding-bottom: 2px;
}

/* Grid principal */
.match-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  align-items: start;
}

@media (max-width: 860px){
  .match-grid{ grid-template-columns: 1fr; }
}

/* Bloque de info (reparto puntos) */
.subtle{
  background: #f5f6f8;
  border: 1px solid #e6e8ee;
  padding: 12px 14px;
  border-radius: 14px;
  margin: 12px 0 16px;
}

/* Pistas */
.pista-card{
  margin-top: 14px;
  border: 1px solid #dfe8f5;
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 65%);
}

.pista-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pista-card h3{
  margin: 0;
  font-size: 18px;
}

/* Cabecera de pista en “pastilla” */
.pista-head h3{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.05);
}

/*
  Colores por pista (nota):
  Esto funciona si las pista-card son las primeras “cards” dentro del formulario.
  Si no, se quedarán con el color base (arriba) y no se rompe nada.
*/
.pista-card:nth-of-type(1){
  background: linear-gradient(180deg, #e9f2ff 0%, #ffffff 68%);
  border-color: #cfe0ff;
}
.pista-card:nth-of-type(2){
  background: linear-gradient(180deg, #eafaf0 0%, #ffffff 68%);
  border-color: #c9efd7;
}
.pista-card:nth-of-type(3){
  background: linear-gradient(180deg, #fff6e6 0%, #ffffff 68%);
  border-color: #ffe0ad;
}
.pista-card:nth-of-type(4){
  background: linear-gradient(180deg, #fde9f3 0%, #ffffff 68%);
  border-color: #f7c7df;
}

/* Autocomplete */
.ac-wrap{ position: relative; }

.ac-suggestions{
  position:absolute;
  top: calc(100% + 6px);
  left:0;
  right:0;
  background:#fff;
  border: 1px solid #cfd6e6;
  border-radius: 12px;
  box-shadow: 0 14px 26px rgba(0,0,0,0.12);
  z-index: 9999;
  max-height: 220px;
  overflow:auto;
  display:none;
}

.ac-item{
  padding: 10px 12px;
  cursor:pointer;
  border-bottom: 1px solid #f0f0f0;
}
.ac-item:last-child{ border-bottom:0; }
.ac-item:hover{ background:#f4f8ff; }

.ac-item .nick{ font-weight: 650; }

/* Campo inválido */
.player-ac.invalid,
input.invalid{
  border-color:#d83b3b !important;
  background:#fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(216,59,59,0.12) !important;
}

/* Tablas */
.table-wrap{
  margin-top: 14px;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid #e6e6e6;
  background: #fff;
}

table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}

thead th{
  position: sticky;
  top: 0;
  background: #f3f5f8;
  color: #111;
  text-align: left;
  font-weight: 700;
  padding: 12px 12px;
  border-bottom: 1px solid #e3e6ee;
}

tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f4;
  vertical-align: top;
}

tbody tr:nth-child(even){ background: #fafbfc; }
tbody tr:hover{ background: #f0f6ff; }

table th:first-child,
table td:first-child{
  width: 70px;
  text-align: right;
  color: #333;
}

table th:nth-child(4),
table td:nth-child(4){
  width: 90px;
  text-align: center;
}

table th:nth-child(5),
table td:nth-child(5){
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  color: #333;
}

/* Rules / notices */
.rules{ line-height: 1.55; }
.rules h2{ margin-top: 18px; }
.rules h3{ margin-top: 14px; }

.notice{
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dfe8f5;
  background: #f3f7ff;
}

.notice.danger{
  border-color: #f3b3b3;
  background: #fdeaea;
}

/* Footer “aire” */
.site-footer{
  height: 24px;
  margin-top: 24px;
}
.nav-sep{
  opacity: 0.35;
  padding: 0 4px;
}
.pass-wrap{
  position: relative;
}

.pass-wrap input{
  padding-right: 44px; /* espacio para el botón */
}

.pass-toggle{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  line-height: 1;
  opacity: 0.75;
}

.pass-toggle:hover{
  background: rgba(0,0,0,0.06);
  opacity: 1;
}
input[type="date"],
input[type="datetime-local"]{
  appearance: auto;
  -webkit-appearance: auto;
  box-sizing: border-box;
  min-height: 40px;
  padding: 10px 12px;
  padding-right: 40px;
  line-height: normal;
  font-size: 14px;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator{
  opacity: 1;
  cursor: pointer;
}
/* =========================
   Sorteo público (sorteo.php)
   Pega esto al FINAL de style.css
   ========================= */

:root{
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 6px 18px rgba(17,24,39,.08);
  --radius: 14px;
}

/* Fondo + centrado */
body{
  background: var(--bg);
  color: var(--text);
}

/* Contenedor principal */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* Header info (día/pistas/estado) */
.card .muted{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.card .muted b{
  color: var(--text);
}

/* Separadores */
.card hr{
  border: 0;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* Títulos */
.big{
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin: 4px 0 10px;
}

/* Cuenta atrás */
#countdown{
  font-variant-numeric: tabular-nums;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: inline-block;
  background: #fbfbfd;
}

/* Bloques de pista */
.pista{
  background: #fcfcfe;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px;
  margin-top: 12px;
}

.pista b{
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}

/* Parejas dentro de pista */
.pair{
  padding: 8px 0;
  border-bottom: 1px dashed #eef2f7;
  font-size: 14px;
}

.pair:last-child{
  border-bottom: 0;
}

/* Grid de participantes */
.grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

/* “Pills” participantes */
.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(17,24,39,.04);
  font-size: 13px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive: en móvil */
@media (max-width: 520px){
  .card{ padding: 14px; }
  .grid{ grid-template-columns: 1fr; }
  .big{ font-size: 18px; }
}
