:root {
  --color-pond-deep: #0b2520;
  --color-pond-water: #113f36;
  --color-pond-surface: #1e594d;
  --color-accent-green: #38b000;
  --color-accent-lime: #70e000;
  --color-accent-cyan: #2ec4b6;
  --color-accent-gold: #ffb703;
  --color-accent-orange: #fb8500;
  --color-accent-pink: #ff5d8f;
  --color-text-light: #f4fbf7;
  --color-text-muted: #a7cfbe;
  --color-card-bg: rgba(16, 49, 43, 0.75);
  --color-card-border: rgba(112, 224, 0, 0.25);
  
  --font-display: 'Fredoka', cursive, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-subtle: 0 4px 15px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 25px rgba(112, 224, 0, 0.35);
  --shadow-water: 0 10px 30px rgba(7, 24, 21, 0.6);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-pond-deep);
  color: var(--color-text-light);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  user-select: none;
}

/* Fondo dinámico estilo estanque */
.pond-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at 50% 20%, #174e43 0%, #0d2e27 60%, #061814 100%);
  overflow: hidden;
}

.water-waves {
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 30% 40%, rgba(46, 196, 182, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 75% 65%, rgba(112, 224, 0, 0.06) 0%, transparent 45%);
  animation: waterDrift 18s ease-in-out infinite alternate;
}

@keyframes waterDrift {
  0% { transform: translate(-5%, -5%) scale(1); }
  100% { transform: translate(3%, 3%) scale(1.08); }
}

/* Contenedor Principal */
.game-wrapper {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header / Barra Superior */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background: rgba(14, 43, 37, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-subtle);
  margin-bottom: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 2rem;
  animation: subtleBounce 2.5s ease-in-out infinite;
  display: inline-block;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a7f3d0 0%, #38b000 60%, #ffd166 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-accent-gold);
}

.icon-button {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.2s ease;
  color: var(--color-text-light);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.08);
}

/* Control de Pantallas */
.screen {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.screen.active {
  display: block;
  opacity: 1;
}

/* Banner Hero */
.hero-banner {
  text-align: center;
  padding: 1.8rem 1rem 2.2rem;
}

.frog-mascot {
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: center;
}

.frog-avatar-anim {
  position: relative;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, #2d6a4f 0%, #1b4332 80%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--color-accent-lime);
  box-shadow: var(--shadow-glow);
}

.frog-emoji {
  font-size: 3rem;
  animation: frogHop 3s ease-in-out infinite;
}

.ripple-ring {
  position: absolute;
  inset: -12px;
  border: 2px solid rgba(112, 224, 0, 0.4);
  border-radius: 50%;
  animation: rippleSpread 2.5s infinite;
}

@keyframes rippleSpread {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes frogHop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes subtleBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-3px) rotate(-4deg); }
  75% { transform: translateY(-3px) rotate(4deg); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: #f1faee;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
  color: var(--color-text-muted);
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Tarjetas de Minijuegos */
.minigames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.75rem;
  padding: 0.5rem 0 3rem;
}

.game-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow-water);
}

.game-card:hover {
  transform: translateY(-8px);
  border-color: var(--color-accent-lime);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), var(--shadow-glow);
}

.card-badge {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: rgba(112, 224, 0, 0.15);
  border: 1px solid var(--color-accent-lime);
  color: var(--color-accent-lime);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.card-illustration {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 1rem;
}

.card-emoji {
  font-size: 4.2rem;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

.sub-emoji {
  font-size: 2.2rem;
  position: absolute;
  bottom: 5px;
  right: 25%;
  animation: subtleBounce 2.5s infinite;
}

.card-content h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.card-content p {
  color: var(--color-text-muted);
  font-size: 0.98rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.card-meta {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-left: 3px solid var(--color-accent-cyan);
}

.meta-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-accent-gold);
}

/* Botones con estilo videojuego */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #38b000 0%, #226f00 100%);
  color: #fff;
  border-bottom: 4px solid #144400;
  box-shadow: 0 4px 12px rgba(56, 176, 0, 0.35);
  width: 100%;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(56, 176, 0, 0.5);
}

.btn-primary:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e5f6df;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 3px solid rgba(0, 0, 0, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.btn-arrow {
  transition: transform 0.2s ease;
}

.game-card:hover .btn-arrow {
  transform: translateX(4px);
}

/* PANTALLA DE JUEGO (GAMEPLAY SCREEN) */
body.in-gameplay {
  overflow: hidden !important;
  touch-action: none !important;
  overscroll-behavior: none !important;
  -webkit-overflow-scrolling: auto !important;
  height: 100vh;
}

body.in-gameplay .game-wrapper {
  min-height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  padding: 0.75rem 1rem;
}

#gameplayScreen {
  flex-direction: column;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#gameplayScreen.active {
  display: flex;
}

.gameplay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(16, 49, 43, 0.85);
  border: 1px solid var(--color-card-border);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.gameplay-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #a7f3d0;
  text-align: center;
}

.gameplay-score-display {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-accent-gold);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.score-label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.score-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-accent-gold);
  min-width: 40px;
  text-align: right;
}

.gameplay-container {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 540;
  max-height: 70vh;
  background: #09201b;
  border-radius: var(--radius-lg);
  border: 3px solid rgba(112, 224, 0, 0.3);
  overflow: hidden;
  box-shadow: var(--shadow-water), 0 0 30px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: contain;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.interactive-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  touch-action: none;
}

.interactive-overlay > * {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  touch-action: none;
}

/* MODAL DE RESULTADOS / GAME OVER */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 15, 12, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-backdrop.hidden {
  display: none;
  opacity: 0;
}

