@import url('../shared/theme.css');

body {
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #111827 0%, #030712 100%);
  position: relative;
  overflow: hidden; /* NO SCROLL */
  margin: 0;
}

/* Ultra Premium Background Effects & Magical Atmosphere */
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #1e1b4b 0%, #0f172a 50%, #030712 100%);
}

.bg-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/assets/images/stardust.png') repeat, radial-gradient(circle at 20% 80%, rgba(251, 191, 36, 0.15), transparent 40%);
  opacity: 0.4;
  animation: magicStardust 30s linear infinite;
}

.candle {
  position: absolute;
  width: 4px;
  height: 50px;
  background: linear-gradient(to top, transparent, rgba(251, 191, 36, 0.8), #fff);
  border-radius: 50%;
  filter: blur(2px);
  animation: floatCandle 5s ease-in-out infinite, candleFlicker 0.2s infinite alternate;
  box-shadow: 0 0 20px #fbbf24, 0 0 40px #f59e0b;
}

@keyframes floatCandle {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.1); }
}

@keyframes candleFlicker {
  0% { opacity: 0.7; filter: brightness(0.9); }
  100% { opacity: 1; filter: brightness(1.2); }
}

@keyframes magicStardust {
  from { background-position: 0 0; }
  to { background-position: -500px 500px; }
}

