:root {
  --ink: #172c26;
  --pine: #153c32;
  --deep: #12352c;
  --moss: #49745a;
  --paper: #f4f2e8;
  --card: #fffef8;
  --line: #d9ddd0;
  --muted: #506353;
  --gold: #f4c569;
  --darkgold: #775420;
  --error: #9b331f;
  --heading: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}
* {box-sizing: border-box}
[hidden] {display: none !important}
body {margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.48 var(--body)}
button, input {font: inherit}
button {cursor: pointer}
button:disabled {cursor: default}
a {color: inherit}
button:focus-visible, a:focus-visible, input:focus-visible, input:focus-visible + span {outline: 3px solid #b96816; outline-offset: 3px}
.wrap {width: min(1216px, calc(100% - 72px)); margin-inline: auto}
.mast {background: var(--pine); color: #fcf7e9}
.mast-inner {min-height: 76px; display: flex; align-items: center; gap: 23px}
.brand {display: inline-flex; gap: 13px; align-items: center; font: bold 25px/1 var(--heading); text-decoration: none; letter-spacing: -.8px}
.brand-mark {background: var(--gold); color: var(--deep); width: 36px; height: 37px; display: grid; place-items: center; border-radius: 3px 3px 13px 13px; font: bold 24px/1 var(--heading)}
.school {display: inline-flex; align-items: center; gap: 7px; color: #d1dfd1; font-size: 14px; padding-left: 22px; border-left: 1px solid #6c8776}
.school span {background: #a8b9a9; border-radius: 50%; width: 3px; height: 3px}
.mast-btn {margin-left: auto; min-height: 43px; border: 1px solid #8da696; border-radius: 7px; background: transparent; color: #fff9e8; padding: 6px 16px; font-weight: 600; font-size: 15px}
.mast-btn:hover {background: #2b5144}
.hero {margin: 30px 0 24px; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 302px; background: #e5eadb; border-radius: 15px; overflow: hidden; border: 1px solid #d4dbcb}
.hero-copy {align-self: center; padding: 30px clamp(24px, 4vw, 52px)}
.eyebrow {margin: 0; display: flex; align-items: center; gap: .65em; color: var(--moss); font: 750 12px/1.35 var(--body); text-transform: uppercase; letter-spacing: .15em}
.rule {display: inline-block; width: 26px; height: 3px; background: #ac812f}
.sep {color: #8b956f}
h1,h2 {font-family: var(--heading); margin: 0; color: var(--pine); letter-spacing: -.045em; font-weight: 600}
h1 {font-size: clamp(48px, 5.2vw, 74px); line-height: .94; margin: 13px 0}
.hero-intro {max-width: 41ch; margin: 0; line-height: 1.43; color: #385044}
.meta {display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #47604c; font-size: 14px; margin: 15px 0 0; font-weight: 600}
.meta b {color: #998058}
.hero-art {min-height: 100%; background: #becbb6 url("assets/habitat.webp") center center / cover no-repeat}
.dashboard {display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, 1fr); align-items: stretch; gap: 22px}
.panel,.play-card {border-radius: 15px}
.panel {background: var(--card); border: 1px solid var(--line)}
.standings,.play-card {padding: clamp(22px, 2.65vw, 32px)}
.section-head,.game-top,.stage-bar,.dialog-head,.dialog-actions,.game-actions {display: flex; align-items: center; justify-content: space-between; gap: 12px}
h2 {font-size: clamp(32px, 3vw, 43px); line-height: 1.12}
.section-head h2,.play-card h2 {margin-top: 6px}
.text-btn,.light-link {border: 0; background: transparent; color: var(--pine); font-weight: 650; padding: 8px 0; min-height: 42px}
.text-btn:hover,.light-link:hover {text-decoration: underline}
.text-btn span {font-size: 20px; margin-left: 2px}
.sort-rule,.play-card > p:not(.eyebrow):not(.play-status) {margin: 10px 0 18px; line-height: 1.46}
.sort-rule {color: var(--muted); font-size: 15px}
.table-scroll {overflow-x: auto}
table {width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; text-align: left}
thead {background: #edf0e6}
th,td {padding: 10px 12px; white-space: nowrap}
thead th {font-size: 11px; text-transform: uppercase; letter-spacing: .115em; color: #4c6353}
tbody th {font-size: 20px; font-weight: 700}
tbody tr {border-bottom: 1px solid var(--line)}
tbody tr:last-child {border-bottom: 0}
td.rank {font-family: var(--heading); color: #425b49; font-weight: bold; font-size: 20px}
.rank-one {background: #f9efcf}
.class-name {display: inline-flex; align-items: center; gap: 9px}
.class-name::before {content: ""; display: inline-block; width: 5px; height: 20px; border-radius: 2px; background: var(--accent)}
.time-cell {text-align: right}
.unplayed {color: #7a847b}
.status {margin: 13px 0 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere}
.status:empty,.play-status:empty {display: none}
.status.error {color: var(--error); font-weight: 600}
.play-card {background: #214b3f; color: #f1f5ec}
.eyebrow.light {color: #c5dabe}
.play-card h2 {color: #fff7df}
.play-card fieldset, #answerFieldset {border: 0; padding: 0; margin: 0; min-width: 0}
.play-card legend,.dialog-actions {margin-bottom: 7px}
.play-card legend {font-size: 14px; font-weight: 650; color: #def0df}
.class-buttons {display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px}
input.radio {position: absolute; opacity: 0; width: 1px; height: 1px}
.class-buttons label,.answers label {position: relative; display: block; cursor: pointer}
.class-buttons label span {min-height: 45px; display: grid; place-items: center; border: 1px solid #87a190; color: #eff9ec; border-radius: 6px; font-size: 16px; font-weight: 700}
.class-buttons label:hover span {background: #345b4e}
.class-buttons input:checked + span {background: #f0f5e8; color: var(--pine); border: 2px solid #e5ca8c}
.action-stack {display: grid; gap: 3px; margin-top: 18px}
.gold-btn,.green-btn,.outline-btn {border: 1px solid transparent; border-radius: 7px; min-height: 48px; padding: 9px 18px; font-weight: 700}
.gold-btn {background: var(--gold); color: #342b17}
.gold-btn:hover:not(:disabled) {background: #ffdb89}
.gold-btn:disabled {background: #a4b49b; color: #263e2e}
.green-btn {background: var(--pine); color: #fffaeb}
.green-btn:hover:not(:disabled) {background: #2e5846}
.green-btn:disabled,.outline-btn:disabled {opacity: .58}
.outline-btn {color: var(--pine); border-color: #9bafa1; background: transparent}
.outline-btn:hover {background: #eff2e9}
.play-status,.light-link {color: #e2eddd; font-size: 14px}
.play-status {margin: 12px 0 0}
.play-status.error {color: #ffdc98}
.foot {padding: 26px 1px 35px; display: flex; justify-content: space-between; gap: 12px; color: #627365; font-size: 12px}
.stage {max-width: 900px; margin: 25px auto 40px}
.stage-bar {margin-bottom: 12px}
.stage-class {font-weight: 700; color: var(--pine); background: #e4e9db; padding: 6px 14px; border-radius: 5px}
.question-card,.result {padding: clamp(23px, 4vw, 48px)}
.clock {color: #3b503e; background: #e9ecdf; font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 700; padding: 5px 12px; border-radius: 5px}
.progress {height: 5px; border-radius: 5px; background: #e3e7da; margin: 19px 0 22px; overflow: hidden}
.progress span {display: block; height: 100%; background: #b58b35}
.question-count {margin: 0 0 9px; font-size: 15px; color: var(--muted); font-weight: 650}
#questionText {font-size: clamp(29px, 3.6vw, 48px); line-height: 1.13}
.answers {display: grid; gap: 10px; margin: 24px 0 18px}
.option {display: flex; align-items: center; gap: 15px; min-height: 59px; padding: 11px 16px; border: 1px solid #bdcabb; border-radius: 8px; font-size: clamp(17px, 1.8vw, 23px); line-height: 1.35}
.option b {font: 700 15px/1 var(--body); padding: 7px; min-width: 29px; text-align: center; border-radius: 5px; background: #e8ede0; color: var(--pine)}
.answers label:hover .option {background: #f3f5eb}
.answers input:checked + .option {background: #e3ead7; border: 2px solid #48704b; padding: 10px 15px}
.answers input:checked + .option b {color: white; background: var(--pine)}
.game-actions {justify-content: flex-end}
.result h2 {font-size: clamp(44px, 5vw, 68px); margin: 18px 0 6px}
.result-grid {display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0}
.result-grid > div {padding: 20px; background: #e6ecdf; border-radius: 8px}
.result-grid span,.result-grid strong {display: block}
.result-grid strong {color: var(--pine); font: 600 clamp(28px, 4vw, 44px)/1.3 var(--heading); font-variant-numeric: tabular-nums}
dialog {width: min(490px, calc(100% - 28px)); max-height: 90dvh; padding: 25px; border-radius: 13px; border: 1px solid #c7cebd; background: var(--card); color: var(--ink); box-shadow: 0 12px 74px #102b2340}
dialog::backdrop {background: #0c211bb8}
dialog h2 {margin-top: 7px}
.close-btn {width: 40px; height: 40px; border: 1px solid #c2cdbd; border-radius: 50%; color: var(--pine); background: transparent; font-size: 25px; line-height: 1}
dialog label {display: block; font-weight: 650; margin-bottom: 6px}
dialog input {width: 100%; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #9bad9a; border-radius: 5px; margin-bottom: 15px}
.admin-rows {list-style: none; padding: 0}
.admin-rows li {display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 9px 0}
.admin-rows .text-btn {color: #923d26}
.dialog-actions {justify-content: flex-end}
.notice {background: #fff3d4; padding: 12px; border-radius: 5px}
.sr-only {position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap}
@media (min-width: 1500px) {body {font-size: 19px}}
@media (max-width: 830px) {
  .wrap {width: calc(100% - 36px)}
  .hero {min-height: 275px}
  .hero-copy {padding: 25px}
  .dashboard {grid-template-columns: minmax(0, 1.4fr) minmax(245px, 1fr); gap: 13px}
  .standings,.play-card {padding: 21px 18px}
  td,th {padding-inline: 8px}
}
@media (max-width: 680px) {
  .wrap {width: calc(100% - 24px)}
  .mast-inner {min-height: 63px; gap: 9px}
  .brand {gap: 8px; font-size: 22px}
  .brand-mark {width: 29px; height: 32px; font-size: 20px}
  .school {display: none}
  .mast-btn {font-size: 14px; padding-inline: 11px}
  .hero {margin: 15px 0; grid-template-columns: 1fr; min-height: auto}
  .hero-art {min-height: 0; height: clamp(115px, 28vw, 178px); background-position: center 45%; grid-row: 1}
  .hero-copy {padding: 20px}
  h1 {font-size: 45px; line-height: .99}
  h1 br {display: none}
  h1 br::after {content: " "}
  .dashboard {grid-template-columns: 1fr}
  .foot {padding-inline: 4px}
  .result-grid {gap: 8px}
  .result-grid > div {padding: 13px 9px}
  .result-grid span {font-size: 13px}
  .class-buttons label span {min-height: 48px}
}
@media (prefers-reduced-motion: no-preference) {.progress span {transition: width .15s ease}}
.lesson-link {display: inline-block; color: #244b38; font-size: 15px; font-weight: 700; padding: 7px 0; text-underline-offset: 3px}
