* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  color: #222;
  background: #fafafa;
}

/* ---------- Tabs (shared by both pages) ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  border-bottom: 1px solid #ddd;
  background: #fff;
}

.tab {
  padding: 0.7rem 0.9rem;
  text-decoration: none;
  color: #666;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}

.tab.active {
  color: #4a90d9;
  border-bottom-color: #4a90d9;
}

/* ---------- Vote page: full-screen, split top/bottom ---------- */
body.vote-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh; /* "dynamic" viewport height — accounts for mobile browser bars */
  overflow: hidden;
}

.matchup {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
}

.thing {
  flex: 1;
  width: 100%;
  border: none;
  cursor: pointer;
  font-size: clamp(1.5rem, 6vw, 3rem);
  font-weight: 700;
  color: #222;
  padding: 1rem;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background-color 0.15s, transform 0.05s;
}

.thing-top {
  background: #eef4fb;
}

.thing-bottom {
  background: #fbf3ec;
}

.thing-top:hover {
  background: #dde9f8;
}

.thing-bottom:hover {
  background: #f8e7d6;
}

.thing:active {
  transform: scale(0.98);
}

/* The little "vs" badge floating over the dividing line */
.vs {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  z-index: 1;
}

/* Reserved, non-invasive ad space pinned at the very bottom */
.ad-slot {
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bbb;
  background: #f0f0f0;
  border-top: 1px solid #e0e0e0;
}

/* ---------- Centered, readable column (leaderboard, quiz, about) ---------- */
body.stats-page,
body.quiz-page,
body.about-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.results {
  margin-top: 1rem;
}

.empty {
  color: #888;
}

#leaderboard li {
  padding: 0.3rem 0;
  font-size: 1.05rem;
}

/* Hide elements with the [hidden] attribute, even flex/grid containers */
[hidden] {
  display: none !important;
}

/* ---------- Quiz page ---------- */
.quiz {
  text-align: center;
  margin-top: 1.5rem;
}

.quiz-question {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.quiz-option {
  flex: 1;
  min-width: 140px;
  min-height: 90px;
  font-size: 1.15rem;
  font-weight: 600;
  border: 2px solid #ddd;
  border-radius: 12px;
  background: #fff;
  color: #222;
  cursor: pointer;
  padding: 1rem;
  transition: border-color 0.15s, background-color 0.15s;
}

.quiz-option:hover:not(:disabled) {
  border-color: #4a90d9;
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option.correct {
  border-color: #3aa657;
  background: #eaf7ee;
  color: #1e7a3a;
}

.quiz-option.wrong {
  border-color: #d9534f;
  background: #fbeaea;
  color: #a83a37;
}

.quiz-result {
  min-height: 1.5em;
  font-weight: 600;
  margin: 1.2rem 0;
}

.quiz-result.good {
  color: #2e8b57;
}

.quiz-result.bad {
  color: #c0392b;
}

.quiz-next {
  padding: 0.6rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #4a90d9;
  color: #fff;
  cursor: pointer;
}

.quiz-score {
  margin-top: 1.5rem;
  color: #666;
}

/* ---------- About page ---------- */
.about {
  line-height: 1.65;
}

.about p {
  margin: 1rem 0;
}
