:root {
  --color-primary:   #F3A200;
  --color-accent-1:  #429DFF;
  --color-accent-2:  #F3A200;
  --color-accent-3:  #ACFF00;
  --color-accent-4:  #ED00A6;
  --color-error:     #E74C3C;
  --color-dark:      #222B34;
  --color-light:     #FFF6E6;
  --color-white:     #FFFFFF;

  --font-title: 'Muli', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:  'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

/* Foco visible para quien navega con teclado */
:focus-visible {
  outline: 3px solid var(--color-accent-4);
  outline-offset: 2px;
  border-radius: 4px;
}
.cw-grid:focus-visible { outline-offset: 4px; }

html {
  /* Base grande: el público objetivo son niños con dificultades de lectura. */
  font-size: 19px;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
  font-family: var(--font-body);
  background: linear-gradient(135deg, #F3A200 0%, #FFEFCF 100%);
  background-attachment: fixed;
  color: var(--color-dark);
}

h1, h2, h3, h4 { font-family: var(--font-title); margin: 0 0 8px; }
button { font-family: var(--font-body); cursor: pointer; }

/* ---------- Pantallas ---------- */
.screen {
  display: none;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.screen.active { display: flex; }

.card {
  background: var(--color-white);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  padding: 26px 24px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}
.card--menu { max-width: 660px; }
.card--modal { max-width: 560px; max-height: 86vh; overflow-y: auto; text-align: left; }

.title { font-size: 1.8rem; color: var(--color-dark); }
.title--sm { font-size: 1.4rem; text-align: center; }
.subtitle { margin: 0 0 20px; color: #6a5a3a; font-size: 1.05rem; }

/* ---------- Botones ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 13px 18px;
  margin: 8px 0;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #E67E00);
  color: var(--color-white);
  box-shadow: 0 6px 14px rgba(243, 162, 0, 0.4);
}
.btn-ghost { background: var(--color-light); color: var(--color-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn--inline { display: inline-block; width: auto; margin: 4px; font-size: 1rem; padding: 10px 16px; }
.stack-buttons { display: flex; flex-direction: column; }
.menu-actions { margin-top: 10px; }

.icon-btn {
  background: rgba(255,255,255,0.18);
  border: none;
  color: var(--color-white);
  font-size: 1.3rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  line-height: 1;
}
.chip-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 14px;
}

/* ---------- Menú principal ---------- */
.hub-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.hub-card {
  background: var(--color-light);
  border-radius: 16px;
  padding: 18px 16px;
  text-align: center;
  border-top: 5px solid var(--card-color, var(--color-primary));
}
.hub-card-icon { font-size: 2.3rem; margin-bottom: 4px; }
.hub-card-title { font-size: 1.15rem; margin: 4px 0; }
.hub-card-desc { font-size: 0.95rem; color: #6a5a3a; margin: 0 0 8px; min-height: 40px; }
.hub-card-progress { font-size: 0.88rem; font-weight: 700; color: var(--card-color, var(--color-primary)); margin: 0 0 10px; }
.hub-card-btn { margin: 0; }

/* ---------- Ajustes ---------- */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
  text-align: left;
}
.setting-row label { font-weight: 700; font-size: 1.02rem; }
.setting-row input[type="range"] { flex: 1; accent-color: var(--color-primary); }
.switch { width: 22px; height: 22px; accent-color: var(--color-primary); }
.settings-divider { border: none; border-top: 2px solid var(--color-light); margin: 18px 0 10px; }

/* ---------- Selector de nivel ---------- */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}
.level-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  background: var(--color-light);
  border: 2px solid transparent;
  border-left: 6px solid var(--color-primary);
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.level-btn:active { transform: scale(0.98); }
.level-btn:hover { border-color: var(--color-primary); }
.level-btn-num { font-weight: 800; font-size: 0.82rem; color: var(--color-primary); text-transform: uppercase; }
.level-btn-name { font-weight: 800; font-size: 1.1rem; }
.level-btn-desc { font-size: 0.9rem; color: #6a5a3a; }

/* ---------- Cabecera de juego ---------- */
.screen[id^="screen-game"] { align-items: stretch; padding: 0; }
.screen[id^="screen-game"].active { display: flex; flex-direction: column; }

.game-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  color: var(--color-white);
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(34, 43, 52, 0.55);
  backdrop-filter: blur(6px);
}
.game-header-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.game-info {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  align-self: center;
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
}
.mode-badge {
  padding: 4px 14px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1rem;
  background: var(--color-primary);
  color: var(--color-white);
}

.game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 12px 36px;
}
.game-prompt {
  font-weight: 700; font-size: 1.2rem; margin: 0; text-align: center;
  color: var(--color-white); text-shadow: 0 1px 5px rgba(0,0,0,0.4);
  max-width: 520px;
}

/* ---------- Bandeja de letras (Juego 1 y 3) ---------- */
.letter-rack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 460px;
}
.letter-tile {
  width: 54px; height: 54px;
  border: none;
  border-radius: 12px;
  background: var(--color-white);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 1.5rem;
  box-shadow: 0 5px 0 rgba(0,0,0,0.18);
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.letter-tile:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,0.18); }
.letter-tile.is-used { opacity: 0.28; box-shadow: none; }
.letter-tile.shake { animation: shake 0.35s; }

