/* ============================================
   OLIMPIADAS DEL SABER - Design System
   Colors: Green #006633, Yellow #ffce00 (Politécnica del Carchi)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* --- CSS Variables --- */
:root {
  --green: #006633;
  --green-light: #00994d;
  --green-dark: #00331a;
  --green-glow: rgba(0, 102, 51, 0.4);

  --yellow: #ffce00;
  --yellow-light: #ffe066;
  --yellow-dark: #cca300;
  --yellow-glow: rgba(255, 206, 0, 0.35);

  --gray: #9d9d9c;
  --gray-light: #c2c2c1;
  --gray-dark: #6e6e6d;

  --bg-primary: #080e10;
  --bg-secondary: #0d1a12;
  --bg-card: rgba(12, 28, 18, 0.95);
  --bg-glass: rgba(0, 102, 51, 0.08);

  --text-primary: #ffffff;
  --text-secondary: #c8d8cc;
  --text-muted: #7a9a82;

  --correct: #22c55e;
  --incorrect: #ef4444;
  --correct-glow: rgba(34, 197, 94, 0.4);
  --incorrect-glow: rgba(239, 68, 68, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow-green: 0 0 30px var(--green-glow);
  --shadow-glow-yellow: 0 0 30px var(--yellow-glow);

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* --- Animated Background --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 20%, rgba(0, 102, 51, 0.12), transparent),
    radial-gradient(ellipse 500px 500px at 80% 80%, rgba(255, 206, 0, 0.08), transparent),
    radial-gradient(ellipse 400px 300px at 50% 50%, rgba(157, 157, 156, 0.05), transparent);
  z-index: 0;
  pointer-events: none;
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

/* --- App Container --- */
#app {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ============================================
   SETUP SCREEN
   ============================================ */

/* ============================================================
   SETUP SCREEN — Full Viewport Two-Panel Layout
   ============================================================ */
.setup-screen {
  display: flex;
  width: 100%;
  height: 100vh;
  flex-shrink: 0;
  overflow: hidden;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- LEFT: Hero Panel ---- */
.setup-hero {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #071a0e 0%, #0f2d18 45%, #071a0e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

/* Animated orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(55px);
  opacity: 0.5;
  animation: orbFloat 8s ease-in-out infinite;
}

.hero-orb-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, var(--green), transparent);
  top: -100px; left: -100px;
  animation-delay: 0s;
}

.hero-orb-2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--yellow), transparent);
  bottom: -70px; right: 10%;
  animation-delay: 3s;
  opacity: 0.25;
}

.hero-orb-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, var(--green-light), transparent);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: 1.5s;
  opacity: 0.4;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(20px, -20px) scale(1.08); }
}

.hero-orb-3 { animation-name: orbFloatCenter; }
@keyframes orbFloatCenter {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%       { transform: translate(-45%, -55%) scale(1.1); }
}

.setup-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 48px;
  gap: 0;
}

/* Logo */
.hero-logo-wrap {
  position: relative;
  margin-bottom: 24px;
}

.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  object-fit: contain;
  background: white;
  padding: 8px;
  box-shadow: 0 0 0 3px rgba(255,206,0,0.25), 0 8px 40px rgba(0,0,0,0.5);
  animation: logoBreathe 4s ease-in-out infinite;
}

@keyframes logoBreathe {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,206,0,0.25), 0 8px 40px rgba(0,0,0,0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(255,206,0,0.4),  0 12px 50px rgba(0,0,0,0.6); }
}

.hero-logo-ring {
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  border: 2px dashed rgba(255,206,0,0.2);
  animation: ringRotate 20s linear infinite;
}

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Title */
.hero-title {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 12px;
}

.hero-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--yellow), transparent);
  border-radius: 2px;
  margin: 0 auto 12px;
}

.hero-tagline {
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  font-weight: 700;
  color: var(--yellow);
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

.hero-university {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
  margin-bottom: 28px;
}

/* Feature list */
.hero-features {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  max-width: 360px;
}

.hero-feat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-size: 0.87rem;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  text-align: left;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
}

.hero-feat:hover {
  background: rgba(255, 206, 0, 0.09);
  border-color: rgba(255, 206, 0, 0.25);
  color: #ffffff;
  transform: translateX(3px);
}

