/* ══════════════════════════════════════════════════════════════
   🐠 ESTILOS — Atrapa el Concepto
   Estética cartoon submarina • Parodia • Sin assets externos
   ══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@600;700;800;900&display=swap');

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

:root {
  --sky: #1a9cd4;
  --ocean-top: #0e8cc4;
  --ocean-mid: #0b6fa0;
  --ocean-deep: #074b70;
  --sand: #f5d77b;
  --sand-dark: #e0b84c;
  --coral: #ff5e8a;
  --coral-dark: #e84870;
  --coral-light: #ff9db5;
  --green: #4cd964;
  --green-dark: #35b748;
  --red: #ff3b5c;
  --red-dark: #d63048;
  --yellow: #ffcc02;
  --yellow-dark: #e6b300;
  --white: #ffffff;
  --text-dark: #2d1b0e;
  --purple: #b87deb;
  --header-h: 52px;
}

html, body {
  width: 100%; height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: 'Nunito', 'Fredoka One', -apple-system, sans-serif;
  background: #06121e;
  color: var(--white);
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}

/* ─── Fondo del body ── */
body {}

/* ─── Burbujas flotando ───────────────────────── */
.bubbles-container {
  position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden;
}
.bubble {
  position: absolute; bottom: -40px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.2), rgba(255,255,255,0.03));
  border-radius: 50%;
  animation: rise linear infinite;
}
@keyframes rise {
  0% { transform: translateY(0) scale(1); opacity: 0.35; }
  50% { opacity: 0.5; }
  100% { transform: translateY(-110vh) scale(0.4); opacity: 0; }
}

/* ─── App container ────────────────────────────── */
#app {
  width: 100%; height: 100%;
  height: 100dvh;
  position: relative; overflow: hidden;
}

/* ─── Pantallas ────────────────────────────────── */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.35s, transform 0.35s;
  z-index: 1;
}
.screen.hidden {
  opacity: 0; pointer-events: none;
  transform: scale(0.92);
  z-index: 0;
}

/* ═══════════════════════════════════════════════
   PANTALLA BIENVENIDA (sin scroll, todo en viewport)
   ═══════════════════════════════════════════════ */
#welcome-screen {
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0;
  text-align: center; gap: 0.4rem;
  background:
    linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)),
    url('../assets/welcome-bg.webp') center/cover no-repeat;
  justify-content: flex-start;
  overflow: hidden;
}

.welcome-box-img {
  width: 100%;
  max-height: 35vh;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  animation: box-movement 5s ease-in-out infinite;
  transform-origin: 50% 80%;
}

