/* =============================================
   EVIN — styles.css
   Hoja de estilos principal
   Orden: Variables → Reset → Base → Layout →
          Header → Nav → Tarjetas → Botones →
          Formularios → Modal → Badges →
          Juegos → Modo solo-juego → Responsive
   ============================================= */


/* ── 1. VARIABLES ─────────────────────────────────────────── */
:root {
  /* Paleta principal */
  --primary:        #1e3a5f;
  --primary-light:  #2d5a8e;
  --accent:         #e63946;
  --accent-green:   #16a34a;
  --accent-amber:   #d97706;

  /* Fondos */
  --light:          #f8fafc;
  --surface:        #ffffff;
  --surface-2:      #f1f5f9;

  /* Texto */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  /* Bordes */
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 28px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05);

  /* Tipografía */
  --font-family:  'Roboto', system-ui, -apple-system, sans-serif;
  --font-display: 'Montserrat', sans-serif;

  /* Espaciado y radios */
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --gap:        1rem;
  --max-width:  1200px;

  /* Transición global */
  --transition: 0.18s ease;
}


/* ── 2. RESET ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}


/* ── 3. BASE ──────────────────────────────────────────────── */
body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0;
  padding: 0;
  background: var(--light);
  color: var(--text-primary);
}

::selection {
  background: #bfdbfe;
  color: var(--primary);
}

::-webkit-scrollbar       { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }


/* ── 4. LAYOUT ────────────────────────────────────────────── */
main {
  padding: 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

section {
  margin-bottom: 2rem;
}

.hidden {
  display: none !important;
}


/* ── 5. HEADER ────────────────────────────────────────────── */
header {
  background: linear-gradient(90deg, var(--primary) 0%, #0f2744 100%);
  color: white;
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(15,39,68,0.18);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
}

.logo-box {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  animation: logoFadeIn 1.2s;
}

@keyframes logoFadeIn {
  0%   { opacity: 0; transform: translateY(-24px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-img {
  height: 48px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(67,97,238,0.10);
}

.logo-text {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(120deg, #ffffff, #f4d35e, #f94144);
  -webkit-background-clip: text;
  color: transparent;
  animation: evin-pop 1.2s ease-out forwards;
  cursor: default;
}

.logo-text::after {
  content: 'EVIN';
  position: absolute;
  inset: 0;
  z-index: -1;
  color: rgba(0,0,0,0.18);
  filter: blur(2px);
  transform: translateY(2px);
}

@keyframes evin-pop {
  0%   { transform: scale(0.8); letter-spacing: 0.3em; opacity: 0; }
  50%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1);   letter-spacing: 0.08em; }
}

.logo-text:hover {
  animation: evin-bounce 0.4s ease-out;
}

@keyframes evin-bounce {
  0%   { transform: translateY(0) scale(1); }
  30%  { transform: translateY(-2px) scale(1.05); }
  60%  { transform: translateY(1px) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}


/* ── 6. FOOTER ────────────────────────────────────────────── */
footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  text-align: center;
  font-size: 0.9rem;
  padding: 1.25rem;
  margin-top: 2rem;
}


/* ── 7. NAVEGACIÓN ────────────────────────────────────────── */
.main-nav {
  display: flex;
  align-items: center;
  flex: 1;
  margin-left: 1.5rem;
}

.nav-links {
  display: flex;
  justify-content: center;
  flex: 1;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  color: #f1faee;
  background: transparent;
  min-height: 44px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              transform var(--transition), border-color var(--transition);
}

.menu-btn i {
  margin-right: 0.35rem;
  font-size: 0.95em;
}

.menu-btn:hover {
  background: rgba(241,250,238,0.15);
  transform: translateY(-1px);
}

.menu-btn.active {
  background: rgba(241,250,238,0.25);
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  color: #f1faee;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.nav-links a:hover {
  background: rgba(241,250,238,0.18);
  transform: translateY(-1px);
}

.nav-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 1rem;
  background: #ffffff;
  color: var(--primary);
  border: 1px solid #ffffff;
  transition: background var(--transition), border-color var(--transition);
}

.nav-login:hover {
  background: #f1f5ff;
  border-color: #f1f5ff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: #f1faee;
  border-radius: 999px;
}


/* ── 8. TARJETAS ──────────────────────────────────────────── */
.game-list,
.student-list {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.card img {
  border-radius: 8px;
  align-self: flex-start;
}

.card button {
  margin-top: 0.4rem;
  align-self: flex-start;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--transition), transform var(--transition);
}

.card button:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.card-alumno {
  position: relative;
}

.alumno-evin-icon {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  width: 60px;
  height: auto;
}

.foto-carnet {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.alumno-activo-label {
  margin-top: 0.5rem;
  color: var(--accent-green);
  font-weight: 700;
}

.avatar-alumno {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.perfil-avatar {
  width: 72px;
  height: 72px;
  border: 3px solid rgba(255,255,255,0.3);
}


/* ── 9. BOTONES GENERALES ─────────────────────────────────── */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  border: none;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger {
  background: var(--accent);
  color: #fff;
}

.btn-danger:hover {
  background: #c1121f;
  transform: translateY(-1px);
}

.btn-secundario {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--border-strong);
}

.btn-secundario:hover {
  background: var(--surface-2);
  border-color: var(--primary);
}


/* ── 10. FORMULARIOS ──────────────────────────────────────── */
input,
select,
textarea {
  font-family: var(--font-family);
  font-size: 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  background: var(--surface);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.12);
}

input[type="search"] {
  width: 100%;
  padding: 0.55rem 1.1rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
}

.form-error {
  color: #7f1d1d;
  background: #fff1f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.form-success {
  color: #14532d;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
  display: block;
}

.form-links {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  text-align: center;
}

.strength-bar {
  display: flex;
  gap: 4px;
  margin-top: 0.4rem;
}

.strength-bar span {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.3s ease;
}

.strength-label {
  font-size: 0.8rem;
  margin-top: 0.2rem;
  font-weight: 600;
}


/* ── 11. MODAL ────────────────────────────────────────────── */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#modal.hidden {
  display: none;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 480px;
  width: 90%;
  padding: 2rem 2.2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  font-family: var(--font-family);
}

.modal-content h2 {
  margin: 0 0 0.8rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--primary);
  font-weight: 700;
}

#modalDesc {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-line;
}

