:root {
  color-scheme: light;
  --bg: #f3eee4;
  --paper: #fffdf7;
  --paper-soft: rgba(255, 252, 246, 0.92);
  --ink: #20241f;
  --muted: #686259;
  --line: rgba(43, 35, 20, 0.14);
  --line-strong: rgba(31, 27, 20, 0.62);
  --accent: #c8522c;
  --accent-dark: #973817;
  --blue: #285a7e;
  --green: #1e7259;
  --gold: #bd842f;
  --shadow: 0 24px 54px rgba(82, 65, 35, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.92), transparent 24%),
    radial-gradient(circle at bottom right, rgba(40, 90, 126, 0.12), transparent 26%),
    linear-gradient(180deg, #faf4eb 0%, var(--bg) 100%);
}

button,
a {
  font: inherit;
}

.quiz-shell {
  display: grid;
  grid-template-columns: minmax(330px, 520px) minmax(0, 1fr);
  gap: 20px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px;
}

.quiz-panel,
.card-panel {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 24px;
  background: var(--paper-soft);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.quiz-panel {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 24px;
}

.top-nav,
.question-meta,
.quiz-actions,
.card-panel-header,
.paper-header,
.paper-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top-nav a {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.top-nav span,
.question-meta span {
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(40, 90, 126, 0.1);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 900;
}

.eyebrow,
.metric-label,
.feedback-label,
.paper-kicker,
.paper-panel-title {
  margin: 0;
  color: #7f604a;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 9.5em;
  font-size: clamp(2.3rem, 4vw, 4rem);
  line-height: 0.94;
}

h2 {
  font-size: clamp(1.45rem, 2vw, 2.25rem);
  line-height: 1.05;
}

h3 {
  font-size: 1.18rem;
}

.quiz-hero {
  display: grid;
  gap: 12px;
}

.hero-copy,
.question-copy,
.feedback-copy,
.card-hint,
.card-note,
.review-item p,
.bench-item span {
  color: var(--muted);
  line-height: 1.56;
}

.quiz-status {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 12px;
}

.quiz-status article,
.question-card,
.feedback-card,
.poll-results {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.metric-value {
  margin: 8px 0 0;
  font-size: 2rem;
  font-weight: 900;
}

.metric-value-small {
  font-size: 1.05rem;
  line-height: 1.2;
}

.question-card {
  display: grid;
  gap: 14px;
}

.question-meta {
  justify-content: start;
  flex-wrap: wrap;
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice-btn {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 64px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.choice-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(40, 90, 126, 0.28);
  box-shadow: 0 12px 24px rgba(40, 90, 126, 0.09);
}

.choice-btn:disabled {
  cursor: default;
}

.choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(40, 90, 126, 0.1);
  color: var(--blue);
  font-weight: 900;
}

.choice-btn.is-correct {
  border-color: rgba(30, 114, 89, 0.34);
  background: rgba(30, 114, 89, 0.11);
}

.choice-btn.is-correct .choice-letter {
  background: var(--green);
  color: #fff;
}

.choice-btn.is-wrong {
  border-color: rgba(200, 82, 44, 0.34);
  background: rgba(200, 82, 44, 0.1);
}

.choice-btn.is-wrong .choice-letter {
  background: var(--accent);
  color: #fff;
}

.feedback-card {
  display: grid;
  gap: 10px;
}

.feedback-card.hidden,
.poll-results.hidden,
.hidden {
  display: none;
}

.feedback-card.is-correct {
  background: rgba(30, 114, 89, 0.1);
  border-color: rgba(30, 114, 89, 0.22);
}

.feedback-card.is-wrong {
  background: rgba(200, 82, 44, 0.1);
  border-color: rgba(200, 82, 44, 0.22);
}

.rule-note {
  display: grid;
  gap: 8px;
}

.rule-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.poll-results {
  display: grid;
  gap: 12px;
}

.poll-breakdown {
  display: grid;
  gap: 10px;
}

.poll-row {
  display: grid;
  gap: 7px;
}

.poll-row-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.poll-row.is-correct .poll-row-top {
  color: var(--green);
  font-weight: 800;
}

.poll-row.is-selected .poll-row-top span::after {
  content: "  Your choice";
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.poll-meter {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 31, 19, 0.1);
}

.poll-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: rgba(40, 90, 126, 0.44);
}

.poll-row.is-correct .poll-meter span {
  background: var(--green);
}

.primary-btn,
.ghost-btn {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 16px 30px rgba(200, 82, 44, 0.2);
}

.primary-btn:disabled {
  cursor: default;
  opacity: 0.48;
  box-shadow: none;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.card-panel {
  min-width: 0;
  padding: 22px;
}

.card-panel-header {
  margin-bottom: 16px;
  align-items: end;
}

.card-hint {
  max-width: 260px;
  margin-bottom: 0;
  text-align: right;
}

.scenario-card-image-wrap {
  margin: 0;
  display: grid;
  gap: 12px;
}

.scenario-card-stage {
  position: relative;
}

.scenario-card-image {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid #25333a;
  background: #fff;
  box-shadow: 0 18px 38px rgba(50, 38, 18, 0.14);
}

.correct-card-overlay {
  position: absolute;
  inset: 3px;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(255, 253, 247, 0.68);
}

.correct-card-overlay.hidden {
  display: none;
}

.card-answer-reveal {
  display: grid;
  gap: 12px;
  width: min(860px, 92%);
  max-height: 92%;
  overflow: auto;
  padding: clamp(18px, 3.2vw, 34px);
  border: 2px solid rgba(30, 114, 89, 0.28);
  border-radius: 26px;
  background: rgba(249, 253, 246, 0.96);
  color: var(--ink);
  box-shadow: 0 24px 54px rgba(35, 46, 28, 0.18);
}

.card-answer-reveal.is-wrong {
  border-color: rgba(200, 82, 44, 0.28);
  background: rgba(255, 247, 241, 0.96);
}

.card-answer-reveal h3 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.card-answer-reveal p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.7vw, 1.32rem);
  line-height: 1.48;
}

.card-answer-reveal strong {
  color: var(--muted);
}

.paper-left-sheet,
.paper-right-sheet {
  min-height: 650px;
  padding: 22px 24px;
  background: #fffefa;
}

.paper-left-sheet {
  border-right: 2px solid rgba(31, 31, 31, 0.18);
}

.paper-header {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
}

.paper-header h3 {
  text-align: center;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.45rem, 2vw, 2rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.paper-form-lines {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.paper-form-lines p {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto auto;
  align-items: end;
  gap: 14px;
  margin: 0;
}

.paper-form-lines span,
.signature-line span,
.paper-note-lines span {
  display: block;
  min-height: 20px;
  border-bottom: 2px solid #303030;
}

.lineup-table {
  border: 1.5px solid #303030;
  border-radius: 0;
  overflow: hidden;
  background: #fffefa;
}

.lineup-head,
.lineup-row {
  display: grid;
  grid-template-columns: 28px 40px 42px minmax(134px, 1fr) 42px minmax(100px, 0.9fr);
}

.lineup-head {
  background: #fffefa;
}

.lineup-head > span,
.lineup-row > span {
  min-height: 49px;
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-right: 1.5px solid #737373;
  border-bottom: 1.5px solid #737373;
}

.lineup-head > span {
  justify-content: center;
  color: #202020;
  font-family: Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lineup-row:last-child > span {
  border-bottom: 0;
}

.lineup-head > span:last-child,
.lineup-row > span:last-child {
  border-right: 0;
}

.lineup-row.is-focus > span {
  background: rgba(255, 255, 255, 0.6);
}

.slot-number,
.player-number,
.player-name,
.sub-number-cell {
  font-weight: 900;
}

.slot-number {
  justify-content: center;
  color: #222;
  font-family: Arial, sans-serif;
  font-size: 0.92rem;
}

.player-number,
.player-name,
.player-position,
.player-status,
.sub-number-cell {
  font-family: "Arial Narrow", Arial, sans-serif;
  color: #111;
  font-size: 0.98rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.player-status,
.player-position,
.sub-number-cell {
  justify-content: center;
  font-weight: 800;
}

.player-name {
  display: grid !important;
  align-content: center;
  gap: 3px;
  position: relative;
}

.starter-line {
  display: block;
  font-family: "Arial Black", Arial, sans-serif;
}

.starter-line.is-crossed,
.player-position.is-crossed {
  color: rgba(0, 0, 0, 0.72);
  text-decoration: line-through;
  text-decoration-thickness: 4px;
  text-decoration-color: #000;
}

.player-name:has(.starter-line.is-crossed)::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 76px;
  height: 40px;
  border: 4px solid #000;
  border-radius: 999px;
  transform: translateY(-50%) rotate(-12deg);
  pointer-events: none;
}

.player-name:has(.starter-line.is-crossed)::before {
  content: "";
  position: absolute;
  left: 104px;
  top: 50%;
  width: 74px;
  border-top: 4px solid #000;
  transform: translateY(-50%) rotate(-20deg);
  pointer-events: none;
}

.starter-note {
  display: block;
  color: rgba(151, 56, 23, 0.84);
  font-size: 0.72rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.player-status {
  display: grid !important;
  align-content: stretch;
  padding: 0 !important;
}

.starter-marker {
  display: inline-flex;
  width: fit-content;
  margin: 4px 8px 2px;
  padding: 2px 8px;
  border: 3px solid #000;
  border-radius: 999px;
  color: #000;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 0.92rem;
  font-weight: 900;
  transform: rotate(-8deg);
}

.sub-entry {
  display: grid;
  grid-template-columns: 38px minmax(72px, 1fr) 34px 36px;
  align-items: center;
  min-height: 28px;
  padding: 3px 6px;
  border-bottom: 1px solid rgba(31, 31, 31, 0.28);
}

.sub-entry:last-child {
  border-bottom: 0;
}

.sub-entry.is-empty {
  display: flex;
  color: rgba(31, 77, 118, 0.62);
  font-size: 0.88rem;
}

.sub-entry.is-empty::after {
  content: "";
  width: 100%;
  border-bottom: 1px dashed rgba(31, 27, 20, 0.18);
}

.sub-entry.is-out {
  color: #000;
  text-decoration: line-through;
  text-decoration-thickness: 4px;
  text-decoration-color: #000;
}

.sub-entry.is-reentry {
  position: relative;
  color: #000;
}

.sub-entry.is-reentry::before {
  content: "";
  position: absolute;
  left: -15px;
  top: -4px;
  width: 54px;
  height: 32px;
  border: 4px solid #000;
  border-right-color: transparent;
  border-radius: 999px;
  transform: rotate(-24deg);
}

.sub-entry.is-reentry::after {
  content: "A";
  position: absolute;
  left: 4px;
  top: -3px;
  color: #000;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 1rem;
  transform: rotate(-8deg);
}

.sub-code,
.sub-position,
.sub-inning {
  font-size: 0.78rem;
}

.sub-code,
.sub-inning {
  font-family: Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
}

.sub-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 30px;
  min-height: 24px;
  padding: 1px 6px;
  border: 2px solid #111;
  border-radius: 999px;
}

.sub-player {
  font-weight: 900;
}

.reserve-table {
  margin-top: 48px;
  border: 1.5px solid #737373;
}

.reserve-head,
.bench-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  margin: 0;
}

.reserve-head span,
.bench-item strong,
.bench-item span {
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 3px 8px;
  border-right: 1.5px solid #737373;
  border-bottom: 1.5px solid #737373;
}

.reserve-head span {
  justify-content: center;
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bench-item strong,
.bench-item span {
  color: #111;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 0.92rem;
  text-transform: uppercase;
}

.bench-item strong {
  justify-content: center;
}

.bench-item span {
  position: relative;
  gap: 14px;
}

.bench-item span.is-used {
  text-decoration: line-through;
  text-decoration-thickness: 4px;
  text-decoration-color: #000;
}

.bench-item span.is-used::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 50%;
  width: 110px;
  border-top: 4px solid #000;
  transform: translateY(-50%) rotate(-34deg);
}

.bench-item span em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  margin-left: auto;
  border: 4px solid #000;
  border-radius: 999px;
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 1.9rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1;
  transform: rotate(-7deg);
}

.bench-item:last-child {
  border-bottom: 0;
}

.equipment-line {
  margin: 10px 6px 42px;
  font-size: 0.84rem;
  font-weight: 900;
  text-transform: uppercase;
}

.signature-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: end;
  margin-bottom: 24px;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.conference-box {
  display: grid;
  gap: 6px;
  margin-bottom: 28px;
}

.conference-box p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
}

.conference-grid {
  display: grid;
  grid-template-columns: 44px repeat(9, minmax(0, 1fr));
}

.conference-grid span {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1.5px solid #737373;
  border-bottom: 1.5px solid #737373;
  font-size: 0.72rem;
  font-weight: 800;
}

.conference-head span {
  min-height: 20px;
  border-bottom: 0;
}

.paper-note-lines {
  display: grid;
  gap: 12px;
}

.card-note {
  margin: 10px 0 0;
  color: #111;
  font-family: "Arial Narrow", Arial, sans-serif;
  font-size: 0.94rem;
  font-weight: 800;
  text-transform: uppercase;
}

.review-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.review-item p {
  margin: 0;
}

.review-item p + p {
  margin-top: 6px;
}

@media (max-width: 1120px) {
  .quiz-shell {
    grid-template-columns: 1fr;
  }

  .card-hint {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .quiz-shell {
    padding: 12px;
  }

  .quiz-panel,
  .card-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .quiz-status,
  .bench-panel {
    grid-template-columns: 1fr;
  }

  .top-nav,
  .quiz-actions,
  .card-panel-header,
  .paper-header {
    display: grid;
    justify-content: stretch;
  }

  .paper-card {
    overflow-x: auto;
  }

  .lineup-table {
    min-width: 760px;
  }
}
