:root {
  --quiz-primary: #F09E0B;
  --quiz-success: #16a34a;
  --quiz-danger: #dc2626;
  --quiz-card-bg: #263549;
  --quiz-border: #3d4f63;
  --quiz-text: #e5e7eb;
  --player-max-width: 1200px;
  --player-primary: var(--quiz-primary);
  --player-border: var(--quiz-border);
  --player-text: var(--quiz-text);
}

main.quiz-player-main {
  padding: 1rem 0 3rem;
}

.question-card,
.state-card,
.quiz-summary {
  border: 1px solid var(--quiz-border);
  background: linear-gradient(180deg, rgba(38, 53, 73, 0.98), rgba(26, 37, 47, 0.98));
  border-radius: 18px;
  padding: 1.5rem;
}

.download-section {
  text-align: center;
  margin: 0;
}

.download-link {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--quiz-primary), #f59e0b);
  color: #1a252f;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(240, 158, 11, 0.3);
}

.download-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(240, 158, 11, 0.4);
}

.download-link:active {
  transform: translateY(0);
}

.scorebar {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  border: 2px solid var(--quiz-border);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(38, 53, 73, 0.7);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--quiz-text);
}

.question-card {
  margin: 0;
}

.q-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.q-number {
  font-weight: 700;
  color: var(--quiz-primary);
  min-width: 2.5rem;
  text-align: right;
  font-size: 1rem;
}

.q-text {
  font-size: 1.08rem;
  color: var(--quiz-text);
  font-weight: 600;
}

.answers {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.answer,
button.answer {
  border: 1px solid var(--quiz-border);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(38, 53, 73, 0.5);
  transition: all 0.2s ease;
}

button.answer {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  cursor: pointer;
  user-select: none;
  color: var(--quiz-text);
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  text-align: center;
}

.answer:hover,
button.answer:hover:not(:disabled) {
  border-color: var(--quiz-primary);
  background: rgba(240, 158, 11, 0.1);
}

.answer input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.answer label {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.answer label:hover {
  background: rgba(240, 158, 11, 0.15);
}

button.answer:disabled {
  cursor: default;
  opacity: 0.7;
}

.answer.correct,
button.answer.correct {
  border-color: rgba(22, 163, 74, 0.8);
  background: rgba(22, 163, 74, 0.12);
}

.answer.correct label {
  background: rgba(22, 163, 74, 0.15);
}

.answer.wrong,
button.answer.wrong {
  border-color: rgba(220, 38, 38, 0.8);
  background: rgba(220, 38, 38, 0.12);
}

.answer.wrong label {
  background: rgba(220, 38, 38, 0.15);
}

@media (min-width: 700px) {
  .answers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.feedback {
  margin-top: 1rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.feedback.ok {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.feedback.no {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

button {
  appearance: none;
  border: 1px solid var(--quiz-border);
  color: var(--quiz-text);
  background: rgba(38, 53, 73, 0.6);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

button:hover {
  background: rgba(240, 158, 11, 0.16);
  border-color: var(--quiz-primary);
}

button.ghost {
  background: transparent;
  border-color: var(--quiz-primary);
  color: var(--quiz-primary);
}

body[data-theme="light"] .question-card {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 239, 226, 0.98));
  border-color: rgba(212, 136, 6, 0.2);
  color: #1f2937;
}

body[data-theme="light"] .state-card {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 239, 226, 0.98));
  border-color: rgba(212, 136, 6, 0.2);
  color: #1f2937;
}

body[data-theme="light"] .pill {
  background: rgba(255, 247, 234, 0.98) !important;
  color: #1f2937 !important;
  border-color: #d7c8b2 !important;
}

body[data-theme="light"] .answer,
body[data-theme="light"] button.answer {
  background: rgba(255, 253, 249, 0.98);
  border-color: rgba(212, 136, 6, 0.18);
}

body[data-theme="light"] .answer:hover,
body[data-theme="light"] button.answer:hover:not(:disabled) {
  background: rgba(255, 240, 210, 0.72);
}

body[data-theme="light"] .answer label,
body[data-theme="light"] button.answer {
  color: #1f2937 !important;
}

body[data-theme="light"] .answer label:hover {
  background: rgba(255, 240, 210, 0.72);
}

body[data-theme="light"] .answer.correct,
body[data-theme="light"] button.answer.correct {
  background: rgba(22, 163, 74, 0.12);
}

body[data-theme="light"] .answer.correct label {
  background: rgba(22, 163, 74, 0.16);
}

body[data-theme="light"] .answer.wrong,
body[data-theme="light"] button.answer.wrong {
  background: rgba(220, 38, 38, 0.1);
}

body[data-theme="light"] .answer.wrong label {
  background: rgba(220, 38, 38, 0.14);
}

body[data-theme="light"] .q-text {
  color: #1f2937;
}

body[data-theme="light"] .quiz-summary {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(247, 239, 226, 0.98));
  border-color: rgba(212, 136, 6, 0.2);
  color: #1f2937;
}

body[data-theme="light"] .summary-pill {
  background: rgba(255, 247, 234, 0.98) !important;
  color: #1f2937 !important;
  border-color: #d7c8b2 !important;
}

body[data-theme="light"] .feedback {
  background: #fffdf9;
  border-color: #d7c8b2;
  color: #1f2937;
}

body[data-theme="light"] .feedback.ok {
  color: #166534;
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.28);
}

body[data-theme="light"] .feedback.no {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.24);
}

body[data-theme="light"] button {
  color: #1f2937;
}

@media (max-width: 768px) {
  .question-card {
    padding: 1rem;
  }

  .scorebar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .pill,
  .scorebar button,
  .summary-retry {
    width: 100%;
    text-align: center;
  }
}