/* Main Layout & Master Cinematic Transitions */
.tv-layout, .init-screen, .selection-section, #view-loading, #view-preamble, .screen {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1.5rem;
  padding: 3rem 5rem;
  box-sizing: border-box;
  z-index: 10;
  animation: cinematicEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.title-group h1 {
  font-family: var(--font-title);
  font-size: 3.5rem;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.title-group p {
  font-size: 1.2rem;
  color: var(--color-text-dim);
  margin: 0.2rem 0 0 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Central Panel */
.central-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  padding: 3rem;
}

.room-display {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.room-label {
  font-size: 1.2rem;
  color: var(--color-text-dim);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.room-code-large {
  font-family: var(--font-title);
  font-size: 8rem;
  font-weight: 800;
  color: var(--color-accent);
  letter-spacing: 0.3em;
  margin: 0;
  animation: glowPulse 3s infinite ease-in-out;
  padding-left: 0.3em; /* Offset for centering letters */
}

.qr-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

#qrcode {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}

.qr-image {
  display: block;
  width: 220px;
  height: 220px;
  padding: 12px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow:
    0 0 0 1px rgba(255, 216, 121, 0.25),
    0 24px 70px rgba(0, 0, 0, 0.45),
    0 0 45px rgba(255, 216, 121, 0.18);
  transition: transform 0.3s ease;
}

.qr-image:hover {
  transform: scale(1.05);
}

.qr-fallback {
  max-width: 220px;
  padding: 18px;
  border-radius: 20px;
  color: #f8e7b0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 216, 121, 0.22);
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: center;
}

.join-url {
  font-family: monospace;
  font-size: 1.1rem;
  opacity: 0.6;
}

/* Player Grid */
.players-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* PREMIUM ANIMATIONS & LOADER */
.magic-loader-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.magic-wand-loader {
  width: 10px;
  height: 80px;
  background: linear-gradient(to bottom, #d4af37, #8a6d3b);
  border-radius: 5px;
  position: relative;
  animation: wandRotate 2s infinite ease-in-out;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.magic-wand-loader::after {
  content: '✨';
  position: absolute;
  top: -20px;
  left: -8px;
  font-size: 20px;
  animation: sparkBloom 1s infinite alternate;
}

.magic-circles {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(212, 175, 55, 0.1);
  border-radius: 50%;
  animation: circleExpand 3s infinite linear;
}

.magic-circles::before {
  content: '';
  position: absolute;
  inset: -15px;
  border: 1px solid rgba(212, 175, 55, 0.05);
  border-radius: 50%;
  animation: circleExpand 3s infinite linear reverse;
}

@keyframes wandRotate {
  0% { transform: rotate(-20deg); }
  50% { transform: rotate(20deg); }
  100% { transform: rotate(-20deg); }
}

@keyframes sparkBloom {
  from { opacity: 0.5; transform: scale(0.8) translate(0,0); filter: blur(1px); }
  to { opacity: 1; transform: scale(1.2) translate(0, -5px); filter: blur(0px); }
}

@keyframes circleExpand {
  0% { transform: scale(0.5); opacity: 0; }
  50% { opacity: 0.5; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(212, 175, 55, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.init-screen {
    background: radial-gradient(circle at center, rgba(30, 35, 50, 0.8), rgba(10, 15, 30, 1));
    height: 100vh;
    width: 100vw;
    z-index: 100;
}

.players-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1rem;
  min-height: 120px;
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  animation: magicIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.3s ease;
  position: relative;
}

.ready-indicator {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  background: #10b981;
  border-radius: 50%;
  border: 3px solid #111827;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ready-indicator::after {
  content: '✓';
  color: #000;
  font-size: 0.8rem;
  font-weight: bold;
}

@keyframes magicIn {
  100% { transform: translateY(0) rotate(2deg); }
}

/* Mapa Travieso - Ultra Premium Aged Parchment */
.map-pergamino {
  width: 90%;
  max-width: 1000px;
  height: 550px;
  background: linear-gradient(135deg, #fbf2db 0%, #e8d09d 50%, #c9a665 100%);
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8), inset 0 0 120px rgba(74, 45, 11, 0.85);
  position: relative;
  overflow: hidden;
  border: 16px solid #2a1a0a;
  border-image: linear-gradient(to bottom, #4a2e18, #1a0f08) 1;
}
.map-pergamino::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(42, 26, 10, 0.6) 100%);
  pointer-events: none;
}
.map-canvas {
  width: 100%;
  height: 100%;
  position: relative;
}
.map-point {
  position: absolute;
  width: 28px;
  height: 28px;
  background: radial-gradient(circle, #8b4513, #3a1805);
  border: 2px solid #fbbf24;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.8);
  animation: pulsePoint 2s infinite;
}
@keyframes pulsePoint {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 15px rgba(251, 191, 36, 0.8); }
  50% { transform: translate(-50%, -50%) scale(1.2); box-shadow: 0 0 30px rgba(251, 191, 36, 1); }
}
.map-label {
  position: absolute;
  top: 35px;
  font-size: 1.1rem;
  color: #2a1a0a;
  white-space: nowrap;
  font-family: var(--font-magic);
  font-weight: 800;
  text-shadow: 0 0 5px #fff, 0 0 10px #fbf2db;
  background: rgba(251, 242, 219, 0.8);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #c9a665;
}
.map-item-visual {
  font-size: 3rem;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}

.caldero-log {
  height: 220px;
  overflow-y: auto;
  padding: 1.5rem;
  font-family: var(--font-main);
  text-align: left;
  background: rgba(0,0,0,0.4);
  border-radius: 1rem;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.log-entry {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  animation: slideInRight 0.3s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.cauldron-main {
  font-size: 10rem;
  filter: drop-shadow(0 0 40px #10b981) drop-shadow(0 0 80px #065f46);
  animation: sway 3s infinite ease-in-out, cauldronBoil 1.5s infinite alternate;
  margin: 2rem 0;
  position: relative;
}
@keyframes cauldronBoil {
  0% { filter: drop-shadow(0 0 30px #10b981); transform: scale(1); }
  100% { filter: drop-shadow(0 0 60px #34d399); transform: scale(1.05); }
}
@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* RETRATOS CHISMOSOS */
.portrait-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  margin: 2rem 0;
}
.portrait-frame {
  width: 250px;
  height: 320px;
  background: #1a1a1a;
  border: 15px solid #d4af37;
  border-image: linear-gradient(to bottom, #d4af37, #aa8a2e) 1;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.portrait-character {
  font-size: 8rem;
  animation: sway 4s infinite ease-in-out;
}
.gossip-bubble {
  max-width: 600px;
  padding: 1.5rem 2rem;
  font-style: italic;
  font-family: 'Crimson Text', serif;
  font-size: 1.4rem;
  line-height: 1.4;
  position: relative;
  border-left: 4px solid var(--color-accent);
}

/* HECHIZO INCOMPLETO - Glowing Ancient Rune Scroll */
.spell-parchment {
  background: linear-gradient(135deg, #fbf2db 0%, #e8d09d 50%, #c9a665 100%);
  padding: 4rem;
  border-radius: 16px;
  max-width: 900px;
  margin: 2rem auto;
  box-shadow: 0 25px 60px rgba(0,0,0,0.8), inset 0 0 120px rgba(74, 45, 11, 0.85);
  color: #2a1a0a;
  text-align: center;
  position: relative;
  border: 4px solid #8b4513;
  border-image: linear-gradient(to right, #8b4513, #d4af37, #8b4513) 1;
}
.spell-text {
  font-family: var(--font-magic);
  font-size: 4rem;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.spell-text span.blank {
  display: inline-block;
  width: 180px;
  border-bottom: 6px solid #d4af37;
  margin: 0 15px;
  vertical-align: bottom;
  animation: pulseBlank 1.5s infinite alternate;
  box-shadow: 0 10px 10px -10px #fbbf24;
}
@keyframes pulseBlank {
  0% { border-color: #8b4513; box-shadow: 0 10px 10px -10px transparent; }
  100% { border-color: #fbbf24; box-shadow: 0 10px 20px -5px #fbbf24; }
}

/* PATRONUS PERSONALIZADO - Ethereal Hypnotic Arena */
.patronus-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 450px;
  position: relative;
}
.patronus-aura {
  font-size: 20rem;
  opacity: 0.25;
  position: absolute;
  z-index: 0;
  animation: breatheAura 6s infinite alternate ease-in-out;
  filter: drop-shadow(0 0 80px #38bdf8) drop-shadow(0 0 150px #0284c7);
}
.submissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  z-index: 1;
}
.submission-card {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(56, 189, 248, 0.3);
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  font-family: var(--font-magic);
  font-size: 1.6rem;
  font-weight: 700;
  color: #e0f2fe;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(56, 189, 248, 0.15);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.submission-card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: #38bdf8;
  box-shadow: 0 20px 40px rgba(2, 132, 199, 0.4), inset 0 0 30px rgba(56, 189, 248, 0.3);
}

/* COPA FINAL - Ultimate Glory Wagers */
.copa-central {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4rem;
  margin-top: 2rem;
}
.copa-trophy {
  font-size: 14rem;
  filter: drop-shadow(0 0 60px #ffd700) drop-shadow(0 0 120px #ffae00);
  animation: shineTrophy 3s infinite alternate, floatTrophy 4s infinite ease-in-out;
}
.wager-grid {
  display: flex;
  gap: 3rem;
  justify-content: center;
  width: 100%;
}
.house-wager-card {
  padding: 2rem;
  width: 220px;
  text-align: center;
  border-bottom: 6px solid rgba(255,255,255,0.2);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
  transition: all 0.4s ease;
}
.house-wager-card.sealed {
  border-bottom: 6px solid var(--color-accent);
  background: linear-gradient(to top, rgba(251, 191, 36, 0.25), rgba(255,255,255,0.05));
  box-shadow: 0 20px 50px rgba(251, 191, 36, 0.3);
  transform: translateY(-10px);
}

@keyframes breatheAura {
  from { transform: scale(0.9) rotate(-5deg); opacity: 0.15; filter: drop-shadow(0 0 60px #38bdf8); }
  to { transform: scale(1.2) rotate(5deg); opacity: 0.35; filter: drop-shadow(0 0 120px #38bdf8) drop-shadow(0 0 200px #bae6fd); }
}
@keyframes shineTrophy {
  from { filter: drop-shadow(0 0 40px #ffd700) brightness(1); }
  to { filter: drop-shadow(0 0 100px #ffd700) drop-shadow(0 0 150px #ffae00) brightness(1.3); }
}
@keyframes floatTrophy {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.player-card.offline {
  opacity: 0.4;
  filter: grayscale(1);
}

.player-avatar {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.player-name {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* House Variants */
.player-card.gryffindor { border-bottom: 4px solid var(--house-gryffindor); }
.player-card.slytherin { border-bottom: 4px solid var(--house-slytherin); }
.player-card.ravenclaw { border-bottom: 4px solid var(--house-ravenclaw); }
.player-card.hufflepuff { border-bottom: 4px solid var(--house-hufflepuff); }

/* Footer */
.footer {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}

.btn-start-premium {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #000;
  border: none;
  padding: 1.2rem 4rem;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-title);
  border-radius: 3rem;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(251, 191, 36, 0.3);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.btn-start-premium:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(251, 191, 36, 0.5);
}

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

/* Start Screen */
.init-screen {
  text-align: center;
  max-width: 600px;
}

.btn-create-premium {
  background: var(--glass-bg);
  color: var(--color-text);
  border: 1px solid var(--glass-border);
  padding: 1.5rem 3rem;
  font-size: 1.5rem;
  border-radius: 1rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.btn-create-premium:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-accent);
}

/* Trivia Specifics */
.timer-container {
  width: 300px;
  height: 20px;
  overflow: hidden;
  border-radius: 10px;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background: var(--color-accent);
  box-shadow: 0 0 15px var(--color-accent);
  transition: width 1s linear;
}

.trivia-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem;
  gap: 3rem;
  text-align: center;
}

.trivia-question {
  font-family: var(--font-title);
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  max-width: 1000px;
}

.trivia-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
  width: 100%;
  max-width: 1300px;
  perspective: 1000px;
}

.option-card {
  padding: 2.5rem;
  font-size: 2.2rem;
  font-weight: 700;
  border-radius: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-style: preserve-3d;
}

.option-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: var(--glass-bg-hover);
  border-color: var(--color-accent);
  box-shadow: 0 20px 50px rgba(251, 191, 36, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.option-label {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #000;
  width: 65px;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
  font-size: 2rem;
  box-shadow: 0 10px 20px rgba(251, 191, 36, 0.4);
}

/* Results Screen */
.results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.result-player-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
  animation: zoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-status {
  padding: 0.6rem 1.5rem;
  border-radius: 2rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.status-correct { background: rgba(16, 185, 129, 0.25); color: #34d399; border: 2px solid #10b981; box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); }
.status-wrong { background: rgba(239, 68, 68, 0.25); color: #f87171; border: 2px solid #ef4444; box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }

.results-footer {
  padding: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.4);
  border-radius: 2rem;
  border: 1px solid var(--glass-border);
  margin-top: 2rem;
}

#narrator-comment {
  font-style: italic;
  font-size: 1.8rem;
  color: var(--color-accent);
  margin: 0;
  font-family: var(--font-magic);
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.4);
}
/* --- Snitch Game - Ultra Premium Quidditch Night Pitch --- */
.snitch-arena {
  position: relative;
  width: 100%;
  height: 80vh;
  background: url('/assets/images/quidditch_pitch.png') center/cover no-repeat, radial-gradient(circle at center, #064e3b 0%, #022c22 50%, #020617 100%);
  border-radius: 28px;
  overflow: hidden;
  margin-top: 2rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.9), inset 0 0 120px rgba(212, 175, 55, 0.5);
  border: 2px solid rgba(212, 175, 55, 0.6);
}
.snitch-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 20%, rgba(0, 0, 0, 0.6) 80%, rgba(0, 0, 0, 0.9) 100%);
  pointer-events: none;
}
.snitch-ball {
  position: absolute;
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #ffd700 30%, #b8860b 80%, #5c4308 100%);
  border-radius: 50%;
  box-shadow: 0 0 30px #ffd700, 0 0 60px #ffae00, 0 0 90px #ff8c00, inset 0 0 15px #ffffff;
  z-index: 10;
  transform: translate(-50%, -50%);
  animation: snitchFlutter 0.08s infinite alternate;
}
.snitch-ball::before, .snitch-ball::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 60px;
  height: 25px;
  background: linear-gradient(90deg, rgba(255,255,255,0.9), rgba(255,215,0,0.6), transparent);
  border-radius: 50% 100% 0 50%;
  filter: drop-shadow(0 0 15px rgba(255,215,0,0.8));
  pointer-events: none;
}
.snitch-ball::before {
  left: -55px;
  transform-origin: right center;
  animation: wingFlapLeft 0.05s infinite alternate;
}
.snitch-ball::after {
  right: -55px;
  transform-origin: left center;
  transform: scaleX(-1);
  animation: wingFlapRight 0.05s infinite alternate;
}
@keyframes wingFlapLeft {
  0% { transform: translateY(-50%) rotate(-30deg); filter: drop-shadow(0 0 10px #ffd700); }
  100% { transform: translateY(-50%) rotate(30deg); filter: drop-shadow(0 0 25px #ffffff); }
}
@keyframes wingFlapRight {
  0% { transform: scaleX(-1) translateY(-50%) rotate(-30deg); filter: drop-shadow(0 0 10px #ffd700); }
  100% { transform: scaleX(-1) translateY(-50%) rotate(30deg); filter: drop-shadow(0 0 25px #ffffff); }
}
@keyframes snitchFlutter {
  0% { filter: drop-shadow(0 0 20px #ffd700) brightness(1); transform: translate(-50%, -50%) scale(0.95); }
  100% { filter: drop-shadow(0 0 50px #ffffff) brightness(1.3); transform: translate(-50%, -50%) scale(1.05); }
}
.snitch-zone {
  position: absolute;
  width: 160px;
  height: 160px;
  border: 6px dashed rgba(255, 215, 0, 0.9);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.35), rgba(255, 215, 0, 0.1) 60%, transparent 100%);
  z-index: 5;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.6), inset 0 0 40px rgba(255, 215, 0, 0.6);
  animation: zoneRotateHUD 8s linear infinite;
}
.snitch-zone::before {
  content: '';
  position: absolute;
  inset: -15px;
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 50%;
  animation: zoneRotateHUD 12s linear infinite reverse;
}
@keyframes zoneRotateHUD {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.catches-feed {
  position: absolute;
  bottom: 2.5rem;
  left: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  z-index: 20;
}
.catch-toast {
  padding: 1rem 2rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-left: 6px solid var(--color-accent);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.6);
  font-size: 1.2rem;
  font-weight: 700;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Duelo Game - High Voltage Magical Beam Clash --- */
.duelo-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 60vh;
  margin-top: 5vh;
  position: relative;
}
.duelist {
  text-align: center;
  padding: 3rem;
  border-radius: 28px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  width: 350px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.duelist:hover {
  transform: translateY(-10px) scale(1.05);
  border-color: var(--color-accent);
  box-shadow: 0 30px 70px rgba(251, 191, 36, 0.3);
}
.duelo-vs {
  font-size: 7rem;
  font-family: var(--font-title);
  color: var(--color-accent);
  text-shadow: 0 0 40px rgba(212, 175, 55, 0.8), 0 0 80px rgba(212, 175, 55, 0.4);
  animation: pulseVs 1.5s infinite alternate;
}
@keyframes pulseVs {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.15); filter: brightness(1.3); }
}
.duelo-status {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-top: 2rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.5);
}
.clash-meter {
    width: 85%;
    height: 60px;
    background: rgba(0,0,0,0.6);
    margin: 3rem auto;
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.5), 0 0 40px rgba(59, 130, 246, 0.5), inset 0 0 20px rgba(0,0,0,0.8);
    border: 3px solid rgba(255,255,255,0.2);
}
.clash-bar {
    height: 100%;
    transition: width 0.1s linear;
}
#clash-bar-1 { background: var(--color-accent); }
#clash-bar-2 { background: #ff4d4d; }

/* --- Sombrero Game --- */
.sombrero-container {
  text-align: center;
  padding: 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.sombrero-avatar {
  font-size: 8rem;
  margin-bottom: 2rem;
  animation: sway 4s ease-in-out infinite;
}
.hat-line {
  font-family: var(--font-title);
  font-size: 3.5rem;
  color: var(--color-accent);
  text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  max-width: 900px;
  line-height: 1.2;
}
.vote-meter {
  margin-top: 3rem;
  padding: 1rem 2rem;
  font-size: 1.5rem;
  border-radius: 50px;
}

/* --- Pociones Game - Ethereal Glowing Cauldron Laboratory --- */
.pociones-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  position: relative;
}
.cauldron {
  font-size: 14rem;
  margin-bottom: 4rem;
  filter: drop-shadow(0 0 60px #10b981) drop-shadow(0 0 120px #065f46);
  animation: swayCauldron 4s infinite ease-in-out, bubbleGlow 2s infinite alternate;
}
@keyframes swayCauldron {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-15px); }
}
@keyframes bubbleGlow {
  0% { filter: drop-shadow(0 0 40px #10b981); }
  100% { filter: drop-shadow(0 0 90px #34d399) drop-shadow(0 0 150px #a7f3d0); }
}
.sequence-display {
  display: flex;
  gap: 2.5rem;
  height: 160px;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  padding: 2rem 4rem;
  border-radius: 2rem;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 0 30px rgba(16, 185, 129, 0.2);
}
.ing-card {
  font-size: 5rem;
  background: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  padding: 2rem;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.3);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transition: transform 0.3s ease;
}
.ing-card:hover {
  transform: scale(1.15) rotate(5deg);
  border-color: #10b981;
  box-shadow: 0 20px 40px rgba(16, 185, 129, 0.4);
}
.pociones-status {
  margin-top: 3.5rem;
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 20px #10b981, 0 0 40px #34d399;
}

@keyframes sway {
  0%, 100% { transform: rotate(-5deg) translateY(0); }
  50% { transform: rotate(5deg) translateY(-10px); }
}
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Story Mode Styles */
.story-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem;
  width: 100%;
}

.story-card {
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.story-card:hover {
  transform: translateY(-10px);
  border-color: var(--color-accent);
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.2);
}

.story-card h2 {
  font-family: var(--font-title);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.story-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-dim);
}

.dialogue-panel {
  padding: 3rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: center;
  min-height: 400px;
}

.narrative-text {
  font-size: 1.8rem;
  line-height: 1.6;
  font-family: var(--font-main);
  font-weight: 300;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.narrative-text p {
  animation: fadeIn 0.8s ease-out forwards;
}

.visual-placeholder {
  font-size: 8rem;
  text-align: center;
  animation: float 4s ease-in-out infinite;
}

.instructions-panel {
  padding: 3rem;
  max-width: 1000px;
  margin: 0 auto;
}

.instructions-body {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.instr-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.instr-section h3, .instr-col h3 {
  color: var(--color-accent);
  margin-bottom: 1rem;
  font-family: var(--font-title);
}

.instr-section ul, .instr-col ul {
  list-style: none;
  padding: 0;
}

.instr-section li, .instr-col li {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.instr-section li::before, .instr-col li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.scoreboard-story-panel {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  padding: 2rem;
}

.house-ranking-large {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.house-bar-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.house-label {
  width: 150px;
  font-family: var(--font-title);
  font-size: 1.5rem;
}

.house-bar-bg {
  flex: 1;
  height: 40px;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}

.house-bar-fill {
  height: 100%;
  transition: width 1s ease-out;
}

.house-points {
  width: 100px;
  font-size: 1.5rem;
  font-weight: bold;
}

.winner-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  padding: 2rem;
}

.winner-house-card {
  padding: 3rem;
  text-align: center;
  width: 400px;
  border: 2px solid var(--color-accent);
  box-shadow: 0 0 50px rgba(251, 191, 36, 0.3);
  animation: glowPulse 3s infinite;
}

.winner-crest {
  font-size: 6rem;
  margin-bottom: 1rem;
}

.winner-house-card h2 {
  font-size: 3rem;
  font-family: var(--font-title);
  margin-bottom: 0.5rem;
}

.final-ranking {
  display: flex;
  gap: 1rem;
}

.final-rank-item {
  padding: 1rem 2rem;
  border-radius: 1rem;
  background: rgba(255,255,255,0.05);
}

.narrative-comment {
  font-style: italic;
  color: var(--color-text-dim);
  text-align: center;
  margin-bottom: 1rem;
}

/* Voice Controls */
.voice-controls-panel {
  pointer-events: all;
}

.btn-voice {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--color-accent);
  color: white;
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-voice:hover {
  background: var(--color-accent);
  box-shadow: 0 0 15px var(--color-accent);
  transform: scale(1.05);
}

.btn-voice:active {
  transform: scale(0.95);
}

.voice-status-text {
  font-family: var(--font-title);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.8;
}
/* Selection Carousel */
.selection-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1rem;
  animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Selection Carousel Layout */
.selection-carousel-main {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  height: 100%;
  gap: 4rem;
  padding: 0 4rem;
}

#view-selection .header {
  position: absolute;
  bottom: 10rem;
  left: 6rem;
  flex-direction: column;
  align-items: flex-start;
  z-index: 20;
  max-width: 35%;
  pointer-events: none;
}

#view-selection .header .title-group h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

#view-selection .header .connection-status {
  margin-top: 1.5rem;
}

.carousel-wrapper {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  overflow: visible;
  perspective: 1000px;
}

.instructions-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  padding: 3rem;
}

.carousel-track {
  display: flex;
  gap: 2.5rem;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  padding: 0 450px; /* Push cards to the right half */
}

.selection-card {
  min-width: 320px;
  height: 450px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  filter: grayscale(0.8) brightness(0.6);
  opacity: 0.5;
  transform: scale(0.8);
}

.selection-card.active {
  filter: grayscale(0) brightness(1.2);
  opacity: 1;
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--color-accent);
  box-shadow: 0 20px 60px rgba(212, 175, 55, 0.25);
}

.selection-card .card-icon {
  font-size: 7rem;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
  transition: transform 0.5s ease;
}

.selection-card.active .card-icon {
  transform: scale(1.1) rotate(5deg);
}

.selection-card h3 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  text-align: center;
  margin: 0;
  padding: 0 1rem;
}

.selection-card .card-type {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  background: rgba(0,0,0,0.5);
  padding: 0.3rem 0.6rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Details Panel */
.selection-details {
  display: flex;
  flex-direction: column;
  padding: 3rem;
  gap: 2rem;
  min-height: 350px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  animation: fadeIn 0.8s ease-out;
}

.details-content h3 {
  font-family: var(--font-title);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-accent);
}

.details-content p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--color-text-dim);
  margin-bottom: 1.5rem;
}

.detail-meta {
  display: flex;
  gap: 2rem;
  font-weight: 600;
}

.details-structure {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-content: flex-start;
}

.struct-step-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.struct-label {
  font-size: 0.7rem;
  color: var(--color-accent);
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}

.struct-step {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
/* Lobby Footer Centered */
.lobby-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  width: 100%;
}

#lobby-actions {
  display: flex;
  gap: 2rem;
  justify-content: center;
  width: 100%;
}

/* Preamble View Styles */
.preamble-main {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.preamble-content {
    display: grid;
    grid-template-columns: 1fr 0.7fr 1fr; /* 3 Columns: Image, Details, List */
    gap: 3rem;
    padding: 2.5rem;
    max-width: 1600px;
    width: 96%;
    align-items: stretch;
    height: auto;
}

.preamble-visual {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
}

.preamble-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: zoomIn 15s infinite alternate ease-in-out;
}

.preamble-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1.5rem;
    padding-top: 0.5rem;
}

.preamble-list-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.preamble-list-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
}

.preamble-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column list in the 3rd cell */
    gap: 0.8rem;
    overflow-y: auto;
    max-height: 40vh; /* Contain the list! */
    padding-right: 0.5rem;
}

/* Custom scrollbar for minigame list */
.preamble-grid::-webkit-scrollbar {
    width: 4px;
}
.preamble-grid::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 2px;
}
.preamble-stats {
    display: flex;
    gap: 2rem;
    margin-top: auto;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.05);
    padding: 1rem 2rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-title);
    color: var(--color-accent);
}

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

.preamble-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.preamble-game-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 1rem;
    border: 1px solid rgba(255,255,255,0.05);
    animation: fadeIn 0.5s ease-out backwards;
}

.preamble-game-item .icon {
    font-size: 2rem;
}

.preamble-game-item .name {
    font-weight: 600;
    font-size: 1.1rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-select-adventure {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  padding: 1.2rem 3rem;
  font-size: 1.5rem;
  border-radius: 3rem;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.btn-select-adventure:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.5);
}
/* High-End Focus System (Console Style) */
.focused,
button:focus {
    outline: none !important;
    border: 3px solid var(--color-accent) !important;
    box-shadow: 0 0 50px rgba(212, 175, 55, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.3) !important;
    transform: scale(1.08) translateY(-10px) !important;
    background: rgba(212, 175, 55, 0.25) !important;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    animation: focusGlowPulse 1.5s infinite alternate ease-in-out !important;
}

@keyframes focusGlowPulse {
    from {
        box-shadow: 0 0 30px rgba(212, 175, 55, 0.4), inset 0 0 15px rgba(212, 175, 55, 0.2);
    }
    to {
        box-shadow: 0 0 60px rgba(212, 175, 55, 0.8), inset 0 0 30px rgba(212, 175, 55, 0.5);
    }
}

.selection-card.focused {
    transform: scale(1.15) translateY(-20px) !important;
    border-width: 4px !important;
    box-shadow: 0 20px 60px rgba(212, 175, 55, 0.4) !important;
}

/* Button Premium Shine Effect */
.btn-create-premium, .btn-start-premium {
    position: relative;
    overflow: hidden;
}

.btn-create-premium::before, .btn-start-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: none;
}

.focused::before {
    animation: buttonShine 2s infinite;
}

@keyframes buttonShine {
    0% { left: -100%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

/* Custom Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.modal-container {
    width: 600px;
    padding: 3rem;
    text-align: center;
    animation: zoomInModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomInModal {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    margin-bottom: 2rem;
}

.modal-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.modal-body {
    margin-bottom: 3rem;
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--color-text-dim);
}

.modal-footer {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

/* Responsive adjustments for compact screens (720p / laptops / projectors) */
@media (max-height: 800px) {
    .tv-layout, .init-screen, .selection-section, #view-loading, #view-preamble, .screen {
        padding: 1.5rem 3rem !important;
        gap: 1rem !important;
    }
    .title-group h1 {
        font-size: 2.5rem !important;
    }
    .title-group p {
        font-size: 1rem !important;
    }
    .central-panel {
        padding: 1.5rem 2.5rem !important;
        gap: 2rem !important;
    }
    #lobby-main-content {
        gap: 1rem !important;
    }
    .room-code-large {
        font-size: 5.5rem !important;
    }
    .room-label {
        margin-bottom: 0.5rem !important;
        font-size: 1rem !important;
    }
    .qr-container {
        gap: 0.8rem !important;
    }
    #qrcode {
        min-height: 160px !important;
    }
    .qr-image {
        width: 160px !important;
        height: 160px !important;
    }
    .players-section {
        margin-top: 1rem !important;
        gap: 0.5rem !important;
    }
    .players-grid {
        min-height: 80px !important;
        gap: 0.8rem !important;
    }
    .player-card {
        padding: 0.8rem !important;
    }
    .lobby-actions-integrated {
        padding-top: 1rem !important;
        gap: 1.5rem !important;
    }
    .btn-start-premium {
        padding: 1rem 4rem !important;
        font-size: 1.4rem !important;
        min-width: 350px !important;
    }
    .btn-create-premium {
        padding: 1rem 2.5rem !important;
        font-size: 1.1rem !important;
        min-width: 200px !important;
    }
}
