:root {
    color-scheme: light;
    --field: #101c18;
    --ink: #19262b;
    --muted: #596971;
    --accent: #b5ed7c;
    --green: #28624b;
    --line: #dae4df;
    --canvas: #eff4f1;
    --paper: #fff;
    font-family: "Inter", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
    background: var(--canvas);
    color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1 { font-size: 1.18rem; font-weight: 750; }
h2 { font-size: 1.08rem; font-weight: 750; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
.top { background: var(--field); color: white; }
.top-inner, .frame { max-width: 690px; margin: auto; }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 8px 17px; gap: 10px; }
.identity { display: flex; align-items: center; gap: 12px; }
.brand { color: var(--accent); font-weight: 850; font-size: 1.22rem; letter-spacing: -.035em; }
.role-label { border-left: 1px solid #5d7069; padding-left: 12px; color: #dbe9e3; font-size: .85rem; }
.text-button { background: transparent; border: 0; color: #dbe9e3; padding: 12px 0 12px 8px; font-size: .82rem; }
.frame { padding: 15px 12px calc(24px + env(safe-area-inset-bottom)); }
.panel, .match { margin-bottom: 12px; border-radius: 16px; overflow: hidden; }
.panel { padding: 16px; border: 1px solid var(--line); background: var(--paper); }
.match { color: #f4fbf7; padding: 15px; background: #173227; }
.match-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; min-width: 0; }
.match-heading h1 { overflow-wrap: anywhere; }
.connection { flex: none; margin-top: 2px; font-size: .7rem; color: #c7eeb9; border: 1px solid #648e73; border-radius: 18px; padding: 4px 7px; white-space: nowrap; }
.connection[data-state="offline"] { color: #ffdda7; border-color: #987f55; }
.match-detail { display: grid; align-items: center; grid-template-columns: 1fr auto 1fr; gap: 9px; margin-top: 13px; border-top: 1px solid #658271; padding-top: 13px; }
.match-team { min-width: 0; overflow-wrap: anywhere; font-size: .9rem; line-height: 1.35; font-weight: 650; text-align: center; }
.clock { text-align: center; min-width: 65px; }
.clock span { display: block; color: #c2ddcd; font-size: .72rem; }
.clock strong { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 1.4rem; line-height: 1.2; }
form { display: grid; gap: 12px; margin-top: 14px; }
.sign-in { margin-top: 24px; max-width: 420px; margin-inline: auto; }
.sign-in form { gap: 9px; }
.sign-in .primary { margin-top: 7px; }
label:not(.choices label), legend { display: block; font-size: .77rem; color: var(--muted); font-weight: 650; }
#player-fields label, .form-cols label, #time-field label { margin-bottom: 5px; }
input:not([type=radio]), select { min-height: 46px; display: block; width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #bccdc4; border-radius: 9px; background: #fcfefd; color: var(--ink); font-size: 1rem; }
:focus-visible { outline: 3px solid #4385ed; outline-offset: 2px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices legend { margin-bottom: 5px; padding: 0; }
.event-grid, .team-grid { display: grid; gap: 6px; }
.event-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.event-grid label:last-child { grid-column: 1 / -1; }
.team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choices label { display: block; position: relative; cursor: pointer; }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices label > span { display: flex; align-items: center; justify-content: center; min-height: 42px; background: #f3f7f4; border: 1px solid #d9e5df; border-radius: 8px; padding: 6px; color: #345346; font-size: .86rem; font-weight: 700; }
.choices input:checked + span { color: #143723; background: #e0f3d4; border-color: #72a459; }
.choices input:focus-visible + span { outline: 3px solid #4385ed; outline-offset: 2px; }
.event-choices input[value=yellow]:checked + span { background: #fff0b6; border-color: #c3a347; color: #5f4810; }
.event-choices input[value=red]:checked + span { background: #ffe3e0; border-color: #ce8780; color: #873328; }
.team-grid label > span { flex-direction: column; min-height: 55px; justify-content: center; align-items: flex-start; gap: 2px; padding: 6px 9px; }
.team-grid small { color: #577364; font-size: .68rem; font-weight: 600; }
.team-grid b { line-height: 1.25; overflow-wrap: anywhere; }
.form-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats-fields { display: grid; gap: 5px; }
.stats-field { display: grid; gap: 8px; align-items: center; grid-template-columns: 1fr minmax(75px, .46fr); }
.stats-field label { color: var(--ink); font-size: .86rem; }
.stats-field input { min-height: 42px; text-align: center; }
.primary { min-height: 48px; border: 0; border-radius: 8px; background: #28624b; color: white; font-weight: 750; padding: 10px 12px; }
.primary:hover { background: #174d38; }
.message { color: #285e47; font-size: .85rem; line-height: 1.5; }
.message:empty { display: none; }
.message[data-error=true] { color: #952a25; }
.records h2 { margin-bottom: 9px; }
.records ul { margin: 0; padding: 0; list-style: none; }
.records li { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 38px; padding: 7px 0; font-size: .82rem; border-top: 1px solid #e5eee9; }
.records li p { overflow-wrap: anywhere; }
.record-heading { display: flex; justify-content: space-between; align-items: baseline; }
.record-heading span, .muted, .record-note { color: var(--muted); font-size: .78rem; }
.record-note { white-space: nowrap; }
.discard { flex: none; border: 1px solid #d4a8a2; background: white; color: #902c23; padding: 7px 9px; border-radius: 7px; }
@media (min-width: 480px) {
    .frame { padding-inline: 18px; }
    .event-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .event-grid label:last-child { grid-column: auto; }
    .stats-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
}