.hero-feat svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--yellow);
  opacity: 0.9;
}





/* Extra options — single column for readability */
.config-options-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.config-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.config-option-card:hover {
  border-color: rgba(255,206,0,0.25);
  background: rgba(255,206,0,0.04);
}

.config-option-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

/* SVG icon wrapper in option cards */
.config-option-svg {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--yellow-glow);
  border: 1px solid rgba(255, 206, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.config-option-svg svg {
  width: 18px;
  height: 18px;
  color: var(--yellow);
}

.config-option-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.config-option-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 11px;
  transition: 0.3s ease;
  border: 1px solid rgba(255,255,255,0.12);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  transition: 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--green);
  border-color: var(--green);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: white;
}

/* Question limit input */
.question-limit-input {
  width: 54px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,206,0,0.25);
  border-radius: var(--radius-sm);
  color: var(--yellow);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  flex-shrink: 0;
}

.question-limit-input::-webkit-outer-spin-button,
.question-limit-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.question-limit-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255,206,0,0.12);
}

/* Push start button to bottom */
.setup-panel .btn-start {
  margin-top: auto;
}


.auto-timer-info {
  background: var(--bg-glass);
  border: 1px solid rgba(255, 206, 0, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 18px;
}

.auto-timer-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.auto-timer-title svg {
  width: 14px;
  height: 14px;
  color: var(--yellow);
  flex-shrink: 0;
}

/* Mode toggle row */
.timer-mode-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.timer-mode-btn {
  flex: 1;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timer-mode-btn:hover {
  border-color: var(--yellow);
  color: var(--yellow);
}

.timer-mode-btn.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--bg-primary);
}

/* Manual input */
.manual-timer-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.manual-timer-input {
  width: 80px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid rgba(255, 206, 0, 0.3);
  border-radius: var(--radius-sm);
  color: var(--yellow);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.manual-timer-input::-webkit-outer-spin-button,
.manual-timer-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.manual-timer-input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255, 206, 0, 0.15);
}

.auto-timer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.timer-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.timer-chip.vf {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
}

.timer-chip.multiple {
  background: rgba(255, 206, 0, 0.12);
  border: 1px solid rgba(255, 206, 0, 0.3);
  color: var(--yellow-light);
}

.timer-chip.ejercicio {
  background: rgba(99, 179, 237, 0.12);
  border: 1px solid rgba(99, 179, 237, 0.3);
  color: #90cdf4;
}

/* --- Time Extension Buttons (+5 / +10 / +15) --- */
.time-ext-btns {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.time-ext-btn {
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(255, 206, 0, 0.35);
  background: rgba(255, 206, 0, 0.08);
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.time-ext-btn:hover {
  background: rgba(255, 206, 0, 0.2);
  border-color: var(--yellow);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(255, 206, 0, 0.2);
}

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

/* Flash when time is added */
.timer-text.time-added {
  color: var(--yellow) !important;
  text-shadow: 0 0 16px rgba(255, 206, 0, 0.8) !important;
  animation: timeAddedPop 0.6s ease;
}

@keyframes timeAddedPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* badge-manual */
.question-type-badge.badge-manual {
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
}

/* --- Game Topbar Brand --- */
.game-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: white;
  padding: 2px;
  flex-shrink: 0;
}

.game-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.game-brand-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--yellow);
}

.game-brand-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Question Type Badge (in timer row) --- */
.question-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.question-type-badge.badge-vf {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.question-type-badge.badge-multiple {
  background: rgba(255, 206, 0, 0.12);
  border: 1px solid rgba(255, 206, 0, 0.35);
  color: var(--yellow-light);
}

.question-type-badge.badge-ejercicio {
  background: rgba(99, 179, 237, 0.12);
  border: 1px solid rgba(99, 179, 237, 0.35);
  color: #90cdf4;
}

/* --- Results Logo --- */
.results-logo {
  margin-bottom: 16px;
}

.results-logo-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: white;
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-md);
}

/* --- Form Controls --- */
.form-group {
  margin-bottom: 18px;
}

.form-group.compact {
  margin-bottom: 0;
}

