/* variables globales tomadas del sitio principal */
:root {
  --bg-primary: #0d0d12;
  --bg-secondary: #13131a;
  --bg-card: #18181f;
  --text-primary: #f0f0f8;
  --text-secondary: #8888a8;
  --text-muted: #555568;
  --accent-blue: #5b9cf6;
  --border: rgba(255,255,255,0.07);
  --radius-lg: 16px;
  --radius-md: 10px;
  
  --cc-glass: rgba(255, 255, 255, 0.1);
  --cc-glass-border: rgba(255, 255, 255, 0.2);
  --cc-glass-hover: rgba(255, 255, 255, 0.25);
  --cc-text: #ffffff;

  --udechile-glass: rgba(13, 71, 161, 0.2);
  --udechile-glass-border: rgba(13, 71, 161, 0.5);
  --udechile-glass-hover: rgba(13, 71, 161, 0.6);
  --udechile-text: #5b9cf6;
}

[data-theme="light"] {
  --bg-primary: #f0f2f8;
  --bg-secondary: #e6e8f0;
  --bg-card: #ffffff;
  --text-primary: #0d0d20;
  --text-secondary: #44446a;
  --text-muted: #888899;
  --border: rgba(0,0,0,0.08);

  --cc-glass: rgba(0, 0, 0, 0.05);
  --cc-glass-border: rgba(0, 0, 0, 0.15);
  --cc-glass-hover: rgba(0, 0, 0, 0.1);
  --cc-text: #0d0d20;
}

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
}

.quiz-page-wrapper {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
}

.quiz-container {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  width: 100%;
  padding-bottom: 40px;
}

.ad-game-side {
  position: absolute;
  top: 120px;
  right: 40px;
  width: 300px;
  height: 600px;
  display: flex !important;
  z-index: 10;
}

@media (max-width: 1300px) {
  .ad-game-side {
    right: 10px;
  }
}

@media (max-width: 1250px) {
  .quiz-page-wrapper {
    display: flex;
    flex-direction: column;
  }
  .ad-game-side {
    position: static;
    display: flex !important;
    width: 100%;
    max-width: 320px;
    height: 90px;
    margin: 20px auto 40px;
    order: 2;
  }
  .quiz-container {
    min-height: auto;
    order: 1;
  }
}

/* TOP BAR */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
}
.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
.back-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
  transform: translateX(-2px);
}
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--accent-blue); }

/* MAIN CONTAINER */
.quiz-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

/* SCREENS */
.screen {
  width: 100%;
  max-width: 600px;
  text-align: center;
  display: none;
  animation: fadeIn 0.4s ease forwards;
}
.screen.active {
  display: block;
}
.hidden {
  display: none !important;
}

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

/* MENU SCREEN */
.quiz-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 5px;
}
.quiz-subtitle {
  color: var(--text-secondary);
  margin-bottom: 40px;
}
.teams-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 30px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  width: 200px;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}
.team-card:hover {
  transform: translateY(-5px);
}
.team-card.colocolo:hover {
  box-shadow: 0 10px 30px rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}
[data-theme="light"] .team-card.colocolo:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  border-color: rgba(0,0,0,0.3);
}
.team-card.udechile:hover {
  box-shadow: 0 10px 30px rgba(13,71,161,0.3);
  border-color: var(--accent-blue);
}
.team-card.laroja:hover {
  box-shadow: 0 10px 30px rgba(232,64,64,0.3);
  border-color: rgba(232,64,64,0.7);
}
.team-logo-wrap {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
}
.team-card .team-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
}
.team-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* COUNTDOWN SCREEN */
#countdown-text {
  font-size: 3rem;
  font-weight: 900;
  color: var(--accent-blue);
}
.countdown-bounce {
  animation: bounceIn 0.5s ease;
}
@keyframes bounceIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* QUESTION SCREEN */
.header-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.timer-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bomb-icon {
  font-size: 1.2rem;
  animation: shake 1s infinite alternate;
}
@keyframes shake {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}
.timer-bar-bg {
  width: 150px;
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}
.timer-bar-fill {
  height: 100%;
  background: #4ade80;
  width: 100%;
  transition: width 1s linear, background-color 0.3s;
}
.question-box {
  margin-bottom: 40px;
}
#question-text {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Glassmorphism Options */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.option-btn {
  padding: 18px 20px;
  border-radius: 999px; /* Circulos tipo burbuja */
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: 'Poppins', sans-serif;
}

/* Tema Colo-Colo */
body[data-team="colocolo"] .option-btn {
  background: var(--cc-glass);
  border: 1px solid var(--cc-glass-border);
  color: var(--cc-text);
}
body[data-team="colocolo"] .option-btn:hover {
  background: var(--cc-glass-hover);
  transform: translateY(-2px);
}
body[data-team="colocolo"] .option-btn.correct {
  background: rgba(74,222,128,0.2) !important;
  border-color: #4ade80 !important;
  color: #4ade80 !important;
}
body[data-team="colocolo"] .option-btn.wrong {
  background: rgba(232,64,64,0.2) !important;
  border-color: var(--accent-red) !important;
  color: var(--accent-red) !important;
}

/* Tema U de Chile */
body[data-team="udechile"] .option-btn {
  background: var(--udechile-glass);
  border: 1px solid var(--udechile-glass-border);
  color: var(--udechile-text);
}
body[data-team="udechile"] .option-btn:hover {
  background: var(--udechile-glass-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(13, 71, 161, 0.2);
}
body[data-team="udechile"] .option-btn.correct {
  background: rgba(74,222,128,0.2) !important;
  border-color: #4ade80 !important;
  color: #4ade80 !important;
}
body[data-team="udechile"] .option-btn.wrong {
  background: rgba(232,64,64,0.2) !important;
  border-color: var(--accent-red) !important;
  color: var(--accent-red) !important;
}

/* Tema La Roja */
body[data-team="laroja"] .option-btn {
  background: rgba(232,64,64,0.1);
  border: 1px solid rgba(232,64,64,0.3);
  color: #ef4444;
}
body[data-team="laroja"] .option-btn:hover {
  background: rgba(232,64,64,0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(232, 64, 64, 0.2);
}
body[data-team="laroja"] .option-btn.correct {
  background: rgba(74,222,128,0.2) !important;
  border-color: #4ade80 !important;
  color: #4ade80 !important;
}
body[data-team="laroja"] .option-btn.wrong {
  background: rgba(232,64,64,0.3) !important;
  border-color: var(--accent-red) !important;
  color: var(--accent-red) !important;
}
/* RESULT SCREEN */
.result-title {
  font-size: 2.5rem;
  margin-bottom: 10px;
}
.result-score {
  font-size: 4rem;
  font-weight: 900;
  color: var(--accent-blue);
  margin-bottom: 20px;
}
body[data-team="colocolo"] .result-score {
  color: var(--text-primary);
}
body[data-team="udechile"] .result-score {
  color: var(--udechile-text);
}
.result-message {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}
.action-btn {
  background: var(--accent-blue);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  transition: opacity 0.2s;
}
.action-btn:hover {
  opacity: 0.9;
}

/* -- BOTONES DE COMPARTIR -- */
.share-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  width: 100%;
  max-width: 320px;
  justify-content: center;
}
.share-btn {
  flex: 1;
  min-height: 44px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.share-btn:hover {
  background-color: var(--bg-hover);
}
.share-btn i {
  font-size: 1.1rem;
}


.share-actions {
  margin-bottom: 25px !important;
}

