/* ==========================================================================
   CSS GENERAL - TEMA MÁGICO HARRY POTTER
   ========================================================================== */

:root {
  /* Paleta General */
  --bg-dark: #07090e;
  --bg-dark-rgb: 7, 9, 14;
  --bg-panel: rgba(18, 22, 33, 0.7);
  --border-gold: rgba(211, 166, 37, 0.3);
  --border-gold-hover: rgba(211, 166, 37, 0.75);
  
  --gold: #d3a625;
  --gold-hover: #ffdf6d;
  --gold-glow: rgba(211, 166, 37, 0.35);
  
  --text-light: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;
  
  /* Casas de Hogwarts */
  --gryffindor: #740001;
  --gryffindor-accent: #d3a625;
  --slytherin: #2a623d;
  --slytherin-accent: #aaaaaa;
  --ravenclaw: #222f5b;
  --ravenclaw-accent: #be9063;
  --hufflepuff: #ecb939;
  --hufflepuff-accent: #372e29;

  /* Fuentes */
  --font-title: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;
  
  /* Sombras y Blurs */
  --glass-blur: blur(12px);
  --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset de Estilos */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Fondo Mágico de Fondo */
.magic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, #151a2d 0%, var(--bg-dark) 80%);
  opacity: 0.85;
}

.magic-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(211, 166, 37, 0.05) 1px, transparent 0);
  background-size: 24px 24px;
}

/* ==========================================================================
   TIPOGRAFÍA Y ELEMENTOS GENERALES
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  letter-spacing: 1px;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--gold-hover);
  text-shadow: 0 0 8px var(--gold-glow);
}

/* Barra de Scroll */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(211, 166, 37, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ==========================================================================
   BOTONES E INPUTS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-title);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  font-size: 0.95rem;
}

.btn-gold {
  background: linear-gradient(135deg, #b0891d 0%, var(--gold) 50%, #e6be44 100%);
  color: var(--bg-dark);
  border-color: #fce38a;
  box-shadow: 0 4px 14px rgba(211, 166, 37, 0.25);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold) 0%, #ffe37d 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211, 166, 37, 0.45);
}

.btn-gold:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