/* Settings row: timer + volume side by side */
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.form-label svg {
  width: 16px;
  height: 16px;
  color: var(--yellow);
}

.file-drop-zone {
  border: 2px dashed rgba(255, 206, 0, 0.25);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-glass);
  position: relative;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--yellow);
  background: rgba(255, 206, 0, 0.05);
  box-shadow: var(--shadow-glow-yellow);
}

.file-drop-zone.file-loaded {
  border-color: var(--green);
  background: rgba(0, 102, 51, 0.08);
  border-style: solid;
}

.file-drop-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--yellow);
  opacity: 0.7;
  transition: opacity var(--transition-base);
}

.file-drop-zone:hover .file-drop-icon {
  opacity: 1;
}

.file-drop-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.file-drop-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-loaded-info {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.file-loaded-info svg {
  width: 24px;
  height: 24px;
  color: var(--correct);
}

.file-loaded-info span {
  font-weight: 600;
  color: var(--correct);
}

/* Timer input */
.timer-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  transition: border-color var(--transition-base);
}

.timer-input-wrapper:focus-within {
  border-color: var(--yellow);
}

.timer-input-wrapper svg {
  width: 20px;
  height: 20px;
  color: var(--yellow);
  flex-shrink: 0;
}

.timer-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  width: 80px;
}

.timer-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.timer-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* JSON Format Help */
.format-help {
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 8px;
}

.format-help-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: color var(--transition-fast);
  width: 100%;
}

.format-help-toggle:hover {
  color: var(--yellow);
}

.format-help-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.format-help-toggle.open svg {
  transform: rotate(90deg);
}

.format-help-content {
  margin-top: 12px;
  display: none;
}

.format-help-content.open {
  display: block;
}

.format-help-content pre {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.75rem;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--gray-light);
  font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Start Button */
.btn-start {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-glow-green);
  margin-top: 8px;
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px var(--green-glow);
}

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

.btn-start:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-start svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   GAME SCREEN
   ============================================ */

.game-screen {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px;
  animation: fadeSlideUp 0.5s ease;
}

/* --- Top Bar --- */
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0;
  gap: 12px;
}

.game-progress-info {
  display: flex;
  align-items: center;
}

.question-badge {
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(0, 102, 51, 0.3);
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Inline volume control in game */
.volume-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(20, 28, 48, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 4px 12px;
}

.volume-inline .vol-icon {
  width: 14px;
  height: 14px;
  color: var(--yellow);
  flex-shrink: 0;
}

.volume-slider-mini {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.volume-slider-mini::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(255, 206, 0, 0.4);
}

.volume-slider-mini::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--yellow);
  cursor: pointer;
  border: none;
}

.volume-value-mini {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--yellow);
  min-width: 36px;
  text-align: right;
}

/* Volume control in setup */
.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--yellow);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 206, 0, 0.5);
  transition: transform 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--yellow);
  cursor: pointer;
  border: none;
}

.volume-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--yellow);
  min-width: 52px;
  text-align: right;
  white-space: nowrap;
}

/* --- Timer Bar --- */
.timer-container {
  margin-bottom: 14px;
}

.timer-bar-wrapper {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  height: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-light), var(--yellow));
  border-radius: var(--radius-full);
  transition: width 1s linear;
  position: relative;
  box-shadow: 0 0 8px rgba(0, 200, 83, 0.4);
}

.timer-bar.warning {
  background: linear-gradient(90deg, var(--yellow-dark), var(--yellow));
  box-shadow: 0 0 8px rgba(255, 206, 0, 0.5);
}

.timer-bar.danger {
  background: linear-gradient(90deg, var(--incorrect), #ff6e40);
  animation: timerPulse 0.5s ease infinite;
  box-shadow: 0 0 12px rgba(255, 23, 68, 0.6);
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.timer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
}

.timer-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.timer-text svg {
  width: 18px;
  height: 18px;
}

.timer-text.warning {
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(255, 206, 0, 0.3);
}

.timer-text.danger {
  color: var(--incorrect);
  text-shadow: 0 0 10px rgba(255, 23, 68, 0.4);
}

/* --- Pause Button --- */
.btn-pause {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ffffff;
  transition: all var(--transition-base);
  flex-shrink: 0;
}

.btn-pause:hover {
  background: rgba(255, 206, 0, 0.15);
  border-color: var(--yellow);
  color: var(--yellow);
  transform: scale(1.1);
}

.btn-pause svg {
  width: 16px;
  height: 16px;
}

.btn-pause.paused {
  background: rgba(255, 206, 0, 0.15);
  border-color: var(--yellow);
  color: var(--yellow);
  animation: pausePulse 1.5s ease-in-out infinite;
}

@keyframes pausePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 206, 0, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(255, 206, 0, 0); }
}