/* ---------- Barra de intento (Juego 1) ---------- */
.attempt-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 460px;
}
.attempt-box {
  flex: 1;
  min-height: 56px;
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  flex-wrap: wrap;
}
.attempt-placeholder { color: #9a8a6a; font-weight: 600; }
.attempt-letter {
  font-weight: 800; font-size: 1.5rem; letter-spacing: 1px;
  min-width: 26px; text-align: center;
}
.attempt--good { outline: 3px solid var(--color-accent-3); }
.attempt--wrong { outline: 3px solid var(--color-error); animation: shake 0.35s; }
.attempt--dupe { outline: 3px solid var(--color-accent-1); }

.round-btn {
  border: none;
  border-radius: 12px;
  background: var(--color-white);
  color: var(--color-dark);
  font-size: 1.4rem;
  font-weight: 800;
  min-width: 56px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.18);
}
.round-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,0.18); }
.round-btn:disabled { opacity: 0.4; }
.round-btn--go { background: var(--color-accent-3); }

.control-bar { display: flex; flex-wrap: wrap; justify-content: center; }

/* ---------- Palabras a encontrar (rayitas, Juego 1) ---------- */
.targets {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  justify-content: center;
  background: rgba(255,255,255,0.9);
  border-radius: 16px;
  padding: 16px;
  max-width: 560px;
  width: 100%;
}
.target-group-title { font-size: 0.85rem; color: #6a5a3a; margin: 0 0 6px; text-align: center; }
.target-word { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 8px; }
.target-word.is-found .target-slot { color: #3a8a00; border-color: #3a8a00; }
.target-slot {
  width: 26px;
  height: 30px;
  border-bottom: 4px solid var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.4rem;
  line-height: 1;
}
.target-slot.hinted { color: var(--color-primary); border-color: var(--color-primary); }
.target-tick { color: #3a8a00; font-weight: 800; font-size: 1.2rem; margin-left: 2px; }

/* ---------- Teclado (Juego 2 y 4) ---------- */
.keyboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  max-width: 460px;
}
.key {
  width: 42px; height: 46px;
  border: none;
  border-radius: 9px;
  background: var(--color-white);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 0 rgba(0,0,0,0.16);
}
.key:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.16); }
.key:disabled { opacity: 0.9; }
.key--hit { background: var(--color-accent-3); }
.key--miss { background: #C7CDD3; color: #7a828a; }
.key--wide { width: 66px; }

/* ---------- Línea de palabra (Juego 2 y 3) ---------- */
.word-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 560px;
}
.word-slot {
  min-width: 30px;
  height: 42px;
  padding: 0 4px;
  border-bottom: 5px solid var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--color-white);
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
.word-slot.filled { border-color: var(--color-accent-3); }
.word-slot.missed { color: #ffd7d2; border-color: var(--color-error); }

/* Juego 2: tira oscura tras las letras para que el blanco contraste bien */
#screen-game2 .word-line {
  background: rgba(34, 43, 52, 0.5);
  border-radius: 14px;
  padding: 8px 14px;
}
.word-line--fill .word-slot { color: var(--color-dark); text-shadow: none; border-color: rgba(0,0,0,0.25); }
.word-line--fill .word-slot.given {
  background: rgba(255,255,255,0.9); border-radius: 8px 8px 0 0; border-color: var(--color-dark);
}
.word-line--fill .word-slot.blank { background: rgba(255,255,255,0.55); border-radius: 8px 8px 0 0; }
.word-line--fill .word-slot.blank.active { border-color: var(--color-accent-4); background: #fff; box-shadow: 0 0 0 3px rgba(237,0,166,0.35); }
.word-line--fill .word-slot.blank.filled { background: var(--color-accent-3); border-color: #3a8a00; }
.word-line--fill .word-slot.blank.hinted { background: var(--color-primary); color: #fff; border-color: #b97c00; }

.fill-image {
  font-size: 4.5rem;
  line-height: 1;
  background: rgba(255,255,255,0.92);
  border-radius: 18px;
  padding: 10px 18px;
  animation: pop 0.3s ease;
}

/* ---------- Juego 2: tarta de cumpleaños ---------- */
.cake-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 240px;
  width: 100%;
}
.cake { position: relative; width: 240px; transition: transform 1.1s ease, filter 1.1s ease; transform-origin: bottom center; }
.cake-candles {
  position: absolute;
  top: -34px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 3;
}
.candle { position: relative; width: 8px; height: 34px; }
.wax {
  position: absolute; bottom: 0; left: 0;
  width: 8px; height: 26px;
  border-radius: 2px;
  background: repeating-linear-gradient(45deg, #ED00A6 0 5px, #fff 5px 10px);
}
.wick { position: absolute; top: 4px; left: 3px; width: 2px; height: 5px; background: #40312a; }
.flame {
  position: absolute; top: -12px; left: 1px;
  width: 6px; height: 14px;
  background: radial-gradient(circle at 50% 70%, #fff 0%, #FFD23F 40%, #F3A200 70%, #ED5A00 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform-origin: bottom center;
  animation: flicker 0.5s infinite alternate ease-in-out;
  box-shadow: 0 0 10px 3px rgba(243,162,0,0.6);
}
.smoke {
  position: absolute; top: -10px; left: 2px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(120,120,120,0.5);
  opacity: 0;
}
.candle.is-out .flame { display: none; }
.candle.is-out .smoke { animation: smoke-rise 0.9s ease-out forwards; }

.cake-tier { margin: 0 auto; border-radius: 6px 6px 3px 3px; position: relative; }
.cake-tier--top { width: 120px; height: 40px; background: linear-gradient(#FFF3D6, #F6D9A0); z-index: 2; }
.cake-tier--mid { width: 176px; height: 46px; background: linear-gradient(#FFE7C2, #F0C58A); margin-top: -4px; z-index: 1; }
.cake-tier--bot { width: 232px; height: 52px; background: linear-gradient(#FFDCA8, #E8B978); margin-top: -4px; }
.cake-tier::before {
  content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 0 rgba(255,255,255,0.65);
}
.cake-tier--top::after,
.cake-tier--mid::after {
  content: ""; position: absolute; top: 6px; left: 8px; right: 8px; height: 12px;
  background:
    radial-gradient(circle at 12% 0, #ED00A6 0 6px, transparent 7px),
    radial-gradient(circle at 40% 0, #ED00A6 0 6px, transparent 7px),
    radial-gradient(circle at 68% 0, #ED00A6 0 6px, transparent 7px),
    radial-gradient(circle at 92% 0, #ED00A6 0 6px, transparent 7px);
}
.cake-plate {
  width: 262px; height: 12px;
  margin: -2px auto 0;
  background: linear-gradient(#EAEFF3, #B9C4CE);
  border-radius: 0 0 20px 20px / 0 0 40px 40px;
}

.cake.is-happy { animation: cake-bounce 0.6s ease; }
.cake.is-melting { transform: translateY(26px) scaleY(0.72) skewX(-3deg); filter: saturate(0.75) blur(0.3px); }
.cake.is-melting .cake-tier {
  border-radius: 40% 40% 46% 46% / 70% 70% 30% 30%;
  transition: border-radius 1.1s ease;
}
.cake.is-melting .cake-tier::after { opacity: 0.25; }
.cake.is-melting .candle { opacity: 0.4; transform: rotate(-8deg); transition: all 1s ease; }

/* ---------- Juego 4: crucigrama ---------- */
.game-body--cw { padding-bottom: 18px; }
.cw-grid-wrap { width: 100%; overflow: auto; max-height: 52vh; padding: 6px; }
.cw-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell, 34px));
  gap: 3px;
  margin: 0 auto;
  width: max-content;
}
.cw-cell {
  width: var(--cell, 34px);
  height: var(--cell, 34px);
  position: relative;
  background: var(--color-white);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: calc(var(--cell, 34px) * 0.52);
  color: var(--color-dark);
}
.cw-cell--block { background: transparent; }
.cw-cell--word { background: #FFE9BE; }
.cw-cell--active { background: #FFD23F; box-shadow: 0 0 0 3px rgba(237,0,166,0.55); z-index: 2; }
.cw-cell--done { background: var(--color-accent-3); }
.cw-cell--done::after {
  content: "✓"; position: absolute; right: 1px; bottom: 0;
  font-size: calc(var(--cell, 34px) * 0.3); color: #3a8a00; font-weight: 900;
}
.cw-cell--hint { background: #FFE0A3; box-shadow: inset 0 0 0 2px var(--color-primary); }
.cw-cell--bad { background: #FAD4CF; color: var(--color-error); box-shadow: inset 0 0 0 2px var(--color-error); }
.cw-cell--wrong { animation: shake 0.35s; }
.cw-num { position: absolute; top: 1px; left: 2px; font-size: calc(var(--cell, 34px) * 0.28); font-weight: 700; color: #8a6a2a; }

.clue-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  background: rgba(255,255,255,0.94);
  border-radius: 14px;
  padding: 10px 12px;
}
.clue-bar-text { flex: 1 1 100%; text-align: left; order: -1; }
.clue-bar-num { display: inline-block; font-weight: 800; color: var(--color-accent-4); margin-right: 6px; }
.clue-bar { flex-wrap: wrap; }
.clue-bar .round-btn { min-width: 44px; font-size: 1.05rem; flex: 1; }

.clues-group { margin-bottom: 14px; }
.clues-group h4 { color: var(--color-accent-4); }
.clue-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--color-light);
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  margin: 5px 0;
  font-size: 0.98rem;
}
.clue-item.is-done { opacity: 0.5; text-decoration: line-through; }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(34, 43, 52, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.overlay.hidden { display: none; }

.instructions-list { padding-left: 20px; margin: 0 0 18px; font-size: 1.02rem; }
.instructions-list li { margin-bottom: 10px; line-height: 1.45; }

.result-icon { font-size: 2.8rem; margin-bottom: 6px; }
.result-text { color: #6a5a3a; margin: 8px 0 14px; font-size: 1.05rem; }
.result-stats { text-align: center; margin: 0 0 10px; font-size: 0.98rem; }
.result-stats p { margin: 4px 0; }

.hidden { display: none !important; }
[hidden] { display: none !important; }

/* Confeti */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti span {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
}

/* ---------- Animaciones ---------- */
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(600deg); opacity: 0.3; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes flicker {
  from { transform: scaleY(0.9) rotate(-3deg); opacity: 0.9; }
  to   { transform: scaleY(1.1) rotate(3deg); opacity: 1; }
}
@keyframes smoke-rise {
  0% { opacity: 0.6; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-22px) scale(2.4); }
}
@keyframes cake-bounce {
  0%,100% { transform: translateY(0); }
  30% { transform: translateY(-14px); }
  60% { transform: translateY(-4px); }
}

/* ---------- Componentes de accesibilidad ---------- */
.settings-group-label { font-size: 0.85rem; font-weight: 800; color: var(--color-primary); text-transform: uppercase; text-align: left; margin: 2px 0 6px; }

.hub-stats {
  font-size: 0.92rem;
  font-weight: 700;
  color: #6a5a3a;
  background: var(--color-light);
  border-radius: 12px;
  padding: 8px 12px;
  margin: 0 0 16px;
}

/* Pista de categoría del Juego 2 */
.clue-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.94);
  border-radius: 16px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-dark);
  max-width: 520px;
}
.clue-pill-label { color: var(--color-primary); font-weight: 800; }

/* Lectura en voz alta de las instrucciones: frase que se está leyendo */
.reading-active {
  background: #FFF0C2;
  box-shadow: 0 0 0 3px #FFF0C2;
  border-radius: 6px;
}

/* Letras que se confunden (b/d/p/q): cada una con un "suelo" de color distinto,
   para que no parezcan la misma letra girada. */
.key[data-bdpq], .letter-tile[data-bdpq] { position: relative; }
[data-bdpq="B"] { box-shadow: inset 0 -6px 0 #429DFF, 0 4px 0 rgba(0,0,0,0.16); }
[data-bdpq="D"] { box-shadow: inset 0 -6px 0 #F3A200, 0 4px 0 rgba(0,0,0,0.16); }
[data-bdpq="P"] { box-shadow: inset 0 -6px 0 #ACFF00, 0 4px 0 rgba(0,0,0,0.16); }
[data-bdpq="Q"] { box-shadow: inset 0 -6px 0 #9900FF, 0 4px 0 rgba(0,0,0,0.16); }

/* ---------- Ajuste: MAYÚSCULAS / minúsculas ---------- */
.word-slot, .letter-tile, .key, .target-slot, .attempt-letter, .cw-ltr { text-transform: uppercase; }
html[data-case="lower"] .word-slot,
html[data-case="lower"] .letter-tile,
html[data-case="lower"] .key,
html[data-case="lower"] .target-slot,
html[data-case="lower"] .attempt-letter,
html[data-case="lower"] .cw-ltr { text-transform: lowercase; }

/* ---------- Ajuste: tipografía para dislexia ---------- */
/* Si añades los archivos en palabrodromo/fonts/ se usa OpenDyslexic;
   si no, se aplica igualmente el mayor espaciado y una familia más legible. */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('fonts/OpenDyslexic-Regular.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'OpenDyslexic';
  src: url('fonts/OpenDyslexic-Bold.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
html[data-font="dyslexic"] {
  --font-title: 'OpenDyslexic', 'Verdana', 'Trebuchet MS', sans-serif;
  --font-body:  'OpenDyslexic', 'Verdana', 'Trebuchet MS', sans-serif;
}
html[data-font="dyslexic"] body { letter-spacing: 0.035em; word-spacing: 0.12em; line-height: 1.7; }
html[data-font="dyslexic"] .word-slot,
html[data-font="dyslexic"] .letter-tile,
html[data-font="dyslexic"] .key,
html[data-font="dyslexic"] .target-slot { letter-spacing: 0; }
html[data-font="dyslexic"] .instructions-list li,
html[data-font="dyslexic"] .clue-bar-text,
html[data-font="dyslexic"] .clue-item { line-height: 1.8; }

/* ---------- Ajuste: casillas y letras más grandes ---------- */
html[data-size="xl"] { font-size: 21px; }
html[data-size="xl"] .letter-tile { width: 64px; height: 64px; font-size: 1.8rem; }
html[data-size="xl"] .key { width: 50px; height: 54px; font-size: 1.35rem; }
html[data-size="xl"] .key--wide { width: 78px; }
html[data-size="xl"] .word-slot { min-width: 38px; height: 52px; font-size: 2rem; }
html[data-size="xl"] .target-slot { width: 32px; height: 38px; font-size: 1.7rem; }

/* ---------- Ajuste: reducir animaciones ---------- */
html[data-motion="reduced"] .confetti { display: none; }
html[data-motion="reduced"] .flame { animation: none; }
html[data-motion="reduced"] .candle.is-out .smoke { animation: none; opacity: 0; }
html[data-motion="reduced"] .cake.is-happy { animation: none; }
html[data-motion="reduced"] .fill-image { animation: none; }
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation-duration: 0.001s !important;
  transition-duration: 0.05s !important;
}
@media (prefers-reduced-motion: reduce) {
  .confetti { display: none; }
  .flame { animation: none; }
  * { animation-duration: 0.001s !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .card { padding: 22px 18px; }
}
@media (max-width: 480px) {
  html { font-size: 17px; }
  html[data-size="xl"] { font-size: 19px; }
  .game-info { font-size: 0.85rem; padding: 5px 10px; gap: 7px; }
  .letter-tile { width: 46px; height: 46px; font-size: 1.3rem; }
  .key { width: 36px; height: 42px; font-size: 1rem; }
  .cake { width: 210px; }
  .cake-tier--bot { width: 200px; }
  .cake-tier--mid { width: 155px; }
  .cake-tier--top { width: 106px; }
  .cake-plate { width: 226px; }
}