#closeModal {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.6rem;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
}

#closeModal:hover {
  color: var(--accent);
  background: #fff1f2;
}


/* ── 12. BADGES ───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0.1rem 0 0.35rem;
}

.badge-fácil   { background: #dcfce7; color: #166534; }
.badge-medio   { background: #fef9c3; color: #713f12; }
.badge-difícil { background: #fee2e2; color: #7f1d1d; }

.badge-progreso {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.progreso-alto  { background: #dcfce7; color: #166534; }
.progreso-medio { background: #fef9c3; color: #713f12; }
.progreso-bajo  { background: #fee2e2; color: #991b1b; }

.user-role-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
  color: #fff;
  background: var(--primary);
}

.rol-profesor { background: var(--primary); color: #fff; }
.rol-tecnico  { background: #0f766e;         color: #fff; }
.rol-padre    { background: #c2410c;         color: #fff; }
.rol-alumno   { background: #16a34a;         color: #fff; }


/* ── 13. JUEGO — MEMORIA VISUAL ───────────────────────────── */
.memoria-panel-controles {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.memoria-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}

.memoria-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(60px, 1fr));
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto 2rem;
}

.memoria-card {
  position: relative;
  width: 100%;
  padding-top: 100%;
  cursor: pointer;
  perspective: 700px;
}

.memoria-card-inner {
  position: absolute;
  inset: 0;
  transition: transform 0.3s ease;
  transform-style: preserve-3d;
}

.memoria-card.memoria-girada .memoria-card-inner,
.memoria-card.memoria-acertada .memoria-card-inner {
  transform: rotateY(180deg);
}

.memoria-card-front,
.memoria-card-back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 700;
}