.modal-card {
  background: linear-gradient(160deg, #16463d 0%, #0d2c25 100%);
  border: 2px solid var(--color-accent-lime);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem 2rem;
  max-width: 440px;
  width: 90%;
  text-align: center;
  position: relative;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-ribbon {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent-lime);
  color: #0b2520;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.35rem 1.4rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.modal-card h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.4rem;
  color: #fff;
}

.modal-card p {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.score-summary-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.05rem;
  color: var(--color-text-muted);
}

.summary-row strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #fff;
}

.summary-row.new-record {
  color: var(--color-accent-gold);
  font-weight: 700;
  font-size: 1.15rem;
  justify-content: center;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(0.97); }
  100% { transform: scale(1.03); }
}

.modal-actions {
  display: flex;
  gap: 1rem;
}

.modal-actions .btn {
  flex: 1;
}

/* Estilos de controles y botones para el minijuego de Sinfonía */
.simon-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 400px;
  width: 100%;
  padding: 1rem;
}

.simon-pad {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.simon-pad:hover {
  transform: scale(1.05);
}

.simon-pad:active, .simon-pad.active {
  transform: scale(0.95);
  filter: brightness(1.6);
  box-shadow: 0 0 35px var(--glow-color, #fff);
}

.simon-pad.green { background: radial-gradient(circle, #52b788 0%, #2d6a4f 100%); --glow-color: #70e000; }
.simon-pad.blue { background: radial-gradient(circle, #48cae4 0%, #0077b6 100%); --glow-color: #00b4d8; }
.simon-pad.yellow { background: radial-gradient(circle, #ffd166 0%, #f77f00 100%); --glow-color: #ffd166; }
.simon-pad.red { background: radial-gradient(circle, #ff758f 0%, #c9184a 100%); --glow-color: #ff4d6d; }

.simon-pad-note {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  margin-top: 4px;
}

/* Notificación o overlay dentro del juego */
.game-instructions-overlay {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  color: #e2fced;
  border: 1px solid rgba(112, 224, 0, 0.4);
  pointer-events: none;
  animation: fadeInOut 4s forwards;
  z-index: 10;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translate(-50%, -10px); }
  15%, 80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* Zona de Controles táctiles / D-Pad inferior (para no tapar la pantalla) */
.gameplay-controls-area {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.85rem;
  padding: 0.25rem 0 0.5rem;
}

.mobile-dpad-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(14, 43, 37, 0.85);
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(112, 224, 0, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(112, 224, 0, 0.15);
  touch-action: none;
}

.dpad-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dpad-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2.5px solid rgba(112, 224, 0, 0.7);
  background: linear-gradient(135deg, #2d6a4f 0%, #1b4332 100%);
  color: #fff;
  font-size: 1.6rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
  transition: transform 0.08s ease, background 0.08s ease, box-shadow 0.08s ease;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.dpad-btn:active, .dpad-btn.pressed {
  transform: scale(0.91);
  background: linear-gradient(135deg, #70e000 0%, #38b000 100%);
  color: #0b2520;
  box-shadow: 0 0 20px rgba(112, 224, 0, 0.9);
}

.dpad-center {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  opacity: 0.9;
  pointer-events: none;
}

/* Evitar scroll, pull-to-refresh o zoom en el canvas en móviles */
#gameCanvas {
  touch-action: none;
}

/* Responsividad para móviles */
@media (max-width: 768px) {
  .virtual-dpad-container {
    bottom: 8px;
    right: 8px;
  }

  .dpad-btn {
    width: 48px;
    height: 48px;
    font-size: 1.2rem;
  }

  .hero-title {
    font-size: 2rem;
  }
  
  .game-card {
    padding: 1.25rem;
  }
  
  .gameplay-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .gameplay-title {
    order: 3;
    width: 100%;
  }

  .wardrobe-body {
    flex-direction: column !important;
  }
}

/* Badge especial para juegos de niños */
.badge-kids {
  background: rgba(255, 183, 3, 0.18) !important;
  border-color: #ffd166 !important;
  color: #ffd166 !important;
  animation: pulse 1.8s infinite alternate;
}

/* Botón de acceso al Armario */
.wardrobe-nav-btn {
  background: linear-gradient(135deg, #ff758f 0%, #c9184a 100%) !important;
  color: #fff !important;
  border: 1px solid #ff4d6d !important;
  box-shadow: 0 4px 14px rgba(255, 77, 109, 0.4) !important;
}

.wardrobe-nav-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 18px rgba(255, 77, 109, 0.6) !important;
}

/* Mascota en el menú principal */
#heroMascotTrigger {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#heroMascotTrigger:hover {
  transform: scale(1.08);
}

.mascot-touch-hint {
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: #ffd166;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 209, 102, 0.3);
  animation: subtleBounce 2s infinite ease-in-out;
}

/* Renderizador de Mascota con Ropa */
.mascot-avatar {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-hat {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  z-index: 10;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
  animation: subtleBounce 2s infinite ease-in-out;
}

.mascot-glasses {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  z-index: 9;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.mascot-body-shape {
  width: 76px;
  height: 64px;
  background: var(--mascot-color, #52b788);
  border: 3px solid var(--mascot-accent, #38b000);
  border-radius: 50% 50% 45% 45%;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mascot-eyes {
  display: flex;
  gap: 16px;
  margin-top: -12px;
}

.mascot-eye {
  width: 24px;
  height: 24px;
  background: #fff;
  border: 2.5px solid var(--mascot-accent, #38b000);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mascot-pupil {
  width: 9px;
  height: 9px;
  background: #0f201a;
  border-radius: 50%;
}

.mascot-mouth {
  width: 22px;
  height: 10px;
  border-bottom: 3px solid #1b4332;
  border-radius: 0 0 12px 12px;
  margin-top: 6px;
}

.mascot-cheeks {
  display: flex;
  gap: 36px;
  position: absolute;
  top: 24px;
}

.mascot-blush {
  width: 10px;
  height: 6px;
  background: rgba(255, 117, 143, 0.6);
  border-radius: 50%;
}

/* MODAL DEL ARMARIO */
.wardrobe-card {
  background: linear-gradient(160deg, #134237 0%, #0c2b23 100%);
  border: 2px solid var(--color-accent-lime);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(112, 224, 0, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 650px;
  width: 94%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wardrobe-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 0.75rem;
}

.wardrobe-header h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: #fff;
}

.close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #ff5d8f;
  transform: scale(1.1);
}

.wardrobe-body {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.wardrobe-preview-box {
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(112, 224, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 2.2rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 170px;
}

.preview-tag {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: #ffd166;
  margin-top: 1rem;
}

.wardrobe-catalog {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.wardrobe-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-md);
}

.wtab-btn {
  flex: 1;
  padding: 0.5rem;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.wtab-btn.active {
  background: var(--color-accent-lime);
  color: #0b2520;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.wardrobe-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 0.75rem;
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
}

.wardrobe-item-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  transition: all 0.2s ease;
}

.wardrobe-item-card.equipped {
  border-color: var(--color-accent-lime);
  background: rgba(112, 224, 0, 0.1);
}

.skin-color-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.item-emoji-display {
  font-size: 2rem;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.btn-wear {
  background: var(--color-accent-lime);
  color: #09201b;
  border: none;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: bold;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.btn-wear:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

.btn-buy {
  background: #ffb703;
  color: #2b1d00;
  border: none;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.btn-buy:hover {
  filter: brightness(1.15);
  transform: scale(1.05);
}

.tag-equipped {
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--color-accent-lime);
  text-transform: uppercase;
}

.wardrobe-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 0.75rem;
  display: flex;
  justify-content: flex-end;
}

.wallet-display {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-accent-gold);
}

/* ========================================================
   ESTILOS DE MINIJUEGO 9: PIANO CROAC (PIANO DE COLA REAL)
======================================================== */
.real-piano-stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.6rem 0.8rem 0.6rem;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 25%, #183e35 0%, #081a16 100%);
  overflow: hidden;
  user-select: none;
}

/* Barra superior de herramientas */
.piano-top-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10;
}

.toolbar-cluster {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.toolbar-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: #a7f3d0;
  margin-right: 0.15rem;
}

.piano-inst-btn, .piano-song-tab, .drum-loop-btn, .drum-action-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f1faee;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.12s ease;
}

.piano-inst-btn:hover, .piano-song-tab:hover, .drum-loop-btn:hover, .drum-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.piano-inst-btn.active, .piano-song-tab.active, .drum-loop-btn.active {
  background: var(--color-accent-lime);
  color: #06201a;
  border-color: #70e000;
  box-shadow: 0 0 12px rgba(112, 224, 0, 0.6);
}

.drum-action-btn {
  background: linear-gradient(135deg, #f77f00, #d62828);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 3px 10px rgba(247, 127, 0, 0.4);
}

.drum-action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(247, 127, 0, 0.6);
}

/* Banner de canción guiada */
.piano-song-banner {
  background: rgba(10, 25, 20, 0.85);
  border: 2px solid var(--color-accent-gold);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #ffd166;
  font-family: var(--font-display);
  margin-top: 0.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

.song-title-group {
  display: flex;
  flex-direction: column;
}

.song-title-text {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffd166;
}

.song-hint-text {
  font-size: 0.8rem;
  color: #bbf7d0;
}

.song-progress-tag {
  background: var(--color-accent-gold);
  color: #2b1800;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

/* Mueble del Piano de Cola Real */
.grand-piano-casing {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #24130c 0%, #150a06 80%, #0d0604 100%);
  border-radius: 14px;
  border: 3.5px solid #3d2115;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), inset 0 2px 4px rgba(255, 255, 255, 0.15);
  margin-top: 0.4rem;
  overflow: hidden;
  position: relative;
}

/* Tapa frontal de madera lacada del piano (Fallboard) */
.piano-fallboard {
  height: 48px;
  background: linear-gradient(180deg, #2c160e 0%, #180b07 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 2px solid #4a2718;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.piano-fallboard-accent-line {
  position: absolute;
  top: 4px;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.4), transparent);
}

.piano-brand-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #ffd166;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 12px rgba(255, 209, 102, 0.3);
}

.brand-crest {
  font-size: 1.1rem;
}

.fallboard-reflection-glare {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.05), transparent);
}

/* Tira de fieltro rojo aterciopelado superior */
.piano-felt-dampener {
  height: 6px;
  background: linear-gradient(180deg, #990f1d 0%, #680510 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.8);
  z-index: 5;
}

/* Base del teclado con bloques laterales de madera */
.piano-keyboard-bed {
  flex: 1;
  display: flex;
  align-items: stretch;
  background: #0d0604;
  position: relative;
  min-height: 180px;
}

.piano-cheek-block {
  width: 18px;
  background: linear-gradient(90deg, #24130c, #130905);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.8);
  z-index: 4;
}

.piano-cheek-block.right {
  background: linear-gradient(270deg, #24130c, #130905);
}

/* Conjunto de teclas blancas y negras superpuestas */
.piano-keys-assembly {
  flex: 1;
  position: relative;
  display: flex;
  height: 100%;
}

/* Teclas Blancas: Distribuidas equitativamente */
.white-keys-row {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 2px;
  background: #111;
  padding: 0 1px;
}

.piano-key.white-key {
  flex: 1;
  height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #fbf9f4 65%, #eae3d2 95%, #ded5c0 100%);
  border: 1px solid #d6cebe;
  border-bottom: 6px solid #b8ab94;
  border-radius: 0 0 6px 6px;
  box-shadow: inset 0 1px 0 #fff, inset -1px 0 2px rgba(0,0,0,0.1), 0 5px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 0.6rem;
  cursor: pointer;
  position: relative;
  transition: transform 0.06s ease, border-bottom 0.06s ease, background 0.06s ease;
  user-select: none;
  touch-action: none;
  z-index: 1;
}

.piano-key.white-key:hover {
  background: linear-gradient(180deg, #ffffff 0%, #fdfcf9 65%, #f2ecdf 100%);
}

.piano-key.white-key.key-pressed {
  transform: translateY(4px);
  border-bottom: 2px solid #998a75;
  background: linear-gradient(180deg, #f0eae1 0%, #e2dac9 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.25), 0 1px 2px rgba(0, 0, 0, 0.5);
}

.white-key-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}

.key-note-label {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #2b1800;
}

.key-shortcut-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #4b3619;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  padding: 1px 6px;
}

/* Teclas Negras (Sostenidos) */
.black-keys-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 58%;
  pointer-events: none;
  z-index: 3;
}

.piano-key.black-key {
  position: absolute;
  top: 0;
  width: 6.4%;
  height: 100%;
  background: linear-gradient(180deg, #3a3a3a 0%, #202020 60%, #0d0d0d 100%);
  border: 1px solid #1a1a1a;
  border-bottom: 6px solid #000;
  border-radius: 0 0 4px 4px;
  box-shadow: 3px 5px 10px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 0.4rem;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  transition: transform 0.06s ease, border-bottom 0.06s ease, background 0.06s ease;
}

.piano-key.black-key:hover {
  background: linear-gradient(180deg, #484848 0%, #292929 60%, #141414 100%);
}

.piano-key.black-key.key-pressed {
  transform: translateY(3px);
  border-bottom: 2px solid #000;
  background: linear-gradient(180deg, #222 0%, #111 100%);
  box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.9);
}

.black-key-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  pointer-events: none;
}

.black-note-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffd166;
}

.black-shortcut-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  padding: 0 4px;
}

/* Indicadores de estrellas y ranitas en teclas */
.key-star-marker {
  display: none;
  font-size: 1.5rem;
  position: absolute;
  top: 10px;
  animation: starBounceAnim 0.7s infinite alternate ease-in-out;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.7));
  z-index: 5;
}

.key-star-marker.black-star {
  font-size: 1.2rem;
  top: 4px;
}

.piano-key.target-star-key .key-star-marker {
  display: block;
}

.piano-key.target-star-key {
  animation: starKeyPulse 0.8s infinite alternate ease-in-out;
}

@keyframes starBounceAnim {
  0% { transform: translateY(0); }
  100% { transform: translateY(-7px); }
}

@keyframes starKeyPulse {
  0% { filter: drop-shadow(0 0 4px #ffd166); }
  100% { filter: drop-shadow(0 0 16px #ffd166); }
}

.key-frog-peek {
  display: none;
  font-size: 1.3rem;
  position: absolute;
  top: -12px;
  animation: peekPop 0.18s ease-out;
  z-index: 6;
}

.piano-key.key-pressed .key-frog-peek {
  display: block;
}

@keyframes peekPop {
  0% { transform: translateY(8px) scale(0.6); opacity: 0; }
  100% { transform: translateY(0) scale(1.1); opacity: 1; }
}

.piano-key.key-wrong {
  animation: keyShake 0.28s ease-in-out;
  background: #ffb4a2 !important;
}

@keyframes keyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Barra inferior frontal de madera del piano (Keyslip) */
.piano-keyslip {
  height: 24px;
  background: linear-gradient(180deg, #1f0f08 0%, #130805 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
}

.keyslip-hint {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-family: var(--font-body);
}

/* Partícula musical flotante */
.piano-flying-spark {
  position: absolute;
  font-size: 1.8rem;
  pointer-events: none;
  animation: floatSparkUp 0.85s forwards ease-out;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  z-index: 60;
}

@keyframes floatSparkUp {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  100% { transform: translateY(-70px) scale(1.4) rotate(16deg); opacity: 0; }
}


/* ========================================================
   ESTILOS DE MINIJUEGO 10: BATERÍA DE LA CHARCA (SET ACÚSTICO)
======================================================== */
.real-drum-stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.5rem 0.8rem 0.6rem;
  box-sizing: border-box;
  background: radial-gradient(circle at 50% 35%, #183e35 0%, #071713 100%);
  overflow: hidden;
  position: relative;
  user-select: none;
}

/* Barra superior de ritmos */
.drum-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10;
}

.drum-bar-section {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.drum-section-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffd166;
}

/* Escenario central de la batería */
.drum-kit-stage-area {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
  min-height: 220px;
}

/* Alfombra circular de batería (Persian Rug) */
.drum-persian-rug {
  position: absolute;
  width: 90%;
  height: 90%;
  max-width: 680px;
  max-height: 380px;
  background: radial-gradient(ellipse at 50% 50%, #44171d 0%, #2a0c10 70%, #150508 100%);
  border-radius: 50%;
  border: 4px solid #b07d50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 25px rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.rug-inner-border {
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(255, 209, 102, 0.35);
  border-radius: 50%;
}

.rug-center-medallion {
  font-size: 3rem;
  opacity: 0.2;
}

/* Disposición general del Set de Batería */
.drum-kit-layout {
  position: relative;
  width: 100%;
  max-width: 740px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  z-index: 3;
}

.drum-row-upper, .drum-row-lower {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 1.1rem;
}

.drum-row-upper {
  margin-bottom: -15px;
}

/* Componentes comunes de la batería */
.drum-component {
  position: relative;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  transition: transform 0.08s ease, filter 0.08s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drum-component:hover {
  transform: scale(1.04);
}

/* PLATILLOS (Hi-Hat, Crash, Ride): Textura de bronce torneado con surcos concéntricos */
.cymbal-metallic-disc {
  border-radius: 50%;
  background: radial-gradient(circle at 45% 45%, #fff0ad 0%, #e9b44c 35%, #b8860b 70%, #7d5705 100%);
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.65), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hihat-disc {
  width: 90px;
  height: 90px;
  background: radial-gradient(circle at 45% 45%, #fff5c2 0%, #f4a261 40%, #c86b1f 80%, #753b0a 100%);
}

.crash-disc {
  width: 105px;
  height: 105px;
  background: radial-gradient(circle at 45% 45%, #ffe699 0%, #f39c12 40%, #c0392b 85%, #641e16 100%);
}

.ride-disc {
  width: 115px;
  height: 115px;
  background: radial-gradient(circle at 45% 45%, #ffebad 0%, #e67e22 45%, #a04000 85%, #582103 100%);
}

/* Campana central elevada del platillo */
.cymbal-center-bell {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #ffd166 60%, #996515 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cymbal-center-bell.big-bell {
  width: 34px;
  height: 34px;
}

.cymbal-badge {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  margin-top: 26px;
}

.key-shortcut-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 2px;
}

/* Animación de oscilación y bamboleo de platillo al golpearlo */
.cymbal-component.cymbal-wobble .cymbal-metallic-disc {
  animation: cymbalWobbleAnim 0.55s ease-out;
}

@keyframes cymbalWobbleAnim {
  0% { transform: rotate3d(1, 0.5, 0, 22deg) scale(0.96); filter: brightness(1.4); }
  25% { transform: rotate3d(1, 0.5, 0, -16deg) scale(1.02); }
  50% { transform: rotate3d(1, 0.5, 0, 10deg); }
  75% { transform: rotate3d(1, 0.5, 0, -5deg); }
  100% { transform: rotate3d(0, 0, 0, 0deg) scale(1); filter: brightness(1); }
}

/* TAMBORES (Toms y Caja): Parches acústicos con aros cromados y bellotas */
.drumhead-surface {
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.7);
}

/* Aros cromados de afinación */
.drum-chrome-rim {
  position: absolute;
  inset: -4px;
  border: 4px solid #cfd8dc;
  border-radius: 50%;
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.7), 0 3px 6px rgba(0,0,0,0.6);
  pointer-events: none;
}

/* Toms aéreos 1 y 2 */
.tom-head {
  width: 82px;
  height: 82px;
  background: radial-gradient(circle at 45% 45%, #a7f3d0 0%, #2d6a4f 60%, #1b4332 100%);
  border: 2px solid #52b788;
}

.drum-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Caja acústica (Snare) */
.snare-casing {
  position: relative;
}

.snare-head {
  width: 98px;
  height: 98px;
  background: radial-gradient(circle at 45% 45%, #ffffff 0%, #f1faee 50%, #d8e2dc 85%, #b0bec5 100%);
  border: 2px solid #fff;
}

.snare-head .drum-label {
  color: #1d3557;
  text-shadow: none;
}

.snare-head .key-shortcut-tag {
  background: #1d3557;
}

/* Tom de suelo / Goliat */
.floortom-head {
  width: 105px;
  height: 105px;
  background: radial-gradient(circle at 45% 45%, #a7f3d0 0%, #1e594d 55%, #0f3029 100%);
  border: 2px solid #2ec4b6;
}

/* Animación de compresión y vibración de tambores */
.drum-component.drum-vibrate .drumhead-surface {
  animation: drumHeadVibrate 0.22s ease-out;
}

@keyframes drumHeadVibrate {
  0% { transform: scale(0.92); filter: brightness(1.3); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* GRAN BOMBO (BASS DRUM) EN EL CENTRO */
.kick-casing {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.bass-drum-cylinder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bass-drum-front-head {
  width: 155px;
  height: 140px;
  border-radius: 48%;
  background: radial-gradient(circle at 50% 40%, #1f5e50 0%, #0d2e27 65%, #051411 100%);
  border: 5px solid #2d6a4f;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.bass-drum-outer-hoop {
  position: absolute;
  inset: -6px;
  border: 5px solid #d4af37;
  border-radius: 48%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.6), inset 0 1px 2px rgba(255,255,255,0.4);
  pointer-events: none;
}

/* Emblema frontal del bombo */
.bass-drum-frog-emblem {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.emblem-frog-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
}

.emblem-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffd166;
  letter-spacing: 1px;
  text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

.emblem-subtitle {
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  color: #a7f3d0;
  letter-spacing: 1px;
}

.bass-sound-port {
  position: absolute;
  bottom: 12px;
  right: 18px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #000;
  border: 2px solid #555;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.9);
}

.kick-center-tag {
  display: none;
}

.kick-shortcut {
  position: absolute;
  bottom: 6px;
  background: rgba(0, 0, 0, 0.7);
  font-size: 0.72rem;
  padding: 1px 8px;
}

/* Animación de golpe en el bombo */
.kick-casing.drum-vibrate .bass-drum-front-head {
  animation: kickThump 0.22s ease-out;
}

@keyframes kickThump {
  0% { transform: scale(0.95); filter: brightness(1.3); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); filter: brightness(1); }
}

/* Pedal de Bombo con maza animada */
.kick-pedal-unit {
  position: absolute;
  bottom: -22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  z-index: 5;
}

.pedal-beater {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform-origin: bottom center;
  transition: transform 0.08s ease;
}

.beater-head {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f1faee;
  border: 2px solid #333;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.beater-rod {
  width: 3px;
  height: 22px;
  background: #cfd8dc;
}

.pedal-beater.beater-kick-action {
  animation: beaterStrike 0.16s ease-out;
}

@keyframes beaterStrike {
  0% { transform: rotateX(-35deg) scale(0.9); }
  50% { transform: rotateX(25deg) scale(1.1); }
  100% { transform: rotateX(0deg); }
}

.pedal-footboard {
  width: 38px;
  height: 18px;
  background: linear-gradient(180deg, #90a4ae 0%, #455a64 100%);
  border: 1px solid #cfd8dc;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.6);
}

.pedal-text {
  font-size: 0.58rem;
  font-weight: 700;
  color: #fff;
}

/* Baquetas animadas de madera */
.drumstick {
  position: absolute;
  width: 8px;
  height: 52px;
  background: linear-gradient(90deg, #d4a373, #faedcd);
  border-radius: 4px;
  border: 1px solid #bc6c25;
  box-shadow: 0 4px 10px rgba(0,0,0,0.6);
  pointer-events: none;
  opacity: 0;
  z-index: 50;
  transform-origin: bottom center;
}

.drumstick::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 8px;
  background: #faedcd;
  border-radius: 50%;
}

.drumstick.stick-strike {
  opacity: 1;
  animation: stickSnap 0.2s ease-out;
}

@keyframes stickSnap {
  0% { transform: translate(-50%, -100%) rotate(-30deg) scale(1.2); opacity: 1; }
  50% { transform: translate(-50%, -50%) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -100%) rotate(15deg) scale(0.9); opacity: 0; }
}

/* Bocadillo cómico de sonido en la batería */
.drum-comic-splash {
  position: absolute;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  pointer-events: none;
  animation: popWordSplash 0.65s forwards ease-out;
  transform: translate(-50%, -50%);
  text-shadow: 0 0 10px rgba(0,0,0,0.9), 0 2px 4px #000;
  z-index: 60;
}

@keyframes popWordSplash {
  0% { transform: translate(-50%, 0) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -45px) scale(1.3); opacity: 0; }
}

/* Barra inferior con guía rápida */
.drum-bottom-guide {
  font-size: 0.76rem;
  color: var(--color-text-muted);
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-top: 0.3rem;
  z-index: 10;
}

.drum-bottom-guide strong {
  color: #ffd166;
}

/* Adaptación responsive para pantallas móviles / tablets */
@media (max-width: 768px) {
  .drum-row-upper, .drum-row-lower {
    gap: 0.45rem;
  }
  .hihat-disc { width: 62px; height: 62px; }
  .crash-disc { width: 72px; height: 72px; }
  .ride-disc { width: 78px; height: 78px; }
  .tom-head { width: 58px; height: 58px; }
  .snare-head { width: 68px; height: 68px; }
  .floortom-head { width: 72px; height: 72px; }
  .bass-drum-front-head { width: 110px; height: 98px; }
  .emblem-frog-icon { font-size: 1.5rem; }
  .emblem-title { font-size: 0.75rem; }
  .emblem-subtitle { font-size: 0.5rem; }
  .cymbal-badge, .drum-label { font-size: 0.65rem; }

  .piano-cheek-block { width: 8px; }
  .key-note-label { font-size: 0.85rem; }
  .black-note-label { font-size: 0.65rem; }
  .key-shortcut-badge, .black-shortcut-badge { display: none; }
}

/* ========================================================
   ESTILOS DE RANKINGS Y PERFIL DE JUGADOR
======================================================== */
.player-nav-btn {
  background: rgba(46, 196, 182, 0.15) !important;
  border-color: rgba(46, 196, 182, 0.4) !important;
  color: #a7f3d0 !important;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-nav-btn:hover {
  background: rgba(46, 196, 182, 0.25) !important;
  box-shadow: 0 0 14px rgba(46, 196, 182, 0.4);
}

.ranking-nav-btn {
  background: rgba(255, 183, 3, 0.18) !important;
  border-color: rgba(255, 183, 3, 0.45) !important;
  color: #ffd166 !important;
}

.ranking-nav-btn:hover {
  background: rgba(255, 183, 3, 0.3) !important;
  box-shadow: 0 0 16px rgba(255, 183, 3, 0.5);
}

/* Card del Modal de Rankings */
.rankings-modal-card {
  background: linear-gradient(180deg, #102d26 0%, #0a1f1a 100%);
  border: 2px solid rgba(255, 209, 102, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(255, 209, 102, 0.2);
  border-radius: var(--radius-lg);
  width: 95%;
  max-width: 660px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  box-sizing: border-box;
  animation: modalPopIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPopIn {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.rankings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.rankings-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rankings-title-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

.rankings-title-row h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #ffd166;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* Selector horizontal de minijuegos con chips */
.rankings-games-scroller {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.2rem 0.2rem 0.6rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.rankings-games-scroller::-webkit-scrollbar {
  height: 5px;
}

.rankings-games-scroller::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.rank-game-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.rank-game-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transform: translateY(-1px);
}

.rank-game-chip.active {
  background: linear-gradient(135deg, #38b000, #226f00);
  border-color: #70e000;
  color: #fff;
  box-shadow: 0 0 12px rgba(112, 224, 0, 0.5);
}

.chip-emoji {
  font-size: 1.1rem;
}

/* Barra de pestañas de tipo de ranking (Todos los niños / Top / Personal) */
.rankings-tab-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.3rem;
  border-radius: var(--radius-md);
  margin-top: 0.4rem;
}

.rank-tab-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.3rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
}

.rank-tab-btn small {
  font-size: 0.65rem;
  font-weight: normal;
  opacity: 0.8;
}

.rank-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.rank-tab-btn.active {
  background: rgba(255, 209, 102, 0.2);
  color: #ffd166;
  border: 1px solid rgba(255, 209, 102, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.rank-tab-description {
  font-size: 0.78rem;
  color: #bbf7d0;
  text-align: center;
  background: rgba(16, 185, 129, 0.1);
  border: 1px dashed rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
  margin: 0.5rem 0;
}

/* Lista de clasificaciones */
.rankings-list-container {
  flex: 1;
  overflow-y: auto;
  min-height: 260px;
  max-height: 52vh;
  margin-top: 0.2rem;
  padding-right: 0.3rem;
}

.rankings-list-container::-webkit-scrollbar {
  width: 6px;
}

.rankings-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.rankings-loading, .rankings-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 220px;
  text-align: center;
  color: var(--color-text-muted);
}

.loading-spin {
  font-size: 2.4rem;
  animation: frogHop 1.2s infinite;
  margin-bottom: 0.5rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.6rem;
  opacity: 0.7;
}

.rankings-empty-state h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fff;
  margin-bottom: 0.3rem;
}

.rankings-empty-state p {
  font-size: 0.85rem;
  max-width: 320px;
}

/* ========================================================
   SALÓN DE LA FAMA: PODIO 3D Y TARJETAS DE CLASIFICACIÓN
======================================================== */

/* Contenedor del Podio de Campeones */
.podium-stage-container {
  background: radial-gradient(circle at 50% 20%, rgba(255, 209, 102, 0.18) 0%, rgba(13, 37, 30, 0.95) 75%);
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.2rem 0.8rem 0.5rem;
  margin-bottom: 1.2rem;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.podium-stage-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ffd166, transparent);
  opacity: 0.8;
}

.podium-stage-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffd166;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  margin-bottom: 1rem;
}

/* Fila de las 3 columnas del podio */
.podium-slots-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.8rem;
  padding: 0 0.5rem;
}

.podium-column {
  flex: 1;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Animación de la Corona Flotante para el 1º puesto */
.crown-float-anim {
  font-size: 1.8rem;
  animation: crownHover 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.8));
  margin-bottom: -0.3rem;
  z-index: 5;
}

@keyframes crownHover {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  50% { transform: translateY(-7px) scale(1.12) rotate(4deg); }
}

/* Tarjeta de jugador sobre el pedestal */
.podium-player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 0.5rem;
  text-align: center;
  transition: transform 0.2s ease;
}

.podium-player-card:hover {
  transform: translateY(-3px);
}

.podium-player-card.is-current-user {
  background: rgba(112, 224, 0, 0.15);
  padding: 0.35rem 0.25rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(112, 224, 0, 0.6);
}

/* Wrapper del avatar con resplandor */
.podium-avatar-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4rem;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.podium-column.first-place .podium-avatar-wrapper {
  width: 74px;
  height: 74px;
}

.podium-avatar {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.6));
}

.podium-avatar.gold-avatar {
  font-size: 2.7rem;
}

/* Resplandores según metal */
.gold-glow {
  border-color: #ffd166 !important;
  box-shadow: 0 0 20px rgba(255, 209, 102, 0.6), inset 0 0 10px rgba(255, 209, 102, 0.4);
}

.silver-glow {
  border-color: #e0e1dd !important;
  box-shadow: 0 0 14px rgba(224, 225, 221, 0.45), inset 0 0 8px rgba(224, 225, 221, 0.3);
}

.bronze-glow {
  border-color: #cd7f32 !important;
  box-shadow: 0 0 14px rgba(205, 127, 50, 0.45), inset 0 0 8px rgba(205, 127, 50, 0.3);
}

/* Medallas en el avatar */
.podium-medal-badge {
  position: absolute;
  bottom: -6px;
  background: rgba(0, 0, 0, 0.8);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  color: #fff;
}

.podium-medal-badge.gold-badge {
  background: linear-gradient(135deg, #ffd166, #b38600);
  color: #1a0f00;
  border-color: #ffe699;
  font-size: 0.78rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Nombres y puntuaciones en el podio */
.podium-player-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #e2e8f0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.podium-player-name.gold-name {
  color: #ffd166;
  font-size: 0.98rem;
}

.podium-score-val {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: #70e000;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.podium-score-val small {
  font-size: 0.65rem;
  color: var(--color-text-muted);
}

.podium-score-val.gold-score {
  font-size: 1.25rem;
  color: #ffe699;
}

/* Pedestales 3D con efecto de escalón */
.pedestal-block {
  width: 100%;
  border-radius: 8px 8px 2px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0.5rem;
  position: relative;
  box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.35), 0 8px 15px rgba(0, 0, 0, 0.5);
}

.pedestal-rank-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.pedestal-cup-icon {
  font-size: 1.1rem;
  margin-top: 0.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Alturas y colores de los 3 pedestales */
.gold-pedestal {
  height: 110px;
  background: linear-gradient(180deg, #ffc837 0%, #ff8008 100%);
  border-top: 3px solid #ffea85;
  color: #3b2200;
}

.silver-pedestal {
  height: 80px;
  background: linear-gradient(180deg, #e0e1dd 0%, #778da9 100%);
  border-top: 3px solid #ffffff;
  color: #1b263b;
}

.bronze-pedestal {
  height: 60px;
  background: linear-gradient(180deg, #d48b52 0%, #8c4a1e 100%);
  border-top: 3px solid #f2b88b;
  color: #2b1305;
}

/* Hueco vacío en podio si no hay suficientes participantes */
.podium-empty-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 90px;
  opacity: 0.4;
  margin-bottom: 0.5rem;
}

.empty-pedestal-icon {
  font-size: 1.8rem;
  filter: grayscale(0.8);
}

.empty-pedestal-text {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* ========================================================
   LISTA DETALLADA: GAMER CARDS CON MEDIDORES VISUALES
======================================================== */
.rankings-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.list-section-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: #a7f3d0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
  padding-left: 0.2rem;
}

/* Tarjeta individual de jugador en el ranking */
.rank-row-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.rank-row-card:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Destacados para los 3 primeros en la lista */
.rank-row-card.rank-row-gold {
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.2) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: rgba(255, 209, 102, 0.55);
}

.rank-row-card.rank-row-silver {
  background: linear-gradient(90deg, rgba(224, 225, 221, 0.16) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(224, 225, 221, 0.45);
}

.rank-row-card.rank-row-bronze {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.16) 0%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(205, 127, 50, 0.45);
}

/* Tarjeta del jugador actual ("¡TÚ!") */
.rank-row-card.rank-row-you {
  border: 2px solid #70e000 !important;
  background: linear-gradient(90deg, rgba(112, 224, 0, 0.22) 0%, rgba(6, 32, 26, 0.7) 100%) !important;
  box-shadow: 0 0 14px rgba(112, 224, 0, 0.35);
}

/* Escudo de Posición (#1, #2, etc.) */
.rank-pos-shield {
  min-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shield-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffd166;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.rank-row-card.rank-row-gold .shield-text {
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.5), rgba(179, 134, 0, 0.4));
  border-color: #ffd166;
  color: #fff;
}

/* Globo de Avatar del Jugador */
.rank-avatar-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.5));
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.orb-emoji {
  font-size: 1.7rem;
  line-height: 1;
}

/* Zona de Información (Nombre, fecha y barra) */
.rank-info-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.rank-name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.rank-player-title {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.you-badge-pill {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  background: #70e000;
  color: #06201a;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  animation: pulseGlow 1.8s infinite;
  box-shadow: 0 0 8px rgba(112, 224, 0, 0.6);
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.85; }
}

.rank-time-label {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-left: auto;
  white-space: nowrap;
}

/* Barra Medidora Visual de Puntuación */
.rank-meter-bar {
  width: 100%;
  height: 7px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #38b000 0%, #70e000 60%, #ffd166 100%);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 6px rgba(112, 224, 0, 0.5);
}

/* Caja de Puntuación (Derecha) */
.rank-score-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-right: 3px solid #70e000;
  min-width: 65px;
  flex-shrink: 0;
}

.rank-row-card.rank-row-gold .rank-score-box {
  border-right-color: #ffd166;
  background: rgba(255, 209, 102, 0.15);
}

.big-score-digit {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffd166;
  line-height: 1;
}

.score-unit-text {
  font-size: 0.68rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* Responsividad para móviles y pantallas pequeñas */
@media (max-width: 520px) {
  .rankings-modal-card {
    padding: 0.9rem 0.65rem;
    width: 98%;
  }

  .podium-stage-container {
    padding: 0.8rem 0.4rem 0.4rem;
  }

  .podium-slots-row {
    gap: 0.35rem;
    padding: 0;
  }

  .podium-avatar-wrapper {
    width: 48px;
    height: 48px;
  }

  .podium-column.first-place .podium-avatar-wrapper {
    width: 60px;
    height: 60px;
  }

  .podium-avatar {
    font-size: 1.8rem;
  }

  .podium-avatar.gold-avatar {
    font-size: 2.2rem;
  }

  .crown-float-anim {
    font-size: 1.4rem;
  }

  .gold-pedestal { height: 85px; }
  .silver-pedestal { height: 60px; }
  .bronze-pedestal { height: 46px; }

  .pedestal-rank-num {
    font-size: 1.4rem;
  }

  .rank-row-card {
    padding: 0.45rem 0.55rem;
    gap: 0.45rem;
  }

  .rank-pos-shield {
    min-width: 40px;
  }

  .shield-text {
    font-size: 0.82rem;
    padding: 0.15rem 0.35rem;
  }

  .rank-avatar-orb {
    width: 36px;
    height: 36px;
  }

  .orb-emoji {
    font-size: 1.35rem;
  }

  .rank-player-title {
    max-width: 105px;
    font-size: 0.86rem;
  }

  .big-score-digit {
    font-size: 1.1rem;
  }

  .rank-score-box {
    padding: 0.25rem 0.5rem;
    min-width: 52px;
  }
}

/* Pie de Rankings con perfil actual */
.rankings-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 0.65rem;
  margin-top: 0.65rem;
  display: flex;
  justify-content: center;
}

.footer-player-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.footer-player-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-accent-lime);
}

.player-avatar-mini {
  font-size: 1.15rem;
}

.edit-hint-tag {
  font-size: 0.75rem;
  color: var(--color-accent-gold);
}

/* ========================================================
   MODAL DE PERFIL / CAMBIO DE NOMBRE DE JUGADOR
======================================================== */
.profile-modal-card {
  background: linear-gradient(180deg, #102d26 0%, #081a15 100%);
  border: 2px solid rgba(112, 224, 0, 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 25px rgba(112, 224, 0, 0.25);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 440px;
  padding: 1.4rem;
  box-sizing: border-box;
  animation: modalPopIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.6rem;
  margin-bottom: 0.85rem;
}

.profile-header h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #a7f3d0;
}

.profile-desc {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffd166;
  margin-bottom: 0.4rem;
}

.avatar-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}

.avatar-pick-chip {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.18);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.avatar-pick-chip:hover {
  transform: scale(1.12);
  background: rgba(255, 255, 255, 0.2);
}

.avatar-pick-chip.selected {
  background: var(--color-accent-lime);
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(112, 224, 0, 0.7);
}

.profile-name-field {
  margin-bottom: 1.4rem;
}

.input-group {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.8rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-group:focus-within {
  border-color: var(--color-accent-lime);
  box-shadow: 0 0 16px rgba(112, 224, 0, 0.4);
}

.input-avatar-preview {
  font-size: 1.6rem;
  margin-right: 0.6rem;
}

.input-group input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: normal;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-actions .btn {
  width: 100%;
}
