:root {
    color-scheme: light;
    --red: #a60919;
    --deep-red: #6d0813;
    --wine: #35070c;
    --gold: #ffca72;
    --gold-light: #ffe6a9;
    --paper: #fff8eb;
    --ink: #341a18;
    --muted: #795c54;
    --line: #ead6c6;
    --sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --serif: "Songti SC", "STSong", "Noto Serif CJK SC", SimSun, Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--sans); }
h1, h2, h3, p, ol { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
a, button, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #df9525; outline-offset: 3px; }
fieldset { min-width: 0; margin: 0; }
legend { padding: 0 8px; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.btn {
    display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 17px; border: 1px solid transparent; border-radius: 8px; font-weight: 700;
    text-decoration: none; text-align: center; line-height: 1.3;
}
.primary { color: #fff6e0; background: linear-gradient(155deg, #cb1724, #940714 70%, #780710); border-color: #ad0b18; }
.primary:hover { background: linear-gradient(155deg, #e22431, #a60a18 75%); }
.secondary { color: #642222; background: #fff9f4; border-color: #e6d3c8; }
.secondary:hover, .secondary[aria-pressed="true"] { background: #f7e8da; border-color: #c99975; }
.quiet { color: var(--deep-red); }
.link-btn { border: 0; padding: 4px 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.danger { color: #fff; background: #95202a; }
.paper { background: var(--paper); color: var(--ink); }
.stack { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-full { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 650; }
label small { font-weight: 400; color: var(--muted); line-height: 1.6; }
input:not([type="radio"]):not([type="checkbox"]), select {
    width: 100%; min-width: 0; min-height: 42px; border-radius: 7px; border: 1px solid #d9bfb0;
    padding: 9px 11px; color: var(--ink); background: #fffdf8;
}
input[readonly] { background: #f3ede8 !important; color: #674e45 !important; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--red); }
.notice { padding: 11px 14px; border-radius: 8px; margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.notice.error { color: #871721; background: #ffebeb; border: 1px solid #efb9bc; }
.notice.success { color: #24513f; background: #eef7ed; border: 1px solid #bfd8c6; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { white-space: nowrap; }

.stage-body {
    color: #fff1d4; min-height: 100vh; isolation: isolate; position: relative;
    background: radial-gradient(ellipse at 50% 44%, #920b19 0%, #5d0711 52%, #2e050a 100%);
}
.stage-art {
    position: fixed; z-index: -1; pointer-events: none; inset: 0; overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 104%, #ef442673 0, transparent 58%),
        conic-gradient(from 284deg at 53% 88%, transparent 0deg, #f64b241c 2deg, transparent 7deg 38deg, #e3482d29 40deg, transparent 47deg 76deg, #ea503023 79deg, transparent 85deg 360deg),
        linear-gradient(146deg, #f24d2f89 -13%, transparent 18% 80%, #ca1c2585 105%);
}
.stage-art::before {
    content: ""; position: absolute; inset: 0; opacity: .25;
    background-image: radial-gradient(#ffb55f8c 0.65px, transparent 1px);
    background-size: 7px 7px;
    mask-image: linear-gradient(to bottom, transparent 10%, #000 88%);
}
.stage-art i {
    position: absolute; width: 135%; height: 28%; top: 77%; left: -16%; border-radius: 50%;
    border: 1px solid #ffbd58a0; box-shadow: 0 -3px 10px #ff7e35bd, inset 0 8px 35px #ff612652, 0 -9px 44px #f12e2094;
    transform: rotate(-8deg);
}
.stage-art i + i {
    top: 81%; left: -19%; transform: rotate(8deg); opacity: .7;
    border-color: #ffe2a6c9; box-shadow: 0 -2px 12px #ff9b42cb, inset 0 8px 40px #f03430b5;
}
.gold-title {
    font-family: var(--serif); color: var(--gold-light); font-weight: 800; letter-spacing: .07em;
    text-shadow: 0 2px 0 #692413, 0 0 35px #ff932441; overflow-wrap: anywhere;
}
.ceremony-mark {
    display: inline-flex; align-items: center; gap: 9px; color: #ffce82; font-size: .82rem; font-weight: 700;
    letter-spacing: .18em; max-width: 100%; text-align: center; overflow-wrap: anywhere;
}
.ceremony-mark::before, .ceremony-mark::after {
    content: ""; display: block; flex: 0 0 18px; height: 1px; background: #e79f54; opacity: .7;
}
.ceremony-mark img { display: block; width: auto; height: 42px; max-height: 8vh; object-fit: contain; }
.gold-divider { display: flex; justify-content: center; align-items: center; gap: 12px; color: #ffc677; font-size: 10px; }
.gold-divider span { display: block; width: min(20vw, 115px); height: 1px; background: linear-gradient(90deg, transparent, #ffc668); }
.gold-divider span:last-child { transform: scaleX(-1); }

.mobile-shell { width: min(calc(100% - 30px), 480px); margin: 0 auto; padding: 35px 0 24px; min-height: 100vh; display: flex; flex-direction: column; }
.mobile-heading { display: grid; justify-items: center; gap: 9px; text-align: center; margin-bottom: 21px; }
.mobile-heading .event-title { font-weight: 650; font-size: clamp(14px, 4vw, 19px); color: #ffdda0; overflow-wrap: anywhere; max-width: 100%; }
.mobile-heading .gold-title { font-size: clamp(35px, 9.4vw, 48px); line-height: 1.18; margin: 4px 0; }
.identity { display: flex; gap: 9px; margin-top: 5px; align-items: center; }
.identity span, .identity b {
    border-radius: 30px; padding: 5px 14px; background: linear-gradient(180deg, #ffe8af, #edb564);
    color: #681923; font-size: 13px; font-weight: 800;
}
.identity b { background: #6d0918; border: 1px solid #c98354; color: #ffdf9f; }
.mobile-card {
    padding: 20px; border-radius: 15px; border: 1px solid #f7d18d;
    background: linear-gradient(145deg, #fffaf0, #faead2);
    box-shadow: 0 6px 18px #2b00064c, inset 0 1px #fff;
}
.mobile-card h2 { font-size: 20px; color: #711522; overflow-wrap: anywhere; }
.mobile-card p { color: #714839; margin-top: 7px; line-height: 1.6; font-size: 14px; }
.code-form { margin-top: 17px; }
.code-form input { letter-spacing: .09em; font-size: 16px; }
.mobile-shell .primary { width: 100%; min-height: 46px; border-radius: 30px; border-color: #e5aa58; font-size: 17px; box-shadow: inset 0 1px 1px #ff836d8c, 0 3px 10px #31060c2d; }
.mobile-tabs { display: flex; gap: 5px; margin-bottom: 12px; }
.mobile-tabs a {
    flex: 1; color: #ffe0a9; text-decoration: none; padding: 8px 4px; text-align: center;
    border: 1px solid #eeb77565; border-radius: 8px; font-size: 13px; background: #4a030e6b;
}
.mobile-tabs a[aria-current="page"] { background: #ffe1a5; color: #671423; border-color: #ffce82; font-weight: 800; }
.match-card .small-label { font-size: 12px; letter-spacing: .15em; margin: 0 0 4px; color: #9d531f; }
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 17px 0; text-align: center; }
.matchup span { color: #681321; font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.matchup em { color: #a35b10; font: 700 italic 24px Georgia, serif; }
.collection-status { display: inline-flex; gap: 7px; align-items: center; border-radius: 24px; background: #f1dcc3; color: #674a35; padding: 5px 10px; font-size: 12px; font-weight: 750; }
.collection-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.collection-status.is-open { color: #186346; background: #e4eddb; }
.mobile-entries { display: grid; gap: 10px; margin-top: 12px; }
.mobile-entries a {
    background: linear-gradient(120deg, #a91422, #770b18); border: 1px solid #eab06f; border-radius: 12px;
    color: #ffedc4; text-decoration: none; display: flex; align-items: center; justify-content: space-between;
    padding: 13px 17px; font-size: 18px; font-weight: 800; box-shadow: 0 4px 12px #31020b4c;
}
.mobile-entries a b { font-size: 26px; }
.mobile-entries a small { display: block; margin-top: 3px; color: #ffd296; font-size: 12px; font-weight: 500; }
.ballot { display: grid; gap: 11px; }
.ballot-instruction { text-align: center; color: #ffe4ad; font-size: 13px; }
.score-card h2, .vote-card h2 { display: flex; align-items: center; gap: 9px; font-size: 19px; }
.side-tag { flex: 0 0 auto; background: linear-gradient(135deg, #d41925, #8d0b19); padding: 3px 9px; border-radius: 7px; color: #fff2d5; font-size: 14px; }
.stepper { display: grid; grid-template-columns: 42px minmax(0, 150px) 42px; align-items: center; justify-content: center; gap: 11px; margin-top: 12px; }
.stepper input { text-align: center; font-size: 30px; color: #760f1e !important; font-weight: 850; font-variant-numeric: tabular-nums; padding: 5px 0 !important; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.stepper input[type="number"] { appearance: textfield; }
.stepper button { color: #7f1720; background: #f5ca82; border: 1px solid #e5ad69; border-radius: 50%; height: 42px; font-size: 23px; font-weight: 800; }
.vote-card { padding-top: 13px; padding-bottom: 10px; }
.vote-card h2 { margin-bottom: 8px; }
.candidate {
    display: grid; grid-template-columns: 43px 1fr 25px; align-items: center; padding: 8px 9px; min-height: 43px;
    border-radius: 7px; color: var(--ink); cursor: pointer; border-bottom: 1px solid #ead1b8;
}
.candidate:last-child { border-bottom-color: transparent; }
.candidate:has(:checked) { background: #f9d9c8; border-bottom-color: transparent; }
.candidate-seat { font-size: 13px; color: #87431d; }
.candidate strong { overflow-wrap: anywhere; }
.candidate input { width: 20px; height: 20px; margin: 0; }
.ballot-message { color: #ffe2ac; font-size: 14px; text-align: center; }
.ballot-message:empty { display: none; }
.empty-card { text-align: center; }
.state-symbol {
    width: 45px; height: 45px; margin: 0 auto 10px; border-radius: 50%;
    color: #852b21; background: #f2d69d; display: grid; place-items: center; font-size: 25px; font-weight: 800;
}
.empty-card .btn { margin-top: 15px; }
.exit-form { margin: 15px auto 0; font-size: 12px; color: #ffe0a7; }
.mobile-footer { padding-top: 21px; margin-top: auto; text-align: center; font-size: 12px; color: #f3d2a9; }
.mobile-footer a { text-underline-offset: 3px; }

.screen-shell {
    width: min(94vw, 1660px); margin: 0 auto; min-height: 100vh; min-height: 100svh; padding: clamp(29px, 5vh, 72px) 0 22px;
    display: flex; flex-direction: column; justify-content: center; position: relative;
}
.screen-tools { display: flex; gap: 8px; align-items: center; justify-content: flex-end; position: absolute; right: 0; top: 13px; }
.live-chip, .screen-btn {
    border: 1px solid #eda97081; color: #ffebc5; background: #3e0613ac; border-radius: 32px; padding: 6px 10px;
    font-size: clamp(11px, 1vw, 14px); line-height: 1.1;
}
.live-chip::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #a9edab; margin-right: 6px; vertical-align: 2px; }
.live-chip.offline::before { background: #ffae70; }
.screen-heading { display: grid; justify-items: center; gap: clamp(6px, 1.2vh, 14px); text-align: center; }
.screen-heading .ceremony-mark { font-size: clamp(12px, 1.05vw, 18px); }
.screen-heading .gold-title { max-width: min(1130px, 100%); font-size: clamp(30px, 4.35vw, 76px); line-height: 1.12; }
#scene { min-width: 0; }
.debate-topic { text-align: center; margin: 15px 0 clamp(15px, 3.5vh, 40px); }
.stage-caption {
    width: fit-content; margin: 0 auto 9px; padding: 7px 26px; display: flex; align-items: center; gap: 13px;
    background: linear-gradient(90deg, #6b0715, #af1e24 52%, #6b0715); color: #ffe0a4;
    border: 1px solid #dc8d50; border-radius: 5px 19px 5px 19px; font-size: clamp(13px, 1.4vw, 21px); font-weight: 750;
}
.stage-caption span { width: 1px; height: 1em; background: #dd9e66; }
.debate-topic h2 { font-family: var(--serif); font-size: clamp(20px, 2.45vw, 40px); color: #fff0cf; line-height: 1.3; max-width: 1160px; margin: auto; overflow-wrap: anywhere; }
.glass {
    background: linear-gradient(148deg, #870a1bdb, #420612f0);
    border: 1px solid #ee9d65; box-shadow: 0 10px 27px #32020bb0, inset 0 0 25px #e5233573, 0 0 13px #ff734a45; border-radius: 13px;
}
.timer-grid { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: clamp(12px, 2vw, 32px); align-items: center; }
.stage-team { min-width: 0; padding: clamp(10px, 1.45vw, 21px); }
.stage-team header, .stage-score header { display: flex; align-items: center; gap: .55em; margin-bottom: 10px; }
.stage-team header > span, .stage-score header > span {
    background: linear-gradient(145deg, #ffe6a8, #e9a851); color: #640d19; padding: .23em .53em;
    border-radius: 4px 9px 4px 9px; font-weight: 800; white-space: nowrap; font-size: clamp(13px, 1.3vw, 20px);
}
.stage-team h3, .stage-score h3 { color: #ffebc2; font-size: clamp(16px, 2vw, 34px); overflow-wrap: anywhere; }
.stage-team ol { padding: 0; margin: 0; list-style: none; display: grid; gap: clamp(4px, .6vh, 9px); }
.stage-team li {
    display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .85em; padding: .34em .5em;
    border-bottom: 1px solid #f9a5684d; background: #4009136b; font-size: clamp(14px, 1.33vw, 23px);
}
.stage-team li span { font-weight: 660; color: #ffc985; white-space: nowrap; }
.stage-team li strong { overflow-wrap: anywhere; }
.timer-zone { min-width: 0; display: grid; gap: 8px; text-align: center; }
.versus { font: italic 700 clamp(27px, 4.2vw, 66px)/.95 Georgia, serif; color: #ffdd97; text-shadow: 0 0 22px #ffa14a, 0 2px 0 #a23611; }
.timer-faces { display: flex; gap: 10px; }
.timer-face {
    display: grid; flex: 1; min-width: 0; padding: clamp(8px, 1.5vh, 17px) 6px;
    border: 1px solid #de8b56; border-radius: 14px 34px 14px 34px;
    background: radial-gradient(ellipse at 50% 110%, #b71925, #56061a 77%);
    box-shadow: 0 7px 25px #420210, inset 0 0 28px #e83e3755;
}
.timer-face.active { border-color: #ffe5a5; box-shadow: 0 0 20px #f8764e9c, inset 0 0 22px #fb584a73; }
.timer-face span { font-size: clamp(11px, 1vw, 17px); letter-spacing: .15em; color: #ffcb89; }
.timer-face strong {
    color: #ffe6a3; font: 700 clamp(48px, 8.1vw, 145px)/.99 Georgia, serif; font-variant-numeric: lining-nums tabular-nums;
    text-shadow: 0 2px #91260b, 0 0 20px #ff9f566a;
}
.split-clock .timer-face strong { font-size: clamp(27px, 4.55vw, 74px); }
.js-time.urgent { color: #fff1c5; }
.js-time.expired { color: #ffab93; }
.speaker-line {
    padding: 7px 9px; color: #ffedc4; border: 1px solid #d59561; border-radius: 7px;
    background: linear-gradient(90deg, #710819ae, #ad2629dc, #710819ae); font-size: clamp(13px, 1.45vw, 23px);
    overflow-wrap: anywhere;
}
.next-speaker { color: #ffd79a; font-size: clamp(11px, 1.05vw, 17px); overflow-wrap: anywhere; }
.phase-line {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 7px;
    text-align: center; margin: clamp(18px, 5vh, 58px) auto 0;
}
.phase-line span {
    display: inline-flex; gap: .45em; align-items: center; padding: .45em .7em; color: #ffd8a7;
    border: 1px solid #e8ae715d; border-radius: 5px; background: #570818bd; font-size: clamp(10px, 1.04vw, 16px);
}
.phase-line span.current { color: #641321; background: #ffdc95; border-color: #ffeaaf; font-weight: 800; }
.phase-line span.past { color: #ffbb94; }
.scoring-clock {
    width: fit-content; display: flex; align-items: center; gap: 13px; margin: -8px auto 15px; padding: 5px 13px;
    color: #ffdfaa; border: 1px solid #db8f59; background: #55091a; border-radius: 30px; font-size: clamp(12px, 1.05vw, 17px);
}
.scoring-clock strong { font-variant-numeric: tabular-nums; color: #fff0c4; font-size: 1.25em; }
.scoring-grid { display: grid; grid-template-columns: 1fr 1fr 1.06fr; gap: clamp(10px, 1.3vw, 20px); align-items: stretch; }
.stage-score, .qr-screen { padding: clamp(10px, 1.25vw, 20px); }
.stage-score h3 { font-size: clamp(16px, 1.55vw, 29px); }
.score-components { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.score-components div { display: grid; gap: 4px; background: #590b1b; border-bottom: 1px solid #a6493c; text-align: center; padding: 7px 3px; color: #ffdbac; font-size: clamp(10px, 1vw, 16px); }
.score-components strong { font: 700 clamp(19px, 2.2vw, 40px)/1.06 Georgia, serif; }
.score-final {
    padding: 6px 9px; margin-top: 10px; border-radius: 6px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    border: 1px solid #e4ac65; background: linear-gradient(110deg, #a12928, #59101a); color: #ffe3aa; font-weight: 800;
}
.score-final span { font-size: clamp(11px, 1.3vw, 19px); }
.score-final strong { font: 700 clamp(26px, 3.4vw, 62px)/1.06 Georgia, serif; }
.qr-screen { text-align: center; }
.qr-screen h3 { color: #ffdfa6; font-size: clamp(15px, 1.55vw, 24px); margin-bottom: 9px; }
.qr-screen-grid { display: flex; justify-content: center; gap: clamp(7px, 1vw, 16px); }
.qr-tile { text-decoration: none; display: grid; gap: 6px; justify-items: center; font-size: clamp(11px, 1.08vw, 18px); line-height: 1.2; }
.qr-tile img { width: clamp(65px, 10vw, 165px); height: auto; aspect-ratio: 1; display: block; border-radius: 4px; background: #fff; image-rendering: pixelated; }
.stage-progress { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin: 13px 0 0; }
.stage-progress span { background: #5b0919; border: 1px solid #c57b54; border-radius: 30px; padding: 6px 10px; font-size: clamp(11px, 1.05vw, 16px); color: #ffdcaa; }
.stage-progress b { margin-left: 4px; color: #fff0c4; }
.screen-wait, .stage-board { max-width: 1320px; margin: clamp(19px, 4vh, 46px) auto 0; }
.screen-wait { padding: clamp(24px, 7vh, 90px); text-align: center; }
.screen-wait h2, .board-title h2 { color: #ffe1a2; font: 800 clamp(23px, 3vw, 49px)/1.15 var(--serif); }
.screen-wait p { margin-top: 12px; }
.stage-board { padding: clamp(12px, 2vw, 32px); }
.board-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.stage-table { font-size: clamp(13px, 1.55vw, 26px); }
.stage-table th, .stage-table td { border-color: #b76047a6; padding: .49em .6em; }
.stage-table th { color: #ffda9e; background: #580b1b; font-size: .8em; }
.stage-table td { overflow-wrap: anywhere; }
.table-total { font-weight: 850; color: #ffdf8f; }
.rank-medal { display: inline-grid; min-width: 1.6em; height: 1.6em; place-items: center; border-radius: 50%; color: #661423; background: #ffd890; font-weight: 800; }

.admin-body { background: #f8f1eb; color: var(--ink); min-height: 100vh; }
.admin-top { background: #550a15; color: #fce1b8; border-bottom: 2px solid #c89762; }
.admin-top-inner {
    max-width: 1270px; margin: 0 auto; padding: 15px 25px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.admin-brand, .auth-header { display: flex; align-items: center; gap: 12px; }
.admin-brand { text-decoration: none; font-size: 17px; font-weight: 800; overflow-wrap: anywhere; }
.admin-brand small { display: block; margin-top: 2px; color: #f1ba90; font-size: 11px; letter-spacing: .13em; }
.brand-glyph {
    flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center; font: 750 25px var(--serif);
    color: #6e1321; background: linear-gradient(145deg, #ffebbd, #ebb16b); border-radius: 7px 16px 7px 16px;
    border: 1px solid #f8cf94;
}
.admin-top-actions { display: flex; align-items: center; gap: 13px; white-space: nowrap; font-size: 13px; }
.admin-top-actions .btn { min-height: 34px; }
.admin-shell { width: min(100%, 1270px); margin: 0 auto; padding: 0 25px 32px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; border-bottom: 1px solid #dbc1b0; }
.admin-nav a { text-decoration: none; color: #674236; white-space: nowrap; padding: 14px 2px 12px; border-bottom: 2px solid transparent; }
.admin-nav a[aria-current="page"] { color: #851522; font-weight: 800; border-color: #a01929; }
.admin-page-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 22px 0 15px; }
.admin-page-title h1 { font-size: clamp(24px, 3vw, 34px); color: #611422; }
.admin-card {
    margin-bottom: 13px; padding: 19px; border-radius: 13px; border: 1px solid #e9d4c3;
    background: #fffdf9; box-shadow: 0 3px 14px #4c0d1510;
}
.admin-card h2 { color: #681724; font-size: 20px; line-height: 1.2; margin-bottom: 13px; }
.admin-card h3 { font-size: 16px; line-height: 1.3; color: #681724; }
.admin-card p.muted, #admin-results p.muted { margin: 9px 0 12px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.65; }
.link-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.link-tile { min-width: 0; background: #fbf2e9; border: 1px solid #ecd8c8; border-radius: 8px; padding: 10px; }
.link-tile strong { display: block; font-size: 14px; }
.link-tile small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); margin-top: 5px; }
.link-tile div { display: flex; gap: 10px; align-items: center; color: #852330; font-size: 13px; margin-top: 3px; }
.control-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 13px; align-items: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 13px; }
.section-head h2 { margin: 0; }
.sync-chip {
    padding: 5px 9px; border-radius: 20px; border: 1px solid #e9d2bf; color: #6b4b3d; background: #f8ede0;
    font-size: 12px; white-space: nowrap;
}
.sync-chip:empty { display: none; }
.sync-chip.connected { color: #215e44; background: #e6f1e5; border-color: #bdd3c5; }
.button-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.control-clock { display: grid; gap: 3px; color: #ffe5b9; background: #68101e; border-radius: 9px; padding: 11px 12px; margin: 10px 0; }
.control-clock > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; align-items: center; }
.control-clock p { font-size: 13px; line-height: 1.5; }
#control-next { color: #fbd2a1; font-size: 12px; }
#control-clock { font-size: clamp(19px, 2vw, 30px); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.phase-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.phase-grid .btn, .clock-actions .btn { font-size: 13px; padding-inline: 6px; }
#answer-control { margin-top: 9px; font-size: 13px; }
.control-progress { display: grid; gap: 5px; margin-bottom: 10px; }
.control-progress div { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fbf3ec; padding: 7px 9px; border-radius: 6px; font-size: 14px; }
.control-progress strong { color: #751424; font-size: 17px; font-variant-numeric: tabular-nums; }
.control-progress small { color: #795a4f; font-size: 12px; font-weight: 500; }
.subhead { border-top: 1px solid #f0dfd2; padding-top: 13px; margin-top: 13px; }
.roster-tabs { margin-bottom: 10px; }
.roster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.roster-team, .auth-shell fieldset { border: 1px solid #e6d3c4; border-radius: 9px; padding: 12px; }
.roster-team legend, .auth-shell legend { color: #761d29; font-weight: 800; }
.roster-player { display: grid; grid-template-columns: 1fr 1.05fr .65fr; gap: 7px; margin-top: 10px; }
.admin-card .checkbox { display: flex; align-items: center; }
.checkbox input { flex-shrink: 0; width: 16px; height: 16px; }
.admin-card .inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.inline-form input[type="file"] { width: min(100%, 340px) !important; }
.inline-form .count-input { max-width: 100px; }
.code-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: 6px; margin: 8px 0; }
.code-grid button { font: 600 12px ui-monospace, monospace; justify-content: start; padding: 7px; }
.code-grid small { color: #82594a; min-width: 1.5em; }
details { padding: 9px 0; border-top: 1px solid #eeded2; }
summary { cursor: pointer; font-weight: 750; color: #68202b; }
.qr-admin { text-align: center; }
.qr-admin img { height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.qr-admin p { overflow-wrap: anywhere; font-size: 13px; color: #822332; }
.image-preview { width: max-content; max-width: 220px; max-height: 105px; object-fit: contain; }
.danger-card { border-color: #d9a4a2; }
.danger-card input[type="text"], .danger-card input[name="confirm"] { max-width: 280px; }
.auth-shell { width: min(440px, calc(100% - 30px)); margin: 0 auto; padding: min(11vh, 95px) 0 26px; }
.install-shell { width: min(640px, calc(100% - 30px)); }
.auth-header { margin: 0 0 17px; }
.auth-header p { color: #775246; font-size: 13px; margin-bottom: 3px; }
.auth-header h1 { color: #681724; font-size: clamp(22px, 6vw, 31px); }
.auth-back { display: block; font-size: 13px; color: #7a2530; text-align: center; }

@media (max-width: 850px) {
    .link-grid { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); }
    .control-grid, .roster-grid { grid-template-columns: 1fr; gap: 0; }
    .screen-shell { justify-content: start; padding-top: 47px; }
    .timer-grid { grid-template-columns: 1fr 1fr; }
    .timer-zone { order: -1; grid-column: 1 / -1; width: min(100%, 430px); margin: auto; }
    .stage-team { align-self: stretch; }
    .scoring-grid { grid-template-columns: 1fr 1fr; }
    .qr-screen { grid-column: 1 / -1; }
    .qr-tile img { width: clamp(88px, 15vw, 150px); }
}
@media (max-width: 490px) {
    .admin-shell, .admin-top-inner { padding-inline: 12px; }
    .admin-brand { font-size: 14px; }
    .admin-top-actions { gap: 7px; }
    .admin-top-actions .btn { padding: 6px 7px; font-size: 11px; }
    .admin-nav { gap: 5px 11px; }
    .admin-nav a { font-size: 13px; }
    .admin-card { padding: 12px; }
    .roster-player { grid-template-columns: 1fr 1fr; }
    .roster-player label:first-child { grid-column: 1 / -1; }
    .form-grid { grid-template-columns: 1fr; }
    .phase-grid { grid-template-columns: 1fr 1fr; }
    .stage-team header, .stage-score header { flex-wrap: wrap; }
}
@media (min-width: 851px) and (max-height: 660px) {
    .screen-shell { padding-top: 29px; padding-bottom: 11px; }
    .screen-heading .gold-title { font-size: clamp(26px, 3.45vw, 57px); }
    .screen-heading { gap: 4px; }
    .ceremony-mark img { height: 26px; }
    .debate-topic { margin: 9px 0 14px; }
    .debate-topic h2 { font-size: clamp(18px, 1.95vw, 34px); }
    .phase-line { margin-top: 16px; }
    .timer-face strong { font-size: clamp(45px, 6.7vw, 112px); }
    .split-clock .timer-face strong { font-size: clamp(28px, 4vw, 68px); }
    .qr-tile img { width: clamp(80px, 9vw, 150px); }
}