/* --- Question Card --- */
.question-card {
  background: rgba(20, 28, 48, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 102, 51, 0.08);
  margin-bottom: 14px;
}

.question-card.compact {
  padding: 20px 24px;
}

.question-number {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
  box-shadow: 0 0 15px rgba(0, 102, 51, 0.3);
}

.question-text {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.5;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* --- Answer Options --- */
.answers-grid {
  display: grid;
  gap: 10px;
}

.answer-option {
  background: rgba(20, 30, 55, 0.95);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.answer-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.answer-option:hover:not(.disabled) {
  border-color: var(--yellow);
  transform: translateX(6px);
  box-shadow: 0 0 25px rgba(255, 206, 0, 0.2), inset 0 0 30px rgba(255, 206, 0, 0.03);
  background: rgba(30, 40, 70, 0.95);
}

.answer-option:hover:not(.disabled)::before {
  background: linear-gradient(135deg, rgba(255, 206, 0, 0.06), transparent);
  opacity: 1;
}

.answer-letter {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 206, 0, 0.12);
  border: 1.5px solid rgba(255, 206, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--yellow);
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.answer-text {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: #ffffff;
  flex: 1;
  position: relative;
  z-index: 1;
}

.answer-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-base);
  position: relative;
  z-index: 1;
}

/* Correct state */
.answer-option.correct {
  border-color: var(--correct);
  background: rgba(0, 200, 83, 0.1);
  box-shadow: 0 0 30px var(--correct-glow);
  animation: correctPop 0.4s ease;
}

.answer-option.correct .answer-letter {
  background: var(--correct);
  color: white;
  border-color: var(--correct);
}

.answer-option.correct .answer-icon {
  opacity: 1;
  color: var(--correct);
}

/* Incorrect state */
.answer-option.incorrect {
  border-color: var(--incorrect);
  background: rgba(255, 23, 68, 0.1);
  box-shadow: 0 0 30px var(--incorrect-glow);
  animation: incorrectShake 0.5s ease;
}

.answer-option.incorrect .answer-letter {
  background: var(--incorrect);
  color: white;
  border-color: var(--incorrect);
}

.answer-option.incorrect .answer-icon {
  opacity: 1;
  color: var(--incorrect);
}

/* Disabled state */
.answer-option.disabled {
  cursor: default;
  opacity: 0.5;
}

.answer-option.disabled:not(.correct):not(.incorrect):not(.selected-suspense) {
  opacity: 0.35;
}

/* Suspense state - pulsing selected answer during drumroll */
.answer-option.selected-suspense {
  border-color: var(--yellow);
  background: rgba(255, 206, 0, 0.08);
  opacity: 1 !important;
  animation: suspensePulse 0.6s ease-in-out infinite;
}

.answer-option.selected-suspense .answer-letter {
  background: var(--yellow);
  color: var(--bg-primary);
  border-color: var(--yellow);
}

@keyframes suspensePulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 206, 0, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 206, 0, 0.6), 0 0 60px rgba(255, 206, 0, 0.2);
    transform: scale(1.02);
  }
}

@keyframes correctPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes incorrectShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* --- Feedback Banner --- */
.feedback-banner {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 12px;
  animation: fadeSlideUp 0.3s ease;
}

.feedback-banner.correct {
  background: rgba(0, 200, 83, 0.12);
  border: 1px solid rgba(0, 200, 83, 0.3);
}

