/* Venue lighting for control surfaces; never paint an OBS page background. */
:root {
  --venue-deck: #0b1625;
  --venue-panel: #132338;
  --venue-rule: #344961;
  --venue-gold: #e5c58a;
  --venue-ink: #f0f4f8;
}
.venue-editor, .venue-login {
  --ui-surface: var(--venue-panel);
  --ui-border-strong: var(--venue-rule);
  --ui-focus: var(--venue-gold);
  color-scheme: dark;
}
.venue-editor #app .editor-header {
  background: linear-gradient(100deg,#192c42,var(--venue-deck) 60%) !important;
  border-bottom-color: #52637a !important;
}
.venue-editor #app .editor-section {
  border-color: var(--venue-rule);
  box-shadow: inset 0 1px #ffffff0a;
}
.venue-editor #app .editor-section h2,
.venue-editor .cf-head h2 { letter-spacing: .035em; }
.venue-editor [id$="-modal"], .venue-editor #cf-dialog {
  --modal-surface: #132237;
  --modal-surface-raised: #1a2b41;
  --modal-surface-inset: #0b1727;
  --modal-border: var(--venue-rule);
  --modal-text: var(--venue-ink);
}
.venue-editor [id$="-modal"] > :is(div,section):first-child,
.venue-editor #cf-dialog {
  border-top-color: var(--venue-gold) !important;
}
.venue-editor #cf-dialog, .venue-editor .cf-tabs { background: var(--modal-surface); }
.venue-editor #cf-dialog .cf-tabs button[aria-selected=true] {
  background: #302c26; border-color: #89724e; color: #ffe1a5;
}
.venue-editor .cf-status, .venue-editor #app, .progress-title,
.match-score, .matchup-score, .set-number, .public-view .funding-rail,
.public-view .supporter, #combined-container { font-variant-numeric: tabular-nums; }
.venue-login {
  min-height: 100svh;
  background: linear-gradient(130deg,#172c43 0%,#091321 52%,#0b1728);
}
.venue-login .login-container {
  border-top: 2px solid var(--venue-gold);
  padding: clamp(24px,5vw,38px);
  text-align: left;
}
.venue-login .login-container h2 { color: var(--venue-ink); margin-bottom: 8px; }
.venue-login .btn-login { background: var(--venue-gold); color: #19202b; }
.venue-login .btn-login:hover { background: #f3d9aa; }
.public-view .public-section > h2,
.public-view .tournament-header h2 {
  padding-inline-start: 12px; border-inline-start: 3px solid var(--gold);
}
.public-view #public-jumps a:hover { text-decoration: underline; text-underline-offset: 5px; }
.public-view :is(.public-section,#funding) { scroll-margin-top: 82px; }
.match-score, .matchup-score { text-shadow: 0 2px 4px #04101caa; }
#thanks-main-title { text-wrap: balance; }
@media (max-width: 640px) {
  .venue-editor .cf-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .venue-editor #cf-dialog .cf-tabs button { flex: none; min-height: 44px; }
  .public-view #public-jumps { scrollbar-width: thin; }
}

/* One visual grammar across the desk, with a section key for orientation. */
.venue-editor {
  --desk-key: #a8d4e8;
  --desk-paper: #152438;
  --desk-field: #0b1726;
  --desk-line: #435970;
  --desk-muted: #b5c4d3;
}
.venue-editor :is(#cf-dialog,#custom-event-modal,#sponsor-modal,#sponsor-batch-move-modal,
  #egg-modal,#settlement-modal,#settlement-result-modal) { --desk-key: #efd196; }
.venue-editor :is(#player-lineup-delete-modal,#player-lineup-unsaved-modal,#settlement-unsaved-modal) {
  --desk-key: #ffbb9c;
}
.venue-editor :is([id$="-modal"],#cf-dialog) {
  --modal-border: var(--desk-line);
  --modal-surface: var(--desk-paper);
  --modal-surface-inset: var(--desk-field);
  --modal-muted: var(--desk-muted);
  --modal-panel-radius: 9px;
  scrollbar-color: #61758a #101c2c;
}
.venue-editor :is(#settings-modal,[id$="-modal"]) > :is(div,section):first-child,
.venue-editor #cf-dialog {
  border-top: 3px solid var(--desk-key) !important;
  box-shadow: 0 12px 38px #03091170 !important;
}
.venue-editor [id$="-modal"] :is(h2,h3):first-of-type, .venue-editor #cf-title {
  text-wrap: balance;
  line-height: 1.35;
}
.venue-editor [id$="-modal"] :is(.editor-modal-header,.statistics-modal-title,.player-lineup-heading h2),
.venue-editor [id$="-modal"] > div > h3:first-child,
.venue-editor [id$="-modal"] > div > div:first-child > h3:first-child,
.venue-editor #cf-title {
  font-size: 18px !important; font-weight: 700;
  color: var(--desk-key) !important;
}
.venue-editor :is([id$="-modal"],#cf-dialog) :is(input:not([type]),input[type=text],input[type=password],
  input[type=number],input[type=date],textarea,select:not([aria-hidden=true])) {
  background-color: var(--desk-field) !important;
  border-color: var(--desk-line) !important;
  color: #eff5fa;
  accent-color: var(--desk-key);
}
.venue-editor :is([id$="-modal"],#cf-dialog) ::placeholder { color: #9bafc3; opacity: 1; }
.venue-editor :is([id$="-modal"],#cf-dialog) :is(button,input,textarea,select,a):focus-visible {
  outline: 2px solid var(--desk-key) !important; outline-offset: 2px;
}
.venue-editor #settings-modal .settings-modal-nav,
.venue-editor #cf-dialog .cf-list { background: #0c1928; border-color: var(--desk-line); }
.venue-editor #settings-modal [role=tab][aria-selected=true],
.venue-editor #cf-dialog .cf-tabs [aria-selected=true] {
  background: #253546 !important; color: var(--desk-key) !important;
  box-shadow: inset 0 -2px var(--desk-key);
}
.venue-editor :is(#users-modal,#rooms-modal,#host-guest-modal) h4,
.venue-editor #comment-settings-modal .comment-settings-grid h3,
.venue-editor #settlement-modal h4 {
  color: var(--desk-key) !important; font-size: 14px !important; letter-spacing: .03em;
}
.venue-editor :is(#users-list,#rooms-list) > div:nth-child(even),
.venue-editor #statistics-modal tbody tr:nth-child(even) { background-color: #a4c9e509; }
.venue-editor #statistics-modal th, .venue-editor #settlement-result-modal th {
  color: #c5d8e6 !important; background-color: #0d1b2b; font-weight: 600;
}
.venue-editor :is(#statistics-modal,#settlement-result-modal,#settlement-modal) {
  font-variant-numeric: tabular-nums;
}
.venue-editor #statistics-modal tbody td[colspan] { color: #aebfd0 !important; }
.venue-editor #player-lineup-modal .player-lineup-toolbar,
.venue-editor #cf-dialog .cf-actions { background-color: #112032; }
.venue-editor #cf-dialog .cf-head { background: var(--desk-paper); border-bottom-color: var(--desk-line); }
.venue-editor #cf-dialog .cf-muted, .venue-editor #cf-dialog .cf-head small { color: var(--desk-muted); }
.venue-editor #app .editor-header { box-shadow: inset 0 -1px #59708b; }
.venue-editor #app .editor-section > h2 { color: #d7e5ef; }
@media (max-width: 600px) {
  .venue-editor :is(#users-modal,#rooms-modal,#host-guest-modal) input { min-width: 0; }
  .venue-editor #comment-settings-modal .comment-settings-grid { grid-template-columns: minmax(0,1fr) !important; }
  .venue-editor #cf-dialog .cf-actions { padding: 10px 12px; }
}

/* Credits: keep the fitted canvas, reserve the brightest ink for names. */
.venue-credits {
  --bg-color: #0a1422; --card-bg: #17283b; --primary: #bad9e7;
  --accent: #efd198; --success: #a4ddce; --text-sub: #b0c0cd;
  background-image: linear-gradient(155deg,#192d42 0,transparent 48%);
}
.venue-credits .header { border-top: 4px solid #ae9160; }
.venue-credits #thanks-main-title { letter-spacing: .085em; line-height: 1.2; }
.venue-credits .title-deco { background: #ac956b !important; max-width: 130px; }
.venue-credits .item-card { border-radius: 5px; border-color: #354759; }
.venue-credits .item-card::before { width: 2px; }
.venue-credits .type-sponsor .sponsor-amount { color: var(--accent); font-variant-numeric: tabular-nums; }
.venue-credits .card-badge { border-color: #476074; background: #101d2d; }
.venue-credits .footer { opacity: 1; }
.venue-overlay .section-title, .venue-overlay .progress-title { font-weight: 700; letter-spacing: .035em; }
.venue-overlay .segments-container { font-variant-numeric: tabular-nums; }

/* Same scoreboard hierarchy, two reading distances. No new paint loop. */
body.public-view, body.obs { --muted: #b4c4d1; --gold: #edce93; --blue: #add2e0; }
.public-view .view-controls { border-bottom-color: #3a4c60; }
.public-view .broadcast-header { border-bottom: 1px solid #425468; margin-bottom: 20px; }
.public-view .event-card { border-top: 1px solid #415367; padding-block: 15px; }
.public-view .event-card h3 { font-weight: 600; margin-bottom: 8px; }
.public-view .event-value { font-size: clamp(16px,1.35vw,20px); }
.public-view .supporter-grid .supporter:nth-child(even),
.obs .supporter-grid .supporter:nth-child(even) { background: #93b7d30c; }
.public-view .supporter-grid .number, .obs .supporter-grid .number { color: #a5bacb; }
.public-view .supporter-grid strong, .obs .supporter-grid strong { font-variant-numeric: tabular-nums; }
.obs .broadcast-header { box-shadow: inset 0 -1px #a3bed343; }
.obs .event-page-number { color: #d3dee7; font-variant-numeric: tabular-nums; }
.obs .supporters-stage .panel-head { box-shadow: inset 0 -1px #94aec338; }
.obs .supporter-grid .name { font-weight: 600; }
.obs.transparent .broadcast-heading, .obs.transparent .supporter { text-shadow: 0 1px 3px #06101c; }
.matchup-panel .section-heading { border-bottom-color: #496176; }
.victory-panel .event-line, .matchup-panel .match-series { font-variant-numeric: tabular-nums; }
@media (max-width: 700px) and (orientation: portrait) {
  .venue-credits:not(.credits-obs) {
    position: relative; width: 100%; height: auto; min-height: 100svh;
    overflow: visible; transform: none !important;
  }
  .venue-credits:not(.credits-obs) .container {
    height: auto !important; transform: none !important; padding: 12px 16px;
  }
  .venue-credits:not(.credits-obs) .column { padding: 0 !important; }
  .venue-credits:not(.credits-obs) .combined-flow { display: grid; gap: 8px; }
  .venue-credits:not(.credits-obs) .item-card { min-width: 0; padding: 11px 13px; }
  .venue-credits:not(.credits-obs) .title-text { font-size: 17px; }
  .venue-credits:not(.credits-obs) .type-egg .card-content { flex-wrap: wrap; gap: 5px; }
  .venue-credits:not(.credits-obs) .egg-detail { flex-wrap: wrap; white-space: normal; overflow-wrap: anywhere; font-size: 16px; }
  .venue-credits:not(.credits-obs) .card-title { font-size: 18px; }
  .venue-credits:not(.credits-obs) .sponsor-amount { font-size: 21px; }
}

.venue-editor .desk-tools {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 3px 6px; border-inline-start: 1px solid #45586b;
}
.venue-editor .desk-tools-label { color: #b4c5d4; font-size: 12px; margin-inline-end: 3px; }
.venue-editor :is([id$="-modal"],#cf-dialog) .editor-modal-close {
  border: 1px solid #51677c !important; border-radius: 6px !important;
  background: #152739 !important; color: #dae7ef !important;
}
.venue-editor :is([id$="-modal"],#cf-dialog) .editor-modal-close:hover {
  background: #2c4054 !important; color: white !important;
}
.venue-editor #cf-dialog .cf-project[aria-pressed=true] {
  color: #ffdfa5; background: #302e2b; border-color: #947e58;
}
.venue-editor :is(#statistics-modal,#settings-modal,#comment-settings-modal) h4 {
  text-wrap: balance; line-height: 1.45;
}
.venue-login .login-container, .venue-editor #cf-dialog .cf-preview { border-radius: 8px; }
.venue-credits .header h1 { font-size: clamp(32px, 3vw, 48px); }
.venue-credits .column-title { font-weight: 600; letter-spacing: .04em; }
.venue-credits .type-egg .card-title { color: #e5f2ef; }
.venue-credits .footer { border-top: 1px solid #31465c; }
.public-view .supporters-stage .panel-head, .obs .supporters-stage .panel-head {
  align-items: baseline; justify-content: space-between; gap: 12px;
}
.public-view .supporter-meta, .obs .supporter-meta { font-variant-numeric: tabular-nums; }
.obs #supporter-page { color: var(--gold); }
.public-view .event-grid { gap: 0 30px; }
.public-view .event-card { display: grid; grid-template-columns: minmax(5em,.4fr) minmax(0,1fr); gap: 12px; }
.public-view .event-card h3 { margin: 0; }
.public-view .event-value { min-width: 0; }
.matchup-panel .match-score, .victory-panel .matchup-score { font-feature-settings: "tnum"; }

:root {
  --venue-error-ink: #fecdd3;
  --venue-error-panel: #341e2a;
  --venue-error-border: #985160;
  --venue-warning-ink: #ffe2a4;
  --venue-warning-panel: #302719;
  --venue-warning-border: #8b7044;
}
.venue-login .error-msg, .venue-editor #cf-dialog .cf-status.cf-error {
  color: var(--venue-error-ink) !important;
  background: var(--venue-error-panel);
  border-color: var(--venue-error-border);
  overflow-wrap: anywhere;
}
.public-view #connection:not(:empty) {
  color: var(--venue-warning-ink);
  background: var(--venue-warning-panel);
  border: 1px solid var(--venue-warning-border);
  border-inline-start-width: 3px;
  border-radius: 8px;
  max-width: min(70ch, calc(100% - 32px));
  margin: 12px auto 18px;
  padding: 10px 14px;
  text-align: start;
  overflow-wrap: anywhere;
}
.venue-login .password-toggle:focus-visible,
.venue-editor :is([id$="-modal"],#cf-dialog) .editor-modal-close:focus-visible,
.public-view .view-controls :is(a, input):focus-visible {
  outline: 2px solid var(--venue-gold);
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .venue-editor #app .editor-toolbar-actions { display: grid !important; grid-template-columns: minmax(0,1fr); }
  .venue-editor .desk-tools { border: 0; padding: 0; }
  .venue-editor .desk-tools-label { min-width: 2.5em; }
  .venue-editor :is([id$="-modal"],#cf-dialog) .editor-modal-close {
    min-width: 40px !important; min-height: 40px !important;
  }
  .public-view .view-controls { row-gap: 0; }
  .public-view :is(.public-section,#funding) { scroll-margin-top: 118px; }
}