.btn-outline:hover {
  border-color: var(--gold);
  background: rgba(211, 166, 37, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 0 10px rgba(211, 166, 37, 0.2);
}

.btn-danger {
  background: rgba(220, 38, 38, 0.2);
  color: #fecaca;
  border: 1px solid #dc2626;
}

.btn-danger:hover {
  background: #dc2626;
  color: white;
  transform: translateY(-2px);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #128c7e 0%, #25d366 100%);
  color: white;
  border-color: #6cf19b;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
  animation: pulse-green 2s infinite;
}

.btn-whatsapp:hover {
  background: linear-gradient(135deg, #25d366 0%, #4ae582 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* Formularios */
.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.input-group label {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 12px;
  background-color: rgba(7, 9, 14, 0.8);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  color: white;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition-fast);
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(211, 166, 37, 0.3);
}

.input-group select option {
  background-color: var(--bg-dark);
  color: white;
}

/* ==========================================================================
   ESTRUCTURA SPA E INTERFAZ BASE
   ========================================================================== */

.app-header {
  background-color: rgba(7, 9, 14, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-gold);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 15px 0;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
}

.nav-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(211, 166, 37, 0.2);
}

.logo-icon {
  margin-right: 5px;
}

.nav-menu {
  display: flex;
  gap: 25px;
}

.nav-item {
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-item:hover, .nav-item.active {
  color: var(--gold);
  text-shadow: 0 0 6px rgba(211, 166, 37, 0.2);
}

/* Contenido Principal */
.app-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px;
}

/* Pie de Página */
.app-footer {
  background-color: #040508;
  border-top: 1px solid rgba(211, 166, 37, 0.15);
  padding: 30px 0 20px;
  text-align: center;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-tagline {
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.social-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: rgba(18, 22, 33, 0.5);
  border: 1px solid rgba(211, 166, 37, 0.1);
  border-radius: 8px;
  color: var(--text-light);
}

.social-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.social-card.whatsapp:hover {
  background: rgba(37, 211, 102, 0.1);
  border-color: #25d366;
}

.social-card.instagram:hover {
  background: rgba(225, 48, 108, 0.1);
  border-color: #e1306c;
}

.social-card.tiktok:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: #ff0050;
}

.social-icon {
  font-size: 1.25rem;
}

.social-text {
  font-size: 0.85rem;
  font-weight: 500;
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   CARDS DE GLASSMORPHISM (MARCOS MÁGICOS)
   ========================================================================== */

.card-glass {
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  box-shadow: var(--shadow-main);
  padding: 30px;
  text-align: center;
  transition: var(--transition-fast);
}

.card-glass:hover {
  border-color: var(--border-gold-hover);
  box-shadow: 0 10px 40px 0 rgba(211, 166, 37, 0.1);
}

/* ==========================================================================
   ELEMENTOS DE INTERFAZ DE USUARIO ESPECÍFICOS (PANTALLAS)
   ========================================================================== */

/* 1. Landing Screen */
.hero-section {
  max-width: 800px;
  margin: 40px auto;
  text-align: center;
}

.hero-logo {
  font-size: 5rem;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
  margin-bottom: 20px;
  animation: float-gently 4s ease-in-out infinite;
}

.hero-subtitle {
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 15px;
  text-transform: uppercase;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 25px;
  background: linear-gradient(to right, white, #ffdf6d, white);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 40px;
}

/* 2. Escape Rooms List */
.section-title {
  text-align: center;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 40px;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.room-card {
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.room-card:hover .room-cover-img-wrapper img {
  transform: scale(1.25) !important;
}

.room-card.status-draft {
  opacity: 0.65;
  filter: grayscale(80%);
}

.room-card.status-coming_soon {
  border-color: #78611c;
}

.room-book-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0,0,0,0.6);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--gold);
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 600;
}

.room-cover {
  font-size: 4rem;
  color: var(--gold);
  margin: 15px 0 20px;
}

.room-title {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: white;
}

.room-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 25px;
  flex-grow: 1;
}

.room-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(211, 166, 37, 0.15);
  padding-top: 15px;
  margin-bottom: 20px;
  font-size: 0.8rem;
}

.room-status-lbl {
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-title);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: bold;
}

.lbl-active {
  background-color: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border: 1px solid #2563eb;
}

.lbl-coming_soon {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fde047;
  border: 1px solid #d97706;
}

.lbl-draft {
  background-color: rgba(107, 114, 128, 0.2);
  color: #d1d5db;
  border: 1px solid #4b5563;
}

.lbl-closed {
  background-color: rgba(220, 38, 38, 0.2);
  color: #fecaca;
  border: 1px solid #dc2626;
}

/* 3. Room Detail Presentation */
.detail-layout {
  max-width: 800px;
  margin: 0 auto;
}

.detail-header {
  margin-bottom: 30px;
}

.detail-book-num {
  font-family: var(--font-title);
  color: var(--gold);
  text-transform: uppercase;
  font-size: 1rem;
  margin-bottom: 10px;
  display: block;
}

.detail-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 15px;
}

.detail-desc {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 30px;
  text-align: left;
}

.detail-info-block {
  text-align: left;
  background: rgba(7, 9, 14, 0.4);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(211, 166, 37, 0.15);
  margin-bottom: 30px;
}

.detail-info-item {
  display: flex;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.detail-info-item:last-child {
  margin-bottom: 0;
}

.detail-info-item strong {
  width: 150px;
  color: var(--gold);
  font-family: var(--font-title);
}

.detail-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

/* 4. Play Board */
.play-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 25px;
}

@media (max-width: 900px) {
  .play-layout {
    grid-template-columns: 1fr;
  }
}

.game-main-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 15px 25px;
  border-radius: 8px;
  background: rgba(7, 9, 14, 0.6);
  border: 1px solid var(--border-gold);
}

@media (max-width: 576px) {
  .game-top-bar {
    padding: 10px 15px;
    justify-content: space-around;
    gap: 8px;
  }
  .timer-area {
    font-size: 1.1rem;
  }
}

