/* ============================================================
   MUNDOSABER PREMIUM — CSS PRINCIPAL
   © 2026 MundoSaber SpA. Todos los derechos reservados.
   Prohibida la reproducción sin autorización escrita.
   ============================================================ */

/* ---- Reset & Variables ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --pri:       #7C3AED;
  --pri-light: #A78BFA;
  --pri-dark:  #5B21B6;
  --sec:       #F59E0B;
  --sec-light: #FCD34D;
  --green:     #10B981;
  --blue:      #3B82F6;
  --red:       #EF4444;
  --pink:      #EC4899;
  --bg:        #F0F4FF;
  --card:      #FFFFFF;
  --txt:       #1E1B4B;
  --txt-mid:   #4B5563;
  --txt-light: #9CA3AF;
  --border:    #E5E7EB;
  --shadow:    0 4px 20px rgba(124,58,237,0.12);
  --shadow-lg: 0 12px 40px rgba(124,58,237,0.18);
  --r:         20px;
  --r-sm:      12px;
  --font:      'Nunito', sans-serif;
  --fun:       'Fredoka One', cursive;
  /* Especial */
  --sp-bg:     #FFFBF0;
  --sp-acc:    #F59E0B;
}
html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--txt); overflow-x: hidden; }

/* ---- Screens ---- */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

/* ========================================================
   LANDING
   ======================================================== */
#screen-landing {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(145deg, #1e1b4b 0%, #3730a3 40%, #7c3aed 75%, #c026d3 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px 20px 40px;
}
#screen-landing.active { display: flex; }