/* La caja se mueve sutilmente cada 5s como si algo se moviera dentro */
@keyframes box-movement {
  0%, 84% { transform: translateY(0) rotate(0deg) scale(1); }
  86% { transform: translateY(-3px) rotate(-1deg) scale(1.01); }
  89% { transform: translateY(0) rotate(1.5deg) scale(1.02); }
  92% { transform: translateY(-4px) rotate(-1.5deg) scale(1.01); }
  95% { transform: translateY(0) rotate(0.5deg) scale(1.02); }
  98% { transform: translateY(-2px) rotate(0deg) scale(1); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

/* Info de la clase */
.class-info {
  flex-shrink: 0;
  padding: 0.5rem 1.2rem;
  text-align: center;
  background: rgba(0,0,0,0.35);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  margin: 0.5rem 0.8rem 0 0.8rem;
  border: 1px solid rgba(255,255,255,0.08);
}
.class-facilitator {
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  color: var(--yellow);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.class-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem;
  color: var(--white);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  line-height: 1.1;
}
.class-institution {
  font-size: 0.8rem;
  font-weight: 800;
  color: rgba(255,255,255,0.6);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  letter-spacing: 1px;
}

/* Link al ranking (copa) */
.dashboard-link {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: 2px solid rgba(255,204,2,0.4);
  color: var(--yellow);
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
  transition: all 0.2s;
}
.dashboard-link:active { transform: scale(0.9); background: rgba(255,204,2,0.25); }

.players-online {
  font-size: 0.7rem; font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.add-to-home {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
}

/* Narrativa del juego */
.game-narrative {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  margin: 0 0.8rem;
  background: rgba(0,0,0,0.35);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
}
.game-narrative strong {
  color: var(--white);
}

.name-input-group { width: 100%; max-width: 260px; flex-shrink: 0; }
.name-input-wrap {
  position: relative;
  display: flex; align-items: center;
}
.name-input-wrap input {
  width: 100%;
  padding: 0.65rem 2.4rem 0.65rem 1rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem; font-weight: 700;
  border: 3px solid var(--white);
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  color: var(--text-dark);
  text-align: center; outline: none;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
  transition: transform 0.15s, border-color 0.2s;
}
.name-input-wrap input:focus {
  border-color: var(--coral);
  transform: scale(1.03);
  box-shadow: 0 3px 0 rgba(0,0,0,0.15), 0 0 0 5px rgba(255,94,138,0.2);
}
.name-input-wrap input::placeholder {
  color: #b0b0b0; font-weight: 600;
}
.name-input-wrap input[readonly] {
  background: rgba(255,255,255,0.6);
  color: #555;
  cursor: default;
}

.btn-edit-name {
  position: absolute; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.2);
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.btn-edit-name:active { background: rgba(0,0,0,0.4); }
.btn-edit-name.hidden { display: none; }

.btn-play {
  padding: 0.65rem 2.5rem;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  color: var(--white);
  background: linear-gradient(180deg, var(--coral-light) 0%, var(--coral) 40%, var(--coral-dark) 100%);
  border: none;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 4px 0 #c03050, 0 8px 20px rgba(255,94,138,0.4);
  transition: transform 0.1s, box-shadow 0.1s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  flex-shrink: 0;
}
.btn-play:active { transform: translateY(3px); box-shadow: 0 2px 0 #c03050, 0 5px 15px rgba(255,94,138,0.3); }
.btn-play:disabled { opacity: 0.45; transform: none; box-shadow: 0 3px 0 rgba(0,0,0,0.2); cursor: default; }

.quick-instructions {
  display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap;
  flex-shrink: 0;
}
.instruction-chip {
  padding: 0.3rem 0.65rem;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  font-size: 0.7rem; font-weight: 700;
  color: var(--white);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════════════
   PANTALLA JUEGO
   ═══════════════════════════════════════════════ */
#game-screen {
  display: flex; flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  background:
    url('../assets/game-bg.webp') no-repeat;
  background-size: 112% auto;
  background-position: 0% 0%;
}

.game-header {
  height: var(--header-h); width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0.6rem;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(4px);
  z-index: 20; flex-shrink: 0;
  border-bottom: 2px solid rgba(255,255,255,0.06);
  gap: 0.4rem;
}

.btn-exit {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,59,92,0.15);
  border: 1.5px solid rgba(255,59,92,0.3);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-exit:active { background: rgba(255,59,92,0.35); }

.game-timer {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem; color: var(--white);
  display: flex; align-items: center; gap: 0.3rem;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
  min-width: 55px;
}
.game-timer.urgent {
  color: var(--red);
  animation: pulse-urgent 0.4s ease-in-out infinite alternate;
}
@keyframes pulse-urgent {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

.game-score {
  font-family: 'Fredoka One', cursive;
  font-size: 1.5rem; color: var(--yellow);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3), 0 0 18px rgba(255,204,2,0.5);
}

.player-name-tag {
  font-size: 0.75rem; font-weight: 700;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  max-width: 100px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.game-header-right {
  display: flex; align-items: center; gap: 0.3rem;
}
.streak-badge {
  font-size: 0.8rem; font-weight: 800;
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255,204,2,0.5);
  transition: opacity 0.2s;
}
.shields-badge {
  font-size: 0.9rem;
  letter-spacing: -1px;
}

/* ─── Área de juego ──────────────────────────── */
#game-area {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

/* Fondo del game area (overlay sutil sobre el fondo marino) */
#game-area::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, transparent 70%, rgba(224,184,76,0.3) 90%, rgba(200,160,60,0.5) 100%);
  z-index: 0;
  pointer-events: none;
}

/* Algas decorativas */
#game-area::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 40px;
  background:
    radial-gradient(ellipse 20px 35px at 10% 90%, var(--green) 0%, transparent 70%),
    radial-gradient(ellipse 15px 28px at 25% 88%, var(--green-dark) 0%, transparent 70%),
    radial-gradient(ellipse 22px 38px at 50% 92%, var(--green) 0%, transparent 70%),
    radial-gradient(ellipse 18px 30px at 72% 89%, var(--green-dark) 0%, transparent 70%),
    radial-gradient(ellipse 20px 33px at 90% 91%, var(--green) 0%, transparent 70%);
  z-index: 1; pointer-events: none;
}

/* Líneas de carril (más cartoon) */
.lane-lines {
  position: absolute; inset: 0; pointer-events: none; z-index: 1;
}
.lane-line {
  position: absolute; top: 5%; height: 80%;
  width: 3px;
  background: repeating-linear-gradient(
    180deg,
    rgba(255,255,255,0.08) 0px,
    rgba(255,255,255,0.08) 8px,
    transparent 8px,
    transparent 16px
  );
}

/* ─── Personaje (Patricio PNG) ────────────────── */
#character {
  position: absolute;
  bottom: 70px;
  width: 90px; height: 110px;
  transform: translateX(-50%);
  transition: left 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,0.3));
}