.timer-area {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-family: var(--font-title);
  color: #fca5a5;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.timer-running {
  font-weight: 700;
  animation: pulse-light-red 1s infinite alternate;
}

.game-progress-lbl {
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 0.95rem;
}

.game-score-lbl {
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--gold);
}

/* Parchment Card */
.parchment-card {
  background: radial-gradient(circle at top left, #fbf7eb 0%, #f3ebcf 100%);
  color: var(--text-dark);
  border-radius: 12px;
  border: 2px solid #8c6239;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  padding: 35px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.parchment-header {
  border-bottom: 1px dashed rgba(140, 98, 57, 0.5);
  padding-bottom: 15px;
  margin-bottom: 25px;
  text-align: center;
}

.parchment-title {
  color: #5c3e21;
  font-size: 1.6rem;
  font-weight: bold;
}

.parchment-narrative {
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: #3b2817;
  background: rgba(140, 98, 57, 0.05);
  padding: 15px 20px;
  border-radius: 6px;
  border-left: 3px solid #8c6239;
  margin-bottom: 25px;
  flex-grow: 1;
}

.parchment-question {
  font-weight: 600;
  font-size: 1.05rem;
  color: #111;
  margin-bottom: 25px;
}

/* Puzzle Inputs en el pergamino */
.puzzle-interactive-area {
  margin-bottom: 20px;
}

.puzzle-text-input {
  width: 100%;
  padding: 14px;
  border: 2px solid #8c6239 !important;
  border-radius: 8px;
  background-color: white !important;
  color: var(--text-dark) !important;
  font-size: 1.1rem;
  font-family: var(--font-body);
  margin-bottom: 15px;
}

.options-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.option-choice-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid #d4c4a8;
  background-color: rgba(251, 247, 235, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  font-weight: 500;
  color: #4b382a;
}

.option-choice-label:hover {
  background-color: #f0e6c5;
  border-color: #8c6239;
}

.option-choice-label input[type="radio"] {
  accent-color: #8c6239;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Drag and Drop Order List */
.sortable-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.sortable-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid #d4c4a8;
  background: white;
  color: var(--text-dark);
  cursor: grab;
  font-weight: 500;
}

.sortable-item:active {
  cursor: grabbing;
}

.sort-handle {
  color: #8c6239;
  font-size: 1.1rem;
}

.sort-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.sort-btn-arrow {
  padding: 6px 12px;
  background: #eae2cc;
  border: 1px solid #8c6239;
  border-radius: 4px;
  color: #5c3e21;
  cursor: pointer;
}

/* Sidebar del juego (Pistas y Chat Co-op) */
.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hints-panel {
  text-align: left;
}

.hints-title {
  font-size: 1.15rem;
  color: var(--gold);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint-box {
  background: rgba(7, 9, 14, 0.4);
  border: 1px solid rgba(211, 166, 37, 0.15);
  border-radius: 6px;
  padding: 12px 15px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.hint-box.locked {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-style: dashed;
  min-height: 50px;
}

.hint-badge {
  font-family: var(--font-title);
  color: var(--gold);
  font-weight: bold;
  margin-bottom: 5px;
  display: block;
}

/* Chat Cooperativo / Feed */
.chat-panel {
  height: 300px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.chat-title {
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 10px;
}

.chat-messages {
  flex-grow: 1;
  background: rgba(7, 9, 14, 0.5);
  border: 1px solid rgba(211, 166, 37, 0.15);
  border-radius: 6px;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
}

.chat-msg-item {
  line-height: 1.4;
}

.chat-system-msg {
  color: #93c5fd;
  font-style: italic;
  font-weight: 500;
}

.chat-user-lbl {
  font-weight: bold;
}

.chat-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.chat-input {
  flex-grow: 1;
  padding: 8px 12px;
  background: rgba(7, 9, 14, 0.8);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  color: white;
  font-size: 0.8rem;
}

/* 5. Lobby Screen */
.lobby-layout {
  max-width: 600px;
  margin: 0 auto;
}

.lobby-code-area {
  background: rgba(7, 9, 14, 0.5);
  border: 1px solid var(--border-gold);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
}

.lobby-code-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.lobby-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.lobby-code-number {
  font-size: 2.2rem;
  font-family: var(--font-title);
  color: var(--gold);
  font-weight: 750;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(211, 166, 37, 0.2);
}

.lobby-players-list {
  text-align: left;
  margin-bottom: 30px;
}

.lobby-players-title {
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 1.2rem;
  border-bottom: 1px solid rgba(211, 166, 37, 0.15);
  padding-bottom: 8px;
  margin-bottom: 15px;
}

.lobby-player-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(18, 22, 33, 0.5);
  border: 1px solid rgba(211, 166, 37, 0.1);
  border-radius: 8px;
  margin-bottom: 10px;
}

.lobby-player-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lobby-player-icon {
  font-size: 1.3rem;
}

.lobby-player-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.lobby-player-house {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-title);
}

.lobby-player-host-lbl {
  font-size: 0.7rem;
  background-color: rgba(211, 166, 37, 0.2);
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-title);
  text-transform: uppercase;
}

/* 6. Rankings Screen */
.rankings-layout {
  max-width: 900px;
  margin: 0 auto;
}

.rankings-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
}