/* Círculos decorativos */
.landing-bg { position: absolute; inset: 0; pointer-events: none; }
.lb-circle { position: absolute; border-radius: 50%; opacity: 0.15; animation: floatBall 6s ease-in-out infinite; }
.lb-c1 { width: 320px; height: 320px; background: #a78bfa; top: -80px; left: -80px; animation-delay: 0s; }
.lb-c2 { width: 200px; height: 200px; background: #f0abfc; bottom: 10%; right: -40px; animation-delay: 2s; }
.lb-c3 { width: 150px; height: 150px; background: #fbbf24; top: 40%; left: 5%; animation-delay: 4s; }
@keyframes floatBall { 0%,100%{ transform:translateY(0) scale(1); } 50%{ transform:translateY(-20px) scale(1.06); } }

.landing-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  max-width: 560px; width: 100%;
}

/* Logo landing */
.landing-logo {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.12); backdrop-filter: blur(12px);
  border: 2px solid rgba(255,255,255,0.25); border-radius: 50px;
  padding: 12px 28px;
}
.ll-icon { font-size: 2.8rem; animation: spin3d 6s linear infinite; }
@keyframes spin3d { 0%{ transform:rotate(0deg); } 100%{ transform:rotate(360deg); } }
.ll-name { font-family: var(--fun); font-size: 2rem; color: #fff; letter-spacing: 1px; }
.ll-tag { font-size: 0.78rem; color: rgba(255,255,255,0.75); font-weight: 600; }

/* Mascotas landing */
.landing-mascots { display: flex; gap: 18px; justify-content: center; }
.lm-mascot { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.lm-body {
  width: 72px; height: 72px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  border: 3px solid rgba(255,255,255,0.3);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  transition: transform 0.25s;
}
.lm-mascot:hover .lm-body { transform: translateY(-6px) scale(1.08); }
.luna-body { background: linear-gradient(135deg, #a78bfa, #7c3aed); animation: bob 2.8s ease-in-out infinite; }
.max-body  { background: linear-gradient(135deg, #34d399, #059669); animation: bob 2.8s ease-in-out infinite 0.9s; }
.sol-body  { background: linear-gradient(135deg, #fbbf24, #f59e0b); animation: bob 2.8s ease-in-out infinite 1.8s; }
@keyframes bob { 0%,100%{transform:translateY(0);}50%{transform:translateY(-7px);} }
.lm-face { display: flex; gap: 8px; }
.lm-eye { width: 10px; height: 10px; background: #fff; border-radius: 50%; position: relative; }
.lm-eye::after { content:''; width:5px;height:5px;background:#1e1b4b;border-radius:50%;position:absolute;top:2px;left:2px; }
.lm-mouth { width: 20px; height: 10px; border: 2.5px solid #fff; border-top: none; border-radius: 0 0 16px 16px; }
.lm-name { font-family: var(--fun); font-size: 0.9rem; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }

/* Título landing */
.landing-title { font-family: var(--fun); font-size: clamp(1.4rem,5vw,2rem); color: #fff; text-align: center; }

/* Cards de acceso */
.access-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; width: 100%; }
.access-card {
  background: rgba(255,255,255,0.12); backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.22); border-radius: var(--r);
  padding: 22px 14px; text-align: center; cursor: pointer;
  transition: all 0.22s; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.access-card:hover { background: rgba(255,255,255,0.24); transform: translateY(-5px); border-color: rgba(255,255,255,0.5); }
.ac-icon { font-size: 2.4rem; }
.ac-title { font-family: var(--fun); font-size: 1rem; color: #fff; }
.ac-desc { font-size: 0.76rem; color: rgba(255,255,255,0.8); }
.ac-badge {
  background: rgba(255,255,255,0.2); color: #fff; border-radius: 50px;
  padding: 3px 10px; font-size: 0.7rem; font-weight: 700; margin-top: 4px;
}
.ac-child:hover { border-color: #a78bfa; box-shadow: 0 8px 30px rgba(167,139,250,0.4); }
.ac-parent:hover { border-color: #34d399; box-shadow: 0 8px 30px rgba(52,211,153,0.4); }
.ac-school:hover { border-color: #fbbf24; box-shadow: 0 8px 30px rgba(251,191,36,0.4); }

.landing-footer-legal { font-size: 0.75rem; color: rgba(255,255,255,0.55); text-align: center; }
.landing-footer-legal strong { color: rgba(255,255,255,0.8); }
.landing-footer-legal a { color: rgba(255,255,255,0.65); text-decoration: underline; }

/* ========================================================
   TOP BAR (global)
   ======================================================== */
.top-bar {
  background: linear-gradient(135deg, var(--pri-dark), var(--pri));
  color: #fff; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 16px rgba(124,58,237,0.28);
  position: sticky; top: 0; z-index: 200;
}
.parent-top { background: linear-gradient(135deg, #065f46, #059669); }
.school-top  { background: linear-gradient(135deg, #92400e, #b45309); }
.special-top { background: linear-gradient(135deg, #92400e, #d97706); }
.tb-back {
  background: rgba(255,255,255,0.18); border: 2px solid rgba(255,255,255,0.3);
  color: #fff; padding: 7px 14px; border-radius: 50px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.85rem; white-space: nowrap;
  transition: background 0.2s;
}
.tb-back:hover { background: rgba(255,255,255,0.32); }
.tb-brand { font-family: var(--fun); font-size: 1.25rem; flex: 1; display: flex; align-items: center; gap: 8px; }
.tb-btn {
  background: rgba(255,255,255,0.18); border: 2px solid rgba(255,255,255,0.3);
  color: #fff; padding: 7px 14px; border-radius: 50px; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 0.82rem; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; transition: background 0.2s;
}
.tb-btn:hover { background: rgba(255,255,255,0.32); }
.tb-icon-btn {
  background: rgba(255,255,255,0.18); border: 2px solid rgba(255,255,255,0.3);
  width: 34px; height: 34px; border-radius: 50%; color: #fff; cursor: pointer; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
}

/* ========================================================
   CHILD SELECT
   ======================================================== */
.child-select-wrap { padding: 32px 20px 48px; max-width: 680px; margin: 0 auto; }
.cs-title { font-family: var(--fun); font-size: 1.6rem; color: var(--pri); text-align: center; margin-bottom: 24px; }
.profiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: 16px; margin-bottom: 24px; }
.profile-card {
  background: var(--card); border-radius: var(--r); padding: 24px 14px 18px;
  text-align: center; cursor: pointer; border: 3px solid transparent;
  box-shadow: var(--shadow); transition: all 0.22s; position: relative;
}
.profile-card:hover { border-color: var(--pri); transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.pc-avatar { font-size: 3rem; display: block; margin-bottom: 8px; }
.pc-name { font-weight: 800; font-size: 1rem; color: var(--txt); margin-bottom: 4px; }
.pc-age { font-size: 0.78rem; color: var(--txt-light); margin-bottom: 6px; }
.pc-level {
  background: #ede9fe; color: var(--pri); border-radius: 50px;
  padding: 3px 10px; font-size: 0.72rem; font-weight: 700; display: inline-block;
}
.pc-mode-sp {
  position: absolute; top: 10px; right: 10px;
  background: #fef3c7; color: #92400e; border-radius: 50px;
  padding: 2px 7px; font-size: 0.65rem; font-weight: 800;
}
.pc-streak {
  position: absolute; top: 10px; left: 10px;
  background: #fef3c7; border-radius: 50px;
  padding: 2px 7px; font-size: 0.7rem; font-weight: 700;
}
.btn-add-profile {
  width: 100%; background: #ede9fe; color: var(--pri);
  border: 2.5px dashed var(--pri-light); border-radius: var(--r);
  padding: 16px; font-size: 1rem; font-weight: 800; cursor: pointer;
  font-family: var(--font); display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s;
}
.btn-add-profile:hover { background: #ddd6fe; }

/* ========================================================
   CHILD HUB
   ======================================================== */
.child-header {
  background: linear-gradient(135deg, #1e1b4b, #3730a3);
  color: #fff; padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 4px 20px rgba(30,27,75,0.3);
  position: sticky; top: 0; z-index: 200;
}
.child-hdr-info { flex: 1; display: flex; align-items: center; gap: 10px; }
.child-hdr-avatar {
  width: 44px; height: 44px; background: linear-gradient(135deg,#a78bfa,#7c3aed);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; box-shadow: 0 4px 12px rgba(124,58,237,0.35);
}
.child-hdr-name { font-family: var(--fun); font-size: 1.1rem; }
.child-hdr-level { font-size: 0.75rem; color: rgba(255,255,255,0.75); margin-top: 1px; }
.child-hdr-right { display: flex; align-items: center; gap: 8px; }
.stat-pill {
  background: rgba(255,255,255,0.18); border-radius: 50px;
  padding: 5px 12px; font-size: 0.82rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; gap: 4px;
}

/* XP band */
.xp-band {
  height: 8px; background: #ddd6fe; position: relative; overflow: hidden;
}
.xp-band-fill { height: 100%; background: linear-gradient(90deg,#a78bfa,#7c3aed); transition: width 0.6s; }
.xp-band-label {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 0.6rem; font-weight: 800; color: var(--pri); background: rgba(255,255,255,0.8);
  padding: 0 6px; border-radius: 50px;
}

/* ---- Ruta del día ---- */
.daily-path-section {
  background: linear-gradient(135deg,#ede9fe,#faf5ff);
  border-bottom: 2px solid #ddd6fe;
  padding: 18px 20px 20px;
}
.dps-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.dps-title { font-family: var(--fun); font-size: 1.2rem; color: var(--pri); }
.dps-sub { font-size: 0.8rem; color: var(--txt-mid); margin-top: 2px; }
.dps-progress-ring { width: 56px; height: 56px; position: relative; flex-shrink: 0; }
.dps-progress-ring svg { width: 100%; height: 100%; }
.dps-progress-ring span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 900; color: var(--pri);
}
.daily-tasks { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.daily-tasks::-webkit-scrollbar { height: 4px; }
.daily-tasks::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 99px; }
.dt-task {
  flex-shrink: 0; min-width: 110px;
  background: #fff; border-radius: var(--r-sm); padding: 12px 10px;
  text-align: center; cursor: pointer; border: 2.5px solid #e5e7eb;
  transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.dt-task:hover { border-color: var(--pri); transform: translateY(-2px); }
.dt-task.done { background: #d1fae5; border-color: var(--green); }
.dt-task.active { border-color: var(--pri); box-shadow: 0 4px 16px rgba(124,58,237,0.2); }
.dt-icon { font-size: 1.8rem; display: block; margin-bottom: 5px; }
.dt-name { font-size: 0.72rem; font-weight: 700; color: var(--txt); }
.dt-world { font-size: 0.65rem; color: var(--txt-light); margin-top: 2px; }
.dt-check { font-size: 1.1rem; margin-top: 4px; display: block; }

/* ---- Mundos scroll horizontal ---- */
.worlds-section { padding: 20px; }
.ws-title { font-family: var(--fun); font-size: 1.1rem; color: var(--txt); margin-bottom: 14px; }
.worlds-scroll { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.worlds-scroll::-webkit-scrollbar { height: 4px; }
.worlds-scroll::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 99px; }
/* world-tile definido más abajo en 'MEJORAS VISUALES PREMIUM' */

/* ---- Logros recientes ---- */
.recent-section { padding: 0 20px 40px; }
.rs-title { font-family: var(--fun); font-size: 1.1rem; color: var(--txt); margin-bottom: 12px; }
.recent-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.rb-chip {
  background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #fff;
  border-radius: 50px; padding: 6px 14px; font-size: 0.82rem; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  box-shadow: 0 3px 10px rgba(245,158,11,0.3);
}

/* ========================================================
   GAME SCREEN
   ======================================================== */
.game-bar {
  background: linear-gradient(135deg, #0f0e26, #1e1b4b);
  color: #fff; padding: 12px 18px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.game-bar-title { font-family: var(--fun); font-size: 1.2rem; flex: 1; display: flex; align-items: center; gap: 8px; }
.game-bar-hud { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.timer-pill { background: rgba(239,68,68,0.25); border: 2px solid rgba(239,68,68,0.4); }
.timer-pill.urgent { animation: urgentBlink 0.5s infinite; }
@keyframes urgentBlink { 0%,100%{opacity:1;}50%{opacity:0.55;} }
.game-progress-strip { height: 5px; background: #1e1b4b; }
.gps-fill { height: 100%; background: linear-gradient(90deg,#a78bfa,#7c3aed); transition: width 0.4s; }
.game-container { max-width: 680px; margin: 0 auto; padding: 20px 16px 40px; min-height: calc(100vh - 80px); }

/* -- Piezas reutilizables del juego -- */
.q-card {
  background: var(--card); border-radius: var(--r); padding: 26px 24px;
  margin-bottom: 18px; text-align: center;
  box-shadow: var(--shadow); animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { 0%{transform:translateY(16px);opacity:0;}100%{transform:translateY(0);opacity:1;} }
.q-card h2 { font-family: var(--fun); font-size: clamp(1.2rem,4vw,1.7rem); color: var(--pri); margin-bottom: 10px; }
.q-big { font-size: clamp(3.5rem,15vw,7rem); font-family: var(--fun); color: var(--pri); line-height: 1; margin: 8px 0; }
.q-hint-btn {
  background: #ede9fe; color: var(--pri); border: none; border-radius: 50px;
  padding: 7px 16px; font-size: 0.82rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  font-family: var(--font); transition: background 0.2s;
}
.q-hint-btn:hover { background: #ddd6fe; }
/* .answer-grid y .a-btn están definidos en la sección de JUEGOS al final del archivo */
@keyframes shake { 0%,100%{transform:translateX(0);}25%{transform:translateX(-8px);}75%{transform:translateX(8px);} }

/* Memoria, tiles y streak-toast están definidos en la sección JUEGOS al final del archivo */

/* ========================================================
   MODO ESPECIAL
   ======================================================== */
#screen-special { background: var(--sp-bg); }
.special-hero {
  background:linear-gradient(135deg,#fef3c7,#fde68a);
  border-bottom:3px solid #fcd34d;padding:24px 20px;text-align:center;
}
.sh-mascot { font-size:3.5rem;animation:bob 2.5s ease-in-out infinite; }
.special-hero h2 { font-family:var(--fun);font-size:clamp(1.2rem,4vw,1.7rem);color:#92400e;margin:8px 0; }
.special-hero p { color:#b45309;font-size:0.9rem; }
.special-grid {
  display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
  gap:16px;padding:20px;max-width:760px;margin:0 auto;
}
.sp-card {
  background:#fff;border-radius:var(--r);padding:24px 14px;text-align:center;
  cursor:pointer;border:3px solid transparent;
  box-shadow:0 4px 16px rgba(0,0,0,0.07);transition:all 0.22s;
}
.sp-card:hover { border-color:var(--sp-acc);transform:translateY(-5px);box-shadow:0 10px 30px rgba(245,158,11,0.2); }
.sp-card-icon { font-size:3rem;display:block;margin-bottom:8px; }
.sp-card-name { font-family:var(--fun);font-size:1rem;color:var(--txt);margin-bottom:4px; }
.sp-card-desc { font-size:0.76rem;color:var(--txt-light);line-height:1.4; }
.sp-tag { display:inline-block;margin-top:8px;background:#fef3c7;color:#92400e;border-radius:50px;padding:3px 10px;font-size:0.7rem;font-weight:700; }
/* sp-game-wrap, sp-title, sp-instruction, sp-choice-grid, sp-btn, btn-voice
   están definidos más abajo en la sección MODO ESPECIAL — BOTONES SP */

/* ========================================================
   MODALES (base)
   ======================================================== */
.modal-overlay {
  position:fixed;inset:0;background:rgba(15,14,38,0.65);backdrop-filter:blur(8px);
  display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px;
}
.modal-box {
  background:#fff;border-radius:var(--r);padding:32px;
  max-width:440px;width:100%;position:relative;
  box-shadow:0 24px 80px rgba(0,0,0,0.25);
  animation:popIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
  max-height:90vh;overflow-y:auto;
}
@keyframes popIn { 0%{transform:scale(0.75);opacity:0;}100%{transform:scale(1);opacity:1;} }
.modal-x {
  position:absolute;top:14px;right:14px;background:#f3f4f6;border:none;
  width:32px;height:32px;border-radius:50%;cursor:pointer;
  display:flex;align-items:center;justify-content:center;font-size:0.95rem;
}
.modal-header { text-align:center;margin-bottom:20px; }
.modal-icon { font-size:3rem;display:block;margin-bottom:8px; }
.modal-header h2 { font-family:var(--fun);font-size:1.5rem;color:var(--pri);margin-bottom:4px; }
.modal-header p { font-size:0.88rem;color:var(--txt-mid); }

/* Formulario en modal */
.modal-form { display:flex;flex-direction:column;gap:16px; }
.form-group { display:flex;flex-direction:column;gap:6px; }
.form-group label { font-size:0.88rem;font-weight:800;color:var(--txt-mid); }
.form-input {
  border:2.5px solid var(--border);border-radius:var(--r-sm);
  padding:11px 14px;font-size:1rem;font-family:var(--font);color:var(--txt);
  transition:border-color 0.2s;outline:none;
}
.form-input:focus { border-color:var(--pri); }
.form-hint { font-size:0.75rem;color:var(--txt-light);margin-top:2px; }
.optional { color:var(--txt-light);font-weight:400; }

/* Age & avatar pickers */
.age-picker, .avatar-picker { display:flex;gap:8px;flex-wrap:wrap; }
.ap-btn {
  width:42px;height:42px;border-radius:50%;border:2.5px solid var(--border);
  background:#f9fafb;font-size:1rem;font-weight:800;cursor:pointer;
  font-family:var(--font);color:var(--txt);transition:all 0.18s;
}
.ap-btn:hover, .ap-btn.selected { background:var(--pri);color:#fff;border-color:var(--pri);transform:scale(1.1); }
.av-opt {
  width:46px;height:46px;font-size:1.6rem;cursor:pointer;
  border-radius:var(--r-sm);border:2.5px solid transparent;
  display:flex;align-items:center;justify-content:center;
  transition:all 0.18s;
}
.av-opt:hover, .av-opt.selected { border-color:var(--pri);background:#ede9fe;transform:scale(1.1); }
.mode-toggle { display:flex;gap:8px; }
.mt-btn {
  flex:1;padding:10px;border:2.5px solid var(--border);border-radius:var(--r-sm);
  background:#f9fafb;cursor:pointer;font-family:var(--font);font-weight:700;font-size:0.88rem;
  transition:all 0.18s;color:var(--txt);
}
.mt-btn:hover, .mt-btn.active { background:var(--pri);color:#fff;border-color:var(--pri); }
.mt-btn[data-mode="special"].active { background:#f59e0b;border-color:#f59e0b; }

/* reward-modal y rm-* están definidos en la sección MODAL DE RECOMPENSA al final */
.confetti-wrap { position:absolute;inset:0;overflow:hidden;border-radius:var(--r);pointer-events:none; }

/* Badge modal */
.badge-modal { text-align:center;background:linear-gradient(135deg,#fff,#fef3c7);border:3px solid #fcd34d;overflow:visible; }
.bm-glow { position:absolute;inset:0;background:radial-gradient(circle at 50% 0%,rgba(251,191,36,0.3),transparent 70%);border-radius:var(--r);pointer-events:none; }
.bm-icon { font-size:4rem;display:block;margin-bottom:8px;animation:bounceIn 0.5s; }
@keyframes bounceIn { 0%{transform:scale(0.5);}70%{transform:scale(1.15);}100%{transform:scale(1);} }
.bm-name { font-family:var(--fun);font-size:1.3rem;color:var(--pri);margin-bottom:4px; }
.bm-desc { font-size:0.85rem;color:var(--txt-mid);margin-bottom:16px; }

/* Tips modal */
.tips-modal { max-width:520px; }
.tips-modal h2 { font-family:var(--fun);font-size:1.5rem;color:var(--pri);margin-bottom:18px; }
.tips-body { display:flex;flex-direction:column;gap:14px;margin-bottom:20px; }
.tip-block { background:#faf5ff;border-radius:var(--r-sm);padding:14px;border-left:4px solid var(--pri-light); }
.tip-block h4 { font-size:0.95rem;color:var(--pri);margin-bottom:6px; }
.tip-block p, .tip-block li { font-size:0.88rem;color:var(--txt-mid);line-height:1.55; }
.tip-block ul { padding-left:16px; }

/* Student modal */
.student-modal { max-width:520px; }

/* ========================================================
   BOTONES GLOBALES
   ======================================================== */
.btn-primary {
  background:linear-gradient(135deg,var(--pri),var(--pri-dark));color:#fff;
  border:none;border-radius:50px;padding:14px 32px;
  font-size:1rem;font-weight:900;cursor:pointer;font-family:var(--fun);
  box-shadow:0 6px 20px rgba(124,58,237,0.35);transition:all 0.2s;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
}
.btn-primary:hover { transform:translateY(-3px);box-shadow:0 10px 28px rgba(124,58,237,0.45); }
.btn-primary.full-w { width:100%; }
.btn-secondary {
  background:transparent;color:var(--pri);border:2.5px solid var(--pri-light);
  border-radius:50px;padding:10px 24px;font-size:0.9rem;font-weight:700;
  cursor:pointer;font-family:var(--font);transition:all 0.2s;
  display:inline-flex;align-items:center;gap:6px;
}
.btn-secondary:hover { background:#ede9fe; }
.btn-danger {
  background:var(--red);color:#fff;border:none;border-radius:50px;
  padding:8px 18px;font-size:0.85rem;font-weight:700;cursor:pointer;font-family:var(--font);
}

/* ========================================================
   CONFETTI
   ======================================================== */
.confetti-bit {
  position:absolute;width:9px;height:9px;border-radius:2px;
  animation:confettiFall linear forwards;
}
@keyframes confettiFall { 0%{transform:translateY(-10px) rotate(0deg);opacity:1;} 100%{transform:translateY(320px) rotate(720deg);opacity:0;} }

/* ========================================================
   RESPONSIVE
   ======================================================== */
@media(max-width:480px) {
  .access-cards { grid-template-columns:1fr; }
  .answer-grid { grid-template-columns:1fr 1fr; }
  .worlds-scroll { padding-bottom:6px; }
  .daily-tasks { gap:8px; }
  .dt-task { min-width:95px; }
  .game-container { padding:14px 12px 30px; }
  .modal-box { padding:22px 16px; }
  .child-hdr-right .stat-pill:first-child { display:none; }
}
@media(min-width:768px) {
  .special-grid { grid-template-columns:repeat(4,1fr); }
  .profiles-grid { grid-template-columns:repeat(4,1fr); }
}

/* ========================================================
   SPLASH SCREEN
   ======================================================== */
.splash-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(145deg, #1e1b4b 0%, #3730a3 45%, #7c3aed 80%, #c026d3 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.splash-globe {
  font-size: 5rem; animation: splashBounce 1.2s ease infinite alternate;
  filter: drop-shadow(0 8px 24px rgba(167,139,250,0.6));
}
@keyframes splashBounce { 0%{transform:scale(1) rotate(-5deg);}100%{transform:scale(1.12) rotate(5deg);} }
.splash-brand { font-family: var(--fun); font-size: 3rem; color: #fff; letter-spacing: 2px; text-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.splash-tag { font-size: 0.95rem; color: rgba(255,255,255,0.7); font-weight: 600; }
.splash-mascots { display: flex; gap: 16px; justify-content: center; }
.spl-m { font-size: 2.5rem; animation: splashFloat 1.8s ease-in-out infinite; }
.spl-big { font-size: 3rem; animation-delay: 0.6s; }
.spl-m:last-child { animation-delay: 1.2s; }
@keyframes splashFloat { 0%,100%{transform:translateY(0);}50%{transform:translateY(-14px);} }
.splash-loader { width: 260px; }
.sl-bar { height: 8px; background: rgba(255,255,255,0.2); border-radius: 99px; overflow: hidden; }
.sl-fill { height: 100%; background: linear-gradient(90deg,#a78bfa,#fbbf24); border-radius: 99px; width: 0; transition: width 0.4s; }
.sl-txt { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-top: 8px; font-weight: 600; }
.splash-copy { font-size: 0.75rem; color: rgba(255,255,255,0.45); }

/* ========================================================
   LANDING MEJORADO
   ======================================================== */
.ll-version { font-size: 0.68rem; color: rgba(255,255,255,0.5); margin-top: 2px; }
.ll-name { font-family: var(--fun); font-size: clamp(1.5rem,5vw,2rem); color: #fff; letter-spacing: 1px; }
.bounce-logo { animation: splashBounce 3s ease-in-out infinite alternate; }
.lm-center { transform: scale(1.08); }
.lm-desc { font-size: 0.68rem; color: rgba(255,255,255,0.65); font-weight: 600; }
.lm-bubble {
  position: absolute; background: rgba(255,255,255,0.95); border-radius: 12px;
  padding: 6px 10px; font-size: 0.75rem; font-weight: 700; color: var(--pri);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15); white-space: nowrap;
  top: -48px; left: 50%; transform: translateX(-50%);
  display: none; animation: bubblePop 0.3s ease;
}
.lm-bubble.show { display: block; }
.lm-bubble::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: rgba(255,255,255,0.95);
  border-bottom: none;
}
@keyframes bubblePop { 0%{transform:translateX(-50%) scale(0.5);opacity:0;} 100%{transform:translateX(-50%) scale(1);opacity:1;} }
.lm-mascot { position: relative; }
.lm-shine {
  width: 20px; height: 20px; background: rgba(255,255,255,0.4);
  border-radius: 50%; position: absolute; top: 8px; left: 10px;
}
.landing-sub { font-size: 0.9rem; color: rgba(255,255,255,0.75); font-weight: 600; text-align: center; margin-top: -12px; }
.ac-glow {
  position: absolute; inset: 0; border-radius: inherit; opacity: 0;
  transition: opacity 0.3s; pointer-events: none;
}
.ac-child .ac-glow { background: radial-gradient(circle at 50% 50%, rgba(167,139,250,0.4), transparent 70%); }
.ac-parent .ac-glow { background: radial-gradient(circle at 50% 50%, rgba(52,211,153,0.4), transparent 70%); }
.ac-school .ac-glow { background: radial-gradient(circle at 50% 50%, rgba(251,191,36,0.4), transparent 70%); }
.access-card:hover .ac-glow { opacity: 1; }
.ac-arrow { font-size: 1.4rem; color: rgba(255,255,255,0.5); margin-top: 2px; transition: transform 0.2s; }
.access-card:hover .ac-arrow { transform: translateX(4px); color: rgba(255,255,255,0.9); }

/* Estadísticas de landing — definición completa más abajo en MEJORAS VISUALES */
.ls-lbl { font-size: 0.68rem; color: rgba(255,255,255,0.6); font-weight: 600; }

/* ========================================================
   CHILD SELECT MEJORADO
   ======================================================== */
.cs-header { text-align: center; margin-bottom: 24px; padding-top: 8px; }
.cs-title { font-family: var(--fun); font-size: 1.6rem; color: var(--pri); margin-bottom: 6px; }
.cs-sub { font-size: 0.9rem; color: var(--txt-light); }

/* ========================================================
   HUB DEL NIÑO — BIENVENIDA
   ======================================================== */
.hub-welcome-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-bottom: 2px solid #fcd34d;
  padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
}
.hwb-mascot { font-size: 2.5rem; animation: bob 2.5s ease-in-out infinite; flex-shrink: 0; }
.hwb-text { flex: 1; }
.hwb-greeting { font-family: var(--fun); font-size: 1.1rem; color: #92400e; }
.hwb-msg { font-size: 0.82rem; color: #b45309; margin-top: 2px; }
.hwb-sound {
  background: rgba(255,255,255,0.6); border: 2px solid rgba(146,64,14,0.2);
  border-radius: 50%; width: 38px; height: 38px; font-size: 1.2rem;
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.hwb-sound:hover { background: rgba(255,255,255,0.9); }
.pulse-avatar { animation: pulse-ring 2s ease infinite; }
@keyframes pulse-ring {
  0%,100% { box-shadow: 0 4px 12px rgba(124,58,237,0.35); }
  50% { box-shadow: 0 4px 20px rgba(124,58,237,0.7), 0 0 0 6px rgba(167,139,250,0.15); }
}

/* Estrellas / monedas coloreadas */
.star-pill { background: rgba(251,191,36,0.25); border: 1px solid rgba(251,191,36,0.4); }
.coin-pill { background: rgba(16,185,129,0.2); border: 1px solid rgba(16,185,129,0.35); }

/* Mundos header */
.ws-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.ws-sub { font-size: 0.8rem; color: var(--txt-light); }
.ws-title { margin-bottom: 0; }

/* Botón modo especial en hub */
.hub-special-btn-wrap { padding: 8px 20px 48px; }
.hub-special-btn {
  width: 100%; max-width: 480px; display: block; margin: 0 auto;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2.5px solid #fcd34d; border-radius: var(--r);
  color: #92400e; font-family: var(--font); font-weight: 800; font-size: 0.95rem;
  padding: 14px 20px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.hub-special-btn:hover { background: #fde68a; transform: translateY(-2px); }

/* ========================================================
   ESPECIAL — MEJORAS
   ======================================================== */
.special-tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.stag {
  background: rgba(255,255,255,0.6); border: 2px solid rgba(146,64,14,0.25);
  border-radius: 50px; padding: 4px 12px; font-size: 0.78rem; font-weight: 700; color: #92400e;
}
.sh-bounce { animation: bob 2.5s ease-in-out infinite; display: inline-block; }

/* ========================================================
   MODAL MEJORAS
   ======================================================== */
.rm-gains { display: flex; gap: 20px; justify-content: center; margin: 10px 0 18px; }
.rm-gain-item {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-radius: 50px; padding: 8px 20px;
  font-size: 1.15rem; font-weight: 900; color: var(--pri);
}
.mode-hint {
  font-size: 0.8rem; color: var(--txt-mid); background: #f3f4f6;
  border-radius: var(--r-sm); padding: 8px 12px; margin-top: 4px;
  line-height: 1.5;
}

/* ========================================================
   LANDING STATS ANIMACIÓN
   ======================================================== */
@keyframes countUp { 0%{opacity:0;transform:translateY(8px);}100%{opacity:1;transform:translateY(0);} }
.ls-num { animation: countUp 0.5s ease; }

/* world-tile definido más abajo en 'MEJORAS VISUALES PREMIUM' */

/* ========================================================
   RESPONSIVE ADICIONAL
   ======================================================== */
@media(max-width:400px) {
  .landing-stats { flex-direction: column; gap: 8px; padding: 12px 16px; }
  .ls-sep { display: none; }
  .hub-welcome-banner { padding: 10px 14px; }
  .hwb-mascot { font-size: 2rem; }
}
@media(max-width:640px) {
  .access-cards { grid-template-columns: 1fr; gap: 10px; }
  .landing-wrap { gap: 18px; }
}
@media(min-width:641px) {
  .access-cards { grid-template-columns: repeat(3, 1fr); }
}

/* ========================================================
   JUEGOS — BOTONES DE RESPUESTA (clases usadas en games.js)
   ======================================================== */
.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Botón de respuesta principal */
.a-btn {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: var(--r-sm);
  padding: 18px 12px;
  font-size: clamp(1rem, 3.5vw, 1.25rem);
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  color: var(--txt);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-height: 72px;
  position: relative;
  overflow: hidden;
}
.a-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,0.04), transparent);
  opacity: 0;
  transition: opacity 0.18s;
}
.a-btn:hover:not(:disabled) {
  border-color: var(--pri);
  background: #faf5ff;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 20px rgba(124,58,237,0.18);
}
.a-btn:hover:not(:disabled)::before { opacity: 1; }
.a-btn:active:not(:disabled) { transform: scale(0.97); }

/* Variante grande */
.a-btn--big {
  font-size: clamp(1.4rem, 5vw, 2rem);
  padding: 22px 12px;
  min-height: 90px;
}

/* Estados correcto / incorrecto */
.a-btn.correct {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: var(--green);
  color: #065f46;
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(16,185,129,0.25);
  animation: correctPop 0.35s ease;
}
@keyframes correctPop {
  0%  { transform: scale(0.95); }
  60% { transform: scale(1.07); }
  100%{ transform: scale(1.04); }
}
.a-btn.wrong {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: var(--red);
  color: #991b1b;
  animation: shake 0.4s ease;
  box-shadow: 0 4px 14px rgba(239,68,68,0.25);
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}
.a-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* ========================================================
   MEMORIA — TARJETAS (corregidas para games.js)
   ======================================================== */
.memory-grid { display: grid; gap: 10px; max-width: 420px; margin: 0 auto; padding-bottom: 16px; }
.mem-3x4 { grid-template-columns: repeat(3, 1fr); }
.mem-4x4 { grid-template-columns: repeat(4, 1fr); }

.mem-card {
  aspect-ratio: 1;
  cursor: pointer;
  perspective: 700px;
  border-radius: var(--r-sm);
  user-select: none;
}
.mem-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--r-sm);
}
.mem-card.flipped .mem-inner { transform: rotateY(180deg); }
.mem-card.matched .mem-inner { transform: rotateY(180deg); }

.mem-front, .mem-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.4rem, 5vw, 2rem);
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}
.mem-front {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  font-family: var(--fun);
  font-size: 1.5rem;
  border: 3px solid rgba(255,255,255,0.15);
}
.mem-back {
  background: #fff;
  border: 3px solid #ede9fe;
  transform: rotateY(180deg);
}
.mem-card.matched .mem-back {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: var(--green);
  animation: matchedPop 0.4s ease;
}
@keyframes matchedPop {
  0%  { transform: rotateY(180deg) scale(0.9); }
  60% { transform: rotateY(180deg) scale(1.08); }
  100%{ transform: rotateY(180deg) scale(1); }
}

/* ========================================================
   TILES DE LETRAS / PALABRAS (corregidas para games.js)
   ======================================================== */
.letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 14px 0;
}
.l-tile {
  min-width: 46px;
  height: 48px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
  border: none;
  font-family: var(--fun);
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
  transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
  padding: 0 12px;
}
.l-tile:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 20px rgba(124,58,237,0.4);
}
.l-tile:active:not(:disabled) { transform: scale(0.94); }
.l-tile.used, .l-tile:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* Display de palabra construida */
.word-build-display {
  font-family: var(--fun);
  font-size: clamp(1.8rem, 7vw, 3rem);
  letter-spacing: 8px;
  color: var(--txt);
  min-height: 56px;
  padding: 10px 16px;
  border: 2.5px dashed #a78bfa;
  border-radius: var(--r-sm);
  text-align: center;
  background: #faf5ff;
  transition: color 0.3s, border-color 0.3s;
}

/* Streak toast */
.streak-toast {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-radius: 50px;
  padding: 8px 22px;
  font-weight: 900;
  font-size: 0.95rem;
  display: none;
  animation: slideUp 0.3s ease;
  margin-bottom: 12px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(245,158,11,0.4);
}

/* ========================================================
   MODO ESPECIAL — BOTONES SP (corregidas para special.js)
   ======================================================== */
.sp-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 400px;
  margin: 0 auto;
}
.sp-btn {
  background: #fff;
  border: 4px solid var(--border);
  border-radius: var(--r);
  padding: 20px 12px;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  min-height: 100px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.07);
}
.sp-btn .sp-lbl {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--txt);
  text-align: center;
}
.sp-btn:hover:not(:disabled) {
  border-color: var(--sp-acc);
  background: #fef9c3;
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(245,158,11,0.25);
}
.sp-btn:active:not(:disabled) { transform: scale(0.97); }
.sp-btn.correct {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: var(--green);
  animation: correctPop 0.35s ease;
}
.sp-btn.wrong {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: var(--red);
  animation: shake 0.4s ease;
}
.sp-btn.used { opacity: 0.35; cursor: not-allowed; }
.sp-btn:disabled { cursor: not-allowed; opacity: 0.7; }

/* Título de juego especial */
.sp-title {
  font-family: var(--fun);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: #92400e;
  margin-bottom: 6px;
  text-align: center;
}

/* Instrucción especial */
.sp-instruction {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  color: var(--txt);
  margin-bottom: 12px;
  padding: 14px 16px;
  background: #fef3c7;
  border-radius: var(--r-sm);
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
}

/* Botón de voz especial */
.btn-voice {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 10px 24px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(245,158,11,0.4);
  margin: 10px 0;
  transition: all 0.2s;
}
.btn-voice:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(245,158,11,0.5); }

/* Wrapper juego especial */
.sp-game-wrap {
  background: #fff;
  border-radius: var(--r);
  padding: 24px 20px 28px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: slideUp 0.35s ease-out;
}

/* ========================================================
   ANIMACIÓN ENTRADA TARJETAS (slideUp)
   ======================================================== */
@keyframes slideUp {
  0%   { transform: translateY(18px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}
@keyframes fadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

/* ========================================================
   MODAL DE RECOMPENSA — MEJORADO
   ======================================================== */
.reward-modal {
  text-align: center;
  border: 3px solid #ede9fe;
  overflow: visible;
  background: linear-gradient(135deg, #fefefe, #faf5ff);
}
.rm-icon {
  font-size: 5rem;
  display: block;
  margin-bottom: 4px;
  animation: bounceIn 0.55s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes bounceIn {
  0%   { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  70%  { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.rm-title {
  font-family: var(--fun);
  font-size: 2.2rem;
  color: var(--pri);
  margin-bottom: 4px;
}
.rm-stars {
  font-size: 2rem;
  letter-spacing: 8px;
  margin: 8px 0;
  animation: fadeIn 0.5s 0.2s both;
}
.rm-msg {
  font-size: 0.95rem;
  color: var(--txt-mid);
  margin-bottom: 10px;
  line-height: 1.5;
}
.rm-gains {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 12px 0 20px;
}
.rm-gain-item {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border-radius: 50px;
  padding: 8px 22px;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--pri);
  box-shadow: 0 3px 10px rgba(124,58,237,0.15);
}
.rm-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.rm-badge-chip {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ========================================================
   ESTILOS PREMIUM ADICIONALES
   ======================================================== */
/* Botones con icono en HUD */
.game-bar { gap: 10px; }
.game-bar-hud { gap: 6px; flex-wrap: nowrap; }
#gb-lives { font-size: 0.9rem; }

/* Pill del timer urgente */
.stat-pill.timer-pill.urgent {
  background: rgba(239,68,68,0.35);
  border-color: rgba(239,68,68,0.6);
  animation: urgentBlink 0.5s infinite;
}

/* Mejorar tarjetas de perfil */
.profile-card { overflow: hidden; }
.profile-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #a78bfa, #ec4899);
  transform: scaleX(0);
  transition: transform 0.3s;
  transform-origin: left;
}
.profile-card:hover::after { transform: scaleX(1); }

/* Tarjeta de tarea diaria mejorada */
.dt-task.active {
  border-color: var(--pri);
  background: #faf5ff;
  box-shadow: 0 4px 16px rgba(124,58,237,0.2);
}
.dt-task.done .dt-icon { filter: grayscale(0.3); }

/* Chips de logros recientes */
.rb-chip {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(245,158,11,0.3);
  animation: fadeIn 0.4s ease;
}

/* Hub special button animado */
.hub-special-btn {
  position: relative;
  overflow: hidden;
}
.hub-special-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.hub-special-btn:hover::after { transform: translateX(100%); }

/* Scrollbar sutil */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd6fe; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #a78bfa; }

/* Focus visible para accesibilidad */
:focus-visible {
  outline: 3px solid var(--pri-light);
  outline-offset: 2px;
}
button:focus-visible { outline: 3px solid var(--pri-light); outline-offset: 3px; }

/* ============================================================
   MEJORAS VISUALES PREMIUM — Polishing final
   ============================================================ */

/* -- Game bar mejorada -- */
.game-bar {
  background: linear-gradient(135deg, #0f0e26 0%, #1e1b4b 60%, #2d1b69 100%);
  border-bottom: 2px solid rgba(167,139,250,0.25);
}
#gb-score {
  font-family: var(--fun);
  font-size: 1.05rem;
  color: #fbbf24;
  text-shadow: 0 2px 8px rgba(251,191,36,0.4);
}
#gb-lives { letter-spacing: 2px; }

/* -- Progress strip mejorada -- */
.game-progress-strip {
  height: 6px;
  background: rgba(30,27,75,0.6);
}
.gps-fill {
  background: linear-gradient(90deg, #a78bfa, #7c3aed, #ec4899);
  box-shadow: 0 0 8px rgba(167,139,250,0.6);
}

/* -- Game container mejorado -- */
.game-container {
  background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 30%, #f0f4ff 100%);
  min-height: calc(100vh - 90px);
}

/* -- Qcard con sombra mejorada -- */
.ms-qcard {
  border: 1px solid rgba(167,139,250,0.2);
}

/* -- Botón back mejorado -- */
#btn-back-game {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  width: 38px; height: 38px;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
#btn-back-game:hover { background: rgba(255,255,255,0.3); transform: scale(1.08); }

/* -- Stat pills de HUD mejoradas -- */
.stat-pill {
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff;
  white-space: nowrap;
}

/* -- Modal de recompensa mejorado -- */
.reward-modal {
  background: linear-gradient(160deg, #fefefe, #faf5ff, #ede9fe);
  border: 3px solid rgba(167,139,250,0.5);
  box-shadow: 0 20px 60px rgba(124,58,237,0.25);
}
.rm-stars { letter-spacing: 10px; }

/* -- Landing mejorada -- */
.landing-stats {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r);
  padding: 16px 28px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
}
.ls-sep { color: rgba(255,255,255,0.4); font-size: 1.2rem; }
.ls-item { text-align: center; }
.ls-num { font-family: var(--fun); font-size: 1.6rem; color: #fff; display: block; font-weight: 900; }
.ls-label { font-size: 0.72rem; color: rgba(255,255,255,0.75); font-weight: 600; }

/* -- Hub mejorado -- */
#screen-child-hub {
  background: linear-gradient(160deg, #f0f4ff 0%, #ede9fe 30%, #f9f5ff 100%);
  min-height: 100vh;
}
.child-hdr {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  padding: 16px 20px 20px;
  color: #fff;
}
.child-hdr-top {
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.hub-avatar-wrap { position: relative; }
#hub-avatar {
  font-size: 3rem;
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
}
.hub-info { flex: 1; }
#hub-child-name { font-family: var(--fun); font-size: 1.35rem; color: #fff; }
.hub-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.hub-meta .stat-pill {
  font-size: 0.78rem;
  padding: 3px 10px;
  background: rgba(255,255,255,0.18);
}
.hub-xp-bar {
  background: rgba(255,255,255,0.2);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
#hub-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 99px;
  transition: width 0.6s;
  box-shadow: 0 0 8px rgba(251,191,36,0.5);
}
.hub-xp-row {
  display: flex; justify-content: space-between;
  margin-bottom: 4px;
}
.hub-xp-title { font-size: 0.75rem; color: rgba(255,255,255,0.8); font-weight: 700; }
#hub-xp-label { font-size: 0.72rem; color: rgba(255,255,255,0.7); }

/* -- World tiles mejorados -- */
.world-tile {
  background: #fff;
  border-radius: var(--r);
  padding: 18px 12px 14px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border: 2px solid var(--border);
  cursor: pointer;
  width: 130px;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.world-tile:hover:not(.locked) {
  transform: translateY(-6px) scale(1.04);
  border-color: var(--wc, var(--pri));
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}
.world-tile.locked { opacity: 0.55; cursor: not-allowed; }
.wt-icon { font-size: 2.4rem; display: block; margin-bottom: 6px; }
.wt-name { font-family: var(--fun); font-size: 0.82rem; color: var(--txt); margin-bottom: 8px; line-height: 1.2; }
.wt-bar { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.wt-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s; }
.wt-stars { font-size: 0.75rem; }
.wt-lock { position: absolute; top: 6px; right: 6px; font-size: 0.9rem; }
.wt-new {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff; font-size: 0.6rem; font-weight: 900; padding: 2px 8px;
  border-radius: 50px; white-space: nowrap; box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}

/* -- Daily tasks mejoradas -- */
.section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 10px; margin: 0;
}
.section-header h3 {
  font-family: var(--fun); font-size: 1.05rem; color: var(--txt); flex: 1;
}
.section-header .sh-sub { font-size: 0.8rem; color: var(--txt-light); font-weight: 600; }

/* Tarjetas de perfil mejoradas */
.profile-card {
  background: linear-gradient(160deg, #fff, #faf5ff);
}
.pc-mode-badge {
  display: inline-block;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  font-size: 0.68rem; font-weight: 800;
  border-radius: 50px; padding: 2px 8px; margin-top: 4px;
}

/* -- Access cards extra glow -- */
.ac-child:hover { background: rgba(167,139,250,0.2); }
.ac-parent:hover { background: rgba(52,211,153,0.15); }
.ac-school:hover { background: rgba(251,191,36,0.15); }

/* -- Botón primario: estilos base en sección BOTONES GLOBALES -- */
.btn-primary:active { transform: scale(0.97); }

/* -- Mejora de streak toast -- */
.streak-toast {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 6px 20px rgba(239,68,68,0.4);
  font-size: 1.05rem;
  padding: 10px 28px;
}

/* -- Tarjetas de memoria con tamaño mínimo garantizado -- */
.ms-mem-grid {
  min-width: 0;
}
.ms-mem-card {
  aspect-ratio: 1 / 1;
}

/* ========================================================
   RESPONSIVE FINAL
   ======================================================== */
@media (max-width: 360px) {
  .answer-grid { gap: 8px; }
  .a-btn { padding: 14px 8px; min-height: 60px; }
  .a-btn--big { min-height: 76px; }
  .sp-choice-grid { gap: 10px; }
  .sp-btn { padding: 16px 8px; min-height: 80px; }
  .rm-title { font-size: 1.7rem; }
}
@media (min-width: 768px) {
  .answer-grid { gap: 14px; }
  .a-btn { padding: 20px 16px; }
  .sp-choice-grid { max-width: 460px; gap: 16px; }
}

/* ============================================================
   CLASES MS-* — Usadas en games.js v4.0
   Todos los componentes internos de los minijuegos
   ============================================================ */

/* --- Tarjeta de pregunta --- */
.ms-qcard {
  background: var(--card);
  border-radius: var(--r);
  padding: 24px 20px 20px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease-out;
}

/* --- Grid de respuestas --- */
.ms-ans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 4px 24px;
}

/* --- Etiqueta de pregunta --- */
.ms-qlabel {
  font-family: var(--fun);
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  color: var(--pri);
  margin-bottom: 12px;
  line-height: 1.3;
}

/* ======================
   JUEGO 1 & 2 — LETRAS
   ====================== */
.ms-letter-hero {
  font-family: var(--fun);
  font-size: clamp(5rem, 20vw, 9rem);
  color: var(--pri);
  line-height: 1;
  margin: 4px 0 8px;
  text-shadow: 0 4px 16px rgba(124,58,237,0.25);
}
.ms-letter-emoji {
  font-size: 3.5rem;
  display: block;
  margin-bottom: 6px;
}
.ms-letter-word {
  font-family: var(--fun);
  font-size: 1.4rem;
  color: var(--txt-mid);
  margin-bottom: 8px;
}
/* Botón de escuchar */
.ms-listen-btn {
  background: #ede9fe;
  color: var(--pri);
  border: none;
  border-radius: 50px;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-family: var(--font);
  transition: background 0.2s, transform 0.15s;
}
.ms-listen-btn:hover { background: #ddd6fe; transform: scale(1.04); }

/* sub-elementos de a-btn */
.a-btn__emoji { font-size: 2rem; line-height: 1; }
.a-btn__label { font-size: 0.95rem; font-weight: 800; color: var(--txt-mid); }
.a-btn__num   { font-family: var(--fun); font-size: clamp(1.6rem,6vw,2.4rem); color: var(--txt); }

/* ======================
   JUEGO 3 — WORD BUILDER
   ====================== */
.ms-letter-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 12px 8px;
  background: #faf5ff;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.ms-l-tile {
  min-width: 50px;
  height: 52px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
  border: none;
  font-family: var(--fun);
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
  transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
  padding: 0 14px;
}
.ms-l-tile:hover:not(:disabled) { transform: translateY(-4px) scale(1.12); box-shadow: 0 8px 20px rgba(124,58,237,0.4); }
.ms-l-tile:active:not(:disabled) { transform: scale(0.94); }
.ms-l-tile--used, .ms-l-tile:disabled { opacity: 0.3; cursor: not-allowed; transform: none !important; }

.ms-wb-emoji { font-size: 4rem; display: block; margin-bottom: 6px; }
.ms-wb-slots {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border: 2.5px dashed #a78bfa;
  border-radius: var(--r-sm);
  background: #faf5ff;
  min-height: 60px;
  transition: border-color 0.3s;
  margin: 10px 0;
}
.ms-wb-slot {
  font-family: var(--fun);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  color: var(--txt);
  min-width: 40px;
  text-align: center;
  line-height: 1;
}
.ms-wb-slot--filled { color: var(--pri); font-weight: 900; }
.ms-wb-actions { text-align: center; margin-top: 8px; }

/* ======================
   JUEGO 4 — CUENTA PUNTOS
   ====================== */
.ms-dots-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 16px 12px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: var(--r);
  border: 2px solid #ddd6fe;
  margin: 12px 0;
  min-height: 90px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}
.ms-dot-item {
  font-size: clamp(2rem, 7vw, 2.8rem);
  line-height: 1;
  background: none;
  border: 3px solid transparent;
  border-radius: 50%;
  padding: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(52px, 12vw, 68px);
  height: clamp(52px, 12vw, 68px);
}
.ms-dot-item:hover { background: rgba(124,58,237,0.1); transform: scale(1.1); }
.ms-dot-item--tapped {
  background: rgba(124,58,237,0.15);
  border-color: var(--pri);
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}

/* ======================
   JUEGO 5 — NUMBER MATCH
   ====================== */
.ms-num-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: var(--r-sm);
  border: 2px solid #ddd6fe;
  margin: 10px 0;
  max-height: 180px;
  overflow-y: auto;
}
.ms-num-item {
  font-size: clamp(1.4rem, 5vw, 2rem);
  display: inline-block;
  line-height: 1.2;
}
.ms-num-hint {
  font-family: var(--fun);
  font-size: 1.1rem;
  color: var(--txt-mid);
  margin-top: 6px;
  display: none; /* La pista se oculta para que el niño cuente */
}

/* ======================
   JUEGO 6 — SIMPLE MATH
   ====================== */
.ms-math-eq {
  font-family: var(--fun);
  font-size: clamp(2.2rem, 9vw, 4rem);
  color: var(--pri);
  letter-spacing: 4px;
  padding: 12px 0;
  line-height: 1.2;
}
.ms-math-q {
  display: inline-block;
  background: var(--pri);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 2px 12px;
  font-size: 0.9em;
  margin-left: 4px;
  box-shadow: 0 3px 10px rgba(124,58,237,0.35);
}

/* ======================
   JUEGO 7 — MEMORIA ★ TARJETAS GRANDES
   ====================== */
.ms-mem-grid {
  display: grid;
  gap: 10px;
  padding: 12px;
  margin: 0 auto;
  max-width: 480px;
}
.ms-mem-grid--3x4 { grid-template-columns: repeat(3, 1fr); }
.ms-mem-grid--4x4 { grid-template-columns: repeat(4, 1fr); }

.ms-mem-card {
  aspect-ratio: 1;
  cursor: pointer;
  perspective: 700px;
  border-radius: var(--r-sm);
  user-select: none;
  /* Tamaño mínimo para que sean visibles */
  min-width: 70px;
  min-height: 70px;
}
.ms-mem-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.4,0,0.2,1);
  border-radius: var(--r-sm);
}
.ms-mem-card.flipped .ms-mem-inner  { transform: rotateY(180deg); }
.ms-mem-card.matched .ms-mem-inner  { transform: rotateY(180deg); }

.ms-mem-front, .ms-mem-back {
  position: absolute;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}
.ms-mem-front {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  font-family: var(--fun);
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  border: 3px solid rgba(255,255,255,0.2);
}
.ms-mem-back {
  background: #fff;
  border: 3px solid #ede9fe;
  transform: rotateY(180deg);
}
.ms-mem-card.matched .ms-mem-back {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: var(--green);
  animation: matchedPop 0.4s ease;
}
.ms-mem-moves {
  font-size: 0.9rem;
  color: var(--txt-light);
  margin-top: 4px;
  font-weight: 600;
}

/* ======================
   JUEGO 8 & 9 — COLORES
   ====================== */
.ms-color-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: block;
  margin: 12px auto;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  border: 4px solid rgba(255,255,255,0.6);
}
.ms-color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 360px;
  margin: 14px auto 24px;
}
.ms-color-swatch {
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  border: 4px solid rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  min-height: 70px;
}
.ms-color-swatch:hover { transform: scale(1.08); box-shadow: 0 8px 22px rgba(0,0,0,0.22); }
.ms-color-swatch__label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  background: rgba(0,0,0,0.3);
  border-radius: 20px;
  padding: 2px 6px;
}

/* ======================
   JUEGO 10 & 11 — FORMAS
   ====================== */
.ms-shape-hero {
  font-size: clamp(5rem, 18vw, 8rem);
  line-height: 1;
  margin: 10px 0 14px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(124,58,237,0.2));
}

/* ======================
   JUEGO 12 & 13 — ANIMALES
   ====================== */
.ms-sound-display {
  font-family: var(--fun);
  font-size: clamp(1.8rem, 7vw, 3rem);
  color: var(--pri);
  padding: 14px 24px;
  background: linear-gradient(135deg, #ede9fe, #faf5ff);
  border-radius: var(--r);
  border: 2px solid #ddd6fe;
  display: inline-block;
  margin: 12px 0;
  box-shadow: 0 4px 14px rgba(124,58,237,0.1);
}
.ms-animal-hero {
  font-size: clamp(5rem, 18vw, 8rem);
  display: block;
  line-height: 1;
  margin: 8px 0 4px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.12));
}
.ms-animal-name {
  font-family: var(--fun);
  font-size: 1.4rem;
  color: var(--txt);
  margin-bottom: 6px;
}

/* ======================
   JUEGO 15 — SECUENCIA
   ====================== */
.ms-seq-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 14px 8px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border-radius: var(--r-sm);
  border: 2px solid #ddd6fe;
  margin: 10px 0 14px;
}
.ms-seq-item {
  font-family: var(--fun);
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--txt);
  background: #fff;
  border-radius: var(--r-sm);
  padding: 8px 14px;
  border: 2px solid #ddd6fe;
  min-width: 48px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.ms-seq-item--q {
  background: var(--pri);
  color: #fff;
  border-color: var(--pri-dark);
  font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  box-shadow: 0 4px 14px rgba(124,58,237,0.3);
}
.ms-seq-arrow {
  color: var(--txt-light);
  font-size: 1.2rem;
  font-weight: 900;
}

/* ======================
   JUEGO 16 — COMPLETA PALABRA
   ====================== */
.ms-wc-display {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.ms-wc-letter {
  font-family: var(--fun);
  font-size: clamp(2rem, 7vw, 3rem);
  color: var(--txt);
  background: #f5f3ff;
  border-radius: var(--r-sm);
  padding: 6px 10px;
  border: 2px solid #ddd6fe;
  min-width: 44px;
  text-align: center;
}
.ms-wc-blank {
  font-family: var(--fun);
  font-size: clamp(2rem, 7vw, 3rem);
  color: var(--pri);
  background: #ede9fe;
  border-radius: var(--r-sm);
  padding: 6px 10px;
  border: 3px dashed var(--pri);
  min-width: 44px;
  text-align: center;
  animation: urgentBlink 1.5s infinite;
}

/* ======================
   JUEGO 17 — ORDENA FRASE
   ====================== */
.ms-so-display {
  font-family: var(--fun);
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  color: var(--txt-light);
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: var(--r-sm);
  padding: 14px 18px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  margin: 10px 0;
}
.ms-so-display--active { color: var(--txt); border-color: var(--pri-light); background: #faf5ff; }
.ms-so-display--ok { color: #065f46; border-color: var(--green); background: #d1fae5; }
.ms-so-display--err { color: #991b1b; border-color: var(--red); background: #fee2e2; animation: shake 0.4s ease; }

.ms-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 14px 10px;
  background: #f5f3ff;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
}
.ms-word-tile {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-size: clamp(0.95rem, 3.5vw, 1.2rem);
  font-weight: 800;
  font-family: var(--fun);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}
.ms-word-tile:hover:not(:disabled) { transform: translateY(-3px) scale(1.06); box-shadow: 0 8px 20px rgba(124,58,237,0.4); }
.ms-word-tile--used { opacity: 0.3; cursor: not-allowed; transform: none !important; }
.ms-word-tile:disabled { cursor: not-allowed; }

/* ======================
   RESPONSIVE JUEGOS
   ====================== */
@media (max-width: 380px) {
  .ms-qcard { padding: 16px 12px 14px; }
  .ms-ans-grid { gap: 8px; }
  .ms-dots-wrap { gap: 6px; padding: 10px 8px; }
  .ms-dot-item { width: 44px; height: 44px; font-size: 1.6rem; }
  .ms-mem-grid { gap: 6px; padding: 8px; }
  .ms-color-grid { gap: 8px; }
  .ms-word-tile { padding: 8px 14px; font-size: 0.88rem; }
}
@media (min-width: 480px) {
  .ms-mem-grid { max-width: 560px; gap: 14px; }
  .ms-mem-card { min-width: 90px; min-height: 90px; }
  .ms-dots-wrap { max-width: 440px; }
  .ms-color-grid { max-width: 420px; gap: 16px; }
  .ms-color-swatch { min-height: 90px; }
}
@media (min-width: 640px) {
  .ms-ans-grid { gap: 16px; }
  .ms-mem-grid--4x4 { max-width: 580px; }
  .ms-mem-card { min-width: 100px; min-height: 100px; }
}