.feedback-banner.incorrect {
  background: rgba(255, 23, 68, 0.12);
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.feedback-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feedback-banner.correct .feedback-icon {
  background: var(--correct);
  color: white;
}

.feedback-banner.incorrect .feedback-icon {
  background: var(--incorrect);
  color: white;
}

.feedback-icon svg {
  width: 22px;
  height: 22px;
}

.feedback-text {
  flex: 1;
}

.feedback-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.feedback-banner.correct .feedback-title {
  color: var(--correct);
}

.feedback-banner.incorrect .feedback-title {
  color: var(--incorrect);
}

.feedback-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.feedback-detail strong {
  color: var(--correct);
}

/* --- Next Button --- */
.btn-next {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--yellow-dark), var(--yellow));
  color: var(--bg-primary);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-glow-yellow);
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px var(--yellow-glow);
}

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

.btn-next svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   RESULTS SCREEN
   ============================================ */

.results-screen {
  width: 100%;
  max-width: 600px;
  animation: fadeSlideUp 0.5s ease;
}

.results-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.results-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: resultBounce 0.6s ease;
}

.results-icon.great {
  background: linear-gradient(135deg, var(--green), var(--green-light));
  box-shadow: var(--shadow-glow-green);
}

.results-icon.ok {
  background: linear-gradient(135deg, var(--yellow-dark), var(--yellow));
  box-shadow: var(--shadow-glow-yellow);
}

.results-icon.poor {
  background: linear-gradient(135deg, var(--incorrect), #ff6e40);
  box-shadow: 0 0 30px var(--incorrect-glow);
}

.results-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

@keyframes resultBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.results-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.results-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

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

.stat-card {
  background: var(--bg-glass);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 20px 12px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.stat-card:nth-child(1) .stat-value {
  color: var(--yellow);
}

.stat-card:nth-child(2) .stat-value {
  color: var(--correct);
}

.stat-card:nth-child(3) .stat-value {
  color: var(--incorrect);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.btn-restart {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-glow-green);
}

.btn-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px var(--green-glow);
}

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

.btn-restart svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   FEEDBACK FULLSCREEN OVERLAY
   ============================================ */

.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.feedback-overlay.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.feedback-overlay.correct {
  background: radial-gradient(ellipse at center, rgba(0, 180, 70, 0.96) 0%, rgba(0, 100, 40, 0.98) 100%);
}

.feedback-overlay.incorrect {
  background: radial-gradient(ellipse at center, rgba(220, 30, 60, 0.96) 0%, rgba(120, 0, 20, 0.98) 100%);
}

.feedback-overlay-inner {
  text-align: center;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 560px;
  width: 100%;
}

.feedback-emoji {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.4));
  animation: emojiBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes emojiBounce {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

.feedback-overlay-title {
  font-size: 3rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  line-height: 1;
}

.feedback-overlay-detail {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
}

.fb-sub {
  font-weight: 500;
  opacity: 0.85;
}

.fb-answer {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.feedback-next-btn {
  margin-top: 12px;
  padding: 16px 48px;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 9999px;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.feedback-next-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: #ffffff;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.feedback-next-btn:active {
  transform: translateY(0) scale(1);
}

.feedback-next-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
  .setup-card {
    padding: 28px 20px;
  }

  .setup-title {
    font-size: 1.4rem;
  }

  .question-card {
    padding: 24px 18px;
  }

  .question-text {
    font-size: 1.1rem;
  }

  .answer-option {
    padding: 14px 16px;
  }

  .results-card {
    padding: 36px 24px;
  }

  .results-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .game-topbar {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ============================================================
   PROJECTOR / SECOND SCREEN STYLES
   ============================================================ */

/* Projector bar in setup */
.projector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 102, 51, 0.12);
  border: 1.5px solid rgba(0, 102, 51, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
}

.projector-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.projector-bar-left > svg {
  width: 22px;
  height: 22px;
  color: var(--green-light);
  flex-shrink: 0;
}

.projector-bar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.projector-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-projector {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: transparent;
  border: 1.5px solid var(--gray-dark);
  border-radius: var(--radius-full);
  color: var(--gray);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: not-allowed;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-projector svg {
  width: 16px;
  height: 16px;
}

.btn-projector.ready {
  background: var(--green);
  border: 1.5px solid var(--green);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 102, 51, 0.35);
}

.btn-projector.ready:hover {
  background: var(--green-light);
  border-color: var(--green-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 153, 77, 0.45);
}

.btn-projector.active {
  background: linear-gradient(135deg, var(--yellow), var(--yellow-light));
  border-color: var(--yellow);
  color: #0d1a12;
  cursor: pointer;
  box-shadow: 0 0 20px var(--yellow-glow);
}

/* ---- Projector Full Screen ---- */
.projector-screen {
  position: fixed;
  inset: 0;
  background: #060d0a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  z-index: 1000;
}

/* Header */
.proj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 36px;
  background: linear-gradient(135deg, rgba(0,102,51,0.5), rgba(0,51,26,0.6));
  border-bottom: 2px solid rgba(255, 206, 0, 0.25);
  flex-shrink: 0;
}

.proj-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.proj-logo {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: contain;
  background: white;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.proj-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.proj-title {
  font-size: 1.7rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ffce00, #ffe066);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1;
}

.proj-sub {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.04em;
}

.proj-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.proj-question-badge {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  padding: 6px 20px;
}

.proj-type-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.proj-type-badge.badge-vf {
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.4);
  color: #4ade80;
}

.proj-type-badge.badge-multiple {
  background: rgba(255,206,0,0.12);
  border: 1px solid rgba(255,206,0,0.35);
  color: #ffe066;
}

.proj-type-badge.badge-ejercicio {
  background: rgba(99,179,237,0.12);
  border: 1px solid rgba(99,179,237,0.35);
  color: #90cdf4;
}

/* Timer bar strip */
.proj-timer-bar-wrap {
  position: relative;
  height: 10px;
  background: rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.proj-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #006633, #00994d);
  transition: width 0.9s linear, background-color 0.3s;
}

.proj-timer-bar.warning {
  background: linear-gradient(90deg, #cca300, #ffce00);
}

.proj-timer-bar.danger {
  background: linear-gradient(90deg, #991b1b, #ef4444);
  animation: dangerPulse 0.5s ease infinite alternate;
}

@keyframes dangerPulse {
  from { opacity: 0.8; }
  to   { opacity: 1; }
}

.proj-timer-text {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.4);
  padding: 1px 8px;
  border-radius: 4px;
}

/* Question text */
.proj-question-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 28px) 40px clamp(8px, 2vh, 16px);
  flex-shrink: 1;
  min-height: 0;
}

