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

:root {
  --bg: #0d0f14;
  --card-bg: #161b27;
  --border: #252d3d;
  --red: #e63946;
  --green: #4ade80;
  --blue: #3b82f6;
  --text: #e8eaf0;
  --muted: #8892a4;
  --trump-orange: #e8701a;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  background: #0a0c12;
  border-bottom: 2px solid var(--red);
  padding: 1.25rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.header-spacer {
  /* occupies left column to balance the scoreboard on the right */
}

.header-inner {
  text-align: center;
}

.scoreboard-wrap {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: white;
}

.tagline {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.tagline em {
  color: var(--text);
  font-style: italic;
}

/* ── Scoreboard ── */
.scoreboard {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
}

.score-block {
  text-align: center;
  min-width: 48px;
}

.score-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.score-num {
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
  margin-top: 0.15rem;
}

.score-block.you .score-num  { color: var(--green); }
.score-block.trump .score-num { color: var(--trump-orange); }

.score-divider {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Main / Card ── */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 3rem 3.5rem;
  max-width: 900px;
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ── Progress ── */
.progress {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  margin-bottom: 1.75rem;
}

/* ── Question ── */
.question {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.55;
  color: white;
  margin-bottom: 2.5rem;
}

/* ── Answer Buttons ── */
.btn-group {
  display: flex;
  gap: 1rem;
}

.answer-btn {
  flex: 1;
  padding: 1.2rem 1.5rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #1e2535;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  font-family: inherit;
}

.answer-btn:hover {
  border-color: var(--blue);
  background: #1e2d4a;
  color: white;
  transform: translateY(-2px);
}

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

/* ── Result Badge ── */
#result-badge {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
}

#result-badge.correct {
  background: rgba(74, 222, 128, 0.12);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

#result-badge.wrong {
  background: rgba(230, 57, 70, 0.12);
  color: var(--red);
  border: 1px solid rgba(230, 57, 70, 0.3);
}

/* ── Feedback ── */
.feedback {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 1.75rem;
}

/* ── Article Block ── */
.article-block {
  background: #0d0f14;
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.article-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}

.article-date {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
}

#article-link {
  color: #93c5fd;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  line-height: 1.45;
}

#article-link:hover {
  color: white;
  text-decoration: underline;
}

/* ── Next Button ── */
.next-btn {
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0.9rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.next-btn:hover {
  background: #2563eb;
}

/* ── End Card ── */
#end-card {
  text-align: center;
}

#end-card h2 {
  font-size: 1.85rem;
  font-weight: 900;
  color: white;
  margin-bottom: 1rem;
}

.end-message {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.6rem;
}

.end-trump {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.end-trump strong {
  color: var(--trump-orange);
}

/* ── Democracy Text ── */
.democracy-text {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--muted);
  line-height: 1.2;
  text-align: center;
}

/* ── Analysis Button ── */
.analysis-btn {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  border: 1px solid rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.analysis-btn:hover:not(:disabled) {
  background: rgba(74, 222, 128, 0.2);
  border-color: var(--green);
}
.analysis-btn:disabled {
  cursor: not-allowed;
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
  opacity: 0.5;
}

/* ── Analysis Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem 3rem;
  max-width: 540px;
  width: 100%;
  text-align: center;
}
.modal-congrats {
  font-size: 2rem;
  font-weight: 900;
  color: var(--green);
  margin-bottom: 0.4rem;
}
.modal-subtitle {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 2rem;
  line-height: 1.4;
}
.modal-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}
.modal-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.modal-avatar {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--border);
}
.modal-player-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.modal-player-score {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}
.you-color  { color: var(--green); }
.trump-color { color: var(--trump-orange); }
.modal-vs {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  align-self: center;
}
.modal-close {
  max-width: 200px;
  margin: 0 auto;
}

/* ── Footer ── */
footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  color: #93c5fd;
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  color: white;
  text-decoration: underline;
}



.footer-toggles {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 0 1rem;
}

.toggle-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.toggle-btn.toggle-on {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
}

.toggle-btn.toggle-off {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}

/* ── Mobile ── */
@media (max-width: 640px) {
  header {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .header-spacer {
    display: none;
  }

  .scoreboard-wrap {
    justify-self: center;
    align-items: center;
  }

  h1 {
    font-size: 1.8rem;
  }

  .card {
    padding: 1.75rem 1.25rem;
  }

  .question {
    font-size: 1.2rem;
  }

  .btn-group {
    flex-direction: column;
  }
}
