:root {
  color-scheme: dark;
  --canvas: #11131b;
  --nav: #141721;
  --panel: #191d29;
  --panel-high: #202533;
  --input: #121621;
  --line: #2b3141;
  --line-light: #383f53;
  --text: #f3f1ef;
  --soft: #c9cbd4;
  --muted: #a4aabb;
  --gold: #f3d9a8;
  --gold-ink: #271a10;
  --blue: #a3beff;
  --red: #ffabb7;
  --round: 14px;
}

.host-app {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  min-height: 100vh;
  line-height: 1.45;
}

.host-app *, .host-app *::before, .host-app *::after { box-sizing: border-box; }
.host-app [hidden] { display: none !important; }
.host-app button, .host-app input, .host-app select { font: inherit; }
.host-app button { color: inherit; }
.host-app button:disabled, .host-app input:disabled, .host-app select:disabled { opacity: .44; cursor: default; }
.host-app a { color: var(--blue); }
.host-app :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.host-app h1, .host-app h2, .host-app h3, .host-app p { margin: 0; }
.host-app button, .file-button { cursor: pointer; }
.host-app input[type="checkbox"], .host-app input[type="radio"], .host-app input[type="range"] { accent-color: var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 20; top: .5rem; left: .5rem; padding: 8px; background: var(--panel); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 0 31px;
  border-bottom: 1px solid var(--line);
  background: #161924;
}
.host-brand { display: inline-flex; gap: 12px; align-items: center; flex: 0 0 auto; text-decoration: none; }
.brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: inset 0 0 0 1px #fff3;
}
.brand-mark i { width: 3.5px; height: 12px; border-radius: 3px; background: #2b2430; transform: skew(-12deg); }
.brand-mark i:nth-child(2) { height: 21px; }
.brand-mark i:nth-child(3) { height: 15px; }
.brand-text { display: flex; flex-direction: column; font-size: 12px; line-height: 1.1; color: var(--text); letter-spacing: .13em; }
.brand-text b { font-size: 14px; letter-spacing: .085em; }
.brand-text span { color: var(--gold); margin-top: 3px; }
.top-context { display: flex; gap: 25px; align-items: center; color: var(--muted); font-size: 13px; }
.top-divider { height: 24px; width: 1px; background: var(--line-light); }
.top-actions { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 9px;
  min-height: 26px;
  border-radius: 100px;
  background: #252a39;
  color: var(--soft);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.2;
  white-space: nowrap;
}
.badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge[data-tone="blue"] { background: #243457; color: #b8cdff; }
.badge[data-tone="gold"] { background: #443824; color: #f4d5a0; }
.badge[data-tone="red"] { background: #4a2a3a; color: #ffc0ca; }
.language-button { font-weight: 750 !important; font-size: 12px !important; aspect-ratio: 1; }

.workspace { display: grid; grid-template-columns: 196px minmax(0,1fr); min-height: calc(100vh - 72px); }
.nav-rail {
  background: var(--nav);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 27px 14px 19px;
  align-self: stretch;
  min-height: 100%;
}
.nav-main { display: grid; gap: 5px; }
.nav-title, .rail-meta { padding-left: 12px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 745; }
.nav-title { margin-bottom: 8px; }
.nav-action {
  min-height: 45px;
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  text-align: left;
  padding: 0 11px;
  color: var(--soft) !important;
  font-size: 13px !important;
  font-weight: 660 !important;
}
.nav-action:hover:not(:disabled) { background: var(--panel-high); }
.nav-action[aria-current="page"] { background: #252939; border-color: #363c51; color: var(--gold) !important; }
.nav-icon { width: 20px; text-align: center; font-size: 21px; font-weight: 500; line-height: 1; }
.rail-footer { border: 1px solid var(--line); display: flex; gap: 10px; padding: 10px 12px; align-items: center; border-radius: 10px; margin-top: 28px; }
.rail-status-icon { color: var(--blue); font-size: 10px; }
.rail-meta { display: block; padding: 0; letter-spacing: .07em; font-size: 9px; }
.rail-footer strong { font-size: 12px; }

#host-main { min-width: 0; max-width: 1680px; width: 100%; margin: 0 auto; padding: 36px clamp(18px, 3.2vw, 52px) 44px; outline: none; }
.section-header { display: flex; justify-content: space-between; align-items: end; gap: 14px 24px; padding-bottom: 24px; }
.section-header h1 { font-size: clamp(29px, 3.3vw, 51px); letter-spacing: -.055em; font-weight: 730; line-height: 1.06; overflow-wrap: anywhere; }
.section-header p { color: var(--muted); margin-top: 9px; font-size: 14px; max-width: 70ch; }
.section-actions, .tool-actions, .invite-actions, .logo-actions, .dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.desk-grid, .game-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(290px,1fr); gap: 16px; }
.game-grid { grid-template-columns: minmax(0,2fr) minmax(255px,.92fr); }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--round); background: var(--panel); padding: 22px; box-shadow: 0 8px 26px #0709142a; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.panel h2, .host-dialog h2 { font-size: 18px; font-weight: 720; line-height: 1.2; letter-spacing: -.018em; }
.panel-head p, .host-dialog .panel-head p { color: var(--muted); font-size: 12px; margin-top: 5px; max-width: 75ch; }
.section-glyph { display: grid; place-items: center; font-size: 20px; color: var(--gold); background: #2d2b31; width: 32px; height: 32px; border-radius: 8px; border: 1px solid #47404a; flex: 0 0 auto; }

.host-app label:not(.mode-option, .check-line, .file-button) { display: grid; gap: 6px; align-content: start; color: var(--soft); min-width: 0; font-size: 12px; font-weight: 650; }
.host-app input:not([type="checkbox"],[type="radio"],[type="range"],[type="file"]), .host-app select {
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--line-light);
  padding: 0 11px;
  border-radius: 8px;
  height: 40px;
  width: 100%;
  min-width: 0;
  font-size: 14px;
}
.host-app input::placeholder { color: var(--muted); opacity: .77; }
.host-app input[type="range"] { width: 100%; min-width: 0; }
.host-app input[readonly] { color: var(--muted); }
.button, .bare-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px !important;
  font-weight: 735 !important;
  text-align: center;
  line-height: 1.2;
  white-space: normal;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.button:active:not(:disabled), .bare-button:active:not(:disabled) { transform: translateY(1px); }
.bare-button { padding: 0 9px; background: transparent; color: var(--muted) !important; min-height: 32px; border-color: var(--line-light); text-wrap: nowrap; }
.bare-button:hover:not(:disabled) { color: var(--text) !important; background: var(--panel-high); }
.button-primary { background: var(--gold); color: var(--gold-ink) !important; border-color: #f9dfa9; }
.button-primary:hover:not(:disabled) { background: #fce8c3; }
.button-secondary { background: #252a3a; border-color: #3a4155; color: var(--text); }
.button-secondary:hover:not(:disabled) { background: #32394d; border-color: #4e5872; }
.button-blue { background: #25395e; border-color: #405d91; color: #dce7ff !important; }
.button-blue:hover:not(:disabled) { background: #334e7f; }
.button-danger { background: #3a2735; border-color: #624050; color: #ffbbc6 !important; }
.button-danger:hover:not(:disabled) { background: #513040; }

.mode-list { display: grid; border: 0; margin: 0; padding: 0; gap: 8px; }
.mode-option { display: flex; gap: 11px; align-items: center; padding: 9px 11px; position: relative; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; min-height: 58px; background: #1c202c; }
.mode-option:hover { border-color: var(--line-light); }
.mode-option:has(input:checked) { border-color: #90784f; background: #272630; }
.mode-option:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.mode-option:has(input:disabled) { opacity: .55; cursor: default; }
.mode-option input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
.mode-symbol { color: var(--blue); display: grid; place-items: center; font-size: 18px; width: 31px; height: 31px; background: #273148; border-radius: 7px; flex: 0 0 auto; }
.mode-option:has(input:checked) .mode-symbol { background: #433928; color: var(--gold); }
.mode-option-text { display: flex; flex-direction: column; flex: 1; line-height: 1.35; }
.mode-option-text strong { font-size: 13px; }
.mode-option-text small { font-size: 11px; color: var(--muted); }
.radio-mark { display: grid; place-items: center; width: 16px; aspect-ratio: 1; border-radius: 50%; border: 1px solid #777e92; margin-left: auto; flex: 0 0 auto; }
.mode-option:has(input:checked) .radio-mark { border-color: var(--gold); }
.mode-option:has(input:checked) .radio-mark::before { content: ""; width: 8px; aspect-ratio: 1; background: var(--gold); border-radius: 100%; }
.create-form, .inline-form, .switch-form, .sim-setup { display: flex; flex-wrap: wrap; align-items: end; gap: 9px; }
.create-form { margin-top: 16px; }
.create-form label, .inline-form label, .switch-form label { flex: 1 1 175px; }
.create-form button { min-height: 40px; }
.connection-panel { display: flex; flex-direction: column; }
.metric-list { margin: 0 0 12px; }
.metric-list > div { min-height: 38px; padding: 7px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.metric-list > div:last-child { border-bottom: 0; }
.metric-list dt { min-width: 0; font-size: 12px; color: var(--soft); }
.metric-list dd { margin: 0; min-width: 0; max-width: 100%; text-align: right; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.diagnostic-note { border: 1px solid #37476c; background: #232e49; color: #d9e3ff; border-radius: 9px; padding: 10px 12px; display: flex; align-items: flex-start; gap: 9px; font-size: 12px; }
.diagnostic-note p { color: #c4d2f3; font-size: 11px; margin-top: 3px; }
.diagnostic-note-icon { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid #a1b9f1; border-radius: 100%; font-size: 10px; font-weight: 800; flex: 0 0 auto; }
.panel-action { margin-top: 12px; align-self: flex-start; }
.session-panel { grid-column: 1 / -1; }
.saved-list { display: grid; }
.empty-message { padding: 14px 16px; border: 1px dashed var(--line-light); border-radius: 9px; color: var(--muted); font-size: 13px; }
.session-row { display: grid; grid-template-columns: minmax(170px,1.3fr) repeat(3,minmax(75px,.8fr)) auto; align-items: center; gap: 8px 14px; font-size: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.session-row span, .session-row time { min-width: 0; overflow-wrap: anywhere; }
.session-name { color: var(--text); font-weight: 700; font-size: 14px; }
.session-secondary { color: var(--muted); }
.saved-list-heading { margin: 12px 0 6px; font-size: 12px; color: var(--soft); }

.game-kicker { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; }
.code-chip { border: 1px solid #584b37; color: var(--gold); background: #302939; padding: 3px 8px; border-radius: 6px; font-size: 12px; letter-spacing: .1em; font-weight: 750; }
.round-panel .panel-head { margin-bottom: 12px; }
.round-hero {
  min-height: 128px;
  overflow: hidden;
  border: 1px solid #3b4661;
  background: radial-gradient(ellipse at 74% -20%, #344463 0%, transparent 58%), linear-gradient(110deg, #242b3f, #171b28 65%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 19px;
}
.round-panel.has-winner .round-hero { border-color: #91744f; background: radial-gradient(ellipse at 74% -25%, #53422f 0%, transparent 66%), linear-gradient(110deg, #312b33, #1d1b25 72%); }
.winner-mark { display: grid; place-items: center; width: clamp(40px,6vw,66px); aspect-ratio: 1; color: var(--blue); border: 1px solid #52668a; background: #293650; border-radius: 12px; font-size: clamp(25px,4vw,36px); flex: 0 0 auto; }
.has-winner .winner-mark { background: #493c2d; border-color: #94754e; color: var(--gold); }
.winner-content { display: flex; flex-direction: column; min-width: 0; }
.eyebrow { color: var(--muted); letter-spacing: .095em; text-transform: uppercase; font-weight: 730; font-size: 10px; }
.winner-content strong { font-size: clamp(20px,3.8vw,48px); line-height: 1.06; letter-spacing: -.045em; overflow-wrap: anywhere; }
.has-winner .winner-content strong { color: var(--gold); }
#winner-context { margin-top: 5px; color: var(--soft); font-size: 12px; }
.round-clock { margin-left: auto; color: var(--blue); font: 730 clamp(19px,3vw,36px) ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; align-self: flex-start; flex: 0 0 auto; }
.close-finish { margin-top: 10px !important; padding: 8px 9px; border: 1px solid #786449; color: #f4d7a4; background: #3b3129; border-radius: 7px; font-size: 12px; }
.round-config { display: grid; grid-template-columns: minmax(125px,1.5fr) repeat(3,minmax(65px,1fr)); gap: 9px; margin-top: 14px; }
.track-field { grid-column: 1 / -1; }
.round-actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 7px; margin-top: 13px; }
.round-actions .button { min-height: 48px; }
.judge-actions { display: flex; flex-wrap: wrap; margin-top: 7px; gap: 7px; }
.judge-actions > * { flex: 1 1 auto; }
.host-app kbd { color: currentColor; background: #05070f28; border-radius: 4px; padding: 2px 4px; font-family: ui-monospace, Menlo, monospace; font-size: 9px; white-space: nowrap; }

.invite-panel { display: flex; flex-direction: column; align-items: stretch; }
.invite-qr { position: relative; display: grid; place-items: center; border: 1px dashed var(--line-light); border-radius: 10px; min-height: 174px; padding: 9px; }
.invite-qr img { display: block; background: #fff; padding: 5px; max-width: 100%; height: auto; aspect-ratio: 1; border-radius: 7px; object-fit: contain; }
.invite-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 9px; }
.invite-code strong { color: var(--gold); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 780; letter-spacing: .12em; }
.join-address { margin-top: 6px !important; color: var(--muted); overflow-wrap: anywhere; font-size: 11px; }
.invite-actions { margin: 9px 0 3px; }
.invite-actions > * { flex: 1 1 auto; }
#lan-choice { margin-top: 9px; }
.test-panel > * + * { margin-top: 9px; }

.roster-head { align-items: center; }
.roster-head .section-actions { justify-content: flex-end; }
.table-wrap { overflow: auto; margin: 0 -7px; padding: 0 7px; }
.roster-table { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: auto; text-align: left; font-size: 12px; }
.roster-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .03em; padding: 7px 6px; background: var(--panel); position: sticky; top: 0; white-space: nowrap; }
.roster-table td { border-top: 1px solid var(--line); padding: 5px 6px; height: 32px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.roster-table td:nth-child(2), .roster-table td:nth-child(3) { overflow-wrap: anywhere; min-width: 60px; }
.roster-table .bare-button { min-height: 27px; padding: 0 6px; }
.roster-table .badge { min-height: 21px; padding: 3px 6px; font-size: 10px; }
.roster-table .badge i { width: 5px; height: 5px; }
.roster-table .player-first td { background: #3b312a; }
.roster-table .player-name { color: var(--text); font-weight: 665; }
.roster-table td:nth-child(1), .roster-table .latency, .roster-table .latency small { color: var(--muted); }
.roster-table .latency.is-slow { color: #ffc098; }
.roster-table .latency small { font-size: 9px; }
.roster-table .result-time { white-space: nowrap; }
.roster-table .no-players { padding: 20px 10px; color: var(--muted); text-align: center; }
.roster-panel.is-compact { grid-column: 1 / -1; }
.roster-panel.is-compact .roster-table { width: 100%; font-size: 11px; }
.roster-panel.is-compact .roster-table td { padding-block: 0; height: 21px; line-height: 1; }
.roster-panel.is-compact .badge { min-height: 17px; padding-block: 1px; }
.roster-panel.is-compact .roster-table .bare-button { min-height: 17px; }
.roster-panel.is-compact .table-wrap { max-height: 76vh; }
.tool-panel .tool-actions, .session-panel .tool-actions { margin-top: 12px; }
.tool-panel .tool-actions { display: grid; grid-template-columns: 1fr; align-items: stretch; }
.diagnostic-details { margin-top: 11px !important; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.diagnostic-details > * + * { margin-top: 4px; }
.diagnostic-details code { color: var(--gold); }

.settings-grid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; }
.check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--soft); cursor: pointer; }
.check-line input { flex: 0 0 auto; }
.check-grid .check-line { min-height: 33px; border: 1px solid var(--line); border-radius: 7px; padding: 0 7px; }
.logo-actions { margin-top: 13px; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.file-button:has(input:disabled) { opacity: .44; cursor: default; }
.file-button:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.audio-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; gap: 9px 12px; }
.audio-controls .check-line { grid-column: 1 / -1; }
.audio-controls .check-line + label { align-self: center; }
.sound-options { margin-top: 12px; }
.sound-row, .shortcut-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; }
.sound-row .sound-name, .shortcut-row > span { flex: 1 1 95px; color: var(--soft); }
.sound-row label:not(.file-button) { flex: 0 1 65px; }
.sound-row .button { min-height: 32px; padding: 0 8px; }
.shortcut-row button { min-width: 90px; }
.sim-setup label { flex: 0 0 93px; }
#sim-controls { margin-top: 13px; }
#sim-status { color: var(--muted); font-size: 12px; margin-top: 10px; }

.host-dialog { width: min(94vw,520px); max-height: 85vh; overflow: auto; padding: 21px; border: 1px solid var(--line-light); border-radius: var(--round); background: var(--panel); color: var(--text); box-shadow: 0 21px 65px #070712ac; }
.host-dialog::backdrop { background: #080a15b5; }
.host-dialog form > label + label { margin-top: 12px; }
.host-dialog .dialog-actions { justify-content: flex-end; margin-top: 15px; }
.host-dialog .editor-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; }
.host-dialog .editor-grid > :first-child { grid-column: 1 / -1; }
.host-dialog .editor-form-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.host-dialog .editor-list { padding: 0; margin: 0 0 13px; list-style: none; }
.host-dialog .editor-list li { border-top: 1px solid var(--line); padding: 7px 1px; font-size: 12px; }
.host-dialog .editor-list p { color: var(--muted); }
.host-alert, .toast { background: #493042; border: 1px solid #6c485e; color: #ffe4eb; border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.host-alert { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.toast { position: fixed; z-index: 10; right: 18px; bottom: 18px; max-width: min(90vw,415px); background: #273454; border-color: #506799; color: #eef4ff; box-shadow: 0 4px 18px #090a18a6; }
.form-error { color: var(--red); font-size: 12px; margin-top: 6px !important; min-height: 1.3em; }

@media (min-width: 1050px) and (max-width: 1290px) {
  .roster-panel { grid-column: 1 / -1; }
}
@media (max-width: 1049px) {
  .workspace { grid-template-columns: 151px minmax(0,1fr); }
  .nav-rail { padding-left: 9px; padding-right: 9px; }
  .game-grid { grid-template-columns: minmax(0,1.55fr) minmax(205px,.9fr); }
  .roster-panel { grid-column: 1 / -1; }
  .panel { padding: 16px; }
}
@media (max-width: 830px) {
  #host-main { padding-top: 25px; }
  .workspace { grid-template-columns: minmax(0,1fr); }
  .nav-rail { min-width: 0; flex-direction: row; align-items: center; padding: 7px 11px; border-right: 0; border-bottom: 1px solid var(--line); gap: 8px; }
  .nav-main { display: flex; gap: 4px; min-width: 0; overflow: auto; padding: 3px; }
  .nav-action { width: auto; min-height: 35px; gap: 5px; padding: 0 9px; white-space: nowrap; }
  .nav-title { display: none; }
  .nav-icon { font-size: 17px; width: 14px; }
  .rail-footer { margin: 0; padding: 3px 8px; flex-shrink: 0; }
  .topbar { height: 60px; padding: 0 16px; gap: 13px; }
  .top-context { gap: 12px; }
}
@media (max-width: 650px) {
  .desk-grid, .game-grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .section-header { align-items: flex-start; flex-wrap: wrap; padding-bottom: 17px; }
  .top-context, .rail-footer { display: none; }
  .top-actions { gap: 6px; }
  .game-header .section-actions button { min-height: 34px; }
  .session-row { grid-template-columns: minmax(85px,1fr) minmax(65px,.6fr) auto; gap: 3px 7px; }
  .session-row .session-stat, .session-row time { display: none; }
  .round-config { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .round-actions .button { flex-wrap: wrap; padding: 4px 6px; }
  .round-actions kbd { display: none; }
  .roster-head { align-items: flex-start; flex-direction: column; }
  .roster-head .section-actions { justify-content: flex-start; }
  .roster-table { min-width: 650px; }
  .round-hero { padding: 12px 10px; min-height: 100px; gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .host-app *, .host-app *::before, .host-app *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.round-config { grid-template-columns: minmax(115px,1.3fr) repeat(4,minmax(54px,1fr)); }
.locale-option { margin-top: 13px; max-width: 290px; }
.server-id-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.server-id-row code { overflow-wrap: anywhere; min-width: 0; }
#backup-probe .invite-qr { margin-top: 5px; }
#backup-probe .diagnostic-details { display: block; }
.sim-player { display: inline-block; margin-left: 5px; font-size: 9px; color: var(--gold); white-space: nowrap; }
.sound-row .sound-name small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.sound-row .sound-level { flex: 0 1 74px !important; }
.editor-form-actions .score-amount { max-width: 75px; }
.team-edit { margin-top: 10px; }
#editor-dialog details { margin-top: 5px; color: var(--muted); }
#editor-dialog details summary { cursor: pointer; }
.roster-compact .invite-panel, .roster-compact .game-transfer-panel, .roster-compact .demo-panel, .roster-compact .tool-panel { display: none; }
#host-main:has(.roster-compact:not([hidden])) { padding-top: 18px; }
.roster-compact .game-header { padding-bottom: 12px; }
.roster-compact .game-header h1 { font-size: clamp(24px, 3vw, 37px); }
.roster-compact .game-grid { grid-template-columns: 1fr; gap: 10px; }
.roster-compact .round-panel { padding-top: 10px; padding-bottom: 10px; display: grid; grid-template-columns: 1.15fr minmax(250px,.85fr); grid-template-areas: "head actions" "hero judge"; gap: 7px 12px; }
.roster-compact .round-panel .panel-head { grid-area: head; margin: 0; }
.roster-compact .round-hero { grid-area: hero; min-height: 53px; padding: 8px; }
.roster-compact .winner-mark { width: 34px; font-size: 18px; }
.roster-compact .winner-content strong { font-size: clamp(14px,2.7vw,34px); }
.roster-compact .round-config { display: none; }
.roster-compact .round-actions { grid-area: actions; margin: 0; }
.roster-compact .round-actions .button { min-height: 31px; padding: 2px 6px; }
.roster-compact .judge-actions { grid-area: judge; margin: 0; }
.roster-compact .judge-actions .button { min-height: 31px; padding: 2px 6px; }
.roster-compact .close-finish { grid-column: 1 / -1; margin: 0 !important; }
.roster-compact .roster-panel { padding-top: 11px; }
.roster-compact .roster-head { margin-bottom: 4px; }
@media (max-width: 930px) {
  .round-config { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .round-config > :first-child { grid-column: 1 / -1; }
  .roster-compact .round-panel { grid-template-areas: "head" "hero" "actions" "judge"; grid-template-columns: 1fr; }
}
.form-error:empty { display: none; }
@media (max-width: 500px) {
  .topbar { height: auto; min-height: 60px; flex-wrap: wrap; gap: 7px 10px; padding-block: 9px; }
  .top-actions { flex: 1 1 auto; justify-content: flex-end; }
  #host-connection { margin-right: auto; }
}