.proj-question-text {
  font-size: clamp(1.2rem, 4vmin, 2.4rem);
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  line-height: 1.4;
  max-width: 1100px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  overflow-y: auto;
  max-height: 100%;
}

/* Answers grid */
.proj-answers {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 2vh, 16px);
  padding: clamp(8px, 2vh, 10px) 40px clamp(16px, 4vh, 28px);
  align-content: center;
  min-height: 0;
}

.proj-answer {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: clamp(10px, 2vh, 18px) 20px;
  transition: all 0.3s ease;
  min-height: 0;
}

.proj-answer-letter {
  width: clamp(32px, 5vmin, 40px);
  height: clamp(32px, 5vmin, 40px);
  border-radius: 10px;
  background: rgba(255,206,0,0.15);
  border: 1.5px solid rgba(255,206,0,0.35);
  color: #ffe066;
  font-size: clamp(0.9rem, 2vmin, 1.1rem);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- RIGHT: Config Panel ---- */
.setup-panel {
  width: 500px;
  min-width: 440px;
  height: 100vh;
  background: #080f0a;
  border-left: 1px solid rgba(255,206,0,0.08);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Subtle dot grid texture */
.setup-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,206,0,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* Panel Header */
.panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 32px 20px;
  border-bottom: 1px solid rgba(255,206,0,0.1);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(0,102,51,0.15) 0%, transparent 100%);
}

.panel-header > svg {
  width: 26px;
  height: 26px;
  color: var(--yellow);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255,206,0,0.4));
}

.panel-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.panel-header-left h2 {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.panel-file-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #f87171;
  letter-spacing: 0.03em;
  transition: all 0.4s ease;
}

.panel-file-badge.loaded {
  background: rgba(0,102,51,0.2);
  border-color: rgba(0,200,90,0.4);
  color: #4ade80;
  box-shadow: 0 0 8px rgba(0,200,90,0.2);
}

