:root {
  --ink: #171714;
  --muted: #69675f;
  --paper: #f3efe4;
  --card: #fffdf7;
  --line: #d5cebd;
  --accent: #c9482c;
  --accent-dark: #8f2917;
  --blue: #244f73;
  --green: #226547;
  --yellow: #8b5a08;
  --shadow: 0 18px 52px rgba(37, 31, 18, .08);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
a { color: inherit; }
.site-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 5vw; border-bottom: 1px solid var(--line); background: rgba(243,239,228,.94); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 900; text-decoration: none; }
nav { display: flex; align-items: center; gap: 22px; }
nav a, .link-button { font-weight: 800; text-decoration: none; font-size: .92rem; }
.container { width: min(1160px, 90vw); margin: 0 auto; min-height: calc(100vh - 150px); padding: 56px 0 82px; }
footer { border-top: 1px solid var(--line); padding: 26px 5vw; text-align: center; color: var(--muted); font-size: .9rem; }
.build-id { display: block; margin-top: 5px; font-size: .7rem; opacity: .72; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2.5rem, 5vw, 5.5rem); line-height: .98; letter-spacing: -.045em; margin-bottom: 24px; }
h2 { font-family: Georgia, serif; font-size: clamp(1.45rem, 2vw, 2.25rem); line-height: 1.12; }
h3 { font-size: 1.02rem; line-height: 1.35; }
.eyebrow { margin-bottom: 11px; font-size: .72rem; font-weight: 950; letter-spacing: .16em; color: var(--accent-dark); }
.lead { max-width: 760px; color: #45433d; font-size: 1.13rem; }
.lead.compact { font-size: 1rem; }
.muted, .optional { color: var(--muted); }
.optional { font-weight: 600; font-size: .78rem; }
.card, .hero-card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 18px; }
.hero { display: grid; grid-template-columns: 1.3fr .85fr; gap: 64px; align-items: center; padding: 26px 0 78px; }
.hero-card { padding: 34px; transform: rotate(1deg); }
.hero-card h2 { font-size: 2rem; }
.judge-chip { display: inline-flex; padding: 8px 11px; border-radius: 999px; background: #e3edf4; color: var(--blue); font-size: .76rem; font-weight: 900; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 0 20px; border: 1px solid var(--ink); border-radius: 10px; background: var(--ink); color: white; font: inherit; font-weight: 900; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(0,0,0,.12); }
.button.secondary { color: var(--ink); background: transparent; }
.button.danger { background: var(--accent); border-color: var(--accent-dark); }
.button.small { min-height: 35px; padding: 0 14px; }
.button.full { width: 100%; }
.inline-form { display: inline; margin: 0; }
.link-button { border: 0; padding: 0; background: none; cursor: pointer; }
.three-steps { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.three-steps article { padding: 34px 30px 10px 0; }
.three-steps article + article { border-left: 1px solid var(--line); padding-left: 30px; }
.three-steps span { color: var(--accent-dark); font-size: .75rem; font-weight: 900; }
.narrow { width: min(500px, 100%); margin: 35px auto; }
.auth-card, .form-card { padding: 38px; }
.auth-card h1, .form-card h1, .page-head h1, .dashboard-head h1, .match-title h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.form-card { width: min(730px, 100%); margin: 15px auto; }
.stacked-form { display: grid; gap: 18px; }
.stacked-form.compact-form { gap: 12px; }
label, legend { font-weight: 850; font-size: .9rem; }
input, textarea { width: 100%; border: 1px solid #bbb3a2; border-radius: 9px; background: #fffef9; padding: 13px 14px; color: var(--ink); font: inherit; margin-top: 7px; }
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 3px solid rgba(201,72,44,.15); border-color: var(--accent); }
input[type="range"] { padding: 0; }
fieldset { padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.radio { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-weight: 650; }
.radio input { width: auto; margin: 0; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 24px; }
.flash { padding: 13px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); font-weight: 750; }
.flash.success { border-color: #86b59e; color: var(--green); }
.flash.error { border-color: #df9988; color: #9f2b16; }
.flash.warning { border-color: #dab777; color: #815009; }
.dashboard-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 55px; }
.rating-card { min-width: 230px; padding: 20px 24px; border: 1px solid var(--ink); border-radius: 14px; display: grid; }
.rating-card span, .rating-card small { color: var(--muted); font-weight: 700; }
.rating-card strong { font-family: Georgia, serif; font-size: 2.7rem; line-height: 1; margin: 5px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin: 45px 0 18px; }
.section-heading h2 { margin-bottom: 0; }
.match-list { border-top: 1px solid var(--line); }
.match-row { padding: 20px 4px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 30px; text-decoration: none; }
.match-row:hover strong { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.match-row div:first-child { display: grid; gap: 5px; }
.match-row span { color: var(--muted); }
.match-row .right { text-align: right; display: grid; gap: 5px; justify-items: end; }
.status { display: inline-block; width: max-content; padding: 5px 9px; border-radius: 99px; background: #e5dfd1; color: #5b574e; text-transform: uppercase; letter-spacing: .08em; font-size: .64rem; font-weight: 950; }
.status.open { background: #dceddf; color: var(--green); }
.status.collecting { background: #e1ebf2; color: var(--blue); }
.status.review, .status.judging { background: #ffdfae; color: #744300; }
.status.decided { background: #221f1a; color: white; }
.match-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.challenge-card { padding: 24px; display: flex; flex-direction: column; }
.challenge-card h3 { margin: 18px 0 10px; }
.challenge-card form { margin-top: auto; padding-top: 18px; }
.empty-state { border: 1px dashed #aaa393; border-radius: 14px; padding: 30px; color: var(--muted); }
.match-title { max-width: 960px; margin: 0 auto 34px; text-align: center; }
.match-title .status { margin-bottom: 15px; }
.room-description { margin: -8px auto 10px; white-space: pre-wrap; }
.live-status { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(35,107,70,.12); }
.check-now { border: 0; background: transparent; color: inherit; text-decoration: underline; font: inherit; font-weight: 800; cursor: pointer; padding: 0 0 0 4px; }
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 20px; }
.person-card { padding: 20px; border-top: 3px solid #a9a394; background: rgba(255,253,247,.62); }
.person-card.you { border-top-color: var(--accent); }
.person-card.judge-person { border-top-color: var(--blue); }
.person-card span { color: var(--muted); font-weight: 900; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; }
.person-card h2 { margin: 7px 0 8px; }
.person-card small { color: var(--muted); font-weight: 750; }
.progress-card { padding: 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 34px; }
.progress-item { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.progress-item span { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-size: .76rem; font-weight: 900; flex: 0 0 auto; }
.progress-item p { margin: 0; font-size: .78rem; font-weight: 800; }
.progress-item.done { color: var(--green); }
.progress-item.done span { background: var(--green); border-color: var(--green); color: white; }
.center-card { text-align: center; padding: 50px; }
.stage-heading { margin: 48px 0 18px; max-width: 820px; }
.judge-proposal { padding: 28px; display: grid; grid-template-columns: 1fr auto; gap: 25px; align-items: center; }
.approval-list { display: grid; gap: 8px; }
.approval { padding: 8px 11px; border-radius: 8px; background: #eee8db; color: var(--muted); font-size: .79rem; font-weight: 850; }
.approval.approved { background: #e1efe5; color: var(--green); }
.judge-proposal form { grid-column: 1 / -1; }
.judge-options { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.judge-option { padding: 26px; display: flex; flex-direction: column; }
.judge-option form { margin-top: auto; }
.case-layout, .two-cases { display: grid; grid-template-columns: 1.35fr .75fr; gap: 20px; }
.two-cases { grid-template-columns: 1fr 1fr; }
.case-editor, .sealed-card, .case-card { padding: 28px; }
.case-readout p, .case-card p { white-space: pre-wrap; }
.case-readout h3, .case-card h3 { margin-top: 22px; margin-bottom: 5px; color: var(--blue); }
.lock-form { margin-top: 12px; }
.lock-note { margin-top: 20px; padding: 10px 12px; border-radius: 8px; background: #e0efe4; color: var(--green); font-weight: 850; font-size: .85rem; }
.sealed-card { background: #ebe6da; }
.sealed { margin: 45px auto 8px; width: 112px; height: 112px; border: 2px solid #938c7e; border-radius: 50%; display: grid; place-items: center; transform: rotate(-12deg); color: #746d5f; font-weight: 950; letter-spacing: .15em; }
.waiting-banner { margin-top: 18px; padding: 18px; background: #fff1c9; border: 1px solid #dcc17b; border-radius: 10px; text-align: center; font-weight: 800; }
.human-verdict-card, .retry-card { margin-top: 24px; padding: 30px; }
.research-card { margin-top: 24px; padding: 30px; display: flex; align-items: center; gap: 24px; }
.research-spinner { width: 52px; height: 52px; border: 5px solid #ddd3bf; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-card { padding: 40px; margin-top: 24px; }
.result-card h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.truth-note { color: var(--muted); font-weight: 750; }
.central-question, .deciding, .limitations { border-left: 4px solid var(--accent); padding: 12px 18px; margin: 24px 0; display: grid; gap: 5px; }
.central-question { border-left-color: var(--blue); }
.central-question span, .deciding span, .limitations span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 900; }
.judgment { font-size: 1.08rem; white-space: pre-wrap; }
.findings-panel { margin: 20px 0; padding: 18px; border-radius: 14px; background: rgba(35,107,70,.07); border: 1px solid rgba(35,107,70,.18); }
.findings-panel ul { margin-bottom: 0; padding-left: 22px; }
.findings-panel li + li { margin-top: 9px; }
.result-meta, .audit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 22px 0; }
.result-meta > div, .audit-grid > div { padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 5px; }
.result-meta span, .audit-grid span { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; font-weight: 900; }
.elo-changes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.elo-changes div { padding: 17px; border: 1px solid var(--line); border-radius: 10px; display: flex; justify-content: space-between; gap: 12px; }
.sources-panel { margin: 28px 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.45); }
.sources-panel ol { margin: 0; padding-left: 22px; display: grid; gap: 9px; }
.sources-panel a { overflow-wrap: anywhere; }
.audit-panel { margin: 25px 0 0; padding: 17px 20px; border: 1px solid var(--line); border-radius: 12px; }
.audit-panel summary { cursor: pointer; font-weight: 900; }
.response-id { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.activity-section { margin-top: 55px; }
.activity-feed { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--line); }
.activity-feed li { display: grid; grid-template-columns: 160px 1fr; gap: 20px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.activity-feed span { color: var(--muted); font-size: .76rem; font-weight: 750; }
.activity-feed p { margin: 0; }
.page-head { margin-bottom: 30px; }
.table-card { overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 17px 20px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #eae5d9; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.elo-cell { font-family: Georgia, serif; font-weight: 900; font-size: 1.25rem; }

@media (max-width: 900px) {
  .hero, .case-layout, .two-cases { grid-template-columns: 1fr; }
  .hero { gap: 35px; }
  .hero-card { transform: none; }
  .people-grid { grid-template-columns: 1fr 1fr; }
  .judge-person { grid-column: 1 / -1; }
  .progress-card { grid-template-columns: repeat(2, 1fr); }
  .judge-proposal { grid-template-columns: 1fr; }
  .approval-list { grid-column: 1; }
}
@media (max-width: 720px) {
  .three-steps, .match-grid, .judge-options, .result-meta, .audit-grid, .elo-changes, .people-grid { grid-template-columns: 1fr; }
  .judge-person { grid-column: auto; }
  .three-steps article + article { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .dashboard-head, .section-heading, .match-row { align-items: stretch; flex-direction: column; }
  .match-row .right { text-align: left; justify-items: start; }
  .activity-feed li { grid-template-columns: 1fr; gap: 3px; }
}
@media (max-width: 560px) {
  .site-header { padding: 14px 5vw; align-items: flex-start; }
  nav { flex-wrap: wrap; justify-content: flex-end; gap: 10px 14px; }
  .container { padding-top: 34px; }
  .auth-card, .form-card, .result-card, .case-editor, .case-card, .sealed-card { padding: 23px; }
  h1 { font-size: 2.65rem; }
  .progress-card { grid-template-columns: 1fr; }
  th, td { padding: 12px 10px; font-size: .82rem; }
}
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.form-help { margin: -8px 0 2px; color: var(--muted); font-size: .85rem; }
.case-readout > p, .case-card > p { font-size: 1.02rem; line-height: 1.65; }
@media (max-width: 560px) { .form-actions .button { width: 100%; } }
