:root {
  --bg: #170f30;
  --bg-2: #241a4a;
  --bg-3: #31265f;
  --ink: #ffffff;
  --muted: #b6addb;
  --line: rgba(255, 255, 255, 0.12);
  --amarillo: #ffc93c;
  --celeste: #4fc3f7;
  --verde: #4fd18b;
  --rojo: #ff5a5f;
  --picante: #ff3d7f;
  --card-ink: #1b1238;
  --good: #4fd18b;
  --bad: #ff5a5f;
  --gold: #ffd166;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: radial-gradient(120% 80% at 15% 0%, #2d1f66 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink);
  font-family: 'Fredoka', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }

.c-amarillo { --c: var(--amarillo); }
.c-celeste { --c: var(--celeste); }
.c-verde { --c: var(--verde); }
.c-rojo { --c: var(--rojo); }

.logo { font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1; }
.logo span { color: var(--picante); }

.hl { color: var(--gold); }

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.8em 1.6em;
  font-weight: 700;
  background: var(--bg-3);
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}
.btn.primary { background: var(--picante); box-shadow: 0 0.25em 0 #b81f55; }
.btn.ghost { background: transparent; border: 2px solid var(--line); color: var(--muted); }
.btn:disabled { opacity: 0.35; box-shadow: none; }
.btn:not(:disabled):active { transform: translateY(0.15em); box-shadow: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: #000c;
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  z-index: 100;
  animation: toastIn 0.2s ease-out;
  transition: opacity 0.4s;
  max-width: calc(100vw - 2rem);
  text-align: center;
}
.toast.out { opacity: 0; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 1rem); } }

/* Estado de cada palabra en revisión y resultados */
.s-unica { --s: var(--gold); }
.s-correcta { --s: var(--good); }
.s-repetida { --s: var(--celeste); }
.s-invalida { --s: var(--bad); }
.s-vacia { --s: var(--muted); }

/* Avatar: selfie o inicial en un círculo de color */
.av { width: 1.8em; height: 1.8em; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; vertical-align: middle; background: hsl(var(--h, 260) 55% 55%); color: #fff; font-weight: 700; font-size: 1em; line-height: 1; box-shadow: 0 0 0 2px #fff3; }
.av.av-lg { width: 3em; height: 3em; font-size: 1.4em; }
.av.av-xl { width: 5em; height: 5em; font-size: 2em; }

/* Aviso del modo Kids (tele y celu) */
.kids-modal { position: fixed; inset: 0; z-index: 300; background: #170f30e6; display: flex; align-items: center; justify-content: center; padding: 16px; animation: toastIn 0.2s ease-out; }
.km-card { background: var(--bg-2); border-radius: 1.2em; padding: 1.4em 1.4em 1em; max-width: 30em; width: 100%; display: flex; flex-direction: column; gap: 0.6em; box-shadow: 0 0 0 3px var(--amarillo), 0 1em 3em #000a; max-height: 100%; overflow-y: auto; }
.km-emoji { font-size: 2.6em; text-align: center; line-height: 1; }
.km-card h2 { margin: 0; text-align: center; color: var(--amarillo); }
.km-card p, .km-card ul { margin: 0; line-height: 1.4; }
.km-card ul { padding-left: 1.2em; display: flex; flex-direction: column; gap: 0.35em; }
.km-legal { font-size: 0.8em; color: var(--muted); }
.km-card .btn { width: 100%; }

#sound-btn { position: fixed; z-index: 35; border: 0; border-radius: 50%; background: #0006; color: #fff; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; }
#sound-btn.locked { animation: soundPulse 1.2s ease-in-out infinite; }
@keyframes soundPulse { 50% { box-shadow: 0 0 0 6px #ffd23f66; } }