/* ============================================================
   Setup Views System
   ============================================================ */
.setup-views-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.setup-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(30px);
}

.setup-view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.setup-view.hidden {
  display: none;
}

/* ============================================================
   MAIN MENU VIEW — Big premium card buttons
   ============================================================ */
.setup-menu-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 28px 20px;
  flex: 1;
}

/* Section label above buttons */
.menu-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 0 4px;
  margin-bottom: 2px;
}

.setup-menu-btn {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.25s ease, box-shadow 0.3s ease;
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Shimmer on hover */
.setup-menu-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  transition: left 0.5s ease;
}

.setup-menu-btn:hover::after {
  left: 140%;
}

.setup-menu-btn:hover {
  background: rgba(0,102,51,0.12);
  border-color: rgba(255,206,0,0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,206,0,0.1);
}

.setup-menu-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Icon box */
.menu-btn-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,102,51,0.4), rgba(0,60,30,0.6));
  border: 1px solid rgba(255,206,0,0.15);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
  transition: box-shadow 0.3s ease;
}

.setup-menu-btn:hover .menu-btn-icon {
  box-shadow: 0 4px 20px rgba(255,206,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

.menu-btn-icon svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 5px rgba(255,206,0,0.35));
}

/* Text group */
.menu-btn-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.menu-btn-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.menu-btn-desc {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s;
}

.setup-menu-btn:hover .menu-btn-desc {
  color: rgba(255,255,255,0.6);
}

/* Arrow chevron */
.menu-btn-arrow {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.25);
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.setup-menu-btn:hover .menu-btn-arrow {
  background: rgba(255,206,0,0.12);
  border-color: rgba(255,206,0,0.3);
  color: var(--yellow);
}

/* Start button section */
.menu-start-wrap {
  padding: 20px 28px 28px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.btn-start.menu-btn-start {
  width: 100%;
  padding: 18px 28px;
  border-radius: 18px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,102,51,0.4), 0 2px 8px rgba(0,0,0,0.4);
}

.btn-start.menu-btn-start:not(:disabled):hover {
  box-shadow: 0 12px 40px rgba(0,102,51,0.6), 0 2px 8px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}

.btn-start.menu-btn-start:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================================
   SECONDARY VIEWS — Back btn + scrollable content
   ============================================================ */
.btn-back-view {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 20px 28px 8px;
  cursor: pointer;
  transition: color 0.2s ease;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.btn-back-view:hover {
  color: var(--yellow);
}

.btn-back-view svg {
  width: 16px;
  height: 16px;
}

/* View title below back button */
.view-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  padding: 0 28px 16px;
  letter-spacing: -0.02em;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.view-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,206,0,0.15) transparent;
}

.view-content-scroll::-webkit-scrollbar { width: 3px; }
.view-content-scroll::-webkit-scrollbar-track { background: transparent; }
.view-content-scroll::-webkit-scrollbar-thumb { background: rgba(255,206,0,0.2); border-radius: 2px; }

/* ============================================================
   Config sections inside views
   ============================================================ */
.config-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.config-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.config-label svg {
  width: 13px;
  height: 13px;
  color: var(--yellow);
  flex-shrink: 0;
}

/* Compact file drop zone */
.file-drop-zone.compact {
  padding: 18px 20px;
  flex-direction: row;
  gap: 14px;
  min-height: unset;
}

.file-drop-zone.compact .file-drop-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.file-drop-zone.compact .file-drop-icon svg {
  width: 22px;
  height: 22px;
}

.file-drop-zone.compact .file-drop-text {
  font-size: 0.84rem;
  text-align: left;
}

.file-drop-zone.compact .file-drop-hint {
  text-align: left;
}

/* Config grid: 2-column for Timer + Volume */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.config-grid .config-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 16px 18px;
}

/* ============================================================
   Extra options (Shuffle & Limit) — single column
   ============================================================ */
.config-options-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.config-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 16px 18px;
  transition: all 0.3s ease;
}

