@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --purple: #5016a2;
  --purple-dark: #37106f;
  --pink: #e3245a;
  --ink: #1c1530;
  --cream: #fff4e7;
  --grey-bg: #f0eff4;
  --beige-bg: #f4f1eb;
  --page-bg: #f8f8f7;
  --white: #ffffff;
  --correct: #1e8a4c;
  --incorrect: #c92a2a;
  --radius: 8px;
  --radius-lg: 16px;
  --font: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 17px;
  line-height: 1.5;
}

h1,
h2,
h3 {
  font-family: var(--font);
  font-weight: 700;
  margin: 0 0 0.5em;
  color: var(--ink);
}

a {
  color: var(--purple);
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.wrap--narrow {
  max-width: 520px;
}

.eyebrow {
  display: inline-block;
  background: var(--pink);
  color: var(--white);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 2px 14px rgba(28, 21, 48, 0.08);
  margin-bottom: 20px;
}

.card--cream {
  background: var(--cream);
}

.card--grey {
  background: var(--grey-bg);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 16px;
  border: none;
  border-radius: var(--radius);
  padding: 14px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--purple);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background: var(--purple-dark);
}

.btn-secondary {
  background: var(--grey-bg);
  color: var(--ink);
}

.btn-pink {
  background: var(--pink);
  color: var(--white);
}

.btn-block {
  width: 100%;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.field input[type='text'],
.field select {
  width: 100%;
  font-family: var(--font);
  font-size: 17px;
  padding: 12px 14px;
  border: 2px solid var(--grey-bg);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
}

.field input[type='text']:focus,
.field select:focus {
  outline: 3px solid var(--purple);
  outline-offset: 1px;
  border-color: var(--purple);
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--grey-bg);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  font-size: 17px;
}

.option:has(input:checked) {
  border-color: var(--purple);
  background: #ece3f7;
}

.option input {
  width: 20px;
  height: 20px;
  accent-color: var(--purple);
  flex-shrink: 0;
}

.option.is-correct {
  border-color: var(--correct);
  background: #e4f6ea;
}

.option.is-incorrect {
  border-color: var(--incorrect);
  background: #fbe7e7;
}

.bar-row {
  margin-bottom: 14px;
}

.bar-row__label {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 4px;
}

.bar-track {
  background: var(--grey-bg);
  border-radius: 999px;
  overflow: hidden;
  height: 22px;
}

.bar-fill {
  height: 100%;
  background: var(--purple);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.bar-fill.is-correct {
  background: var(--correct);
}

.participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--grey-bg);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 15px;
}

.code-display {
  font-family: var(--font);
  font-weight: 700;
  font-size: 48px;
  letter-spacing: 0.12em;
  color: var(--purple);
  text-align: center;
  margin: 6px 0 18px;
}

.center {
  text-align: center;
}

.muted {
  color: #6b6478;
}

.leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leaderboard li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--grey-bg);
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 18px;
}

.leaderboard li:nth-child(1) {
  background: #fdf0c8;
}

.leaderboard li:nth-child(2) {
  background: #ececec;
}

.leaderboard li:nth-child(3) {
  background: #f3ddc4;
}

.rank {
  font-size: 20px;
  width: 2em;
  text-align: center;
}

.points {
  margin-left: auto;
  color: var(--purple);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-bg);
}

.topbar strong {
  color: var(--purple);
}

.question-index {
  font-weight: 700;
  color: var(--pink);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.qr-box {
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius-lg);
  display: inline-block;
}

.qr-box img {
  display: block;
  width: 220px;
  height: 220px;
}

.status-banner {
  background: var(--incorrect);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  margin-bottom: 16px;
}