.char-img {
  width: 100%; height: 100%;
  object-fit: contain;
  animation: char-bounce 0.6s ease-in-out infinite alternate;
}

@keyframes char-bounce {
  0% { transform: translateY(0) rotate(-2deg) scale(1); }
  100% { transform: translateY(-6px) rotate(2deg) scale(1.04); }
}

/* ─── Partículas de arena (piso) ──────────────── */
@keyframes float-particle {
  0% { transform: translateY(0) translateX(0); opacity: 0.6; }
  100% { transform: translateY(-40px) translateX(10px); opacity: 0; }
}

/* ─── Objetos cayendo (burbujas cartoon) ─────── */
.falling-object {
  position: absolute;
  width: 80%;
  max-width: 130px;
  padding: 0.55rem 0.4rem;
  border-radius: 22px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.78rem; font-weight: 800;
  text-align: center;
  pointer-events: none;
  z-index: 5;
  word-break: break-word; hyphens: auto;
  line-height: 1.2;
  letter-spacing: -0.2px;
  animation: float-wobble 0.35s ease-in-out infinite alternate;
  transition: none;
  border: 3px solid rgba(255,255,255,0.3);
}
@keyframes float-wobble {
  0% { transform: translateX(-50%) rotate(-3deg); }
  100% { transform: translateX(-50%) rotate(3deg); }
}
.falling-object.good {
  background: linear-gradient(180deg, #5eeaaa 0%, var(--green) 100%);
  color: var(--text-dark);
  box-shadow: 0 4px 0 var(--green-dark), 0 8px 18px rgba(0,0,0,0.2);
}
.falling-object.bad {
  background: linear-gradient(180deg, #ff6b7a 0%, var(--red) 100%);
  color: white;
  box-shadow: 0 4px 0 var(--red-dark), 0 8px 18px rgba(0,0,0,0.2);
}
.falling-object.super-bad {
  background: linear-gradient(180deg, #ff1744 0%, #b71c1c 100%);
  color: white;
  font-size: 0.95rem;
  padding: 0.75rem 0.5rem;
  max-width: 150px;
  box-shadow: 0 5px 0 #7f0000, 0 0 20px rgba(255,23,68,0.5);
  animation: super-bad-pulse 0.5s ease-in-out infinite alternate;
  border: 3px solid rgba(255,255,255,0.3);
}
@keyframes super-bad-pulse {
  0% { transform: translateX(-50%) rotate(-4deg) scale(1); }
  100% { transform: translateX(-50%) rotate(4deg) scale(1.06); }
}
.falling-object.shield {
  background: linear-gradient(180deg, #64b5f6 0%, #2196f3 100%);
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 4px 0 #1565c0, 0 8px 18px rgba(33,150,243,0.4);
  animation: shield-glow 0.6s ease-in-out infinite alternate;
}
@keyframes shield-glow {
  0% { box-shadow: 0 4px 0 #1565c0, 0 8px 18px rgba(33,150,243,0.4); }
  100% { box-shadow: 0 4px 0 #1565c0, 0 8px 30px rgba(33,150,243,0.7); }
}

/* ─── Footer touch (sin texto, solo dots) ────── */
.game-footer {
  height: 0; width: 100%;
  flex-shrink: 0;
}
.touch-zone {
  flex: 1;
}

/* ─── Feedback flotante ──────────────────────── */
.feedback-float {
  position: absolute;
  font-family: 'Fredoka One', cursive;
  font-size: 1.5rem;
  pointer-events: none;
  z-index: 25;
  animation: pop-score 0.7s ease-out forwards;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}
.feedback-float.positive { color: var(--yellow); }
.feedback-float.negative { color: var(--red); }
.feedback-float.shield { color: #64b5f6; font-size: 1.8rem; }
.feedback-float.shield-block { color: #64b5f6; }
@keyframes pop-score {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -20px) scale(1.3); }
  100% { opacity: 0; transform: translate(-50%, -55px) scale(0.8); }
}

/* ─── Screen shake ───────────────────────────── */
.screen-shake {
  animation: shake 0.35s ease-out;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  15% { transform: translateX(-8px) rotate(-0.5deg); }
  30% { transform: translateX(8px) rotate(0.5deg); }
  45% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

/* ─── Countdown overlay ──────────────────────── */
.countdown-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s;
}
.countdown-overlay.hidden { opacity: 0; pointer-events: none; }
.countdown-text {
  font-family: 'Fredoka One', cursive;
  font-size: 6rem; color: var(--white);
  text-shadow: 0 0 40px rgba(255,255,255,0.5), 4px 4px 0 rgba(0,0,0,0.3);
  animation: count-pop 0.3s ease-out;
}
@keyframes count-pop {
  0% { transform: scale(1.5); opacity: 0.3; }
  100% { transform: scale(1); opacity: 1; }
}

/* ─── Waiting box (esperando ronda) ──────────── */
.waiting-box {
  display: flex; flex-direction: column;
  align-items: center; gap: 0.6rem;
  padding: 1.5rem 2rem;
  background: rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  backdrop-filter: blur(10px);
}
.waiting-spinner {
  font-size: 2rem; color: var(--yellow);
  text-shadow: 0 0 15px rgba(255,204,2,0.4);
}
.waiting-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem; color: var(--white);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.waiting-sub {
  font-size: 0.75rem; color: rgba(255,255,255,0.5);
}

/* ─── Combo flash ───────────────────────────── */
.combo-flash {
  position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%);
  font-family: 'Fredoka One', cursive;
  font-size: 1.6rem; color: var(--yellow);
  text-shadow: 0 0 25px rgba(255,204,2,0.8), 2px 2px 0 rgba(0,0,0,0.4);
  z-index: 30; pointer-events: none;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
}
.combo-flash.show { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }

/* ─── Players online ────────────────────────── */
.players-online {
  font-size: 0.75rem; font-weight: 700;
  color: rgba(255,255,255,0.6);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  flex-shrink: 0;
}

/* ─── Result streak ─────────────────────────── */
.result-streak {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem; color: var(--yellow);
  text-shadow: 0 0 12px rgba(255,204,2,0.5);
  min-height: 1.2rem;
}

/* ─── Podium ────────────────────────────────── */
.result-podium {
  width: 100%; max-width: 280px;
  background: rgba(0,0,0,0.35);
  border-radius: 14px;
  padding: 0.5rem 0.8rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.podium-title {
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem; color: var(--yellow);
  margin-bottom: 0.3rem;
}
.podium-row {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0;
  font-size: 0.8rem; color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.podium-row:last-child { border-bottom: none; }
.podium-medal { font-size: 1.1rem; }
.podium-score {
  margin-left: auto;
  font-family: 'Fredoka One', cursive;
  font-size: 0.8rem;
  color: var(--yellow);
}

/* ═══════════════════════════════════════════════
   PANTALLA RESULTADO (2 pestañas, sin scroll)
   ═══════════════════════════════════════════════ */
#result-screen {
  padding: 0; text-align: center; gap: 0;
  background:
    linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    url('../assets/welcome-bg.webp') center/cover no-repeat;
  justify-content: flex-start;
  overflow: hidden;
}

/* Tabs */
.result-tabs {
  display: flex; flex-shrink: 0;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}
.result-tab {
  flex: 1;
  padding: 0.7rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem; font-weight: 700;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.result-tab.active {
  color: var(--white);
  border-bottom-color: var(--coral);
  background: rgba(255,94,138,0.1);
}

/* Tab content */
.result-tab-content {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 0.6rem;
  gap: 0.4rem;
  overflow: hidden;
}
.result-tab-content.active {
  display: flex;
}
/* Tab conceptos permite scroll interno */
#tab-conceptos {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
  padding-top: 0.8rem;
}

/* Tab resumen: contenido arriba, botones abajo */
#tab-resumen {
  justify-content: space-between;
  gap: 0.4rem;
  padding-top: 0.5rem;
  padding-bottom: 0.8rem;
}

.resumen-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 0.4rem;
  width: 100%;
}

.resumen-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  flex-shrink: 0;
}

/* Score compact */
.result-score {
  font-family: 'Fredoka One', cursive;
  font-size: 3.5rem; font-weight: 900;
  color: var(--yellow);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.5), 0 0 30px rgba(255,204,2,0.5);
  line-height: 1;
}
.result-score-label {
  font-size: 0.75rem; font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 2px;
}
.result-streak {
  font-family: 'Fredoka One', cursive;
  font-size: 1rem; color: var(--yellow);
  text-shadow: 0 0 10px rgba(255,204,2,0.5);
  min-height: 1rem;
}

.result-stats { display: flex; gap: 1.2rem; flex-shrink: 0; }
.result-stat { text-align: center; }
.result-stat-value {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem; color: var(--white);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}
.result-stat-label {
  font-size: 0.7rem; font-weight: 700;
  color: rgba(255,255,255,0.6);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
}
.result-rank {
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 0.85rem;
  color: var(--white);
  padding: 0.4rem 1.2rem;
  background: rgba(0,0,0,0.4);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.btn-replay {
  padding: 0.65rem 1.8rem;
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem; font-weight: 700;
  color: var(--white);
  background: linear-gradient(180deg, #33b5e5 0%, var(--ocean-top) 100%);
  border: none;
  border-radius: 22px;
  cursor: pointer;
  box-shadow: 0 3px 0 #0d7aad;
  transition: transform 0.1s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  flex-shrink: 0;
  margin-top: auto;
}
.btn-replay:active { transform: translateY(2px); box-shadow: 0 1px 0 #0d7aad; }

.btn-home {
  padding: 0.5rem 1.5rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem; font-weight: 700;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-home:active { background: rgba(255,255,255,0.15); }

.btn-mute {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  padding: 0;
}
.btn-mute:active { background: rgba(255,255,255,0.2); }
.btn-mute.muted { color: rgba(255,59,92,0.7); border-color: rgba(255,59,92,0.3); }

/* Tab conceptos */
.result-concepts-tab {
  width: 100%; text-align: left;
  flex: 1;
}
.concepts-section {
  margin-bottom: 0.8rem;
}
.concepts-label {
  font-weight: 800; font-size: 1.1rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  display: flex; align-items: center; gap: 0.4rem;
}
.concepts-label i { font-size: 1.2rem; }
.good-label { color: var(--green); }
.bad-label { color: var(--red); }
.concepts-list {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.concept-tag {
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  font-size: 0.75rem; font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.concept-tag:active {
  transform: scale(0.95);
  box-shadow: 0 0 8px rgba(255,255,255,0.3);
}
.concept-tag.good {
  background: rgba(76,217,100,0.3);
  color: #5ef08a;
  border: 1px solid rgba(76,217,100,0.5);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}
.concept-tag.bad {
  background: rgba(255,59,92,0.3);
  color: #ff6b7a;
  border: 1px solid rgba(255,59,92,0.5);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}
.concept-empty {
  font-size: 0.8rem; font-style: italic;
  color: rgba(255,255,255,0.55);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════════════
   DASHBOARD DOCENTE
   ═══════════════════════════════════════════════ */
.dashboard-body {
  background: url('assets/welcome-bg.webp') center/cover fixed no-repeat;
  min-height: 100vh;
  font-family: 'Nunito', sans-serif;
}
.dashboard-container {
  width: 100%; max-width: 700px;
  margin: 0 auto; padding: 1rem;
  overflow-y: auto; overflow-x: hidden;
}

/* Header */
.dash-header {
  text-align: center; padding: 1rem 0 0.5rem;
}
.dash-header-img {
  width: 100%; max-width: 300px;
  max-height: 30vh;
  object-fit: contain;
  display: block; margin: 0 auto;
}
.dash-header-text h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 1.4rem; color: var(--white);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  margin-top: 0.3rem;
}
.dash-header-text h1 span { color: var(--coral); }
.dash-header-text p {
  font-weight: 700; font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}

/* Stats */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem; margin: 1rem 0;
}
.stat-card {
  background: rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 18px; padding: 0.8rem 0.5rem;
  text-align: center;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}
.stat-card-value {
  font-family: 'Fredoka One', cursive;
  font-size: 2rem; font-weight: 800; line-height: 1;
}
.stat-card-value.total { color: var(--white); text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.stat-card-value.playing { color: var(--yellow); text-shadow: 0 0 10px rgba(255,204,2,0.4); }
.stat-card-value.finished { color: var(--green); text-shadow: 0 0 10px rgba(76,217,100,0.3); }
.stat-card-label {
  font-size: 0.65rem; font-weight: 800; color: rgba(255,255,255,0.55);
  margin-top: 0.2rem; text-transform: uppercase; letter-spacing: 1px;
}

/* Ranking */
.ranking-table-wrap {
  background: rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 18px; overflow: hidden;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}
.ranking-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ranking-table th {
  background: rgba(0,0,0,0.3);
  padding: 0.6rem 0.5rem; text-align: left;
  font-size: 0.65rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
}
.ranking-table td {
  padding: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ranking-table tr:last-child td { border-bottom: none; }
.ranking-table .rank-num {
  font-family: 'Fredoka One', cursive;
  font-weight: 700; color: rgba(255,255,255,0.4); text-align: center; width: 35px;
}
.ranking-table tr:nth-child(1) .rank-num { color: var(--yellow); }
.ranking-table tr:nth-child(2) .rank-num { color: #c0c0c0; }
.ranking-table tr:nth-child(3) .rank-num { color: #cd7f32; }
.ranking-table .player-name {
  font-weight: 700; color: var(--white);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ranking-table .player-score {
  font-family: 'Fredoka One', cursive;
  font-weight: 700; color: var(--yellow); text-align: center;
}
.status-badge {
  display: inline-block; padding: 0.15rem 0.5rem;
  border-radius: 15px;
  font-size: 0.6rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.status-badge.waiting { background: rgba(150,150,150,0.25); color: #aaa; }
.status-badge.playing { background: rgba(255,204,2,0.25); color: var(--yellow); animation: pulse-urgent 1.2s ease-in-out infinite alternate; }
.status-badge.finished { background: rgba(76,217,100,0.25); color: var(--green); }

/* Controles */
.dashboard-controls {
  display: flex; gap: 0.5rem; margin-top: 0.8rem;
  justify-content: center; flex-wrap: wrap;
}
.btn-dash {
  padding: 0.5rem 1rem;
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem; font-weight: 700;
  border-radius: 20px; cursor: pointer;
  border: 2px solid rgba(255,255,255,0.15);
  transition: transform 0.1s;
  background: rgba(0,0,0,0.3);
  color: var(--white);
  box-shadow: 0 3px 0 rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
}
.btn-dash:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.2); }
.btn-auto { background: rgba(76,217,100,0.2); border-color: rgba(76,217,100,0.4); color: var(--green); }
.btn-auto.off { background: rgba(150,150,150,0.15); border-color: rgba(150,150,150,0.2); color: #999; }
.btn-round { background: rgba(255,94,138,0.2); border-color: rgba(255,94,138,0.4); color: var(--coral); }
.btn-reset { background: transparent; color: var(--red); border-color: rgba(255,59,92,0.4); }

/* Footer */
.dash-footer {
  text-align: center; margin-top: 1rem; padding-bottom: 1rem;
  font-size: 0.7rem; font-weight: 700;
  color: rgba(255,255,255,0.45);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}

.empty-state {
  text-align: center; padding: 2rem 1rem; color: rgba(255,255,255,0.35);
  font-weight: 700; font-size: 0.85rem;
}
.empty-state .icon { font-size: 2rem; display: block; margin-bottom: 0.3rem; }

/* ═══════════════════════════════════════════════
   MODAL DE DEFINICIÓN (estilo submarino cartoon)
   ═══════════════════════════════════════════════ */
.def-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: opacity 0.2s;
}
.def-modal.hidden {
  opacity: 0; pointer-events: none;
}
.def-modal-card {
  background: linear-gradient(180deg, #0d2137 0%, #0a1628 60%, rgba(224,184,76,0.15) 100%);
  border: 3px solid rgba(255,107,157,0.25);
  border-radius: 24px;
  padding: 1.5rem 1.2rem;
  margin: 1rem;
  max-width: 320px; width: 100%;
  text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,0.3), 0 16px 35px rgba(0,0,0,0.5);
  backdrop-filter: blur(16px);
  position: relative;
}
/* Decoración: nubecitas-flor en las esquinas del modal */
.def-modal-card::before {
  content: '🌸';
  position: absolute; top: -14px; left: -8px;
  font-size: 1.5rem; opacity: 0.6; pointer-events: none;
}
.def-modal-card::after {
  content: '🌸';
  position: absolute; bottom: -14px; right: -8px;
  font-size: 1.5rem; opacity: 0.6; pointer-events: none;
  transform: scaleX(-1);
}
.def-modal-title {
  font-family: 'Fredoka One', cursive;
  font-size: 1.3rem;
  color: var(--yellow);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.4), 0 0 15px rgba(255,204,2,0.3);
  margin-bottom: 0.8rem;
}
.def-modal-body {
  font-size: 0.9rem;
  color: #e0e6ed;
  line-height: 1.6;
  margin-bottom: 1.2rem;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
}
.def-modal-close {
  padding: 0.5rem 1.8rem;
  font-family: 'Fredoka One', cursive;
  font-size: 0.85rem;
  color: var(--white);
  background: linear-gradient(180deg, var(--coral-light) 0%, var(--coral) 40%, #e84870 100%);
  border: none;
  border-radius: 25px;
  cursor: pointer;
  box-shadow: 0 4px 0 #c03050;
  transition: transform 0.1s;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}
.def-modal-close:active { transform: translateY(2px); box-shadow: 0 2px 0 #c03050; }
