/* ==================== COMPONENTS & UI ELEMENTS ==================== */

/* Header */
.quiz-header {
  text-align: center;
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 2px solid rgba(255, 68, 68, 0.2);
  position: relative;
}

body.shield-mode .quiz-header { border-bottom-color: rgba(0, 200, 200, 0.2); }
body.spear-mode .quiz-header { border-bottom-color: rgba(255, 215, 0, 0.2); }
body.bow-mode .quiz-header { border-bottom-color: rgba(0, 255, 127, 0.2); }

.shield-logo {
  animation: shieldFloat 3s infinite ease-in-out;
  filter: drop-shadow(0 0 25px var(--glow-1));
}

@keyframes shieldFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.05); }
}

.glow-text {
  font-family: "Cinzel", serif;
  font-size: 38px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent), #ffcc00, var(--primary));
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textShine 4s linear infinite;
  margin: 16px 0;
  letter-spacing: 2px;
  text-transform: uppercase;
}

@keyframes textShine { to { background-position: 300% center; } }

.subtitle {
  color: var(--text-medium);
  font-size: 16px;
  text-shadow: 0 0 15px var(--glow-2);
  font-weight: 500;
  letter-spacing: 1px;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-control {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(20, 5, 5, 0.85);
  color: var(--text-light);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.btn-control:hover {
  transform: translateY(-3px) scale(1.1);
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--glow-1);
}

.btn-theme {
  min-width: 170px;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255, 68, 68, 0.25), rgba(255, 136, 0, 0.2));
  border: 2px solid var(--primary);
  color: var(--text-light);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.btn-theme:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 25px var(--glow-1);
}

/* Start Screen */
.welcome-section {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.start-stats-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.start-stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  font-size: 13px;
}

.pill-label { color: var(--text-medium); }
.pill-value { color: var(--accent); font-weight: 700; }

.input-group {
  margin-bottom: 24px;
  text-align: left;
}

.input-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 14px;
  text-transform: uppercase;
}

.hero-input, .difficulty-select {
  width: 100%;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-size: 15px;
  font-family: inherit;
}

.hero-input:focus, .difficulty-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--glow-1);
}

/* Buttons */
.btn {
  padding: 14px 32px;
  border: none;
  border-radius: 9999px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3), 0 0 30px var(--glow-1);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 35px var(--glow-1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-light);
}

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

.btn-large {
  width: 100%;
  padding: 16px 36px;
  font-size: 18px;
}

/* Stats Panel & Timer */
.stats-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
}

.stat-icon { font-size: 24px; }
.stat-label { font-size: 11px; color: var(--text-medium); text-transform: uppercase; }
.stat-value { font-size: 20px; font-weight: 800; color: var(--primary); }

#timerCard.warning {
  animation: timerPulse 0.5s infinite alternate;
  border-color: #ff0000;
}

@keyframes timerPulse {
  0% { transform: scale(1); box-shadow: 0 0 10px #ff0000; }
  100% { transform: scale(1.05); box-shadow: 0 0 25px #ff0000; }
}

/* Lifelines Bar */
.lifelines-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 18px 0;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.lifeline-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.lifeline-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.lifeline-btn:hover:not(.used) {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--glow-1);
}

.lifeline-btn.used {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(1);
  text-decoration: line-through;
}

/* Question & Options */
.question-set {
  border: none;
  margin-bottom: 25px;
  text-align: left;
}

.question-set legend {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.4;
}

.question-number { color: var(--accent); margin-right: 6px; }

.options {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option {
  display: block;
  cursor: pointer;
  position: relative;
}

.option input { display: none; }

.option-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  font-size: 16px;
  transition: all 0.3s var(--transition);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--accent);
}

.option-text { flex-grow: 1; }
.option-check { opacity: 0; transition: opacity 0.2s; font-weight: 800; }

.option:hover .option-content {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(6px);
}

.option.selected .option-content {
  border-color: var(--primary);
  background: linear-gradient(90deg, rgba(255, 68, 68, 0.2), rgba(0, 0, 0, 0.4));
  box-shadow: 0 0 20px var(--glow-1);
}

.option.selected .option-check { opacity: 1; color: var(--primary); }

/* Progress Bar */
.progress-container { margin-bottom: 25px; }

.progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.4s ease;
}

.progress-text { text-align: right; font-size: 12px; color: var(--text-medium); margin-top: 4px; }

.keyboard-hints {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 16px 0;
  font-size: 12px;
  color: var(--text-medium);
  flex-wrap: wrap;
}

.keyboard-hints kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.nav-buttons {
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

/* Results Screen */
.results { text-align: center; display: none; }
.results.active { display: block; animation: containerFadeIn 0.6s ease; }
.trophy-icon { font-size: 64px; margin-bottom: 10px; animation: badgePulse 2s infinite; }

.score-container {
  display: flex;
  justify-content: center;
  margin: 25px 0;
}

.score-circle {
  position: relative;
  width: 180px;
  height: 180px;
}

.score-ring { transform: rotate(-90deg); }
.score-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 12; }
.score-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 502;
  stroke-dashoffset: 502;
  transition: stroke-dashoffset 1.5s ease-in-out;
}

.score-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score { font-size: 32px; font-weight: 900; color: #fff; }
.score-percent { font-size: 16px; color: var(--accent); font-weight: 700; }
.score-message { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 20px; }

.results-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 25px;
}

.results-stat-item {
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.results-stat-label { font-size: 12px; color: var(--text-medium); }
.results-stat-value { font-size: 18px; font-weight: 800; color: var(--accent); margin-top: 4px; }
.results-actions { display: flex; gap: 16px; justify-content: center; margin-top: 25px; flex-wrap: wrap; }
