:root {
  color-scheme: dark;
  --bg: #0b1012;
  --surface: #141b1e;
  --surface-raised: #1b2427;
  --surface-soft: #202b2e;
  --line: #344246;
  --line-bright: #526267;
  --text: #eef4ed;
  --text-soft: #b0bfba;
  --muted: #82918e;
  --acid: #d6ff42;
  --acid-dark: #9bbd20;
  --orange: #ff795f;
  --cyan: #70dfff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  font-family: Inter, "Arial Narrow", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(145, 169, 161, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145, 169, 161, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}
button:disabled { opacity: 0.58; cursor: wait; }

.topbar {
  height: 76px;
  padding: 0 clamp(18px, 5vw, 76px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 16, 18, 0.96);
}
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid var(--acid);
  border-radius: 6px;
  color: var(--acid);
  background: var(--surface);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -1.5px;
  box-shadow: 3px 3px 0 rgba(214, 255, 66, 0.15);
}
.brand-mark span { color: var(--text); margin: 0 1px; }
.brand-copy { display: grid; gap: 4px; line-height: 1; }
.brand-copy strong { font-size: 10px; line-height: 1.12; letter-spacing: 0.13em; }
.brand-copy small { color: var(--acid); font-size: 8px; font-weight: 800; letter-spacing: 0.17em; }
.topbar-note { display: flex; align-items: center; gap: 9px; color: var(--text-soft); font-size: 9px; font-weight: 850; letter-spacing: 0.13em; }
.topbar-divider { color: var(--line-bright); }
.live-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--acid); box-shadow: 0 0 10px rgba(214, 255, 66, 0.42); }

main { min-height: calc(100vh - 140px); }
.loading-state { max-width: 1160px; margin: 0 auto; padding: 72px 24px; color: var(--muted); }
.shell { max-width: 1260px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 56px); }
.eyebrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: 0.15em; text-transform: uppercase; }
.eyebrow-chip { padding: 5px 7px; color: var(--bg); background: var(--acid); border-radius: 2px; font-size: 8px; letter-spacing: 0.1em; }