@media (max-width: 600px) {
  .rankings-controls {
    flex-direction: column;
    gap: 10px;
  }
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  box-shadow: var(--shadow-main);
  margin-bottom: 30px;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.ranking-table th {
  background-color: rgba(7, 9, 14, 0.9);
  color: var(--gold);
  font-family: var(--font-title);
  padding: 15px 20px;
  border-bottom: 2px solid var(--border-gold);
  font-weight: bold;
}

.ranking-table td {
  padding: 15px 20px;
  border-bottom: 1px solid rgba(211, 166, 37, 0.1);
  background-color: rgba(18, 22, 33, 0.4);
}

.ranking-table tr:hover td {
  background-color: rgba(18, 22, 33, 0.7);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: bold;
  font-size: 0.85rem;
}

.rank-1 { background-color: #ffd700; color: #000; }
.rank-2 { background-color: #c0c0c0; color: #000; }
.rank-3 { background-color: #cd7f32; color: #000; }
.rank-other { color: var(--text-light); }

/* 7. Admin Panel Screen */
.admin-layout {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  padding: 20px;
  text-align: center;
}

.stat-number {
  font-size: 2.2rem;
  font-family: var(--font-title);
  color: var(--gold);
  margin-bottom: 5px;
}

.stat-lbl {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.admin-tabs {
  display: flex;
  gap: 15px;
  border-bottom: 1px solid rgba(211, 166, 37, 0.15);
  padding-bottom: 10px;
}

.admin-tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-title);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 8px 16px;
  transition: var(--transition-fast);
}

.admin-tab-btn.active {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
  text-shadow: 0 0 6px rgba(211, 166, 37, 0.2);
}

/* ==========================================================================
   CASAS DE HOGWARTS ACCENT STYLES
   ========================================================================== */

/* Colores de Casas */
.house-Gryffindor {
  border-color: var(--gryffindor-accent) !important;
  color: #fca5a5 !important;
  background: rgba(116, 0, 1, 0.1) !important;
}
.badge-Gryffindor {
  background-color: var(--gryffindor);
  color: var(--gryffindor-accent);
  border: 1px solid var(--gryffindor-accent);
}

.house-Slytherin {
  border-color: var(--slytherin-accent) !important;
  color: #a7f3d0 !important;
  background: rgba(42, 98, 61, 0.1) !important;
}
.badge-Slytherin {
  background-color: var(--slytherin);
  color: var(--slytherin-accent);
  border: 1px solid var(--slytherin-accent);
}

.house-Ravenclaw {
  border-color: var(--ravenclaw-accent) !important;
  color: #bfdbfe !important;
  background: rgba(34, 47, 91, 0.1) !important;
}
.badge-Ravenclaw {
  background-color: var(--ravenclaw);
  color: var(--ravenclaw-accent);
  border: 1px solid var(--ravenclaw-accent);
}

.house-Hufflepuff {
  border-color: var(--hufflepuff) !important;
  color: #fef08a !important;
  background: rgba(236, 185, 57, 0.05) !important;
}
.badge-Hufflepuff {
  background-color: #111;
  color: var(--hufflepuff);
  border: 1px solid var(--hufflepuff);
}

/* ==========================================================================
   MODALES Y DIÁLOGOS NATIVOS
   ========================================================================== */

.modal-dialog {
  margin: auto;
  border: none;
  background: transparent;
  padding: 15px;
}

.modal-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  box-shadow: var(--shadow-main);
  padding: 30px;
  position: relative;
  text-align: center;
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--gold);
}

.auth-tabs {
  display: flex;
  margin-bottom: 25px;
  border-bottom: 1px solid rgba(211, 166, 37, 0.15);
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--font-title);
  color: var(--text-muted);
  padding: 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.auth-tab.active {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
}

.auth-intro {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

/* Alertas */
.alert-card {
  max-width: 400px;
}

.alert-title {
  color: var(--gold);
  margin-bottom: 12px;
  font-size: 1.3rem;
}

.alert-message {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 25px;
  line-height: 1.5;
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */

@keyframes float-gently {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes pulse-gold {
  0% { box-shadow: 0 0 0 0 rgba(211, 166, 37, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(211, 166, 37, 0); }
  100% { box-shadow: 0 0 0 0 rgba(211, 166, 37, 0); }
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@keyframes pulse-light-red {
  0% { opacity: 0.8; text-shadow: 0 0 4px rgba(239, 68, 68, 0.2); }
  100% { opacity: 1; text-shadow: 0 0 12px rgba(239, 68, 68, 0.7); }
}

/* Loader */
.page-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 0;
}

.magic-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(211, 166, 37, 0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  margin-bottom: 20px;
  box-shadow: 0 0 15px var(--gold-glow);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 1rem;
}

/* ==========================================
   9. MEJORAS DE SEGURIDAD, UX Y GAME DESIGN
   ========================================== */

/* Transiciones entre Acertijos */
.puzzle-main-content {
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  opacity: 1;
  transform: translateY(0);
}

.puzzle-fade-out {
  opacity: 0;
  transform: translateY(-10px);
}

/* Estilos de la Marca Tenebrosa (l6-p6) */
.dark-mark-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 300px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 100, 0.2);
  background: radial-gradient(circle, rgba(16, 24, 16, 0.9) 0%, rgba(5, 8, 5, 0.95) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.dark-mark-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  filter: grayscale(100%);
}

.dark-mark-overlay {
  position: absolute;
  width: 140px;
  height: 220px;
  cursor: pointer;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.4) 0%, rgba(34, 197, 94, 0) 70%);
  filter: drop-shadow(0 0 15px #22c55e);
  animation: dark-mark-pulse 2s infinite ease-in-out;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.dark-mark-overlay:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 25px #4ade80);
}

@keyframes dark-mark-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* Libro Antiguo del Príncipe Mestizo (l6-p8) */
.half-blood-book {
  background: #f4edd8;
  color: #1c1c1c;
  padding: 30px;
  border-radius: 8px;
  border: 8px solid #5a3c1b;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(0,0,0,0.15);
  font-family: 'Georgia', serif;
  text-align: left;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.half-blood-book::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  background: rgba(0,0,0,0.1);
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.book-page-content {
  display: flex;
  justify-content: space-between;
}

.book-page-side {
  width: 46%;
  font-size: 0.9rem;
  line-height: 1.5;
}

.book-scribble {
  color: #102a45;
  font-family: 'Architects Daughter', 'Reenie Beanie', 'Segoe Script', cursive;
  font-size: 0.8rem;
  transform: rotate(-3deg);
  border: 1px dashed rgba(16, 42, 69, 0.3);
  padding: 4px;
  margin-top: 15px;
  background: rgba(16, 42, 69, 0.05);
}

/* Snitch Dorada Interactiva (l7-p9) */
.snitch-interactive-container {
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  perspective: 600px;
  background: radial-gradient(circle, rgba(20, 20, 20, 0.5) 0%, rgba(5, 5, 5, 0.8) 100%);
  border-radius: 12px;
  border: 1px solid rgba(211, 166, 37, 0.15);
  margin-bottom: 20px;
}

.snitch-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  cursor: pointer;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.snitch-body {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #ffe066 0%, #d3a625 70%, #997300 100%);
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(211, 166, 37, 0.8), inset -5px -5px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.5s ease, background 0.5s ease;
}

.snitch-inscription {
  color: rgba(0, 0, 0, 0.6);
  font-size: 0.5rem;
  font-family: 'Cinzel', serif;
  font-weight: bold;
  pointer-events: none;
}

.snitch-wing {
  position: absolute;
  top: 15px;
  width: 100px;
  height: 25px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.1) 100%);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  z-index: 5;
  transition: opacity 0.5s ease;
}

.snitch-wing-left {
  right: 45px;
  transform-origin: right center;
  animation: wing-flap-left 0.12s infinite linear;
}

.snitch-wing-right {
  left: 45px;
  transform-origin: left center;
  animation: wing-flap-right 0.12s infinite linear;
}

@keyframes wing-flap-left {
  0%, 100% { transform: rotateY(0deg) rotate(5deg); }
  50% { transform: rotateY(70deg) rotate(-15deg); }
}

@keyframes wing-flap-right {
  0%, 100% { transform: rotateY(0deg) rotate(-5deg); }
  50% { transform: rotateY(-70deg) rotate(15deg); }
}

.snitch-stone-reveal {
  position: absolute;
  width: 36px;
  height: 36px;
  background: radial-gradient(circle, #5533aa 0%, #1a0f30 90%);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(136, 85, 255, 0.9), inset 0 0 10px rgba(255, 255, 255, 0.4);
  z-index: 8;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
  pointer-events: none;
}

/* Snitch Abierta */
.snitch-wrapper.opened .snitch-body {
  transform: scale(0.6) translateY(-40px);
  opacity: 0.8;
}

.snitch-wrapper.opened .snitch-wing {
  opacity: 0;
  animation: none;
}

.snitch-wrapper.opened .snitch-stone-reveal {
  opacity: 1;
  transform: scale(1);
}

/* Cierre / Patronus (l7-p13) */
.patronus-container {
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: radial-gradient(circle, rgba(0, 100, 200, 0.2) 0%, rgba(5, 5, 8, 0.95) 100%);
  border-radius: 12px;
  border: 1px solid rgba(0, 160, 255, 0.2);
  overflow: hidden;
  margin-bottom: 20px;
}

.patronus-ciervo {
  max-height: 80%;
  opacity: 0.8;
  filter: drop-shadow(0 0 20px rgba(100, 220, 255, 0.8)) brightness(1.2);
  animation: patronus-levitate 3s infinite ease-in-out;
}

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

/* Fuegos Artificiales */
.fw-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  animation: fw-explode 1.2s forwards ease-out;
}

@keyframes fw-explode {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.2); opacity: 0; }
}

/* Pantalla de Resultados Finales Premium */
.results-card {
  max-width: 600px;
  margin: 30px auto;
  background: linear-gradient(135deg, rgba(20, 24, 38, 0.95) 0%, rgba(8, 10, 18, 0.98) 100%);
  border: 2px solid var(--gold);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(211, 166, 37, 0.15);
  border-radius: 12px;
  padding: 40px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.results-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(211, 166, 37, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.results-badge {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: scale-up-badge 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes scale-up-badge {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

.results-title {
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 2.2rem;
  margin-bottom: 5px;
  text-shadow: 0 0 10px rgba(211, 166, 37, 0.3);
}

.results-subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 30px;
}

.results-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 35px;
}

.results-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 15px 10px;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.results-stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(211, 166, 37, 0.3);
  background: rgba(211, 166, 37, 0.02);
}

.results-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 5px;
}

.results-stat-value.gold-text {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(211, 166, 37, 0.2);
}

.results-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.results-code-container {
  background: rgba(7, 9, 14, 0.6);
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 35px;
  position: relative;
}

.results-code-label {
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.results-code-value {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: #fff;
  letter-spacing: 4px;
}

.results-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