.config-option-card:hover {
  border-color: rgba(255,206,0,0.3);
  background: rgba(255,206,0,0.04);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.config-option-info {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

/* SVG icon wrapper in option cards */
.config-option-svg {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,206,0,0.1), rgba(255,206,0,0.02));
  border: 1px solid rgba(255, 206, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.config-option-svg svg {
  width: 20px;
  height: 20px;
  color: var(--yellow);
  filter: drop-shadow(0 0 4px rgba(255,206,0,0.3));
}

.config-option-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1.3;
}

.config-option-desc {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-top: 3px;
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  transition: 0.3s ease;
  border: 1px solid rgba(255,255,255,0.1);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  transition: 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.toggle-switch input:checked + .toggle-slider {
  background: #00c85a;
  border-color: #00c85a;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2), 0 0 10px rgba(0,200,90,0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: white;
}

/* Question limit input */
.question-limit-input {
  width: 60px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,206,0,0.3);
  border-radius: 8px;
  color: var(--yellow);
  font-size: 0.95rem;
  font-weight: 800;
  font-family: inherit;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  flex-shrink: 0;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.question-limit-input::-webkit-outer-spin-button,
.question-limit-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.question-limit-input:focus {
  border-color: var(--yellow);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2), 0 0 0 3px rgba(255,206,0,0.15);
  background: rgba(255,255,255,0.08);
}


.proj-answer-text {
  font-size: clamp(0.9rem, 2.5vmin, 1.4rem);
  font-weight: 600;
  color: #e2e8f0;
  flex: 1;
  line-height: 1.2;
}

.proj-answer-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.proj-answer-icon svg {
  width: 28px;
  height: 28px;
}

/* Suspense animation */
.proj-answer.proj-suspense {
  border-color: #ffce00;
  background: rgba(255,206,0,0.12);
  box-shadow: 0 0 30px rgba(255,206,0,0.25);
  animation: projSuspensePulse 0.7s ease infinite alternate;
}

@keyframes projSuspensePulse {
  from { box-shadow: 0 0 20px rgba(255,206,0,0.2); }
  to   { box-shadow: 0 0 40px rgba(255,206,0,0.5); }
}

/* Correct / Incorrect states */
.proj-answer.proj-correct {
  border-color: #22c55e;
  background: rgba(34,197,94,0.15);
  box-shadow: 0 0 30px rgba(34,197,94,0.25);
}

.proj-answer.proj-correct .proj-answer-letter {
  background: rgba(34,197,94,0.2);
  border-color: #22c55e;
  color: #4ade80;
}

.proj-answer.proj-correct .proj-answer-icon {
  color: #4ade80;
}

.proj-answer.proj-incorrect {
  border-color: #ef4444;
  background: rgba(239,68,68,0.12);
  box-shadow: 0 0 30px rgba(239,68,68,0.2);
}

.proj-answer.proj-incorrect .proj-answer-letter {
  background: rgba(239,68,68,0.15);
  border-color: #ef4444;
  color: #f87171;
}

.proj-answer.proj-incorrect .proj-answer-icon {
  color: #f87171;
}

/* Waiting overlay */
.proj-waiting {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #060d0a 0%, #0d1a12 50%, #060d0a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 50;
}

.proj-waiting-logo {
  width: 150px;
  height: 150px;
  border-radius: 24px;
  object-fit: contain;
  background: white;
  padding: 10px;
  box-shadow: 0 0 60px rgba(255,206,0,0.3), 0 0 0 4px rgba(255,206,0,0.15);
  animation: logoPulse 3s ease infinite;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 40px rgba(255,206,0,0.2), 0 0 0 4px rgba(255,206,0,0.1); }
  50%       { box-shadow: 0 0 80px rgba(255,206,0,0.5), 0 0 0 4px rgba(255,206,0,0.3); }
}

.proj-waiting-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #ffce00, #ffe066);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  margin-top: 8px;
}

.proj-waiting-sub {
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
  color: rgba(255,206,0,0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.proj-waiting-dots {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.proj-waiting-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-light);
  animation: dotBounce 1.2s ease infinite;
}

.proj-waiting-dots span:nth-child(2) { animation-delay: 0.2s; }
.proj-waiting-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-12px); opacity: 1; }
}

.proj-waiting-hint {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.05em;
  margin-top: 4px;
}
