* {
  box-sizing: border-box;
}

:root {
  --bg: #fff8ec;
  --text: #22223b;
  --muted: #4a4e69;
  --card: #ffffff;
  --focus: #1d4ed8;
  --anime: #e0457b;
  --fortnite: #7c3aed;
  --roblox: #dc2626;
  --brawl: #b45309;
}

html,
body {
  margin: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

.hero {
  text-align: center;
  margin-bottom: 32px;
}

.hero-icon {
  font-size: 3.5rem;
  line-height: 1;
}

h1 {
  margin: 8px 0 12px;
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.intro {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--muted);
}

h2 {
  text-align: center;
  font-size: 1.375rem;
  margin: 0 0 16px;
}

.topics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 360px) {
  .topics {
    grid-template-columns: 1fr;
  }
}

.topic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  padding: 16px 8px;
  border: none;
  border-radius: 18px;
  color: #ffffff;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.topic:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
}

.topic:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.topic:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

.topic-icon {
  font-size: 2.25rem;
  line-height: 1;
}

.topic-name {
  overflow-wrap: anywhere;
  text-align: center;
}

.topic-anime { background: var(--anime); }
.topic-fortnite { background: var(--fortnite); }
.topic-roblox { background: var(--roblox); }
.topic-brawl { background: var(--brawl); }

[hidden] {
  display: none !important;
}

/* ---------- Quizrunde (BCA-03) ---------- */

.quiz-topic {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
}

.question {
  margin: 0 0 20px;
  font-size: 1.375rem;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
}

.question:focus {
  outline: none;
}

.answers {
  display: grid;
  gap: 12px;
}

.answer {
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 3px solid #d6d3e8;
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.answer:hover:not(:disabled) {
  border-color: var(--fortnite);
}

.answer:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
}

.answer:disabled {
  cursor: default;
  opacity: 1;
  color: var(--text);
}

.answer.correct {
  border-color: #15803d;
  background: #dcfce7;
  color: #14532d;
}

.answer.wrong {
  border-color: #b91c1c;
  background: #fee2e2;
  color: #7f1d1d;
}

.feedback:empty {
  display: none;
}

.feedback {
  margin: 20px 0 0;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--card);
}

.feedback.is-correct {
  border-left: 6px solid #15803d;
}

.feedback.is-wrong {
  border-left: 6px solid #b91c1c;
}

.primary-button {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 20px 0 0;
  padding: 12px 16px;
  border: none;
  border-radius: 14px;
  background: var(--fortnite);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
}

.primary-button:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

.secondary-button {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 12px 0 0;
  padding: 12px 16px;
  border: 3px solid var(--fortnite);
  border-radius: 14px;
  background: var(--card);
  color: var(--fortnite);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

/* ---------- Punkte und Fortschritt (BCA-04) ---------- */

.status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 700;
}

.progress-bar {
  height: 10px;
  margin: 8px 0 20px;
  border-radius: 999px;
  background: #e7e3f3;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--fortnite);
  transition: width 0.3s ease;
}

/* ---------- Ergebnisseite (BCA-05) ---------- */

.end {
  text-align: center;
}

.end h2 {
  margin: 8px 0 4px;
  font-size: clamp(1.5rem, 6vw, 2rem);
}

.result-score {
  margin: 16px 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
}

.result-score #result-score {
  font-size: 3rem;
  color: var(--fortnite);
  vertical-align: middle;
}

.result-message {
  margin: 0 0 8px;
  color: var(--muted);
}

.end h2:focus {
  outline: none;
}

.footer {
  margin-top: 40px;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .topic,
  .progress-fill {
    transition: none;
  }
}