.home-hero {
  padding: clamp(48px, 8vw, 104px) 0 44px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.65fr);
  gap: clamp(24px, 7vw, 100px);
  align-items: end;
}
.home-title {
  max-width: 820px;
  margin: 18px 0 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: clamp(54px, 7.8vw, 100px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}
.home-title em { color: var(--acid); font-style: normal; }
.home-intro {
  max-width: 330px;
  margin: 0 0 7px;
  padding: 17px 0 0 16px;
  color: var(--text-soft);
  border-left: 2px solid var(--orange);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.7;
}

.entry-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.75fr); gap: 15px; padding-bottom: 76px; }
.panel { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: var(--shadow); }
.panel::before { position: absolute; top: 0; left: 0; width: 52px; height: 3px; background: var(--acid); content: ""; }
.create-panel { padding: clamp(22px, 3.5vw, 40px); }
.join-panel { padding: clamp(22px, 3.5vw, 34px); align-self: start; }
.panel-heading { display: flex; justify-content: space-between; gap: 15px; align-items: start; margin-bottom: 25px; }
.panel-heading h2, .section-heading h2 {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-transform: uppercase;
}
.panel-heading p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.step-number { color: var(--acid); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 850; }
.join-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-bright); border-radius: 4px; color: var(--cyan); font-size: 18px; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > span, .field-label { color: var(--text-soft); font-size: 10px; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase; }
.field-hint { color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.5; letter-spacing: 0; text-transform: none; }
.input, .textarea, .select {
  width: 100%;
  min-height: 45px;
  padding: 11px 12px;
  color: var(--text);
  background: #0e1416;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: #647270; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--line-bright); }
.select option { color: var(--text); background: var(--surface); }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 12px; }
.mode-option { position: relative; }
.mode-option input { position: absolute; opacity: 0; inset: 0; }
.mode-card {
  min-height: 82px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #101719;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.mode-card:hover { border-color: var(--line-bright); transform: translateY(-1px); }
.mode-option input:checked + .mode-card { background: #222b1b; border-color: var(--acid); box-shadow: inset 3px 0 0 var(--acid); }
.mode-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 3px; color: var(--acid); background: var(--surface-raised); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 900; }
.mode-card strong { display: block; margin: 1px 0 5px; color: var(--text); font-size: 11px; font-weight: 850; letter-spacing: 0.04em; text-transform: uppercase; }
.mode-card small { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; }
.mode-description { min-height: 40px; margin: 0 0 18px; padding: 10px 12px; color: var(--text-soft); background: #101719; border-left: 2px solid var(--cyan); font-size: 11px; line-height: 1.5; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field-submit .primary-button { width: 100%; }
.primary-button, .secondary-button, .quiet-button, .winner-button, .copy-button, .score-control, .undo-button {
  border-radius: 4px;
  cursor: pointer;
  font-weight: 850;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.primary-button:hover, .secondary-button:hover, .winner-button:hover, .copy-button:hover, .score-control:hover { transform: translateY(-1px); }
.primary-button { min-height: 47px; padding: 0 17px; color: #10150a; background: var(--acid); border: 1px solid var(--acid); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.primary-button:hover { background: #e4ff8a; border-color: #e4ff8a; }
.secondary-button { min-height: 44px; padding: 0 15px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--line-bright); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; }
.secondary-button:hover { border-color: var(--cyan); color: var(--cyan); }
.quiet-button { padding: 8px 10px; color: var(--text-soft); background: transparent; border: 1px solid transparent; font-size: 10px; font-weight: 800; }
.quiet-button:hover { color: var(--acid); background: var(--surface-raised); border-color: var(--line); }
.form-error { min-height: 17px; margin: 0 0 8px; color: var(--orange); font-size: 11px; }
.join-panel .field { margin-top: 22px; }
.join-button { width: 100%; margin-top: 4px; }
.join-caption { margin: 13px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

/* Join screen */
.join-shell { max-width: 610px; padding-top: clamp(55px, 10vh, 105px); padding-bottom: 100px; }
.join-code { display: inline-flex; margin: 16px 0; padding: 8px 11px; color: #0d130b; background: var(--acid); border-radius: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 900; letter-spacing: 0.17em; }
.join-shell .panel { padding: clamp(24px, 6vw, 42px); }

/* Session and score panels */
.session-shell { padding-top: 25px; padding-bottom: 80px; }
.session-top { display: flex; justify-content: space-between; gap: 20px; align-items: start; padding: 20px 0 22px; border-bottom: 1px solid var(--line); }
.session-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: 0.13em; text-transform: uppercase; }
.mode-tag { padding: 5px 8px; color: var(--acid); background: #202b18; border: 1px solid #485c25; border-radius: 2px; letter-spacing: 0.05em; }
.session-title { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: clamp(31px, 4.3vw, 48px); font-weight: 850; line-height: 1.08; letter-spacing: -0.045em; text-transform: uppercase; }
.session-meta { margin-top: 9px; color: var(--muted); font-size: 10px; }
.session-meta strong { color: var(--text-soft); }
.share-box { min-width: 230px; padding: 12px 14px; color: var(--text); background: #101719; border: 1px solid var(--line-bright); border-radius: 5px; box-shadow: inset 3px 0 0 var(--acid); }
.share-label { display: block; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: 0.14em; }
.share-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 6px; }
.share-code { color: var(--acid); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 19px; font-weight: 900; letter-spacing: 0.15em; }
.copy-button { padding: 8px 9px; color: #10150a; background: var(--acid); border: 0; border-radius: 3px; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.session-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 13px 0 17px; }
.identity { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.identity strong { color: var(--text); }
.tabs { display: flex; gap: 3px; padding: 3px; background: #0f1517; border: 1px solid var(--line); border-radius: 4px; }
.tab-button { min-height: 32px; padding: 0 13px; color: var(--muted); background: transparent; border: 0; border-radius: 2px; font-size: 9px; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.tab-button[aria-selected="true"] { color: #10150a; background: var(--acid); }
.summary-grid { display: grid; grid-template-columns: 1.25fr repeat(3, 0.65fr); gap: 8px; margin: 0 0 17px; }
.summary-lead, .summary-stat { min-height: 88px; padding: 15px 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.summary-lead { color: var(--text); background: #171f21; border-color: #415047; box-shadow: inset 3px 0 0 var(--acid); }
.summary-lead small, .summary-stat small { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.summary-lead small { color: var(--acid); }
.summary-lead strong { display: block; margin-top: 11px; font-size: clamp(17px, 2.1vw, 25px); font-weight: 850; letter-spacing: -0.025em; }
.summary-stat { background: #111719; }
.summary-stat small { color: var(--muted); }
.summary-stat strong { display: block; margin-top: 6px; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 27px; font-weight: 800; }
.summary-stat span { color: var(--muted); font-size: 9px; }
.score-layout { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(300px, 0.78fr); gap: 14px; align-items: start; }
.score-main { display: grid; gap: 14px; }
.score-panel, .stats-panel, .history-panel { padding: clamp(18px, 2.8vw, 27px); }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 15px; margin-bottom: 17px; }
.section-heading h2 { font-size: 22px; }
.section-heading p { margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.section-index { color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 850; }
.players-list { display: grid; }
.player-line { min-height: 60px; display: grid; grid-template-columns: minmax(110px, 1fr) auto auto auto; gap: 8px; align-items: center; border-top: 1px solid var(--line); }
.player-name { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--text); font-weight: 800; }
.player-index { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 3px; color: var(--cyan); background: var(--surface-raised); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 850; }
.player-record { min-width: 66px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-align: right; white-space: nowrap; }
.player-record strong { color: var(--text); }
.rename-player { grid-column: 4; white-space: nowrap; }
.score-control { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-bright); border-radius: 4px; color: var(--text); background: var(--surface-raised); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; line-height: 1; }
.score-control.plus { color: #10150a; background: var(--acid); border-color: var(--acid); }
.score-control.minus { color: var(--orange); font-size: 21px; }
.control-caption { display: flex; justify-content: flex-end; gap: 29px; padding: 0 5px 7px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; text-transform: uppercase; letter-spacing: 0.09em; }
.matchup { padding: 16px; background: #101719; border: 1px solid var(--line-bright); border-radius: 4px; }
.matchup-label { margin-bottom: 12px; color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 850; letter-spacing: 0.14em; text-transform: uppercase; }
.matchup-players { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.matchup-player { min-width: 0; }
.matchup-player:last-child { text-align: right; }
.matchup-player strong { display: block; overflow: hidden; color: var(--text); font-size: clamp(16px, 2vw, 22px); font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.matchup-player small { color: var(--muted); font-size: 9px; }
.versus { color: var(--orange); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 900; }
.winner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.winner-button { min-height: 42px; padding: 0 11px; color: #10150a; background: var(--acid); border: 1px solid var(--acid); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.winner-button.secondary { color: var(--text); background: var(--surface-raised); border-color: var(--line-bright); }
.winner-button.secondary:hover { color: var(--cyan); border-color: var(--cyan); }
.queue { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; color: var(--muted); font-size: 9px; }
.queue strong { color: var(--text-soft); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.queue-person { padding: 5px 8px; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 3px; }
.round-form { display: grid; gap: 9px; }
.placement-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(110px, 0.7fr); gap: 9px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.placement-number { color: var(--orange); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 850; }
.placement-name { min-width: 0; overflow: hidden; color: var(--text); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.placement-select { min-height: 36px; padding: 6px 8px; color: var(--text); background: #0e1416; border: 1px solid var(--line); border-radius: 3px; font-size: 10px; }
.round-note { margin: 4px 0 3px; padding: 10px 11px; color: var(--text-soft); background: #15201b; border-left: 2px solid var(--acid-dark); font-size: 10px; line-height: 1.5; }
.team-scoreboard { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.team-card { padding: 14px; border: 1px solid var(--line); border-radius: 4px; background: #101719; }
.team-card h3 { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 11px; color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-transform: uppercase; }
.team-card h3 span { color: var(--muted); font-family: Inter, Arial, sans-serif; font-size: 8px; font-weight: 500; text-transform: none; }
.team-member { display: flex; justify-content: space-between; gap: 7px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--text); font-size: 11px; font-weight: 750; }
.team-member .player-record { min-width: auto; }
.team-card .winner-button { width: 100%; margin-top: 10px; }
.stats-list { display: grid; }
.pair-row { display: grid; grid-template-columns: minmax(74px, 1fr) auto minmax(74px, 1fr); gap: 7px; align-items: center; min-height: 49px; border-top: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.pair-name { overflow: hidden; color: var(--text-soft); font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.pair-name:last-child { text-align: right; }
.pair-score { min-width: 68px; display: flex; justify-content: center; gap: 6px; align-items: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.pair-score strong { color: var(--text-soft); font-size: 12px; }
.pair-score .winner-score { color: var(--acid); }
.panel-footnote { margin: 13px 0 0; padding-top: 11px; color: var(--muted); border-top: 1px solid var(--line); font-size: 9px; line-height: 1.5; }
.empty-state { padding: 25px 10px; color: var(--muted); text-align: center; font-size: 11px; }

.backfill-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 11px; border-top: 1px solid var(--line); }
.backfill-bar > span { color: var(--muted); font-size: 9px; }
.backfill-toggle { color: var(--acid); border-color: #405226; }
.backfill-form, .turn-form { margin-top: 10px; padding: 15px; background: #101719; border: 1px dashed var(--line-bright); border-radius: 4px; }
.backfill-heading { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 14px; }
.backfill-heading strong { color: var(--acid); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; letter-spacing: 0.1em; }
.backfill-heading span { color: var(--muted); font-size: 9px; text-align: right; }
.backfill-form .field { margin-bottom: 12px; }
.backfill-form .primary-button { width: 100%; }
.turn-tools { display: flex; justify-content: flex-end; margin-top: 8px; }
.turn-tools .quiet-button { color: var(--cyan); }
.turn-form .field { margin-bottom: 10px; }
.turn-form .dialog-actions { margin-top: 7px; }

.history-list { display: grid; }
.history-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 15px 0; border-top: 1px solid var(--line); }
.history-icon { width: 26px; height: 26px; display: grid; place-items: center; color: var(--text-soft); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 900; }
.history-item:first-child .history-icon { color: #10150a; background: var(--acid); border-color: var(--acid); }
.history-description { color: var(--text); font-size: 11px; font-weight: 750; line-height: 1.45; }
.history-meta { margin-top: 5px; color: var(--muted); font-size: 9px; }
.history-time { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; white-space: nowrap; }
.history-actions { display: flex; justify-content: flex-end; padding-top: 12px; }
.undo-button { min-height: 35px; padding: 0 11px; color: var(--orange); background: #211714; border: 1px solid #654033; font-size: 9px; text-transform: uppercase; }
.undo-button:hover { background: #34211b; }
.notice { margin: 0 0 13px; padding: 11px 13px; border-left: 2px solid var(--acid); color: var(--text-soft); background: #15201b; font-size: 10px; line-height: 1.5; }
.error-notice { border-left-color: var(--orange); background: #251815; }
.toast { position: fixed; z-index: 10; right: 20px; bottom: 20px; max-width: calc(100vw - 40px); padding: 12px 15px; color: var(--bg); background: var(--acid); border: 1px solid #f0ffb8; border-radius: 4px; box-shadow: var(--shadow); font-size: 10px; font-weight: 850; }
.rename-dialog { width: min(440px, calc(100vw - 30px)); max-width: none; padding: 0; border: 0; background: transparent; }
.rename-dialog::backdrop { background: rgba(0, 0, 0, 0.72); }
.rename-form { padding: clamp(22px, 5vw, 34px); }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.dialog-actions .primary-button { min-height: 42px; }
.hidden { display: none !important; }

.site-footer { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px clamp(20px, 5vw, 76px); color: var(--muted); border-top: 1px solid var(--line); background: #090d0f; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 750; letter-spacing: 0.07em; }

@media (max-width: 850px) {
  .home-hero { grid-template-columns: 1fr; gap: 17px; align-items: start; }
  .home-intro { max-width: 520px; }
  .entry-grid { grid-template-columns: 1fr; }
  .join-panel { display: grid; grid-template-columns: 1fr auto; column-gap: 20px; align-items: center; }
  .join-panel .panel-heading { margin: 0; }
  .join-panel form { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
  .join-panel .field { margin: 20px 0 0; }
  .join-panel .join-button { width: auto; min-width: 165px; margin: 0; }
  .join-caption { grid-column: 1 / -1; }
  .score-layout { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .summary-lead { grid-column: 1 / -1; min-height: 78px; }
}

@media (max-width: 570px) {
  .topbar { height: 66px; padding: 0 16px; }
  .brand-mark { width: 38px; height: 38px; }
  .topbar-note { gap: 6px; font-size: 7px; letter-spacing: 0.08em; }
  .home-hero { padding: 40px 0 30px; }
  .home-title { font-size: clamp(42px, 11vw, 62px); line-height: 1.02; letter-spacing: -0.06em; }
  .home-intro { font-size: 12px; }
  .entry-grid { gap: 11px; padding-bottom: 45px; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { min-height: 66px; }
  .two-fields { grid-template-columns: 1fr; gap: 0; }
  .join-panel { display: block; }
  .join-panel form { display: block; }
  .join-panel .field { margin: 20px 0 13px; }
  .join-panel .join-button { width: 100%; }
  .session-shell { padding-top: 14px; }
  .session-top { display: grid; gap: 14px; }
  .share-box { width: 100%; }
  .session-toolbar { align-items: start; flex-direction: column; }
  .summary-grid { gap: 6px; }
  .summary-stat { min-height: 76px; padding: 12px 10px; }
  .summary-stat strong { font-size: 23px; }
  .summary-stat small { font-size: 7px; letter-spacing: 0.07em; }
  .score-panel, .stats-panel, .history-panel { padding: 17px 13px; }
  .player-line { grid-template-columns: minmax(82px, 1fr) auto 30px 30px; gap: 5px; }
  .player-name { gap: 6px; font-size: 11px; }
  .player-record { min-width: 55px; font-size: 9px; }
  .score-control { width: 30px; height: 30px; }
  .control-caption { gap: 22px; font-size: 7px; }
  .team-scoreboard { grid-template-columns: 1fr; }
  .history-item { grid-template-columns: 26px minmax(0, 1fr); gap: 9px; }
  .history-time { grid-column: 2; margin-top: -6px; }
  .backfill-bar { align-items: flex-start; flex-direction: column; gap: 4px; }
  .backfill-bar .quiet-button { padding-left: 0; }
  .backfill-form .two-fields { gap: 0; }
  .site-footer { align-items: start; flex-direction: column; justify-content: center; gap: 5px; }
}
