:root {
  color-scheme: light;
  --ink: #152018;
  --muted: #526057;
  --line: #d7ded8;
  --paper: #fbfcf8;
  --panel: #ffffff;
  --green: #236241;
  --green-dark: #17442e;
  --gold: #c58b23;
  --soft: #eef5ee;
  --soft-gold: #f6eddb;
  --wrong: #a33a32;
  --right: #1f7a4d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 18px;
}

button:hover,
button:focus-visible {
  background: var(--green-dark);
}

button.secondary,
button.quiet {
  background: var(--soft-gold);
  color: #4b3511;
}

button.active {
  background: var(--gold);
  color: #1f1708;
}

.shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: end;
  padding: 30px 0 24px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.question-kicker,
.source-label {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.3rem, 6vw, 4.9rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.38rem;
}

.subtitle {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.source-panel,
.officials,
.setup,
.console,
.scoreboard,
.study {
  margin-top: 22px;
}

.source-panel,
.officials,
.setup,
.question-card,
.scoreboard,
.study {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.source-panel {
  border-left: 5px solid var(--gold);
  padding: 18px;
  box-shadow: 0 16px 38px rgba(21, 32, 24, 0.08);
}

.source-panel strong,
.source-panel span {
  display: block;
}

.source-panel strong {
  margin-bottom: 8px;
  font-size: 1.22rem;
}

.slogan-panel {
  display: grid;
  min-height: 112px;
  align-content: center;
}

.slogan-panel strong {
  margin: 0;
  color: var(--green-dark);
  font-size: 2rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.officials,
.setup,
.scoreboard,
.study {
  padding: 18px;
}

.official-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.official-grid article,
.winner-strip article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.official-grid strong,
.official-grid span,
.winner-strip strong,
.winner-strip span {
  display: block;
}

.official-grid span,
.winner-strip span,
.section-heading p,
.empty {
  color: var(--muted);
}

.rule-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rule-row span {
  border-radius: 999px;
  background: var(--soft-gold);
  color: #513a14;
  font-size: 0.9rem;
  font-weight: 800;
  padding: 8px 12px;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading p {
  margin: 6px 0 0;
}

.study .section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(240px, 380px);
}

.contestant-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px auto;
  gap: 12px;
}

select,
input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 0 12px;
}

.contestant-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.contestant-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.contestant-chip strong,
.contestant-chip span {
  display: block;
}

.contestant-chip span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.contestant-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.undo-score {
  width: 36px;
  min-height: 34px;
  padding: 0;
  background: var(--soft-gold);
  color: #4b3511;
  font-size: 1.2rem;
}

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

.remove {
  min-height: 34px;
  padding: 0 10px;
  background: #f3e4e2;
  color: var(--wrong);
  font-size: 0.82rem;
}

.round-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.round-picker button {
  min-height: 38px;
  padding: 0 13px;
}

.question-card {
  min-height: 430px;
  padding: 22px;
}

.question-topline {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 850;
}

.active-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 360px);
  gap: 12px;
  align-items: center;
  margin: 18px 0;
}

label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.question-card h3 {
  min-height: 96px;
  margin-bottom: 18px;
  font-size: clamp(1.55rem, 3.4vw, 2.55rem);
  line-height: 1.18;
}

.answer-panel {
  border: 1px solid #bcd7c6;
  border-left: 5px solid var(--right);
  border-radius: 8px;
  background: #f2fbf5;
  padding: 18px;
}

.answer-panel strong {
  display: block;
  margin-bottom: 8px;
  color: var(--green-dark);
  font-size: 1.1rem;
}

.answer-panel p {
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.58;
}

.console-actions,
.score-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.score-buttons button {
  min-width: 150px;
  min-height: 62px;
}

.score-buttons span {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  font-weight: 650;
  opacity: 0.9;
}

.winner-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 12px;
  margin-bottom: 16px;
}

.winner-strip strong {
  margin-top: 6px;
  font-size: 1.05rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
}

th {
  background: var(--soft);
  color: var(--green-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
}

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

.verse-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.verse-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--green);
  font-weight: 850;
}

.verse-meta span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.verse-card p {
  margin-bottom: 0;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .hero,
  .official-grid,
  .contestant-form,
  .contestant-list,
  .winner-strip,
  .verse-list {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .question-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .study .section-heading {
    grid-template-columns: 1fr;
  }

  .round-picker {
    justify-content: flex-start;
  }

  .active-row {
    grid-template-columns: 1fr;
  }
}
