@font-face {
  font-family: 'Baloo 2';
  src: url('/fonts/Baloo2.ttf') format('truetype');
  font-weight: 400 800;
}

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

:root {
  --primario: #ff6b35;
  --secundario: #4ecdc4;
  --oscuro: #1a535c;
  --claro: #f7fff7;
  --amarillo: #ffe66d;
}

body {
  font-family: 'Baloo 2', 'Comic Sans MS', 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(rgba(26, 83, 92, .78), rgba(45, 122, 143, .78)),
    url('/img/wallpaper.png') center / cover no-repeat fixed #1a535c;
  color: var(--claro);
  min-height: 100vh;
  padding: 16px;
  padding-bottom: 90px;
}

.contenedor { max-width: 720px; margin: 0 auto; }
.contenedor-ancho { max-width: 1100px; margin: 0 auto; }

h1 { text-align: center; font-size: 1.6rem; margin-bottom: 8px; color: var(--amarillo); }
h2 { margin-bottom: 12px; color: var(--secundario); }
.subtitulo { text-align: center; opacity: .85; margin-bottom: 20px; }

.tarjeta {
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(4px);
}

input[type="text"], input[type="password"], select, textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,.35);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  margin-bottom: 10px;
  background: var(--claro);
  color: var(--oscuro);
  transition: border-color .15s, transform .1s;
}

textarea {
  border-radius: 18px;
  resize: vertical;
}

input[type="text"]:focus, input[type="password"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--amarillo);
  transform: scale(1.01);
}

input::placeholder, textarea::placeholder {
  color: #7aa5a8;
  font-weight: 500;
}

label {
  display: block;
  margin-bottom: 4px;
  color: var(--amarillo);
  font-size: .95rem;
}

input[type="file"] {
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  border: 3px dashed var(--secundario);
  background: rgba(78, 205, 196, .12);
  color: var(--claro);
  font-family: inherit;
  font-weight: 600;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

input[type="file"]:hover {
  background: rgba(78, 205, 196, .25);
  border-color: var(--amarillo);
}

input[type="file"]::file-selector-button {
  font-family: inherit;
  font-weight: bold;
  background: var(--secundario);
  color: var(--oscuro);
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  margin-right: 12px;
  cursor: pointer;
  transition: filter .15s;
}

input[type="file"]::file-selector-button:hover { filter: brightness(1.1); }

.boton {
  display: inline-block;
  background: var(--primario);
  color: white;
  border: 3px solid rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
  transition: transform .1s, filter .15s, box-shadow .1s;
}
.boton:hover { transform: scale(1.04) rotate(-1deg); filter: brightness(1.1); }
.boton:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.boton.secundario { background: var(--secundario); color: var(--oscuro); }
.boton.peligro { background: #e63946; }
.boton:disabled { opacity: .5; cursor: not-allowed; }

.fila-botones { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.foto-marco {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  border: 5px solid var(--amarillo);
  display: block;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}

.progreso {
  height: 10px;
  background: rgba(255,255,255,.15);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progreso > div { height: 100%; background: var(--secundario); transition: width .3s; }

.opcion {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,.1);
  color: var(--claro);
  border: 3px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s, background .15s;
}
.opcion:hover { background: rgba(255,255,255,.2); transform: scale(1.02); }
.opcion.sel { border-color: var(--amarillo); background: rgba(255,230,109,.18); }

.badge-fase {
  display: inline-block;
  background: var(--primario);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: .85rem;
  font-weight: bold;
  margin-bottom: 14px;
}

.grid-categorias { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.miniaturas { display: flex; gap: 12px; flex-wrap: wrap; }
.miniaturas img {
  width: 130px; height: 130px; object-fit: cover;
  border-radius: 14px; cursor: pointer;
  border: 4px solid transparent;
  transition: transform .1s, border-color .15s;
}
.miniaturas img:hover { transform: scale(1.05); }
.miniaturas img.sel { border-color: var(--amarillo); transform: scale(1.05); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.15); }
th { color: var(--amarillo); }

.ganador-card { text-align: center; }
.ganador-card img {
  width: 140px; height: 140px; object-fit: cover;
  border-radius: 50%; border: 4px solid var(--amarillo);
}
.ganador-card .nombre { font-size: 1.2rem; font-weight: bold; margin-top: 8px; color: var(--amarillo); }
.ganador-card .votos { opacity: .8; }
.ganador-card .corona { font-size: 2rem; margin-bottom: 4px; }

.mejor-adivino-card {
  background: linear-gradient(135deg, rgba(255,230,109,.18), rgba(78,205,196,.18));
  border: 3px solid var(--amarillo);
}
.mejor-adivino-card .nombre.grande { font-size: 1.6rem; }

.mensaje-ok { background: rgba(78,205,196,.25); border-radius: 10px; padding: 12px; margin-top: 10px; text-align: center; }
.oculto { display: none !important; }

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.podium { text-align: center; font-size: 1.1rem; }

.fila-quien {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  background: rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 10px;
}
.fila-quien img.foto-adulto {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--primario);
  flex-shrink: 0;
}
.fila-quien .miniaturas { flex: 1; }
.fila-quien .miniaturas img { width: 70px; height: 70px; border-radius: 10px; }

.timer-container {
  text-align: center;
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  backdrop-filter: blur(4px);
}
.timer-label {
  font-size: .85rem;
  opacity: .7;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.timer-display {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--amarillo);
  line-height: 1;
  margin-bottom: 8px;
}
.timer-display.poco-tiempo {
  color: #e63946;
  animation: pulse-timer 0.5s ease-in-out infinite alternate;
}
.timer-bar {
  height: 6px;
  background: rgba(255,255,255,.15);
  border-radius: 999px;
  overflow: hidden;
}
.timer-bar-fill {
  height: 100%;
  background: var(--secundario);
  border-radius: 999px;
  transition: width 1s linear;
}
.timer-bar-fill.poco-tiempo {
  background: #e63946;
}

@keyframes pulse-timer {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.creditos-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 16px;
  background: rgba(255,255,255,.07);
  border-top: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 100;
}
.creditos-footer-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.2);
  flex-shrink: 0;
}
.creditos-footer-info {
  text-align: center;
}
.creditos-footer-empresa {
  font-size: .85rem;
  font-weight: 800;
  color: var(--amarillo);
  letter-spacing: 1.5px;
}
.creditos-footer-depto {
  font-size: .68rem;
  opacity: .55;
  line-height: 1.3;
}