.memoria-card-front {
  background: linear-gradient(135deg, #4361ee, #3f37c9);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.memoria-card-back {
  background: linear-gradient(135deg, #f0f4ff, #e8ecff)!important;
  color: var(--primary);
  font-size: 2rem;
  transform: rotateY(180deg);
}

.memoria-card.memoria-acertada .memoria-card-back {
  background: #2ecc71;
  color: #fff;
}


/* ── 14. JUEGO — RECUERDA LAS CASILLAS ───────────────────── */
.grid-panel-controles {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.grid-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}

.grid-tablero {
  display: grid;
  gap: 0.4rem;
  max-width: 420px;
  margin: 0 auto 2rem;
}

.grid-celda {
  width: 100%;
  padding-top: 100%;
  position: relative;
  border-radius: 8px;
  background: #535456;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform var(--transition);
}

.grid-celda-inner {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
}

.grid-celda-objetivo    { background: #ffb703; outline: 3px dashed var(--primary); }
.grid-celda-seleccionada { background: #8ecae6; outline: 3px solid #0077b6; }
.grid-celda-correcta    { background: #2ecc71; outline: 3px solid #155d27; }
.grid-celda-incorrecta  { background: #e63946; outline: 3px solid #7a0c14; }
.grid-celda-eracorrecta { background: #ffb703; }


/* ── 15. JUEGO — RADAR VISUAL ─────────────────────────────── */
.radar-grid {
  display: grid;
  gap: 8px;
  justify-content: center;
}

.radar-cell {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
}

.radar-img               { max-width: 80%; max-height: 80%; }
.radar-cell-seleccionada { outline: 4px solid var(--primary); box-shadow: 0 0 4px rgba(0,0,0,0.4); }
.radar-cell-correcta     { outline: 4px solid #2a9d8f; }
.radar-cell-incorrecta,
.radar-cell-faltante     { outline: 4px solid var(--accent); }


/* ── 16. MODO SOLO-JUEGO ──────────────────────────────────── */
body.solo-juego header,
body.solo-juego nav.main-nav,
body.solo-juego footer,
body.solo-juego #app-juegos,
body.solo-juego #alumnos,
body.solo-juego #usuario,
body.solo-juego #inicio {
  display: none !important;
}

body.solo-juego {
  margin: 0;
  padding: 0;
  background: var(--light);
  min-height: 100dvh;
}

body.solo-juego main {
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
}

body.solo-juego main > section {
  margin-top: 0;
  padding: 1rem;
  min-height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}


/* ── 17. BOTÓN ALTO CONTRASTE ─────────────────────────────── */
.btn-contraste {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--primary);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.btn-contraste:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}


/* ── 18. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
  .header-container { padding: 0.4rem 0.75rem; }

  .nav-toggle { display: flex; }

  .main-nav {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--primary);
    padding: 0.5rem 0.75rem 0.75rem;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 20;
  }

  .main-nav.open { display: flex; }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.35rem;
  }

  .menu-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-login {
    margin-left: 0;
    margin-top: 0.25rem;
    width: 100%;
    justify-content: center;
  }
}

 /* ── Panel perfil usuario ─────────────────────────────────── */
#perfil-usuario-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#perfil-usuario-overlay.hidden { display: none; }

#perfil-usuario-panel {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.perfil-usuario-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.perfil-usuario-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--primary);
}

.perfil-usuario-header p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.perfil-usuario-cerrar {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.perfil-usuario-cerrar:hover {
  background: #fff1f2;
  color: var(--accent);
}

.perfil-usuario-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.perfil-usuario-body h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--primary);
}

.perfil-usuario-body h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.perfil-usuario-body h4 small {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.perfil-separador {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.75rem 0;
}

.perfil-usuario-body label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.perfil-usuario-body input {
  width: 100%;
  margin-bottom: 0.25rem;
}

.perfil-usuario-botones {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

/* Alto contraste */
body.alto-contraste #perfil-usuario-panel {
  background: #000 !important;
  border: 2px solid #fff !important;
}

body.alto-contraste .perfil-usuario-header {
  border-bottom-color: #555 !important;
}

body.alto-contraste .perfil-usuario-body h3,
body.alto-contraste .perfil-usuario-body h4,
body.alto-contraste .perfil-usuario-body label {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* ── Pantalla completa en juegos ──────────────────────────── */
section[id^="juego-"]:fullscreen,
section[id^="juego-"]:-webkit-full-screen {
  display: flex !important;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  padding: 1rem;
  box-sizing: border-box;
  background: #fff;
}

#juego-radar:fullscreen,
#juego-radar:-webkit-full-screen,
#juego-rasgos:fullscreen,
#juego-rasgos:-webkit-full-screen {
  background: #000 !important;
  color: #fff;
}

#juego-puzzle:fullscreen,
#juego-puzzle:-webkit-full-screen {
  background: #1a1a2e !important;
  color: #fff;
}

@media (max-width: 600px) {
  .memoria-grid {
    grid-template-columns: repeat(3, minmax(60px, 1fr));
  }

  .grid-tablero { max-width: 320px; }

  body.solo-juego main > section { padding: 0.75rem; }
}
