:root {
  --outlaw-red: #e91a2f;
  --outlaw-red-dark: #9f121d;
  --outlaw-blue: #2d7dd2;
  --outlaw-blue-dark: #12395f;
  --outlaw-black: #07080a;
  --outlaw-charcoal: #15191e;
  --outlaw-carbon: #10151d;
  --outlaw-cream: #f1dfc6;
  --outlaw-bone: #f7eddc;
  --outlaw-gold: #f2a51a;
  --outlaw-shadow: #2a1a14;
  --bg: var(--outlaw-charcoal);
  --ink: #101820;
  --muted: #657282;
  --line: #d8cab8;
  --panel: #fbf6ed;
  --red: var(--outlaw-red);
  --blue: #2367b7;
  --green: #168f61;
  --gold: var(--outlaw-gold);
  --dark: var(--outlaw-black);
  --bone: var(--outlaw-bone);
  --track: #2c333a;
}

* {
  box-sizing: border-box;
}

.chat-panel,
.race-chat-panel {
  display: none !important;
}

html {
  overflow-x: hidden;
  overflow-anchor: none;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(233, 26, 47, 0.32), transparent 28%),
    radial-gradient(circle at 88% 4%, rgba(45, 125, 210, 0.28), transparent 30%),
    linear-gradient(180deg, #20242c 0%, #11161d 44%, #07090d 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  overflow-anchor: none;
  overflow-x: hidden;
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  gap: 14px;
  min-height: 100vh;
  overflow-anchor: none;
  padding: 24px;
}

.topbar {
  align-items: center;
  background:
    radial-gradient(circle at 50% -15%, rgba(233, 26, 47, 0.25), transparent 38%),
    linear-gradient(90deg, rgba(7, 8, 10, 0.98), rgba(12, 13, 15, 0.94)),
    var(--outlaw-black);
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    inset 0 -4px 0 rgba(233, 26, 47, 0.2);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 560px) minmax(320px, 1fr);
  gap: 16px;
  margin: 0 auto;
  max-width: 1440px;
  min-height: 150px;
  padding: 18px 20px;
  width: 100%;
}

.brand-lockup {
  align-items: center;
  display: grid;
  gap: 2px;
  grid-column: 2;
  justify-items: center;
  min-width: 0;
  position: relative;
}

.brand-lockup::before,
.brand-lockup::after {
  display: none;
}

.brand-lockup::before {
  right: calc(100% - 24px);
  transform: translateY(28px);
}

.brand-lockup::after {
  left: calc(100% - 24px);
  transform: translateY(28px);
}

.brand-logo {
  display: block;
  filter: drop-shadow(7px 9px 0 rgba(0, 0, 0, 0.62));
  height: auto;
  max-height: 132px;
  max-width: min(560px, 100%);
  object-fit: contain;
  object-position: center;
  width: 100%;
  z-index: 1;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.top-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  grid-column: 3;
  justify-content: flex-end;
}

.broadcast-league-badge {
  align-items: center;
  color: var(--bone);
  display: none;
  gap: 12px;
  grid-column: 1;
  min-width: 0;
}

.broadcast-league-logo {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(244, 234, 216, 0.12), rgba(244, 234, 216, 0.02)),
    rgba(7, 8, 10, 0.72);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  color: var(--gold);
  display: flex;
  flex: 0 0 96px;
  font-size: 28px;
  font-style: italic;
  font-weight: 900;
  height: 72px;
  justify-content: center;
  overflow: hidden;
  text-shadow: 3px 3px 0 #000;
}

.broadcast-league-logo.has-image {
  background-color: rgba(244, 234, 216, 0.92);
}

.broadcast-league-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.broadcast-league-copy span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.broadcast-league-copy strong {
  color: #fff;
  font-size: 20px;
  line-height: 1.05;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.52);
}

.backend-control {
  align-items: center;
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  color: var(--bone);
  display: flex;
  gap: 8px;
  min-height: 52px;
  padding: 8px;
}

.backend-control span {
  color: #e9dcc8;
  font-size: 12px;
  font-weight: 700;
  min-width: 86px;
}

.role-field {
  min-width: 170px;
}

.prototype-tools {
  background: rgba(242, 165, 26, 0.1);
  border: 1px solid rgba(242, 165, 26, 0.22);
  border-radius: 8px;
  color: var(--bone);
  min-width: 190px;
  padding: 8px;
}

.prototype-tools summary {
  color: var(--gold);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style-position: inside;
  text-transform: uppercase;
}

.prototype-tools-grid {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.prototype-tools:not([open]) {
  align-self: center;
}

.login-control {
  align-items: end;
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  color: var(--bone);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(155px, 1fr) minmax(120px, 0.8fr) auto auto;
  padding: 8px;
  width: min(100%, 620px);
}

.login-control span {
  align-self: center;
  color: #e9dcc8;
  font-size: 12px;
  font-weight: 700;
  grid-column: 1 / -1;
}

.login-control.is-authenticated {
  grid-template-columns: minmax(200px, 1fr) auto;
}

.login-control.is-authenticated .field-group,
.login-control.is-authenticated #loginBtn,
.login-control.is-authenticated #passwordResetBtn {
  display: none;
}

body.has-auth-user .prototype-login-field,
body.has-auth-user .top-actions > .role-racer.field-group,
body.has-auth-user .prototype-tools {
  display: none !important;
}

body.has-auth-user .login-control {
  grid-template-columns: minmax(220px, 1fr) auto;
  min-width: min(100%, 330px);
}

body.has-auth-user .login-control span {
  background: rgba(7, 8, 10, 0.46);
  border: 1px solid rgba(244, 234, 216, 0.12);
  border-radius: 8px;
  color: var(--outlaw-bone);
  font-size: 13px;
  grid-column: auto;
  padding: 10px 12px;
}

.auth-gate {
  display: none;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  margin: 0 auto;
  max-width: 1180px;
  width: 100%;
}

.auth-gate-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 45%),
    rgba(7, 8, 10, 0.9);
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  color: var(--bone);
  display: grid;
  gap: 7px;
  padding: 18px;
}

.auth-gate-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-gate-card strong {
  color: #fff;
  font-size: 22px;
  line-height: 1.05;
}

.auth-gate-card p {
  color: #d8cab8;
  font-size: 14px;
  line-height: 1.35;
}

.auth-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.auth-gate-actions button {
  flex: 1 1 160px;
}

.auth-account-card {
  align-content: start;
}

.auth-panel-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.auth-panel-form .field-group label {
  color: #b8c4d3;
}

.auth-panel-form input {
  background: #f7fafc;
  color: var(--ink);
}

.auth-panel-status {
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.12);
  border-radius: 8px;
  padding: 10px;
}

.auth-panel-help {
  background: rgba(47, 125, 211, 0.12);
  border: 1px solid rgba(47, 125, 211, 0.24);
  border-radius: 8px;
  color: #dbeafe;
  font-weight: 800;
  padding: 10px;
}

body.local-test-mode:not(.view-stream) .auth-gate {
  display: grid;
}

body:not(.has-auth-user):not(.view-stream) .auth-gate {
  display: grid;
}

body:not(.has-auth-user):not(.view-stream) .auth-public-card {
  display: none;
}

body:not(.has-auth-user):not(.view-stream) .app-shell > section:not(.auth-gate),
body:not(.has-auth-user):not(.view-stream) .app-shell > footer,
body:not(.has-auth-user):not(.view-stream) .login-control,
body:not(.has-auth-user):not(.view-stream) .prototype-tools,
body:not(.has-auth-user):not(.view-stream) .backend-control {
  display: none !important;
}

body.local-test-mode:not(.view-stream) .control-band,
body.local-test-mode:not(.view-stream) .notice-band,
body.local-test-mode:not(.view-stream) .user-dashboard,
body.local-test-mode:not(.view-stream) .platform-league-panel,
body.local-test-mode:not(.view-stream) .role-summary,
body.local-test-mode:not(.view-stream) .director-tabs,
body.local-test-mode:not(.view-stream) .admin-command-grid,
body.local-test-mode:not(.view-stream) .event-panel,
body.local-test-mode:not(.view-stream) .queue-panel,
body.local-test-mode:not(.view-stream) .readiness-panel,
body.local-test-mode:not(.view-stream) .race-grid,
body.local-test-mode:not(.view-stream) .race-chat-panel,
body.local-test-mode:not(.view-stream) .lower-grid,
body.local-test-mode:not(.view-stream) .event-recap-panel,
body.local-test-mode:not(.view-stream) .log-panel,
body.local-test-mode:not(.view-stream) .records-subtabs,
body.local-test-mode:not(.view-stream) .site-footer,
body.local-test-mode:not(.view-stream) .login-control,
body.local-test-mode:not(.view-stream) .prototype-tools,
body.local-test-mode:not(.view-stream) .backend-control {
  display: none !important;
}

.eyebrow {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--red);
  font-size: clamp(28px, 3vw, 38px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.95;
  text-shadow: 4px 4px 0 #000, 7px 7px 0 rgba(244, 234, 216, 0.18);
  text-transform: uppercase;
}

.site-footer {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(7, 8, 10, 0.98), rgba(21, 25, 30, 0.94)),
    var(--dark);
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  color: var(--bone);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1440px;
  padding: 16px 18px;
  width: 100%;
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  color: #fff;
  font-size: 15px;
  font-style: italic;
  text-transform: uppercase;
}

.site-footer span {
  color: #d8cab8;
  font-size: 13px;
  margin-top: 3px;
}

.site-footer .footer-copyright {
  color: var(--bone);
  font-size: 13px;
  font-weight: 800;
  margin-top: 0;
  text-align: right;
  white-space: nowrap;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.race-status {
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  box-shadow: inset 4px 0 0 var(--red);
  color: var(--bone);
  display: grid;
  gap: 3px;
  min-width: 150px;
  padding: 8px 12px;
}

.race-status span {
  color: #8d9aa8;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.race-status strong {
  color: #fff;
  font-size: 15px;
  line-height: 1.1;
}

.control-band,
.race-grid,
.race-chat-panel,
.readiness-panel,
.lower-grid,
.notice-band,
.role-summary,
.director-tabs,
.records-subtabs,
.admin-command-grid,
.director-flow-panel,
.event-panel,
.queue-panel,
.readiness-panel,
.event-recap-panel {
  margin: 0 auto;
  max-width: 1440px;
  width: 100%;
}

.director-tabs {
  background: rgba(8, 9, 11, 0.92);
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  overflow-x: auto;
  padding: 5px;
  position: sticky;
  top: 10px;
  z-index: 20;
}

.teams-subtabs {
  background: #0b0d10;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  padding: 8px;
}

.records-subtabs {
  align-self: start;
  background: #0b0d10;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  display: flex;
  gap: 6px;
  grid-column: 1 / -1;
  min-height: 48px;
  overflow-x: auto;
  padding: 6px;
}

.director-tab,
.teams-subtab,
.records-subtab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--bone);
  cursor: pointer;
  font-weight: 800;
  min-height: 34px;
  padding: 7px 12px;
  white-space: nowrap;
}

.director-tab {
  flex: 1 0 auto;
  min-width: 150px;
}

.director-tab:hover,
.director-tab.is-active,
.teams-subtab:hover,
.teams-subtab.is-active,
.records-subtab:hover,
.records-subtab.is-active {
  background: linear-gradient(180deg, var(--outlaw-red), var(--outlaw-red-dark));
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.records-subtab {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: center;
  min-width: 130px;
}

.records-league-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.records-league-controls .compact-field {
  min-width: min(320px, 100%);
}

.roster-heading-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.roster-heading-controls .records-league-controls {
  margin: 0;
}

.tab-records-panel:not(.records-subtabs) {
  grid-column: 1 / -1;
}

.admin-command-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(300px, 0.52fr) minmax(620px, 1.48fr);
  margin-bottom: 0;
}

.director-flow-panel {
  background:
    linear-gradient(135deg, rgba(231, 21, 43, 0.12), transparent 36%),
    linear-gradient(90deg, rgba(7, 8, 10, 0.9), rgba(18, 57, 95, 0.22)),
    rgba(12, 16, 22, 0.96);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-left: 5px solid var(--outlaw-red);
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  color: var(--outlaw-bone);
  display: grid;
  gap: 12px;
  padding: 14px;
}

.director-flow-header {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.director-flow-header h2 {
  color: #fff;
  margin: 2px 0 0;
}

.director-flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.director-flow-actions .is-active {
  background: linear-gradient(180deg, var(--outlaw-gold), #c87d10);
  border-color: rgba(242, 165, 26, 0.7);
  color: #0b0d10;
}

.director-flow-steps {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.director-step {
  background: rgba(7, 8, 10, 0.58);
  border: 1px solid rgba(244, 234, 216, 0.13);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 108px;
  padding: 10px;
}

.director-step > span {
  align-items: center;
  background: #0b0d10;
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  color: var(--outlaw-gold);
  display: flex;
  font-size: 18px;
  font-weight: 900;
  grid-row: span 3;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.director-step strong,
.director-step small {
  display: block;
  min-width: 0;
}

.director-step strong {
  color: #fff;
  font-size: 17px;
}

.director-step small {
  color: #aab8c7;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.director-step button {
  grid-column: 2;
  justify-self: start;
}

.director-step.is-ready {
  border-color: rgba(242, 165, 26, 0.54);
  box-shadow: inset 4px 0 0 var(--outlaw-gold);
}

.director-step.is-active {
  border-color: rgba(231, 21, 43, 0.66);
  box-shadow: inset 4px 0 0 var(--outlaw-red);
}

.director-step.is-done {
  border-color: rgba(22, 143, 97, 0.58);
  box-shadow: inset 4px 0 0 #168f61;
}

.director-step.is-blocked {
  opacity: 0.72;
}

.director-live-banner {
  background: rgba(7, 8, 10, 0.62);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  color: #dfe7f1;
  font-weight: 900;
  line-height: 1.35;
  padding: 10px 12px;
}

.director-live-banner.is-dry-run {
  border-color: rgba(242, 165, 26, 0.58);
  box-shadow: inset 5px 0 0 var(--outlaw-gold);
  color: #fff3d6;
}

.race-director-dry-run .pending-result.ready {
  box-shadow: inset 5px 0 0 var(--outlaw-gold);
}

.control-band {
  align-items: start;
  background:
    linear-gradient(135deg, rgba(233, 26, 47, 0.1), transparent 38%),
    linear-gradient(90deg, rgba(7, 8, 10, 0.82), rgba(18, 57, 95, 0.28)),
    rgba(12, 16, 22, 0.94);
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(150px, 0.75fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) minmax(220px, 1.1fr) minmax(220px, 1.1fr) minmax(210px, 0.85fr);
  margin-bottom: 0;
  padding: 12px;
}

.control-actions {
  align-self: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  min-width: 0;
}

.control-actions button {
  width: 100%;
}

.control-action-card {
  background: rgba(7, 8, 10, 0.52);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 7px;
}

.control-action-card span {
  color: #aab8c7;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.control-action-card .primary-btn {
  min-height: 46px;
}

.reset-control-action {
  min-height: 40px;
}

.notice-band {
  align-items: center;
  background: rgba(251, 246, 237, 0.78);
  border: 1px solid rgba(216, 202, 184, 0.8);
  border-radius: 8px;
  color: #4d5966;
  display: flex;
  gap: 10px;
  margin-bottom: 0;
  padding: 7px 10px;
}

.notice-band strong {
  background: #0b0d10;
  border-radius: 999px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 6px 8px;
  text-transform: uppercase;
}

.notice-band span {
  font-size: 13px;
  font-weight: 700;
}

.notice-band,
.role-summary {
  display: none;
}

.user-dashboard {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(180px, 1fr));
  margin: 0 auto;
  max-width: 1440px;
  width: 100%;
}

.platform-league-panel {
  background:
    linear-gradient(135deg, rgba(237, 28, 46, 0.08), rgba(45, 125, 210, 0.08)),
    rgba(7, 8, 10, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--bone);
  display: grid;
  gap: 12px;
  margin: 0 auto;
  max-width: 1440px;
  padding: 18px;
  width: 100%;
}

.platform-overview-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 0.7fr 1.6fr 0.7fr 0.7fr;
}

.platform-stat-card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 12px;
}

.platform-stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.platform-stat-card strong {
  color: #fff;
  font-size: 24px;
  line-height: 1.05;
}

.platform-league-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 1.2fr) auto;
  align-items: end;
}

.platform-league-logo-editor {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 360px) minmax(220px, 1fr) auto;
}

.platform-league-team-editor {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.platform-team-membership-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.platform-team-membership-card {
  align-items: center;
  background: rgba(7, 8, 10, 0.62);
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  color: var(--bone);
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 70px;
  padding: 10px;
}

.platform-team-membership-card input {
  height: 18px;
  width: 18px;
}

.platform-team-membership-card strong,
.platform-team-membership-card span {
  display: block;
}

.platform-team-membership-card strong {
  color: #fff;
  font-size: 15px;
}

.platform-team-membership-card span {
  color: #8d9aa8;
  font-size: 12px;
  font-weight: 800;
}

.platform-team-membership-card.is-active {
  border-color: rgba(242, 165, 26, 0.7);
  box-shadow: inset 4px 0 0 var(--outlaw-gold);
}

.garage-pool-panel {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.garage-pool-editor {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
}

.garage-pool-list {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.garage-car-card {
  background: rgba(5, 7, 10, 0.72);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  color: var(--bone);
  display: grid;
  gap: 8px;
  padding: 8px;
}

.garage-car-card.is-available {
  border-color: rgba(242, 165, 26, 0.55);
}

.garage-car-card.is-claimed {
  opacity: 0.62;
}

.garage-car-image {
  align-items: center;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(231, 21, 43, 0.22), rgba(2, 6, 12, 0.94)),
    var(--outlaw-carbon);
  border: 1px solid rgba(244, 234, 216, 0.12);
  border-radius: 6px;
  color: #cbd5e1;
  display: flex;
  font-size: 14px;
  font-style: italic;
  font-weight: 900;
  justify-content: center;
  overflow: hidden;
  text-transform: uppercase;
}

.garage-car-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.garage-car-card strong,
.garage-car-card span {
  display: block;
}

.garage-car-card strong {
  color: #fff;
  font-size: 15px;
}

.garage-car-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.league-logo-preview {
  align-items: center;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(237, 28, 46, 0.2), transparent 52%),
    rgba(8, 10, 13, 0.9);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  color: var(--outlaw-gold);
  display: flex;
  font-size: 18px;
  font-style: italic;
  font-weight: 900;
  justify-content: center;
  min-height: 110px;
  padding: 14px;
  text-align: center;
  text-transform: uppercase;
}

.league-logo-preview.has-image {
  background-color: rgba(8, 10, 13, 0.9);
}

.dashboard-card {
  background:
    radial-gradient(circle at 10% 0%, rgba(233, 26, 47, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 48%),
    rgba(7, 8, 10, 0.9);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  color: var(--bone);
  display: grid;
  gap: 5px;
  min-height: 94px;
  padding: 14px;
  text-align: left;
}

.dashboard-action {
  cursor: pointer;
  height: auto;
}

.dashboard-action:hover {
  border-color: rgba(242, 165, 26, 0.52);
  box-shadow: inset 0 -3px 0 rgba(242, 165, 26, 0.35);
}

.dashboard-action.is-active-race {
  border-color: rgba(233, 26, 47, 0.78);
  box-shadow:
    0 0 0 2px rgba(233, 26, 47, 0.22),
    inset 0 -3px 0 rgba(233, 26, 47, 0.5);
}

.dashboard-action.is-active-race span,
.dashboard-action.is-next-race span {
  color: var(--outlaw-gold);
}

.dashboard-action.is-active-race strong {
  color: #fff3dd;
}

.dashboard-action.is-next-race {
  border-color: rgba(242, 165, 26, 0.68);
  box-shadow: inset 0 -3px 0 rgba(242, 165, 26, 0.42);
}

.dashboard-action.is-queued-race {
  border-color: rgba(45, 125, 210, 0.48);
}

.dashboard-action[data-dashboard-scope="platform"] {
  border-color: rgba(45, 125, 210, 0.44);
  box-shadow: inset 0 -3px 0 rgba(45, 125, 210, 0.22);
}

.dashboard-action[data-dashboard-scope="league"] {
  border-color: rgba(233, 26, 47, 0.36);
}

.dashboard-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-card strong {
  color: #fff;
  font-size: 20px;
  line-height: 1.05;
}

.dashboard-card small {
  color: #d8cab8;
  font-size: 13px;
  line-height: 1.25;
}

.dashboard-team-logo {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(233, 26, 47, 0.18), rgba(45, 125, 210, 0.1)),
    #080a0d;
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  color: var(--outlaw-gold);
  display: none;
  font-size: 28px;
  font-style: italic;
  font-weight: 900;
  justify-content: center;
  min-height: 78px;
  overflow: hidden;
  text-transform: uppercase;
}

.dashboard-team-logo.is-visible {
  display: flex;
}

.dashboard-team-logo.has-image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

body.view-manager .user-dashboard {
  grid-template-columns: minmax(320px, 1.2fr) repeat(3, minmax(190px, 0.85fr));
  justify-content: center;
  max-width: 1440px;
}

body.is-platform-admin .user-dashboard {
  grid-template-columns: minmax(360px, 1.2fr) repeat(3, minmax(210px, 0.85fr));
}

body.is-platform-admin .dashboard-identity,
body.is-platform-admin .dashboard-action[data-dashboard-scope="platform"] {
  min-height: 118px;
}

body.is-platform-admin .user-dashboard,
body.is-platform-admin .notice-band,
body.is-platform-admin .control-band,
body.is-platform-admin .teams-subtabs,
body.is-platform-admin .records-subtabs,
body.is-platform-admin .admin-command-grid,
body.is-platform-admin .readiness-panel,
body.is-platform-admin .race-grid,
body.is-platform-admin .race-chat-panel,
body.is-platform-admin .challenge-picker-panel,
body.is-platform-admin .shootout-panel,
body.is-platform-admin .qualifier-panel,
body.is-platform-admin .free-agent-panel,
body.is-platform-admin .leaderboard-panel,
body.is-platform-admin .standings-panel,
body.is-platform-admin .roster-panel,
body.is-platform-admin .log-panel,
body.is-platform-admin .mvp-checklist-panel,
body.is-platform-admin .admin-data-panel,
body.is-platform-admin .playtest-panel,
body.is-platform-admin .event-recap-panel {
  display: none !important;
}

body.is-platform-admin .platform-league-panel,
body.is-platform-admin .director-tabs,
body.is-platform-admin .admin-editor-panel,
body.is-platform-admin .season-panel,
body.is-platform-admin .team-manager-panel,
body.is-platform-admin .account-editor-panel {
  display: grid !important;
  margin-left: auto;
  margin-right: auto;
  max-width: 1440px;
  width: 100%;
}

body.is-platform-admin .platform-league-panel {
  order: 2;
}

body.is-platform-admin .director-tabs {
  display: flex !important;
  order: 1;
}

body.is-platform-admin .lower-grid {
  display: grid !important;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-left: auto;
  margin-right: auto;
  max-width: 1440px;
  order: 3;
  width: 100%;
}

body.is-platform-admin .site-footer {
  order: 4;
}

body.is-platform-admin .admin-editor-panel {
  order: 1;
}

body.is-platform-admin .season-panel {
  order: 2;
}

body.is-platform-admin .team-manager-panel {
  order: 3;
}

body.is-platform-admin .account-editor-panel {
  order: 4;
}

body.is-platform-admin .admin-editor-panel h2,
body.is-platform-admin .season-panel h2,
body.is-platform-admin .team-manager-panel h2,
body.is-platform-admin .account-editor-panel h2 {
  color: var(--bone);
}

body.is-platform-admin .stream-view-btn:not([hidden]) {
  display: inline-flex !important;
}

body.view-manager .dashboard-identity {
  gap: 14px;
  min-height: 190px;
  padding: 20px;
  text-align: center;
}

body.view-manager .dashboard-team-logo {
  font-size: 54px;
  min-height: 120px;
  width: 100%;
}

body.view-manager .dashboard-identity > span,
body.view-manager .dashboard-identity > strong,
body.view-manager .dashboard-identity > small {
  justify-self: center;
}

body.view-manager .dashboard-identity > strong {
  font-size: 30px;
}

body.view-league .dashboard-action.role-racer,
body.view-league .dashboard-action.role-manager,
body.view-manager .dashboard-action.role-racer,
body.view-manager .dashboard-action.role-league,
body.view-racer .dashboard-action.role-manager,
body.view-racer .dashboard-action.role-league {
  display: none;
}

.role-summary {
  background: #0b0d10;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  color: var(--bone);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 0;
  min-height: 50px;
  padding: 10px 12px;
}

.role-summary-copy {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.role-summary strong {
  color: var(--gold);
  font-size: 13px;
  min-width: 118px;
  text-transform: uppercase;
}

.role-summary span {
  color: #e9dcc8;
  font-size: 14px;
}

.role-permissions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.role-permissions span {
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 999px;
  color: #f4ead8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
  white-space: nowrap;
}

.field-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mode-help {
  color: #596879;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.control-band .mode-help {
  color: #b8c4d0;
}

label,
.section-label,
.lane-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.control-band label,
.topbar label,
.event-panel label,
.queue-panel .section-label {
  color: #aeb8c4;
}

select,
input {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(201, 211, 220, 0.92);
  border-radius: 8px;
  color: var(--ink);
  max-width: 100%;
  min-height: 44px;
  padding: 0 12px;
  width: 100%;
}

.control-band select,
.control-band input,
.topbar select,
.topbar input {
  background: rgba(9, 13, 19, 0.88);
  border-color: rgba(244, 234, 216, 0.18);
  color: var(--outlaw-bone);
}

.control-band select:focus,
.control-band input:focus,
.topbar select:focus,
.topbar input:focus {
  border-color: rgba(242, 165, 26, 0.75);
  box-shadow: 0 0 0 3px rgba(242, 165, 26, 0.15);
  outline: none;
}

input[type="file"] {
  padding: 9px 10px;
}

#importDataInput {
  display: none;
}

button {
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  padding: 0 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.primary-btn {
  background: linear-gradient(180deg, var(--outlaw-red), var(--outlaw-red-dark));
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  color: #fff;
}

.primary-btn.is-confirmed {
  background: linear-gradient(180deg, #18a86c, #0f754c);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  opacity: 1;
}

.ghost-btn {
  background: var(--outlaw-cream);
  border-color: #d8cab8;
  color: var(--dark);
}

.danger-btn {
  background: var(--outlaw-bone);
  border-color: var(--outlaw-red);
  color: var(--outlaw-red-dark);
}

.small {
  min-height: 34px;
  padding: 0 12px;
}

.race-grid {
  display: grid;
  align-items: start;
  gap: 14px;
  grid-template-columns: minmax(260px, 0.78fr) minmax(560px, 1.6fr) minmax(260px, 0.78fr);
}

.lane-panel,
.center-panel,
.event-panel,
.queue-panel,
.readiness-panel,
.racer-profile-panel,
.free-agent-panel,
.shootout-panel,
.qualifier-panel,
.racer-waiting-panel,
.admin-editor-panel,
.account-editor-panel,
.team-manager-panel,
.standings-panel,
.roster-panel,
.leaderboard-panel,
.season-panel,
.log-panel,
.chat-panel,
.playtest-panel,
.admin-data-panel,
.history-panel,
.event-recap-panel {
  min-width: 0;
}

body.director-tab-race .readiness-panel,
body.director-tab-race .race-chat-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 38%),
    rgba(14, 18, 25, 0.95);
  border-color: rgba(244, 234, 216, 0.15);
  color: var(--outlaw-bone);
}

body.director-tab-race .rules-reference,
body.director-tab-race .mode-guide,
body.director-tab-race .race-checklist,
body.director-tab-race .chat-messages,
body.director-tab-race .chat-form {
  background: rgba(7, 8, 10, 0.48);
  border-color: rgba(244, 234, 216, 0.14);
  color: #d8e0e8;
}

body.director-tab-race .checklist-item {
  background: rgba(244, 234, 216, 0.06);
  border-color: rgba(244, 234, 216, 0.14);
}

body.director-tab-race .checklist-item strong,
body.director-tab-race .rules-reference strong,
body.director-tab-race .rules-reference li,
body.director-tab-race .chat-message strong {
  color: #fff;
}

body.director-tab-race .checklist-item small,
body.director-tab-race .rules-reference li,
body.director-tab-race .chat-message span {
  color: #c6d0dc;
}

body.director-tab-race .chat-form input {
  background: rgba(7, 8, 10, 0.62);
  border-color: rgba(244, 234, 216, 0.16);
  color: #fff;
}

body.director-tab-race .chat-message,
body.director-tab-race .chat-identity {
  background: #f6f8fa;
  border-color: var(--line);
  color: var(--ink);
}

body.director-tab-race .chat-message strong,
body.director-tab-race .chat-message p,
body.director-tab-race .chat-identity strong {
  color: var(--ink);
}

body.director-tab-race .chat-message span,
body.director-tab-race .chat-identity span {
  color: var(--muted);
}

.lane-panel,
.center-panel,
.event-panel,
.queue-panel,
.readiness-panel,
.racer-profile-panel,
.free-agent-panel,
.shootout-panel,
.qualifier-panel,
.racer-waiting-panel,
.admin-editor-panel,
.account-editor-panel,
.team-manager-panel,
.standings-panel,
.roster-panel,
.leaderboard-panel,
.season-panel,
.log-panel,
.chat-panel,
.playtest-panel,
.admin-data-panel,
.history-panel,
.event-recap-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 38%),
    rgba(14, 18, 25, 0.95);
  border: 1px solid rgba(244, 234, 216, 0.15);
  border-radius: 8px;
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.lane-panel {
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 38%),
    rgba(14, 18, 25, 0.95);
  color: var(--outlaw-bone);
  display: grid;
  gap: 12px;
  overflow: hidden;
  padding: 14px;
  position: relative;
}

.lane-panel::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
  content: "";
  inset: 0;
  opacity: 0.65;
  pointer-events: none;
  position: absolute;
}

.lane-panel > * {
  position: relative;
  z-index: 1;
}

#leftPanel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%),
    linear-gradient(135deg, rgba(119, 49, 54, 0.78), rgba(42, 18, 22, 0.94));
  border-color: rgba(233, 26, 47, 0.38);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.26),
    inset 0 0 0 1px rgba(233, 26, 47, 0.12);
}

#rightPanel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%),
    linear-gradient(135deg, rgba(44, 83, 119, 0.78), rgba(17, 35, 54, 0.95));
  border-color: rgba(45, 125, 210, 0.42);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.26),
    inset 0 0 0 1px rgba(45, 125, 210, 0.16);
}

.lane-panel.is-loser {
  opacity: 0.62;
}

.lane-panel.is-launch-ready,
.lane-panel.is-active-lane {
  box-shadow:
    0 0 0 3px rgba(242, 165, 26, 0.34),
    0 20px 42px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(242, 165, 26, 0.36);
  transform: translateY(-2px);
}

.lane-panel.is-active-lane::before,
.lane-panel.is-launch-ready::before {
  opacity: 0.95;
}

.lane-panel.is-waiting-lane {
  opacity: 0.78;
}

.lane-panel.is-active-lane .lane-name::after,
.lane-panel.is-launch-ready .lane-name::after {
  background: var(--gold);
  border-radius: 999px;
  color: #17100a;
  content: " READY";
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  margin-left: 8px;
  padding: 3px 6px;
  vertical-align: middle;
}

body.race-phase-race .lane-panel.is-active-lane .lane-name::after {
  content: " TURN";
}

.winner-badge {
  background: var(--gold);
  border: 1px solid #111;
  border-radius: 8px;
  color: #111;
  display: none;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 7px 10px;
  position: absolute;
  right: 14px;
  text-transform: uppercase;
  top: 14px;
  z-index: 2;
}

.winner-badge.is-visible {
  display: block;
}

.car-photo {
  align-items: center;
  aspect-ratio: 5 / 3;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  box-shadow:
    inset 0 -46px 80px rgba(0, 0, 0, 0.28),
    0 12px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  overflow: hidden;
  position: relative;
}

.car-photo::before {
  background: rgba(255, 255, 255, 0.28);
  content: "";
  height: 46%;
  left: 18%;
  position: absolute;
  top: 24%;
  transform: skewX(-18deg);
  width: 38%;
}

.car-photo.has-image::before,
.car-photo.has-image::after {
  display: none;
}

.car-photo img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.fallback-logo {
  align-items: center;
  background: rgba(0, 0, 0, 0.32);
  color: var(--bone);
  display: flex;
  font-size: 34px;
  font-style: italic;
  font-weight: 900;
  height: 100%;
  justify-content: center;
  text-shadow: 4px 4px 0 #000;
  width: 100%;
}

.fallback-logo.free-agent-logo {
  background:
    linear-gradient(135deg, rgba(7, 8, 10, 0.86), rgba(42, 26, 20, 0.72)),
    var(--outlaw-black);
  color: var(--outlaw-cream);
  font-size: clamp(22px, 3vw, 34px);
  padding: 12px;
  text-align: center;
  text-transform: uppercase;
}

.car-photo::after {
  background: #121820;
  border-radius: 999px;
  box-shadow: 96px 0 0 #121820;
  content: "";
  height: 22px;
  left: 24%;
  position: absolute;
  top: 66%;
  width: 22px;
}

.car-red {
  background:
    radial-gradient(circle at 76% 28%, rgba(255, 255, 255, 0.12), transparent 24%),
    linear-gradient(135deg, #9f4d51, #4a191d);
}

.car-blue {
  background:
    radial-gradient(circle at 76% 28%, rgba(255, 255, 255, 0.14), transparent 24%),
    linear-gradient(135deg, #4b78a5, #183957);
}

.car-gold {
  background: linear-gradient(135deg, #c68620, #62421d);
}

.car-green {
  background: linear-gradient(135deg, #238363, #1c3d33);
}

.car-copy {
  display: grid;
  gap: 3px;
}

.car-copy h2 {
  color: #fff;
  font-size: 20px;
  line-height: 1.05;
}

.car-copy p:not(.lane-name) {
  color: #aeb8c4;
}

.stat-row {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-pill {
  background: rgba(7, 8, 10, 0.48);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  min-width: 0;
  padding: 7px 8px;
}

.stat-pill span {
  color: #93a1b0;
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.stat-pill strong {
  color: #fff;
  font-size: 20px;
}

.meter {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  transition: width 240ms ease;
  width: 0;
}

.left-fill {
  background: linear-gradient(90deg, var(--outlaw-red-dark), var(--outlaw-red));
}

.right-fill {
  background: linear-gradient(90deg, var(--outlaw-blue-dark), var(--outlaw-blue));
}

.lane-data {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lane-data span {
  background: rgba(7, 8, 10, 0.48);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  color: #94a2b0;
  font-size: 12px;
  min-width: 0;
  padding: 8px 9px;
}

.lane-data strong {
  color: #fff;
  display: block;
  font-size: 20px;
  margin-top: 2px;
}

.lane-team-brand {
  display: none;
}

.roll-btn {
  background: var(--dark);
  color: #fff;
  min-height: 46px;
}

#leftRollBtn {
  background: linear-gradient(180deg, var(--outlaw-red), var(--outlaw-red-dark));
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

#rightRollBtn {
  background: linear-gradient(180deg, #4fa7ff, var(--outlaw-blue));
  border-color: rgba(45, 125, 210, 0.7);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
  color: #fff;
}

.center-panel {
  background:
    radial-gradient(circle at 50% 10%, rgba(45, 125, 210, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 36%),
    #0a0e14;
  border-color: rgba(244, 234, 216, 0.28);
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: var(--bone);
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.center-panel > * {
  min-width: 0;
}

.center-panel.is-grudge {
  background: #18100d;
  border-color: #f2a51a;
  box-shadow: 0 0 0 3px rgba(242, 165, 26, 0.16);
}

.center-panel.is-pink-slip {
  background: #19090b;
  border-color: var(--outlaw-red);
  box-shadow:
    0 0 0 3px rgba(238, 26, 45, 0.18),
    inset 0 0 0 1px rgba(242, 165, 26, 0.12);
}

.center-panel.is-pending-confirmation {
  border-color: var(--gold);
  box-shadow:
    0 0 0 3px rgba(242, 165, 26, 0.2),
    0 18px 38px rgba(0, 0, 0, 0.32),
    inset 0 0 0 1px rgba(242, 165, 26, 0.14);
}

body.race-phase-launch .race-mode-badge::after,
body.race-phase-race .race-mode-badge::after,
body.race-phase-complete .race-mode-badge::after,
body.race-result-pending .race-mode-badge::after {
  border-left: 1px solid rgba(244, 234, 216, 0.25);
  color: var(--gold);
  content: "Launch";
  margin-left: 10px;
  padding-left: 10px;
}

body.race-phase-race .race-mode-badge::after {
  content: "Live";
}

body.race-phase-complete .race-mode-badge::after {
  content: "Complete";
}

body.race-result-pending .race-mode-badge::after {
  content: "Confirm Result";
}

.race-mode-badge {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    #050607;
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  color: var(--bone);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 10px 12px;
  text-align: center;
  text-transform: uppercase;
}

.race-mode-badge.is-grudge {
  background: var(--gold);
  color: #14110b;
}

.race-mode-badge.is-pink-slip {
  background: linear-gradient(180deg, #e91c2f, #8d0b17);
  border-color: rgba(242, 165, 26, 0.55);
  color: var(--bone);
}

.broadcast-display-controls {
  align-items: end;
  background: rgba(7, 8, 10, 0.46);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 0.85fr) minmax(210px, 1.15fr) auto minmax(210px, 1fr);
  padding: 10px;
}

.broadcast-display-controls .muted-note {
  align-self: center;
  color: #c7d2df;
}

.track-card {
  background:
    radial-gradient(circle at 50% 40%, rgba(233, 26, 47, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(244, 234, 216, 0.04), transparent 38%),
    #0b0d10;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.live-video-card {
  background:
    radial-gradient(circle at 50% 40%, rgba(233, 26, 47, 0.12), transparent 42%),
    linear-gradient(135deg, rgba(233, 26, 47, 0.16), rgba(45, 125, 210, 0.16)),
    #0b0d10;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  display: none;
  min-height: clamp(190px, 20vw, 250px);
  min-width: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.live-video-card video {
  background: #050607;
  display: block;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  max-width: 100%;
  width: 100%;
}

.live-video-placeholder {
  align-items: center;
  color: #dbe5ef;
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  padding: 28px;
  position: absolute;
  text-align: center;
}

.live-video-placeholder strong {
  color: var(--bone);
  font-size: 26px;
}

.live-video-placeholder span {
  color: #aebccc;
  font-weight: 700;
  max-width: 480px;
}

.live-video-placeholder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.live-video-placeholder-actions .small {
  min-height: 42px;
  min-width: 150px;
}

.live-video-placeholder.is-hidden {
  display: none;
}

.broadcast-live-video.view-stream .track-card {
  display: none;
}

.broadcast-live-video.view-stream .live-video-card {
  display: block;
}

.track-labels {
  color: #d4c6b2;
  display: flex;
  font-size: 12px;
  font-weight: 700;
  justify-content: space-between;
  text-transform: uppercase;
}

.drag-strip {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.28)),
    linear-gradient(90deg, transparent 0 49%, rgba(255, 255, 255, 0.42) 49% 51%, transparent 51% 100%),
    linear-gradient(90deg, rgba(233, 26, 47, 0.12), transparent 38%, transparent 62%, rgba(45, 125, 210, 0.14)),
    repeating-linear-gradient(90deg, #29323b 0 24px, #202832 24px 48px);
  border: 1px solid rgba(244, 234, 216, 0.2);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.22),
    inset 0 0 30px rgba(255, 255, 255, 0.04),
    0 12px 24px rgba(0, 0, 0, 0.22);
  height: clamp(190px, 20vw, 250px);
  overflow: hidden;
  position: relative;
}

.drag-strip::before,
.drag-strip::after {
  background: rgba(242, 245, 248, 0.9);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.24);
  content: "";
  height: 4px;
  left: 0;
  position: absolute;
  right: 0;
}

.drag-strip::before {
  top: 84px;
}

.drag-strip::after {
  top: 136px;
}

.half-marker,
.finish-marker {
  bottom: 0;
  position: absolute;
  top: 0;
  width: 3px;
}

.half-marker {
  background: rgba(255, 255, 255, 0.45);
  left: 50%;
}

.half-marker.is-active {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 165, 26, 0.28), 0 0 22px rgba(242, 165, 26, 0.88);
  width: 5px;
}

.finish-marker {
  background: #fff;
  box-shadow: -7px 0 0 rgba(255, 255, 255, 0.55);
  right: 0;
  width: 5px;
}

.finish-marker.is-finished {
  background: var(--green);
  box-shadow: -7px 0 0 rgba(22, 143, 97, 0.45), 0 0 26px rgba(22, 143, 97, 0.9);
  width: 6px;
}

.car-marker {
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  height: 30px;
  left: 0;
  position: absolute;
  transition: left 260ms ease, transform 260ms ease;
  width: 52px;
}

.red-marker {
  background: linear-gradient(180deg, #ff3447, var(--outlaw-red));
  box-shadow: 0 0 20px rgba(233, 26, 47, 0.44), 0 6px 14px rgba(0, 0, 0, 0.35);
  top: 58px;
}

.blue-marker {
  background: linear-gradient(180deg, #4fa7ff, var(--outlaw-blue));
  box-shadow: 0 0 20px rgba(45, 125, 210, 0.5), 0 6px 14px rgba(0, 0, 0, 0.35);
  top: 146px;
}

.dice-board {
  align-items: stretch;
  background: rgba(7, 8, 10, 0.72);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.3fr);
  padding: 10px;
}

.dice-pair {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.die {
  align-items: center;
  background: #f4ead8;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--dark);
  display: flex;
  font-size: 32px;
  font-weight: 800;
  height: 64px;
  justify-content: center;
  width: 64px;
}

.turn-box {
  align-content: center;
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  color: var(--outlaw-bone);
  display: grid;
  padding: 12px;
}

.turn-box strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  margin-top: 6px;
}

.result-banner {
  align-items: center;
  background: #050607;
  border: 1px solid rgba(244, 234, 216, 0.2);
  border-radius: 8px;
  color: #aab3bd;
  display: none;
  font-size: 22px;
  font-weight: 900;
  gap: 10px;
  grid-template-columns: auto 1fr;
  padding: 12px 14px;
  text-align: left;
}

.result-banner.is-visible {
  background: #103c2d;
  border-color: #23aa78;
  box-shadow: 0 0 0 3px rgba(35, 170, 120, 0.16);
  color: #dff9ef;
  display: grid;
}

.result-banner.is-visible::before {
  background: #dff9ef;
  border-radius: 6px;
  color: #103c2d;
  content: "Result";
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 6px 8px;
  text-transform: uppercase;
}

.condition-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
}

.condition-card {
  align-items: center;
  background: #050607;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-radius: 8px;
  color: #9aa8b6;
  display: grid;
  gap: 0 8px;
  grid-template-columns: 34px 1fr;
  min-height: 62px;
  padding: 9px;
}

.condition-card span,
.condition-card strong {
  display: block;
}

.condition-card i {
  align-items: center;
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.12);
  border-radius: 8px;
  color: #6d7782;
  display: flex;
  font-style: normal;
  font-weight: 900;
  grid-row: 1 / 3;
  height: 34px;
  justify-content: center;
  text-transform: uppercase;
  width: 34px;
}

.condition-card span {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.condition-card strong {
  color: var(--bone);
  font-size: 16px;
  line-height: 1.1;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.condition-card.is-active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 165, 26, 0.18);
  color: #6c4200;
}

.condition-card.is-red {
  background: #3f1117;
  border-color: var(--outlaw-red);
  color: #ffdfe3;
}

.condition-card.is-red i {
  background: var(--outlaw-red);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.condition-card.is-loose {
  background: #44320b;
  color: #ffedae;
}

.condition-card.is-loose i {
  background: var(--gold);
  border-color: rgba(255, 255, 255, 0.2);
  color: #17100a;
}

.condition-card.is-crash {
  background: #17191d;
  border-color: var(--outlaw-red);
  color: #fff;
}

.condition-card.is-crash i {
  background: var(--outlaw-bone);
  border-color: var(--outlaw-red);
  color: var(--outlaw-red);
}

.condition-card.is-crash strong {
  color: #fff;
}

.race-access-note {
  background: rgba(244, 234, 216, 0.08);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-left: 4px solid var(--outlaw-cream);
  border-radius: 8px;
  color: #d8e0e8;
  display: grid;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  padding: 10px 12px;
}

.race-access-note.is-ready {
  background: rgba(22, 143, 97, 0.16);
  border-color: rgba(22, 143, 97, 0.42);
  border-left-color: var(--green);
  color: #e6fff3;
}

.race-access-note.is-waiting {
  background: rgba(242, 165, 26, 0.12);
  border-color: rgba(242, 165, 26, 0.38);
  border-left-color: var(--gold);
  color: #fff3cf;
}

.race-access-note.is-complete {
  background: rgba(45, 125, 210, 0.16);
  border-color: rgba(45, 125, 210, 0.42);
  border-left-color: var(--outlaw-blue);
  color: #e8f4ff;
}

.race-access-message {
  display: block;
}

.race-access-lanes {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.race-access-lane {
  align-items: center;
  background: rgba(7, 8, 10, 0.48);
  border: 1px solid rgba(244, 234, 216, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  grid-template-columns: auto 1fr auto;
  min-width: 0;
  padding: 8px 9px;
}

.race-access-lane strong,
.race-access-lane b {
  color: var(--outlaw-gold);
  font-size: 11px;
  text-transform: uppercase;
}

.race-access-lane em {
  color: var(--outlaw-bone);
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-access-lane.is-ready {
  border-color: rgba(22, 143, 97, 0.55);
  box-shadow: inset 0 0 0 1px rgba(22, 143, 97, 0.12);
}

.race-access-lane.is-yours {
  border-color: rgba(242, 165, 26, 0.68);
  box-shadow:
    0 0 0 2px rgba(242, 165, 26, 0.14),
    inset 0 0 0 1px rgba(242, 165, 26, 0.18);
}

.race-access-lane.is-yours strong {
  color: #fff3dd;
}

.race-access-lane.is-ready b {
  color: #78f0b4;
}

.race-access-lane.is-waiting b {
  color: var(--outlaw-gold);
}

.race-access-lane.is-blocked b {
  color: #ff7d8d;
}

.race-access-lane.is-complete b {
  color: #8ec6ff;
}

.launch-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.launch-actions .primary-btn {
  min-height: 50px;
}

.launch-actions .primary-btn:first-child {
  background: linear-gradient(180deg, var(--outlaw-red), var(--outlaw-red-dark));
}

.launch-actions .primary-btn:last-child {
  background: linear-gradient(180deg, #4fa7ff, var(--outlaw-blue));
  border-color: rgba(45, 125, 210, 0.7);
  color: #fff;
}

.audit-box {
  align-items: center;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px;
}

.audit-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.event-panel {
  color: var(--outlaw-bone);
  padding: 14px;
}

.event-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.event-status-strip,
.event-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.active-event-banner {
  background: rgba(7, 8, 10, 0.68);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  margin-top: 8px;
  padding: 10px;
}

.active-event-banner span {
  color: #8d9aa8;
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.active-event-banner strong {
  color: #fff;
  display: block;
  font-size: 18px;
  margin-top: 3px;
}

.event-stat {
  background: rgba(7, 8, 10, 0.46);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  min-width: 0;
  padding: 9px 10px;
}

.event-stat span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.event-stat strong {
  color: #fff;
  display: block;
  font-size: 18px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-panel {
  color: var(--outlaw-bone);
  padding: 14px;
}

.queue-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(200px, 0.95fr) minmax(190px, 0.8fr) minmax(260px, 1.25fr);
  margin-top: 10px;
}

.queue-action-group {
  background: rgba(244, 234, 216, 0.06);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  min-width: 0;
  padding: 10px;
}

.queue-action-group > span {
  color: #aab8c7;
  font-size: 11px;
  font-weight: 900;
  grid-column: 1 / -1;
  text-transform: uppercase;
}

.queue-action-group-primary {
  background: var(--outlaw-black);
  border-color: rgba(244, 234, 216, 0.2);
}

.queue-action-group-primary > span {
  color: var(--gold);
}

.queue-action-group-primary button {
  grid-column: 1 / -1;
  min-height: 64px;
}

.queue-action-group button {
  min-width: 0;
  overflow-wrap: anywhere;
}

.queue-action-group #clearQueueBtn {
  grid-column: 1 / -1;
}

.pending-result {
  background: rgba(7, 8, 10, 0.44);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  color: #aab8c7;
  font-weight: 700;
  margin-top: 10px;
  padding: 9px 10px;
}

.pending-result.ready {
  background: #fff9ec;
  border-color: var(--gold);
  box-shadow: inset 5px 0 0 var(--gold);
  color: var(--dark);
}

.pending-review {
  display: grid;
  gap: 12px;
}

.pending-review span,
.pending-review small {
  display: block;
}

.pending-review span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pending-review strong {
  color: var(--dark);
  display: block;
  font-size: 18px;
  margin-top: 3px;
}

.pending-review small {
  color: var(--muted);
  margin-top: 3px;
}

.pending-review ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.pending-review li {
  color: var(--dark);
}

.pending-review-header {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.pending-review-header strong {
  font-size: 22px;
}

.pending-mode-chip {
  background: var(--dark);
  border-radius: 8px;
  color: var(--gold);
  flex: 0 0 auto;
  font-weight: 900;
  padding: 9px 12px;
}

.pending-result-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.pending-result-grid > div,
.pending-impact-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.pending-result-grid strong {
  font-size: 17px;
}

.pending-impact-box > span {
  margin-bottom: 8px;
}

.pending-action-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.65fr);
}

.matchup-queue {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.queue-handoff {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.queue-handoff > div {
  background: rgba(7, 8, 10, 0.44);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  padding: 10px;
}

.queue-handoff span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.queue-handoff strong {
  color: #fff;
  display: block;
  margin-top: 3px;
}

.queue-row {
  align-items: center;
  background: rgba(244, 234, 216, 0.06);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(90px, 0.18fr) 1fr auto;
  min-width: 0;
  padding: 9px 10px;
}

.queue-stage {
  align-items: center;
  background: var(--dark);
  border-radius: 6px;
  color: var(--gold);
  display: flex;
  justify-content: center;
  min-height: 34px;
  min-width: 96px;
  padding: 6px 8px;
  text-align: center;
}

.queue-row strong,
.queue-row span {
  display: block;
}

.queue-row strong {
  color: #fff;
}

.queue-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.lower-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 0.8fr) minmax(520px, 1.5fr) minmax(320px, 1fr);
  margin-top: 0;
}

body.view-league .lower-grid,
body.view-manager .lower-grid {
  grid-template-columns: minmax(360px, 0.9fr) minmax(560px, 1.35fr);
}

.admin-editor-panel,
.team-manager-panel,
.account-editor-panel,
.racer-profile-panel,
.free-agent-panel,
.shootout-panel,
.qualifier-panel {
  grid-column: 1 / -1;
  padding: 16px;
}

.challenge-picker-panel {
  grid-column: 1 / -1;
  padding: 16px;
}

body.view-league .mode-panel,
body.view-manager .mode-panel {
  grid-column: 1 / -1;
}

body.view-league.mode-club .mode-panel,
body.view-league.mode-team .mode-panel,
body.view-league.mode-grudge .mode-panel,
body.view-league.mode-pink_slip .mode-panel,
body.view-manager.mode-club .mode-panel,
body.view-manager.mode-team .mode-panel,
body.view-manager.mode-grudge .mode-panel,
body.view-manager.mode-pink_slip .mode-panel {
  display: none;
}

body.view-league:not(.mode-shootout) .mode-shootout-panel,
body.view-manager:not(.mode-shootout) .mode-shootout-panel,
body.view-league:not(.mode-qualifier) .mode-qualifier-panel,
body.view-manager:not(.mode-qualifier) .mode-qualifier-panel {
  display: none;
}

body.view-league .mode-support-panel,
body.view-manager .mode-support-panel {
  display: none;
}

body.view-league.mode-shootout .mode-support-panel,
body.view-league.mode-qualifier .mode-support-panel,
body.view-manager.mode-shootout .mode-support-panel,
body.view-manager.mode-qualifier .mode-support-panel {
  display: block;
  grid-column: 1 / -1;
}

body.view-league .admin-tools-panel,
body.view-manager .admin-tools-panel {
  grid-column: 1 / -1;
  opacity: 0.92;
}

body.mode-shootout .standard-race-action,
body.mode-qualifier .standard-race-action {
  display: none;
}

body.mode-club .setup-right-team-control {
  display: none;
}

body.mode-club .control-band {
  grid-template-columns: minmax(180px, 0.7fr) minmax(210px, 0.8fr) minmax(340px, 1.2fr) minmax(340px, 1.2fr) minmax(280px, 0.85fr);
}

body.mode-shootout .standard-setup-control,
body.mode-qualifier .standard-setup-control {
  display: none;
}

body.view-manager .standard-setup-control {
  display: none;
}

body.view-manager .control-band {
  display: none;
}

.qualifier-only-action {
  display: none;
}

body.mode-qualifier .qualifier-only-action {
  display: block;
}

body.mode-shootout .control-band,
body.mode-qualifier .control-band {
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 0.8fr);
}

body.view-manager .control-band {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.8fr);
}

body.view-league.director-tab-teams .control-band,
body.view-league.director-tab-roster .control-band,
body.view-league.director-tab-records .control-band,
body.view-manager.director-tab-roster .control-band {
  display: none;
}

body.view-manager .event-panel,
body.view-manager .queue-actions {
  display: none;
}

body.view-manager .admin-command-grid {
  grid-template-columns: 1fr;
}

body.view-league:not(.director-tab-race) .tab-race-panel,
body.view-manager:not(.director-tab-race) .tab-race-panel,
body.view-racer:not(.director-tab-race) .tab-race-panel {
  display: none;
}

body.view-league:not(.director-tab-setup) .tab-setup-panel,
body.view-manager:not(.director-tab-setup) .tab-setup-panel,
body.view-racer:not(.director-tab-setup) .tab-setup-panel {
  display: none;
}

body.view-league:not(.director-tab-teams) .tab-teams-panel:not(.tab-setup-panel),
body.view-manager:not(.director-tab-teams) .tab-teams-panel:not(.tab-setup-panel),
body.view-racer:not(.director-tab-teams) .tab-teams-panel:not(.tab-setup-panel) {
  display: none;
}

body.view-league:not(.director-tab-roster) .tab-roster-panel,
body.view-manager:not(.director-tab-roster) .tab-roster-panel {
  display: none;
}

body.view-league:not(.director-tab-records) .tab-records-panel,
body.view-racer:not(.director-tab-records) .tab-records-panel {
  display: none;
}

body.view-league.director-tab-records:not(.records-tab-leaderboard) .records-leaderboard-panel,
body.view-racer:not(.records-tab-leaderboard) .records-leaderboard-panel,
body.view-stream:not(.records-tab-leaderboard) .records-leaderboard-panel,
body.view-league.director-tab-records:not(.records-tab-season) .records-season-panel,
body.view-racer:not(.records-tab-season) .records-season-panel,
body.view-stream:not(.records-tab-season) .records-season-panel,
body.view-league.director-tab-records:not(.records-tab-teams) .records-teams-panel,
body.view-racer:not(.records-tab-teams) .records-teams-panel,
body.view-stream:not(.records-tab-teams) .records-teams-panel,
body.view-league.director-tab-records:not(.records-tab-roster) .records-roster-panel,
body.view-racer:not(.records-tab-roster) .records-roster-panel,
body.view-stream:not(.records-tab-roster) .records-roster-panel,
body.view-league.director-tab-records:not(.records-tab-tools) .records-tools-panel,
body.view-manager .tab-records-panel,
body.view-racer:not(.records-tab-tools) .records-tools-panel {
  display: none;
}

body.view-league.director-tab-teams:not(.teams-tab-team) .teams-team-panel,
body.view-manager.director-tab-teams:not(.teams-tab-team) .teams-team-panel {
  display: none;
}

body.view-league.director-tab-teams:not(.teams-tab-accounts) .teams-accounts-panel,
body.view-manager.director-tab-teams:not(.teams-tab-accounts) .teams-accounts-panel {
  display: none;
}

body.view-manager .free-agent-panel {
  grid-column: 1 / 2;
}

body.view-manager .shootout-panel {
  grid-column: 1 / -1;
}

body.view-manager .qualifier-panel {
  grid-column: 1 / -1;
}

body.view-league.director-tab-teams .teams-subtabs {
  order: 1;
}

body.view-league.director-tab-teams .teams-team-panel {
  order: 2;
}

body.view-league.director-tab-teams .teams-accounts-panel {
  order: 3;
}

body.view-league.director-tab-teams .free-agent-panel {
  order: 4;
}

body.view-league.director-tab-teams .racer-waiting-panel {
  order: 5;
}

body.view-manager .team-manager-panel {
  grid-column: 1 / -1;
}

body.view-racer .racer-profile-panel,
body.view-racer .free-agent-panel {
  grid-column: 1 / -1;
}

.editor-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-top: 12px;
}

.team-editor-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.account-editor-grid {
  grid-template-columns: minmax(190px, 1fr) repeat(4, minmax(150px, 1fr)) repeat(3, minmax(90px, 0.45fr));
}

.team-editor-grid button,
.account-editor-grid button {
  min-height: 46px;
}

.account-login-box {
  align-items: center;
  background: rgba(7, 8, 10, 0.92);
  border: 1px solid rgba(242, 165, 26, 0.35);
  border-radius: 8px;
  color: var(--outlaw-bone);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  margin-top: 14px;
  padding: 14px;
}

.account-login-box[hidden] {
  display: none;
}

.account-login-box strong,
.account-login-box span {
  display: block;
}

.account-login-box span {
  color: #d8cab8;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.account-login-grid {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) auto;
}

.account-login-grid p {
  margin: 0;
}

.account-login-grid code {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  padding: 9px 10px;
}

.roster-workspace {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.roster-free-agent-panel {
  background: rgba(5, 7, 10, 0.52);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  margin-top: 16px;
  padding: 14px;
}

.roster-free-agent-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
}

.mini-section-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mini-section-heading strong {
  color: var(--outlaw-bone);
  font-size: 15px;
  font-weight: 900;
}

.mini-section-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.free-agent-mini-list {
  display: grid;
  gap: 8px;
}

.roster-panel-controls {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.compact-field {
  min-width: 220px;
}

.compact-field select {
  min-height: 44px;
}

.manager-flow {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.manager-flow div {
  background: rgba(7, 8, 10, 0.78);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-left: 4px solid var(--outlaw-red);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.manager-flow strong {
  color: var(--outlaw-bone);
  font-size: 14px;
}

.manager-flow span {
  color: #b7c2cf;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.manager-team-branding {
  background: rgba(7, 8, 10, 0.62);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  margin-top: 14px;
  padding: 14px;
}

.manager-logo-editor {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 280px) minmax(120px, 0.5fr) minmax(220px, 1fr) auto;
}

.manager-logo-editor .dashboard-team-logo {
  display: flex;
  min-height: 92px;
}

.rank-board,
.roster-detail-panel,
.candidate-board {
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.candidate-board {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.car-editor-grid {
  align-items: end;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.stat-edit-row,
.detail-actions {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.detail-actions {
  align-items: end;
  grid-template-columns: 1fr 1fr;
}

.car-editor-grid .selected-owner-garage {
  grid-column: span 3;
}

.compact-heading {
  align-items: center;
  margin-bottom: 10px;
}

.compact-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.compact-heading h3 {
  font-size: 16px;
  margin: 0;
}

.team-manager-panel > .panel-heading h2 {
  color: var(--outlaw-bone);
}

.team-manager-panel > .panel-heading .muted-note {
  color: #b7c2cf;
}

.roster-management-list,
.free-agent-mini-list {
  display: grid;
  gap: 7px;
}

.roster-management-row,
.free-agent-mini-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 54px minmax(180px, 1fr) minmax(96px, auto) minmax(58px, auto) minmax(120px, 0.45fr) auto;
  min-width: 0;
  padding: 9px 10px;
}

.roster-management-row.is-selected {
  background: #fff2cf;
  border-color: var(--outlaw-gold);
  box-shadow: inset 4px 0 0 var(--outlaw-gold);
}

.free-agent-mini-row {
  grid-template-columns: minmax(140px, 1fr) auto minmax(64px, auto);
}

.roster-main span,
.free-agent-mini-row span,
.free-agent-mini-row small {
  color: var(--muted);
  font-size: 12px;
}

.rank-chip {
  align-items: center;
  background: var(--dark);
  border-radius: 6px;
  color: var(--gold);
  display: flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
}

.roster-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.roster-main strong,
.roster-main span,
.free-agent-mini-row strong,
.free-agent-mini-row span,
.free-agent-mini-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-stats {
  color: var(--dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.roster-record {
  background: #05070a;
  border-radius: 999px;
  color: var(--outlaw-gold);
  font-size: 13px;
  font-weight: 900;
  justify-self: start;
  padding: 5px 10px;
  white-space: nowrap;
}

.availability-control {
  display: grid;
  gap: 3px;
}

.availability-control select {
  background: #fffaf1;
  border: 1px solid #d8cab8;
  border-radius: 6px;
  color: var(--dark);
  font-weight: 800;
  min-height: 34px;
  padding: 6px 8px;
}

.availability-control small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.row-actions {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(4, minmax(42px, auto));
  justify-content: end;
}

.icon-action {
  align-items: center;
  background: var(--outlaw-cream);
  border: 1px solid #d8cab8;
  border-radius: 6px;
  color: var(--dark);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  min-height: 34px;
  padding: 0 8px;
  text-transform: uppercase;
  width: auto;
}

.icon-action.primary-action {
  background: var(--outlaw-red);
  border-color: var(--outlaw-red-dark);
  color: #fff;
}

.car-editor-empty {
  background: #f8fafc;
  border: 1px dashed #c8bda9;
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 14px;
}

.car-editor-empty strong {
  font-size: 18px;
}

.car-editor-empty span {
  color: var(--muted);
  font-weight: 700;
}

.car-image-preview-panel {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(29, 35, 43, 0.08), rgba(29, 35, 43, 0.01)),
    #fffaf1;
  border: 1px solid #d8cab8;
  border-radius: 8px;
  color: var(--dark);
  display: grid;
  gap: 8px;
  min-height: 96px;
  overflow: hidden;
  padding: 10px;
}

.compact-car-image-preview {
  align-self: stretch;
  min-height: 62px;
  padding: 8px;
}

.car-image-preview-panel img {
  border-radius: 6px;
  display: block;
  height: 118px;
  object-fit: cover;
  width: 100%;
}

.compact-car-image-preview img {
  height: 64px;
}

.car-image-preview-panel strong {
  align-items: center;
  background: linear-gradient(135deg, #191d23, #320d0f);
  border-radius: 6px;
  color: var(--outlaw-bone);
  display: flex;
  font-size: 22px;
  justify-content: center;
  min-height: 80px;
  text-transform: uppercase;
}

.car-image-preview-panel span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.car-image-preview-panel.free-agent-preview strong {
  color: #cbd5e1;
}

.selected-owner-garage {
  background: #f8fafc;
  border: 1px solid #d8cab8;
  border-radius: 8px;
  color: var(--dark);
  display: grid;
  gap: 10px;
  min-height: 96px;
  padding: 10px;
}

.selected-owner-garage > span {
  align-self: center;
  color: var(--muted);
  font-weight: 800;
}

.selected-owner-garage-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.selected-owner-garage-heading strong {
  color: var(--dark);
  font-size: 14px;
}

.selected-owner-garage-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-owner-garage-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.selected-owner-garage-card {
  background: #fffaf1;
  border: 1px solid #d8cab8;
  border-radius: 7px;
  display: grid;
  gap: 8px;
  grid-template-columns: 54px minmax(0, 1fr);
  min-height: 70px;
  padding: 9px;
}

.selected-owner-garage-card.is-current {
  border-color: var(--outlaw-gold);
  box-shadow: inset 4px 0 0 var(--outlaw-gold);
}

.selected-owner-garage-card strong {
  color: var(--dark);
  display: block;
  font-size: 13px;
}

.selected-owner-garage-thumb {
  align-items: center;
  background: #111820;
  border-radius: 7px;
  display: flex;
  height: 50px;
  justify-content: center;
  overflow: hidden;
}

.selected-owner-garage-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.selected-owner-garage-thumb span {
  color: var(--outlaw-gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-owner-garage-card span,
.selected-owner-garage-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.danger-action {
  background: var(--outlaw-bone);
  border-color: var(--outlaw-red);
  color: var(--outlaw-red-dark);
}

.racer-profile-grid {
  align-items: end;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.racer-profile-grid .primary-btn {
  min-height: 48px;
}

body.view-racer .racer-profile-panel {
  border-color: rgba(242, 165, 26, 0.26);
}

body.view-racer .racer-profile-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

body.view-racer .racer-profile-grid .primary-btn {
  min-height: 56px;
}

.racer-profile-overview {
  align-items: stretch;
  background:
    radial-gradient(circle at 18% 16%, rgba(233, 26, 47, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(231, 21, 43, 0.18), transparent 42%),
    rgba(7, 8, 10, 0.45);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 0.42fr) minmax(260px, 1fr);
  margin: 14px 0;
  padding: 14px;
}

.garage-claim-panel {
  align-items: end;
  background: rgba(5, 7, 10, 0.62);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  margin: 14px 0;
  padding: 12px;
}

.garage-claim-panel strong,
.garage-claim-panel span {
  display: block;
}

.garage-claim-panel strong {
  color: var(--outlaw-gold);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.garage-claim-panel span {
  color: #dbe4ef;
  font-size: 14px;
  line-height: 1.35;
}

.racer-garage-gallery {
  background: rgba(5, 7, 10, 0.5);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  margin: 0 0 14px;
  padding: 12px;
}

.racer-profile-save-row {
  display: grid;
}

.racer-profile-save-row .primary-btn {
  min-height: 56px;
}

.racer-garage-heading,
.racer-garage-empty {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.racer-garage-heading strong,
.racer-garage-empty strong {
  color: var(--outlaw-gold);
  display: block;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.racer-garage-heading span,
.racer-garage-empty span,
.racer-garage-heading small {
  color: #dbe4ef;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.racer-garage-heading small {
  color: var(--muted);
  white-space: nowrap;
}

.racer-garage-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-top: 10px;
}

.racer-garage-card {
  min-width: 0;
}

.racer-garage-card button {
  background: rgba(244, 234, 216, 0.95);
  border: 1px solid rgba(244, 234, 216, 0.22);
  border-radius: 8px;
  color: #08111f;
  cursor: pointer;
  display: grid;
  gap: 8px;
  padding: 8px;
  text-align: left;
  width: 100%;
}

.racer-garage-card button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.racer-garage-card.is-selected button {
  border-color: var(--outlaw-gold);
  box-shadow: 0 0 0 2px rgba(242, 165, 26, 0.3);
}

.racer-garage-image {
  align-items: center;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(231, 21, 43, 0.28), rgba(5, 7, 10, 0.92)),
    var(--outlaw-carbon);
  border-radius: 6px;
  color: #cbd5e1;
  display: flex;
  font-size: 16px;
  font-style: italic;
  font-weight: 900;
  justify-content: center;
  overflow: hidden;
  text-transform: uppercase;
  text-shadow: 2px 3px 0 rgba(0, 0, 0, 0.42);
}

.racer-garage-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.racer-garage-card-body {
  display: grid;
  gap: 2px;
}

.racer-garage-card-body strong {
  color: #08111f;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
}

.racer-garage-card-body span {
  color: #536277;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.racer-profile-image {
  align-items: center;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(231, 21, 43, 0.24), rgba(2, 6, 12, 0.92)),
    var(--outlaw-carbon);
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 8px;
  color: #cbd5e1;
  display: flex;
  font-size: clamp(18px, 2vw, 28px);
  font-style: italic;
  font-weight: 900;
  justify-content: center;
  overflow: hidden;
  text-transform: uppercase;
  text-shadow: 2px 3px 0 rgba(0, 0, 0, 0.45);
}

.racer-profile-image.has-image {
  background: #090b0f;
}

.racer-profile-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.racer-profile-summary {
  align-content: center;
  display: grid;
  gap: 8px;
}

.racer-profile-summary > span {
  color: var(--outlaw-gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.racer-profile-summary strong {
  color: #fff;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1;
}

.racer-profile-summary small {
  color: #dbe4ef;
  font-size: 15px;
  line-height: 1.35;
}

.profile-save-confirmation {
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.42);
  border-radius: 8px;
  color: #d9ffe8;
  font-size: 15px;
  font-weight: 900;
  padding: 10px 12px;
}

.profile-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-stat-strip b {
  background: #05070a;
  border: 1px solid rgba(244, 234, 216, 0.14);
  border-radius: 999px;
  color: var(--outlaw-gold);
  font-size: 13px;
  padding: 5px 10px;
}

.shootout-grid {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-top: 12px;
}

.shootout-grid .primary-btn,
.shootout-grid .ghost-btn {
  min-height: 44px;
}

.shootout-grid #generateShootoutBtn,
.shootout-grid #generateQualifierBtn {
  grid-column: span 2;
}

.challenge-picker-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  margin-top: 12px;
}

.challenge-picker-card {
  background: #fdf8ee;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--dark);
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 16px;
  text-align: left;
}

.challenge-picker-card:hover,
.challenge-picker-card.is-active {
  border-color: var(--red);
  box-shadow: inset 5px 0 0 var(--red), 0 10px 22px rgba(0, 0, 0, 0.08);
}

.challenge-picker-card strong {
  font-size: 20px;
}

.challenge-picker-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.shootout-panel,
.qualifier-panel {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.shootout-panel .panel-heading,
.qualifier-panel .panel-heading {
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.standings-panel,
.roster-panel,
.leaderboard-panel,
.season-panel,
.log-panel,
.chat-panel,
.readiness-panel,
.mvp-checklist-panel,
.playtest-panel,
.history-panel,
.event-recap-panel,
.racer-waiting-panel {
  padding: 14px;
}

.readiness-panel {
  margin-bottom: 0;
  padding: 12px;
}

.race-checklist {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 10px;
}

.checklist-item {
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 3px 0 var(--muted);
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 8px 9px;
}

.checklist-item.is-ready {
  box-shadow: inset 0 3px 0 var(--green);
}

.checklist-item.is-waiting {
  box-shadow: inset 0 3px 0 var(--gold);
}

.checklist-item.is-blocked {
  box-shadow: inset 0 3px 0 var(--red);
}

.checklist-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.checklist-item strong {
  font-size: 15px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checklist-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-guide {
  align-items: start;
  background: #0b0d10;
  border: 1px solid rgba(244, 234, 216, 0.18);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  color: var(--bone);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(280px, 1.2fr) minmax(260px, 1fr);
  margin-top: 10px;
  padding: 10px 12px;
}

.mode-guide:empty {
  display: none;
}

.mode-guide span {
  color: var(--gold);
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mode-guide strong {
  display: block;
  font-size: 18px;
  margin-top: 3px;
}

.mode-guide p {
  color: #e9dcc8;
  line-height: 1.35;
  margin-top: 6px;
}

.mode-guide ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.mode-guide li {
  color: #e9dcc8;
  font-size: 13px;
  font-weight: 700;
}

.workflow-note {
  background: rgba(7, 8, 10, 0.08);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  margin: 12px 0;
  padding: 10px 12px;
}

.rules-modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.68);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 100;
}

.broadcast-confirm-modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 120;
}

.race-checklist-modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.68);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 100;
}

.rules-modal.is-visible {
  display: flex;
}

.broadcast-confirm-modal.is-visible {
  display: flex;
}

.race-checklist-modal.is-visible {
  display: flex;
}

.rules-modal-card {
  background: var(--outlaw-bone);
  border: 1px solid rgba(244, 234, 216, 0.3);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  max-width: 680px;
  padding: 18px;
  width: min(100%, 680px);
}

.race-checklist-card {
  background: var(--outlaw-bone);
  border: 1px solid rgba(244, 234, 216, 0.3);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  max-width: 780px;
  padding: 18px;
  width: min(100%, 780px);
}

.broadcast-confirm-card {
  background: var(--outlaw-bone);
  border: 1px solid rgba(244, 234, 216, 0.32);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  max-height: min(86vh, 900px);
  max-width: 920px;
  overflow: auto;
  padding: 18px;
  width: min(100%, 920px);
}

.broadcast-confirm-body {
  margin-top: 14px;
}

.broadcast-confirm-body .pending-review {
  margin: 0;
}

.broadcast-confirm-body .pending-action-row {
  display: none;
}

.broadcast-confirm-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.rules-modal-card h2 {
  margin: 0;
}

.race-checklist-card h2 {
  margin: 0;
}

.preflight-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.preflight-item {
  background: #fffaf1;
  border: 1px solid rgba(186, 164, 132, 0.7);
  border-left: 6px solid #8d9aa8;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.preflight-item strong {
  color: var(--ink);
  font-size: 16px;
}

.preflight-item span {
  color: #394858;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.preflight-item.is-ok {
  border-left-color: #168f61;
}

.preflight-item.is-warn {
  border-left-color: var(--outlaw-gold);
}

.preflight-item.is-blocked {
  border-left-color: var(--outlaw-red);
}

.rules-modal-card ul {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 22px;
}

.rules-modal-card li {
  color: #263340;
  line-height: 1.4;
}

.rules-tier-box {
  background: rgba(7, 8, 10, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
  padding: 14px;
}

.rules-tier-box h3 {
  color: var(--ink);
  font-size: 18px;
  margin: 0 0 6px;
}

.rules-tier-box p {
  color: #394858;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px;
}

.rules-tier-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(88px, 1fr));
}

.rules-tier-grid span {
  background: #fffaf1;
  border: 1px solid rgba(186, 164, 132, 0.7);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 2px;
  padding: 8px 10px;
}

.rules-tier-grid strong {
  color: var(--red);
  font-size: 14px;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .rules-tier-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.rules-reference {
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 0.35fr) minmax(420px, 1fr);
  margin-top: 10px;
  padding: 10px 12px;
}

.rules-reference span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.rules-reference strong {
  color: var(--dark);
}

.rules-reference > div > strong {
  display: block;
  font-size: 18px;
  margin-top: 3px;
}

.rules-reference ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.rules-reference li {
  color: #394858;
  font-size: 13px;
  line-height: 1.3;
}

.panel-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.panel-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.muted-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.muted-note.is-save-confirmation {
  background: rgba(22, 143, 97, 0.16);
  border: 1px solid rgba(22, 143, 97, 0.35);
  border-radius: 999px;
  color: #9cf0c4;
  padding: 6px 10px;
}

.compact-select {
  font-size: 20px;
  min-height: 50px;
  max-width: 260px;
  padding: 0 18px;
}

.team-standings {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.team-card {
  align-items: center;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 10px;
}

.team-standing-rank {
  align-items: center;
  background: var(--outlaw-black);
  border-radius: 8px;
  color: var(--gold);
  display: flex;
  flex: 0 0 46px;
  font-weight: 900;
  height: 44px;
  justify-content: center;
}

.team-card span,
.history-row span,
.history-row small,
.ranked-roster td span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.team-logo {
  align-items: center;
  background: var(--dark);
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  color: #fff;
  display: flex;
  flex: 0 0 44px;
  font-weight: 800;
  height: 44px;
  justify-content: center;
}

.team-logo.has-image {
  color: transparent;
}

.ranked-roster {
  margin-top: 18px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.ranked-roster table {
  border-collapse: collapse;
  min-width: 1120px;
  table-layout: fixed;
  width: 100%;
}

.ranked-roster th,
.ranked-roster td {
  border-bottom: 1px solid var(--line);
  padding: 16px 12px;
  text-align: left;
}

.ranked-roster th {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ranked-roster td {
  font-size: 20px;
}

.ranked-roster td:first-child {
  font-size: 21px;
  width: 90px;
}

.ranked-roster th:nth-child(1),
.ranked-roster td:nth-child(1) {
  width: 80px;
}

.ranked-roster th:nth-child(2),
.ranked-roster td:nth-child(2) {
  width: 260px;
}

.ranked-roster th:nth-child(3),
.ranked-roster td:nth-child(3) {
  width: 190px;
}

.ranked-roster th:nth-child(4),
.ranked-roster td:nth-child(4) {
  width: 160px;
}

.ranked-roster th:nth-child(5),
.ranked-roster td:nth-child(5),
.ranked-roster th:nth-child(6),
.ranked-roster td:nth-child(6) {
  width: 110px;
}

.ranked-roster th:nth-child(7),
.ranked-roster td:nth-child(7) {
  width: 210px;
}

.ranked-roster td:nth-child(3),
.ranked-roster td:nth-child(4),
.ranked-roster td:nth-child(5),
.ranked-roster td:nth-child(6) {
  white-space: nowrap;
}

.ranked-roster td strong {
  display: block;
  font-size: 22px;
  line-height: 1.12;
}

.ranked-roster td span {
  font-size: 15px;
  line-height: 1.2;
}

.roster-panel .panel-heading h2 {
  font-size: 24px;
}

.leaderboard-panel {
  grid-column: 1 / -1;
}

.leaderboard-table table {
  min-width: 960px;
}

.season-panel {
  grid-column: 1 / -1;
}

.season-overview {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.season-admin {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 1.4fr) minmax(130px, 0.8fr) minmax(110px, 0.55fr) minmax(120px, 0.65fr) minmax(260px, 1fr);
  margin-top: 12px;
}

.season-admin-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.season-admin-actions .primary-btn,
.season-admin-actions .ghost-btn {
  min-height: 54px;
  white-space: normal;
  line-height: 1.1;
  padding-inline: 12px;
}

.season-team-selector {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  padding: 12px;
}

.season-team-selector-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 8px;
}

.season-team-option {
  align-items: center;
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 10px;
}

.season-team-option input {
  height: 18px;
  width: 18px;
}

.season-team-option span,
.season-team-option small {
  display: block;
}

.season-team-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}

.season-stat-grid,
.season-bracket-grid {
  display: grid;
  gap: 10px;
}

.season-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.season-bracket-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.season-stat,
.season-team-summary,
.season-cutline,
.season-bracket {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.season-stat span,
.season-team-summary span,
.season-cutline span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.season-stat strong,
.season-team-summary strong,
.season-cutline strong {
  display: block;
  font-size: 20px;
  margin-top: 4px;
}

.season-team-summary strong {
  font-size: 16px;
}

.season-cutline {
  border-left: 5px solid var(--gold);
}

.season-cutline p {
  color: var(--muted);
  margin-top: 4px;
}

.season-bracket ol {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 22px;
}

.season-bracket li {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.season-bracket li::marker {
  color: var(--gold);
  font-weight: 900;
}

.season-bracket strong,
.season-bracket span {
  display: block;
}

.season-bracket span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.season-history {
  margin-top: 14px;
}

.season-history-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.season-history-card {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.season-history-card summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, auto);
}

.season-history-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-top: 2px;
}

.season-history-card small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}

.season-history-detail {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  margin-top: 12px;
  padding-top: 12px;
}

.season-history-detail h4 {
  font-size: 13px;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.season-history-detail ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.season-history-detail li strong,
.season-history-detail li span {
  display: block;
}

.badge-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.badge-strip small {
  background: #111820;
  border-radius: 999px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
  text-transform: uppercase;
}

.history-panel {
  grid-column: 1 / -1;
}

.chat-panel {
  grid-column: 1 / -1;
}

.race-chat-panel {
  margin-top: 16px;
  padding: 16px;
}

.race-chat-panel .chat-messages {
  min-height: 120px;
  max-height: 220px;
}

.playtest-panel,
.admin-data-panel {
  grid-column: 1 / -1;
}

.admin-data-panel {
  padding: 16px;
}

.admin-data-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  margin-top: 12px;
}

.admin-tool-card {
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.admin-tool-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-tool-card strong {
  color: var(--dark);
  font-size: 14px;
  line-height: 1.25;
  min-height: 36px;
}

.admin-tool-card button {
  justify-self: start;
  min-width: 150px;
}

.admin-tool-card input {
  display: none;
}

.admin-tool-danger {
  background: var(--outlaw-bone);
  border-color: rgba(233, 26, 47, 0.34);
}

.mvp-checklist-panel {
  grid-column: 1 / -1;
}

.chat-messages {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 260px;
  overflow: auto;
}

.chat-message {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.chat-message strong,
.chat-message span {
  display: block;
}

.chat-message span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.chat-form {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.5fr) auto;
  margin-top: 12px;
}

.playtest-form {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(160px, 0.9fr) minmax(150px, 0.6fr) minmax(300px, 1.5fr) auto;
  margin-top: 12px;
}

.mvp-checklist {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.mvp-checklist-row {
  align-items: center;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 0.25fr);
  padding: 10px;
}

.mvp-checklist-row.is-passed {
  border-left-color: var(--green);
}

.mvp-checklist-row.needs-work {
  border-left-color: var(--red);
}

.mvp-checklist-row strong,
.mvp-checklist-row span {
  display: block;
}

.mvp-checklist-row span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

textarea {
  border: 1px solid #c9d3dc;
  border-radius: 8px;
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  resize: vertical;
}

.playtest-notes {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.playtest-note {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.playtest-note span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.playtest-note strong,
.playtest-note p {
  display: block;
  margin: 0;
}

.chat-identity {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}

.stream-view-btn {
  align-self: end;
  min-height: 46px;
  white-space: nowrap;
}

.broadcast-rules-btn {
  align-self: end;
  min-height: 46px;
  white-space: nowrap;
}

.stats-view-btn {
  align-self: end;
  min-height: 46px;
  white-space: nowrap;
}

.broadcast-next-race-btn {
  align-self: end;
  min-height: 46px;
  min-width: 132px;
  white-space: nowrap;
}

.broadcast-sim-btn,
.broadcast-camera-btn {
  align-self: end;
  min-height: 46px;
  white-space: nowrap;
}

body.view-stream .stream-view-btn {
  background: linear-gradient(180deg, #4fa7ff, var(--outlaw-blue));
  border-color: rgba(45, 125, 210, 0.75);
  color: #fff;
}

body.view-stream .broadcast-sim-btn,
body.view-stream .broadcast-camera-btn {
  background: rgba(244, 234, 216, 0.1);
  border-color: rgba(244, 234, 216, 0.32);
  color: var(--bone);
}

body.view-stream .broadcast-sim-btn.is-active,
body.view-stream .broadcast-camera-btn.is-active {
  background: linear-gradient(180deg, #4fa7ff, var(--outlaw-blue));
  border-color: rgba(45, 125, 210, 0.75);
  color: #fff;
}

body.view-stream .broadcast-next-race-btn {
  background: linear-gradient(180deg, #f2cf7d, var(--outlaw-gold));
  border-color: rgba(247, 176, 35, 0.72);
  color: #08090c;
}

body.view-stream.broadcast-control-view .top-actions .stream-view-btn,
body.view-stream.broadcast-control-view .top-actions .broadcast-next-race-btn,
body.view-stream.broadcast-control-view .top-actions .broadcast-sim-btn,
body.view-stream.broadcast-control-view .top-actions .broadcast-camera-btn,
body.view-stream.broadcast-control-view .top-actions .stats-view-btn,
body.view-stream.broadcast-control-view .top-actions .broadcast-rules-btn {
  display: none !important;
}

.broadcast-admin-bar {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(7, 8, 10, 0.96), rgba(10, 13, 18, 0.9)),
    radial-gradient(circle at 22% 0%, rgba(233, 26, 47, 0.22), transparent 36%),
    radial-gradient(circle at 92% 8%, rgba(45, 125, 210, 0.16), transparent 42%);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(244, 234, 216, 0.08);
  color: var(--bone);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: min(1680px, calc(100vw - 36px));
  padding: 12px 16px;
  width: 100%;
}

.broadcast-admin-bar-copy {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.broadcast-admin-bar-copy span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.broadcast-admin-bar-copy strong {
  color: var(--bone);
  font-size: 20px;
  line-height: 1.05;
}

.broadcast-admin-actions {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.broadcast-admin-actions .small {
  min-height: 40px;
  padding: 9px 13px;
}

.broadcast-bar-load-btn {
  background: linear-gradient(180deg, #f2cf7d, var(--outlaw-gold));
  border-color: rgba(247, 176, 35, 0.72);
  color: #08090c;
}

.broadcast-bar-confirm-btn {
  background: linear-gradient(180deg, #4fa7ff, var(--outlaw-blue));
  border-color: rgba(45, 125, 210, 0.75);
  color: #fff;
}

.broadcast-admin-actions .is-active {
  background: linear-gradient(180deg, #4fa7ff, var(--outlaw-blue));
  border-color: rgba(45, 125, 210, 0.75);
  color: #fff;
}

body.view-stream.broadcast-watch-view .broadcast-display-controls,
body.view-stream.broadcast-watch-view .broadcast-next-race-btn,
body.view-stream.broadcast-watch-view .broadcast-sim-btn,
body.view-stream.broadcast-watch-view .broadcast-camera-btn,
body.view-stream.broadcast-watch-view .live-video-placeholder-actions {
  display: none !important;
}

body.view-stream.public-stream-view .dice-board,
body.view-stream.public-stream-view .condition-strip,
body.view-stream.public-stream-view .race-access-note,
body.view-stream.public-stream-view .result-banner,
body.view-stream.public-stream-view .launch-actions {
  display: none !important;
}

body.view-manager .director-tab[data-director-tab="race"],
body.view-manager .dashboard-action[data-dashboard-tab="race"] {
  display: none !important;
}

body.view-stream .broadcast-rules-btn {
  background: var(--outlaw-bone);
  border-color: rgba(244, 234, 216, 0.72);
  color: var(--ink);
}

body.view-stream .stats-view-btn {
  background: rgba(244, 234, 216, 0.1);
  border-color: rgba(244, 234, 216, 0.32);
  color: var(--bone);
}

body.view-stream.view-stats .stats-view-btn {
  background: var(--outlaw-gold);
  border-color: rgba(242, 165, 26, 0.78);
  color: #050607;
}

.chat-identity span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.chat-identity strong {
  display: block;
  margin-top: 2px;
}

.race-history {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  margin-top: 12px;
}

.event-recap-panel {
  grid-column: 1 / -1;
}

.event-recap-box,
.completed-event-recaps {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.event-recap-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.event-recap-summary > div,
.completed-event-card,
.event-recap-results > div,
.event-recognition-list,
.event-recognition-list > div,
.event-incident-list,
.completed-event-notes {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.event-recap-summary span,
.event-recap-results span,
.event-recognition-list span,
.completed-event-card small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.completed-event-card summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
}

.completed-event-card summary::-webkit-details-marker {
  display: none;
}

.completed-event-card summary::after {
  color: var(--red);
  content: "+";
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.completed-event-card[open] summary::after {
  content: "-";
}

.completed-event-detail {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.event-incident-list,
.event-recognition-list,
.completed-event-notes {
  display: grid;
  gap: 8px;
}

.event-incident-list h3,
.event-recognition-list h3,
.completed-event-notes h3 {
  font-size: 14px;
  margin: 0;
  text-transform: uppercase;
}

.event-incident-list div {
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.event-recognition-list {
  grid-column: 1 / -1;
}

.event-recognition-list > div {
  background: #fff7e8;
  border-left: 5px solid var(--gold);
}

.completed-event-notes p {
  color: var(--muted);
  margin: 0;
}

.event-recap-summary strong {
  display: block;
  font-size: 18px;
  margin-top: 3px;
}

.event-recap-results {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.event-notes-grid {
  margin-top: 12px;
}

#eventRecapNotes {
  min-height: 88px;
  resize: vertical;
}

.free-agent-queue {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 12px;
}

.qualifier-panel .free-agent-queue {
  align-items: start;
  max-height: 680px;
  overflow: auto;
  padding-right: 6px;
}

.queue-section-label {
  align-self: stretch;
  background: rgba(7, 8, 10, 0.92);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  grid-column: 1 / -1;
  padding: 10px 12px;
  text-transform: uppercase;
}

.compact-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.free-agent-card {
  appearance: none;
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 12px;
}

.presence-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  padding: 6px 8px;
  text-transform: uppercase;
}

.processing-overlay {
  align-items: center;
  background: rgba(8, 9, 11, 0.72);
  bottom: 0;
  display: none;
  justify-content: center;
  left: 0;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1000;
}

.processing-overlay.is-visible {
  display: flex;
}

.processing-card {
  align-items: center;
  background: #fbf6ed;
  border: 1px solid var(--line);
  border-left: 6px solid var(--red);
  border-radius: 8px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
  color: var(--dark);
  display: grid;
  gap: 16px;
  grid-template-columns: 54px minmax(220px, 1fr);
  max-width: 460px;
  padding: 18px;
  width: min(460px, 100%);
}

.processing-spinner {
  animation: processing-spin 850ms linear infinite;
  border: 5px solid #eadfce;
  border-top-color: var(--red);
  border-radius: 50%;
  height: 44px;
  width: 44px;
}

.processing-card span {
  color: var(--gold);
  display: block;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.processing-card strong {
  display: block;
  font-size: 22px;
  margin-top: 3px;
}

.processing-card p {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 5px;
}

@keyframes processing-spin {
  to {
    transform: rotate(360deg);
  }
}

.status-online {
  background: #d9f2e5;
  color: #10623b;
}

.status-offline {
  background: #f1d8d8;
  color: #8f1620;
}

.status-invited {
  background: #fff0bd;
  color: #694400;
}

.preference-badge {
  align-self: start;
  background: rgba(22, 143, 97, 0.16);
  border: 1px solid rgba(22, 143, 97, 0.35);
  border-radius: 999px;
  color: #10623f;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  padding: 4px 8px;
  text-transform: uppercase;
}

.preference-badge.is-open-pool {
  background: #e8edf3;
  border-color: #ccd7e3;
  color: #4d6174;
}

.preference-badge.is-field-pick {
  background: #ffedb7;
  border-color: #e8c669;
  color: #5e4a0d;
}

.status-ready {
  background: #dff9ef;
  color: #075c36;
}

.waiting-room-box {
  margin-top: 12px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.waiting-room-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.28)),
    #f6f8fa;
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
}

.waiting-room-card-ready {
  border-left-color: var(--green);
}

.waiting-room-card-online {
  border-left-color: var(--outlaw-blue);
}

.waiting-room-card-invited {
  border-left-color: var(--gold);
}

.waiting-room-card-offline {
  border-left-color: var(--outlaw-red-dark);
}

.waiting-room-header {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.waiting-room-header strong,
.waiting-room-header span,
.waiting-room-card > p {
  overflow-wrap: anywhere;
}

.waiting-room-card .presence-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.waiting-room-card > p {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.waiting-room-detail-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}

.waiting-room-detail-grid span,
.waiting-room-action {
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
}

.waiting-room-detail-grid small,
.waiting-room-action span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.waiting-room-detail-grid strong,
.waiting-room-action strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.waiting-room-card small,
.waiting-room-card span {
  color: var(--muted);
  margin: 0;
}

.selectable-card {
  cursor: pointer;
}

.selectable-card:hover {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 151, 62, 0.18);
}

.selectable-card.is-selected {
  background: #fff7e6;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 151, 62, 0.25);
}

.selectable-card.is-disabled,
.selectable-card:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.free-agent-thumb {
  aspect-ratio: 16 / 9;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(7, 8, 10, 0.88), rgba(42, 26, 20, 0.72)),
    var(--outlaw-black);
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  color: var(--outlaw-cream);
  display: flex;
  font-weight: 900;
  justify-content: center;
  margin-bottom: 10px;
  overflow: hidden;
  text-align: center;
  text-transform: uppercase;
}

.free-agent-thumb.has-image {
  display: block;
}

.free-agent-thumb-fallback {
  border: 1px solid rgba(242, 165, 26, 0.35);
  box-shadow: inset 0 -28px 60px rgba(233, 26, 47, 0.12);
}

.free-agent-thumb span {
  color: var(--outlaw-cream);
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.62);
}

.free-agent-card strong,
.free-agent-card span,
.free-agent-card small {
  display: block;
}

.free-agent-card span {
  color: var(--muted);
  margin-top: 4px;
}

.free-agent-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.free-agent-card .status-pill {
  display: inline-flex;
  margin-top: 0;
}

.qualifier-standings-block {
  margin-top: 18px;
}

.qualifier-standings-block h3 {
  font-size: 18px;
  margin: 0;
}

.history-row,
.empty-state {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.empty-state {
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

.prototype-hidden,
.notice-band,
.role-summary {
  display: none !important;
}

body.view-league .user-dashboard,
body.view-manager .user-dashboard,
body.view-racer .user-dashboard {
  display: grid;
}

body.view-league .user-dashboard {
  display: grid;
}

.records-leaderboard-panel,
.records-roster-panel,
.records-season-panel,
.leaderboard-panel,
.roster-panel,
.season-panel {
  background: var(--panel);
  color: var(--ink);
}

.records-leaderboard-panel .panel-heading,
.records-roster-panel .panel-heading,
.records-season-panel .panel-heading,
.leaderboard-panel .panel-heading,
.roster-panel .panel-heading,
.season-panel .panel-heading {
  color: var(--ink);
}

.ranked-roster {
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ranked-roster table {
  background: #fffaf1;
}

.ranked-roster th {
  background: #f3e7d6;
}

.ranked-roster td,
.ranked-roster td strong {
  color: var(--ink);
}

.ranked-roster td span,
.leaderboard-table td span {
  color: #596879;
}

.season-panel .season-admin,
.season-team-selector,
.season-stat,
.season-team-summary,
.season-cutline,
.season-bracket,
.season-history-card {
  background: #fffaf1;
}

body.view-stream .app-shell {
  gap: 18px;
  padding: 18px;
}

body.view-stream .topbar {
  background:
    radial-gradient(circle at 50% 0%, rgba(233, 26, 47, 0.28), transparent 32%),
    linear-gradient(90deg, rgba(19, 7, 10, 0.94), rgba(9, 15, 24, 0.94)),
    var(--outlaw-black);
  grid-template-columns: 1fr minmax(320px, 540px) 1fr;
  margin-bottom: 0;
  max-width: 1680px;
  min-height: 170px;
  padding: 18px 22px;
}

body.view-stream .broadcast-league-badge {
  display: flex;
}

body.view-stream .topbar .eyebrow::after {
  color: var(--gold);
  content: " / Broadcast View";
}

body.view-stream .race-grid {
  background:
    linear-gradient(90deg, rgba(233, 26, 47, 0.18), transparent 34%, transparent 66%, rgba(45, 125, 210, 0.18)),
    rgba(5, 7, 10, 0.72);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 10px;
  box-shadow:
    0 22px 46px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  grid-template-columns: minmax(210px, 0.62fr) minmax(0, 2.25fr) minmax(210px, 0.62fr);
  max-width: min(1680px, calc(100vw - 36px));
  padding: 12px;
  width: 100%;
}

body.view-stream .lane-panel,
body.view-stream .center-panel {
  min-height: 520px;
}

body.view-stream .car-photo {
  aspect-ratio: 16 / 9;
  border-color: rgba(244, 234, 216, 0.22);
}

body.view-stream .fallback-logo {
  font-size: 46px;
}

body.view-stream .car-copy h2 {
  font-size: 34px;
  line-height: 1;
}

body.view-stream .car-copy p:not(.lane-name) {
  font-size: 18px;
}

body.view-stream .stat-pill strong,
body.view-stream .lane-data strong {
  font-size: 34px;
}

body.view-stream .lane-team-brand {
  align-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(244, 234, 216, 0.1), transparent 62%),
    rgba(7, 8, 10, 0.24);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: 1px solid rgba(244, 234, 216, 0.1);
  border-radius: 8px;
  color: var(--bone);
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
  min-height: 132px;
  padding: 16px;
  text-align: center;
}

body.view-stream .lane-team-brand.has-image {
  background-color: rgba(244, 234, 216, 0.06);
  box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.18);
}

body.view-stream .lane-team-brand strong {
  color: var(--gold);
  font-size: clamp(28px, 4vw, 54px);
  font-style: italic;
  line-height: 0.95;
  text-shadow: 5px 5px 0 #000;
  text-transform: uppercase;
}

body.view-stream .lane-team-brand span {
  color: #c8d2df;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

body.view-stream .lane-team-brand.is-free-agent {
  background:
    linear-gradient(135deg, rgba(7, 8, 10, 0.56), rgba(65, 16, 20, 0.34)),
    rgba(7, 8, 10, 0.3);
}

body.view-stream .drag-strip {
  height: 300px;
}

body.view-stream .live-video-card {
  min-height: 300px;
}

body.view-stream .broadcast-display-controls {
  grid-template-columns: minmax(180px, 1fr) auto minmax(240px, 1.2fr);
}

body.view-stream .drag-strip::before {
  top: 112px;
}

body.view-stream .drag-strip::after {
  top: 188px;
}

body.view-stream .red-marker {
  top: 82px;
}

body.view-stream .blue-marker {
  top: 202px;
}

body.view-stream .car-marker {
  height: 42px;
  width: 72px;
}

body.view-stream .die {
  font-size: 48px;
  height: 86px;
  width: 86px;
}

body.view-stream .turn-box strong {
  font-size: 32px;
}

body.view-stream .result-banner {
  font-size: 34px;
  padding: 20px;
}

body.view-stream .condition-card strong {
  font-size: 26px;
}

body.view-stream .race-access-note {
  background: rgba(7, 8, 10, 0.52);
  border-color: rgba(244, 234, 216, 0.16);
  color: #dbe5ef;
}

body.view-stream .race-access-lane {
  background: rgba(244, 234, 216, 0.08);
  border-color: rgba(244, 234, 216, 0.14);
}

body.view-stream .race-access-lane strong {
  color: #fff;
  font-size: 16px;
}

body.view-stream .race-access-lane span,
body.view-stream .race-access-lane b,
body.view-stream .race-access-lane em {
  color: #ccd6e2;
  font-size: 14px;
}

body.view-stream .race-access-lane.is-yours {
  border-color: rgba(242, 165, 26, 0.78);
  box-shadow:
    0 0 0 2px rgba(242, 165, 26, 0.18),
    inset 0 0 0 1px rgba(242, 165, 26, 0.24);
}

body.view-stream .race-access-lane.is-yours strong {
  color: #fff3dd;
}

body.view-stream .race-access-lane.is-ready b {
  color: #78f0b4;
}

body.view-stream .race-access-lane.is-waiting b {
  color: var(--outlaw-gold);
}

body.view-stream .race-access-lane.is-blocked b {
  color: #ff7d8d;
}

body.view-stream .roll-btn,
body.view-stream .launch-actions {
  display: none;
}

body.view-stream.broadcast-control-view .roll-btn {
  display: inline-flex;
}

body.view-stream.broadcast-control-view .launch-actions {
  display: grid;
}

body.view-stream.broadcast-control-view .race-mode-badge {
  order: 1;
}

body.view-stream.broadcast-control-view .launch-actions {
  background: rgba(7, 8, 10, 0.62);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  order: 2;
  padding: 10px;
}

body.view-stream.broadcast-control-view .launch-actions .primary-btn {
  min-height: 58px;
}

body.view-stream.broadcast-control-view .track-card,
body.view-stream.broadcast-control-view .live-video-card {
  order: 3;
}

body.view-stream.broadcast-control-view .dice-board {
  order: 4;
}

body.view-stream.broadcast-control-view .condition-strip {
  order: 5;
}

body.view-stream.broadcast-control-view .race-access-note {
  order: 6;
}

body.view-stream.broadcast-control-view .result-banner {
  order: 7;
}

body.view-stream.broadcast-control-view .broadcast-display-controls {
  order: 8;
}

body.view-stream .control-band,
body.view-stream .user-dashboard,
body.view-stream .platform-league-panel,
body.view-stream .role-summary,
body.view-stream .director-tabs,
body.view-stream .admin-command-grid,
body.view-stream .readiness-panel,
body.view-stream .log-panel,
body.view-stream .records-subtabs,
body.view-stream .login-control,
body.view-stream .backend-control,
body.view-stream .prototype-tools,
body.view-stream .site-footer {
  display: none !important;
}

body.view-stream .lower-grid {
  grid-template-columns: minmax(520px, 1.1fr) minmax(420px, 0.9fr);
  max-width: 1680px;
}

body.view-stream .race-chat-panel {
  grid-column: 1 / -1;
}

body.view-stream .records-leaderboard-panel,
body.view-stream .records-teams-panel,
body.view-stream .records-roster-panel {
  display: grid !important;
}

body.view-stream .records-season-panel,
body.view-stream .records-tools-panel {
  display: none !important;
}

body.view-stream .roster-panel {
  width: 100%;
}

body.view-stream .standings-panel,
body.view-stream .roster-panel {
  min-height: 220px;
}

body.view-stream .leaderboard-panel,
body.view-stream .standings-panel,
body.view-stream .roster-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 36%),
    rgba(10, 14, 20, 0.9);
  color: var(--bone);
}

body.view-stream .leaderboard-panel .panel-heading,
body.view-stream .standings-panel .panel-heading,
body.view-stream .roster-panel .panel-heading {
  color: #fff;
}

body.view-stream .leaderboard-panel .panel-heading h2,
body.view-stream .standings-panel .panel-heading h2,
body.view-stream .roster-panel .panel-heading h2 {
  color: #fff;
}

body.view-stream .stream-record-controls {
  align-items: end;
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

body.view-stream .stream-record-controls .muted-note,
body.view-stream .leaderboard-panel .muted-note,
body.view-stream .standings-panel .muted-note,
body.view-stream .roster-panel .muted-note {
  color: #dbe5ef;
}

body.view-stream .stream-hidden {
  display: none !important;
}

body.view-stream .leaderboard-table,
body.view-stream .ranked-roster table {
  background: rgba(7, 8, 10, 0.42);
}

body.view-stream .leaderboard-table th,
body.view-stream .ranked-roster th {
  background: rgba(244, 234, 216, 0.08);
  color: #f4ead8;
}

body.view-stream .leaderboard-table td,
body.view-stream .leaderboard-table td strong,
body.view-stream .ranked-roster td,
body.view-stream .ranked-roster td strong {
  color: #fff;
}

body.view-stream .leaderboard-table td span,
body.view-stream .ranked-roster td span {
  color: #c6d0dc;
}

body.view-stream .team-card {
  background: #fffaf1;
  color: var(--ink);
}

body.view-stream .team-card strong {
  color: var(--ink);
}

body.view-stream .team-card span {
  color: #596879;
}

#raceLog {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  max-height: 330px;
  overflow: auto;
  padding-left: 24px;
}

#raceLog li {
  background: #f6f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #314252;
  padding: 10px;
}

@media (max-width: 1320px) {
  .control-band {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  body.mode-club .control-band {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .control-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .race-grid {
    grid-template-columns: minmax(220px, 0.85fr) minmax(500px, 1.35fr) minmax(220px, 0.85fr);
  }

  .queue-actions {
    grid-template-columns: minmax(200px, 1fr) minmax(180px, 0.8fr);
  }

  .director-flow-steps {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .queue-action-group:last-child {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .queue-action-group:last-child > span {
    grid-column: 1 / -1;
  }

  .queue-action-group #clearQueueBtn {
    grid-column: auto;
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .brand-lockup,
  .broadcast-league-badge,
  .top-actions {
    grid-column: 1;
  }

  .broadcast-league-badge {
    align-items: stretch;
    display: none;
  }

  body.view-stream .broadcast-league-badge {
    display: grid;
    grid-template-columns: 72px 1fr;
    justify-content: stretch;
  }

  body.view-stream .broadcast-league-logo {
    flex-basis: 72px;
    height: 58px;
  }

  body.view-stream .broadcast-league-copy strong {
    font-size: 17px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .broadcast-admin-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .broadcast-admin-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    justify-content: stretch;
  }

  .backend-control,
  .login-control,
  .prototype-tools,
  .stream-view-btn,
  .race-status {
    width: 100%;
  }

  body.has-auth-user .login-control {
    min-width: 0;
  }

  .auth-gate {
    grid-template-columns: 1fr;
    max-width: 720px;
  }

  .user-dashboard {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  body.view-manager .user-dashboard,
  body.view-racer .user-dashboard,
  body.view-league .user-dashboard {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .admin-command-grid,
  .race-grid,
  .lower-grid,
  body.view-league .lower-grid,
  body.view-manager .lower-grid,
  body.view-stream .lower-grid {
    grid-template-columns: 1fr;
  }

  .admin-command-grid {
    max-width: 980px;
  }

  .director-flow-panel {
    max-width: 980px;
  }

  .director-flow-header {
    align-items: stretch;
    flex-direction: column;
  }

  .director-flow-actions {
    justify-content: stretch;
  }

  .director-flow-actions button {
    flex: 1 1 160px;
  }

  .lane-panel {
    grid-template-columns: minmax(220px, 0.55fr) minmax(260px, 1fr);
  }

  .lane-panel .car-photo,
  .lane-panel .roll-btn {
    grid-row: span 4;
  }

  body.view-stream .topbar {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 14px;
  }

  body.view-stream .broadcast-league-badge {
    grid-column: 1;
    justify-content: center;
  }

  body.view-stream .brand-lockup {
    grid-column: 1;
  }

  body.view-stream .brand-logo {
    max-height: 138px;
  }

  body.view-stream .race-grid {
    grid-template-columns: 1fr;
    max-width: 980px;
    min-width: 0;
  }

  body.view-stream .center-panel {
    order: 1;
  }

  body.view-stream #leftPanel {
    order: 2;
  }

  body.view-stream #rightPanel {
    order: 3;
  }

  body.view-stream .lane-panel {
    grid-template-columns: minmax(180px, 0.5fr) minmax(0, 1fr);
  }

  body.view-stream .lane-team-brand {
    min-height: 96px;
  }

  body.view-stream .lane-panel,
  body.view-stream .center-panel {
    min-height: 0;
  }

  body.view-stream .drag-strip {
    height: 240px;
  }

  body.view-stream .drag-strip::before {
    top: 88px;
  }

  body.view-stream .drag-strip::after {
    top: 152px;
  }

  body.view-stream .red-marker {
    top: 62px;
  }

  body.view-stream .blue-marker {
    top: 166px;
  }

  body.view-stream .lower-grid {
    max-width: 980px;
    min-width: 0;
  }
}

@media (max-width: 1050px) {
  .race-grid,
  .lower-grid,
  .user-dashboard,
  .platform-overview-grid,
  .platform-league-grid,
  .platform-league-logo-editor,
  .garage-pool-editor,
  .garage-claim-panel,
  .racer-garage-heading,
  .racer-garage-empty,
  .control-band,
  .role-summary,
  .manager-flow,
  .manager-logo-editor,
  .roster-workspace,
  .roster-free-agent-grid,
  .candidate-board,
  .car-editor-grid,
  .stat-edit-row,
  .detail-actions,
  .event-grid,
  .event-status-strip,
  .event-actions,
  .admin-command-grid {
    grid-template-columns: 1fr;
  }

  .control-actions,
  .queue-action-group:last-child,
  .lane-panel {
    grid-template-columns: 1fr;
  }

  .lane-panel .car-photo,
  .lane-panel .roll-btn {
    grid-row: auto;
  }

  .center-panel {
    order: 1;
  }

  #leftPanel {
    order: 2;
  }

  #rightPanel {
    order: 3;
  }

  .race-chat-panel {
    order: 4;
  }

  .history-panel {
    grid-column: auto;
  }

  .event-recap-panel {
    grid-column: auto;
  }

  .chat-panel {
    grid-column: auto;
  }

  .playtest-panel {
    grid-column: auto;
  }

  .season-panel {
    grid-column: auto;
  }

  .admin-editor-panel {
    grid-column: auto;
  }

  .team-manager-panel {
    grid-column: auto;
  }

  .editor-grid,
  .car-editor-grid,
  .platform-overview-grid,
  .platform-league-logo-editor,
  .manager-flow,
  .racer-profile-overview,
  .racer-profile-grid,
  .shootout-grid,
  .roster-workspace,
  .candidate-board,
  .stat-edit-row,
  .detail-actions,
  .free-agent-queue,
  .queue-handoff,
  .race-checklist,
  .mode-guide,
  .rules-reference,
  .challenge-picker-grid,
  .event-recap-summary,
  .event-recap-results,
  .queue-actions,
  .queue-action-group,
  .season-admin,
  .season-admin-actions,
  .season-stat-grid,
  .season-bracket-grid,
  .season-history-detail,
  .chat-form,
  .pending-result-grid,
  .pending-action-row,
  .mvp-checklist-row,
  .admin-data-actions,
  .playtest-form {
    grid-template-columns: 1fr;
  }

  body.view-racer .racer-profile-grid,
  body.view-manager .user-dashboard,
  body.view-racer .user-dashboard,
  body.view-league .user-dashboard {
    grid-template-columns: 1fr;
  }

  .queue-row,
  .roster-management-row,
  .free-agent-mini-row {
    grid-template-columns: 1fr;
  }

  .queue-stage,
  .rank-chip {
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }

  .row-actions {
    justify-content: stretch;
  }

  .candidate-board {
    grid-column: auto;
  }

  .race-history {
    grid-template-columns: 1fr;
  }

  .race-chat-panel {
    margin-top: 0;
    order: 4;
  }

  .race-chat-panel .chat-messages {
    max-height: 260px;
  }

  .chat-identity {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    gap: 10px;
    padding: 10px;
  }

  .topbar,
  .top-actions,
  .broadcast-admin-actions,
  .user-dashboard,
  .platform-overview-grid,
  .platform-league-grid,
  .platform-league-logo-editor,
  .garage-pool-editor,
  .garage-claim-panel,
  .control-band,
  .role-summary,
  .role-summary-copy,
  .dice-board,
  .condition-strip,
  .broadcast-display-controls,
  .launch-actions,
  .audit-box,
  .control-actions {
    grid-template-columns: 1fr;
  }

  .director-flow-steps,
  .preflight-grid {
    grid-template-columns: 1fr;
  }

  .director-step {
    min-height: 0;
  }

  .racer-garage-heading,
  .racer-garage-empty {
    align-items: flex-start;
    flex-direction: column;
  }

  .director-tabs,
  .records-subtabs,
  .teams-subtabs {
    position: static;
  }

  .director-tab {
    min-width: 46%;
  }

  .event-panel,
  .queue-panel,
  .lane-panel,
  .center-panel,
  .racer-profile-panel,
  .team-manager-panel,
  .shootout-panel,
  .qualifier-panel,
  .leaderboard-panel,
  .roster-panel,
  .season-panel,
  .standings-panel {
    padding: 10px;
  }

  .role-summary-copy {
    display: grid;
    gap: 4px;
  }

  .role-permissions {
    justify-content: flex-start;
  }

  .audit-box {
    align-items: stretch;
    display: grid;
  }

  .audit-box span {
    text-align: left;
  }

  .topbar {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .brand-lockup,
  .top-actions {
    grid-column: 1;
  }

  .brand-lockup::before,
  .brand-lockup::after {
    display: none;
  }

  .brand-logo {
    max-height: 104px;
    max-width: 100%;
  }

  .top-actions {
    align-items: stretch;
    display: grid;
  }

  .broadcast-admin-bar {
    padding: 10px;
  }

  .backend-control {
    justify-content: space-between;
  }

  .login-control,
  .prototype-tools,
  .prototype-tools-grid {
    grid-template-columns: 1fr;
  }

  .login-control,
  body.has-auth-user .login-control {
    min-width: 0;
    width: 100%;
  }

  body.has-auth-user .login-control {
    grid-template-columns: 1fr;
  }

  body.has-auth-user .login-control span {
    grid-column: 1;
    min-width: 0;
  }

  .auth-gate-card {
    padding: 14px;
  }

  .auth-gate-card strong {
    font-size: 19px;
  }

  .auth-gate-card p {
    font-size: 13px;
  }

  .user-dashboard {
    grid-template-columns: 1fr;
  }

  body.view-manager .user-dashboard {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  body.view-manager .dashboard-identity {
    min-height: 0;
    padding: 14px;
  }

  body.view-manager .dashboard-team-logo {
    font-size: 36px;
    min-height: 110px;
  }

  body.view-manager .dashboard-identity > strong {
    font-size: 24px;
  }

  .dashboard-card {
    min-height: 78px;
    padding: 12px;
  }

  .dashboard-card strong {
    font-size: 18px;
  }

  .prototype-tools {
    width: 100%;
  }

  .site-footer {
    align-items: flex-start;
    display: grid;
  }

  .site-footer .footer-copyright {
    text-align: left;
    white-space: normal;
  }

  .control-band {
    display: grid;
  }

  .stat-row,
  .lane-data {
    grid-template-columns: 1fr;
  }

  body.view-stream .lane-team-brand {
    min-height: 84px;
  }

  .director-tab,
  .records-subtab {
    min-width: 132px;
  }

  .compact-select {
    font-size: 16px;
    max-width: 100%;
    min-height: 44px;
  }

  .race-grid {
    gap: 10px;
  }

  .race-chat-panel {
    border-radius: 8px;
    padding: 12px;
  }

  .race-chat-panel .panel-heading {
    align-items: flex-start;
    display: grid;
    gap: 4px;
  }

  .race-chat-panel .chat-messages {
    min-height: 180px;
    max-height: 38vh;
    overscroll-behavior: contain;
  }

  .chat-message {
    padding: 9px;
  }

  .chat-form {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .chat-form input {
    min-height: 48px;
  }

  .chat-form button {
    min-height: 48px;
    width: 100%;
  }

  .chat-identity {
    border-radius: 8px;
    min-height: 44px;
    padding: 8px 10px;
  }

  body.view-stream .app-shell {
    gap: 10px;
    padding: 10px;
  }

  body.view-stream .topbar {
    border-radius: 8px;
    padding: 12px;
  }

  body.view-stream .brand-logo {
    max-height: 112px;
  }

  body.view-stream .race-grid {
    border-radius: 8px;
    gap: 10px;
    padding: 8px;
  }

  body.view-stream .lane-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  body.view-stream .car-photo {
    max-height: 220px;
  }

  body.view-stream .fallback-logo {
    font-size: 28px;
  }

  body.view-stream .car-copy h2 {
    font-size: 24px;
  }

  body.view-stream .car-copy p:not(.lane-name) {
    font-size: 15px;
  }

  body.view-stream .stat-pill strong,
  body.view-stream .lane-data strong {
    font-size: 24px;
  }

  body.view-stream .race-mode-badge,
  body.view-stream .broadcast-display-controls,
  body.view-stream .track-card,
  body.view-stream .live-video-card {
    width: 100%;
  }

  body.view-stream .broadcast-display-controls {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  body.view-stream .broadcast-display-controls .muted-note {
    width: 100%;
  }

  body.view-stream .drag-strip {
    height: 190px;
    width: 100%;
  }

  body.view-stream .drag-strip::before {
    top: 68px;
  }

  body.view-stream .drag-strip::after {
    top: 120px;
  }

  body.view-stream .red-marker {
    top: 48px;
  }

  body.view-stream .blue-marker {
    top: 132px;
  }

  body.view-stream .car-marker {
    height: 32px;
    width: 54px;
  }

  body.view-stream .die {
    font-size: 34px;
    height: 62px;
    width: 62px;
  }

  body.view-stream .turn-box strong,
  body.view-stream .result-banner {
    font-size: 24px;
  }

  body.view-stream .condition-card strong {
    font-size: 20px;
  }
}

/* Live Video broadcast mode is optimized for StreamYard/YouTube capture:
   large camera feed, compact side cards, and no setup/chat clutter. */
body.view-stream.broadcast-live-video .app-shell {
  gap: 10px;
  padding: 10px;
}

body.view-stream.broadcast-live-video .topbar {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 360px) minmax(220px, 1fr);
  max-width: min(1920px, calc(100vw - 20px));
  min-height: 112px;
  padding: 10px 18px;
}

body.view-stream.broadcast-live-video .broadcast-league-logo {
  height: 66px;
  width: 66px;
}

body.view-stream.broadcast-live-video .broadcast-league-copy strong {
  font-size: 20px;
}

body.view-stream.broadcast-live-video .brand-logo {
  max-height: 116px;
}

body.view-stream.broadcast-live-video .stream-view-btn,
body.view-stream.broadcast-live-video .broadcast-rules-btn {
  min-height: 44px;
  padding: 10px 16px;
}

body.view-stream.broadcast-live-video .broadcast-admin-bar {
  max-width: min(1680px, calc(100vw - 20px));
  padding: 9px 12px;
}

body.view-stream.broadcast-live-video .broadcast-admin-bar-copy {
  min-width: 150px;
}

body.view-stream.broadcast-live-video .broadcast-admin-bar-copy strong {
  font-size: 18px;
}

body.view-stream.broadcast-live-video .broadcast-admin-actions .small {
  min-height: 38px;
  padding: 8px 11px;
}

body.view-stream.broadcast-live-video .race-grid {
  gap: 10px;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 2.35fr) minmax(260px, 0.55fr);
  max-width: min(1920px, calc(100vw - 20px));
  padding: 10px;
  width: 100%;
}

body.view-stream.broadcast-live-video .lane-panel,
body.view-stream.broadcast-live-video .center-panel {
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
}

body.view-stream.broadcast-live-video .lane-panel {
  grid-template-columns: 1fr;
}

body.view-stream.broadcast-live-video .car-photo {
  max-height: 165px;
}

body.view-stream.broadcast-live-video .car-copy h2 {
  font-size: clamp(24px, 1.9vw, 34px);
}

body.view-stream.broadcast-live-video .car-copy p:not(.lane-name) {
  font-size: 15px;
}

body.view-stream.broadcast-live-video .stat-row {
  gap: 8px;
}

body.view-stream.broadcast-live-video .stat-pill,
body.view-stream.broadcast-live-video .lane-data {
  padding: 8px 9px;
}

body.view-stream.broadcast-live-video .stat-pill strong,
body.view-stream.broadcast-live-video .lane-data strong {
  font-size: clamp(24px, 1.9vw, 32px);
}

body.view-stream.broadcast-live-video .lane-team-brand {
  margin-top: 2px;
  min-height: 64px;
  padding: 8px;
}

body.view-stream.broadcast-live-video .lane-team-brand strong {
  font-size: clamp(22px, 2.2vw, 34px);
  text-shadow: 3px 3px 0 #000;
}

body.view-stream.broadcast-live-video .lane-team-brand span {
  font-size: 12px;
}

body.view-stream.broadcast-live-video .race-chat-panel {
  display: none !important;
}

body.view-stream.broadcast-live-video .broadcast-display-controls {
  background: rgba(7, 8, 10, 0.72);
  border: 1px solid rgba(244, 234, 216, 0.16);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(210px, 1.15fr) auto minmax(220px, 1fr);
  margin-bottom: 8px;
  padding: 8px;
}

body.view-stream.broadcast-live-video .live-video-card {
  aspect-ratio: 16 / 9;
  height: clamp(280px, calc(100vh - 470px), 620px);
  max-width: 100%;
  max-height: clamp(360px, calc(100vh - 390px), 720px);
  min-height: clamp(280px, calc(100vh - 470px), 620px);
  overflow: hidden;
}

body.view-stream.broadcast-live-video .live-video-card video {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: cover;
  width: 100%;
}

body.view-stream.broadcast-live-video .dice-section {
  gap: 8px;
  grid-template-columns: auto minmax(220px, 1fr);
  padding: 8px;
}

body.view-stream.broadcast-live-video .die {
  font-size: 34px;
  height: 56px;
  width: 56px;
}

body.view-stream.broadcast-live-video .turn-box {
  min-height: 56px;
  padding: 8px 12px;
}

body.view-stream.broadcast-live-video .turn-box span {
  font-size: 11px;
}

body.view-stream.broadcast-live-video .turn-box strong {
  font-size: 24px;
  margin-top: 3px;
}

body.view-stream.broadcast-live-video .condition-strip {
  gap: 6px;
}

body.view-stream.broadcast-live-video .condition-card {
  gap: 0 6px;
  grid-template-columns: 28px 1fr;
  min-height: 42px;
  padding: 6px 8px;
}

body.view-stream.broadcast-live-video .condition-card i {
  border-radius: 7px;
  height: 28px;
  width: 28px;
}

body.view-stream.broadcast-live-video .condition-card span {
  font-size: 10px;
}

body.view-stream.broadcast-live-video .condition-card strong {
  font-size: 18px;
  margin-top: 1px;
}

body.view-stream.broadcast-live-video .race-access-note {
  gap: 6px;
  padding: 8px;
}

body.view-stream.broadcast-live-video .race-access-note > strong {
  font-size: 13px;
}

body.view-stream.broadcast-live-video .race-access-lanes {
  gap: 6px;
}

body.view-stream.broadcast-live-video .race-access-lane {
  min-height: 32px;
  padding: 6px 8px;
}

body.view-stream.broadcast-live-video .race-access-lane strong,
body.view-stream.broadcast-live-video .race-access-lane b {
  font-size: 10px;
}

body.view-stream.broadcast-live-video .launch-actions {
  gap: 8px;
}

body.view-stream.broadcast-live-video .launch-actions .primary-btn {
  min-height: 42px;
  padding: 8px 10px;
}

@media (max-width: 1450px) {
  body.view-stream .app-shell,
  body.view-stream.broadcast-live-video .app-shell {
    padding-left: 8px;
    padding-right: 8px;
  }

  body.view-stream .topbar,
  body.view-stream .broadcast-admin-bar,
  body.view-stream .race-grid,
  body.view-stream.broadcast-live-video .topbar,
  body.view-stream.broadcast-live-video .broadcast-admin-bar,
  body.view-stream.broadcast-live-video .race-grid {
    max-width: calc(100vw - 16px);
  }

  body.view-stream .race-grid,
  body.view-stream.broadcast-live-video .race-grid {
    gap: 8px;
    grid-template-columns: minmax(230px, 0.52fr) minmax(0, 2.12fr) minmax(230px, 0.52fr);
    padding: 8px;
  }

  body.view-stream.broadcast-live-video .lane-panel,
  body.view-stream.broadcast-live-video .center-panel {
    padding: 8px;
  }

  body.view-stream.broadcast-live-video .car-photo {
    max-height: 125px;
  }

  body.view-stream.broadcast-live-video .car-copy h2 {
    font-size: clamp(21px, 1.8vw, 30px);
  }

  body.view-stream.broadcast-live-video .car-copy p:not(.lane-name) {
    font-size: 13px;
  }

  body.view-stream.broadcast-live-video .stat-row {
    gap: 6px;
  }

  body.view-stream.broadcast-live-video .stat-pill,
  body.view-stream.broadcast-live-video .lane-data {
    padding: 7px;
  }

  body.view-stream.broadcast-live-video .stat-pill strong,
  body.view-stream.broadcast-live-video .lane-data strong {
    font-size: clamp(21px, 1.8vw, 28px);
  }

  body.view-stream.broadcast-live-video .lane-team-brand {
    min-height: 48px;
    padding: 6px;
  }

  body.view-stream.broadcast-live-video .live-video-card {
    height: clamp(250px, calc(100vh - 450px), 540px);
    max-height: clamp(320px, calc(100vh - 360px), 620px);
    min-height: clamp(250px, calc(100vh - 450px), 540px);
  }

  body.view-stream.broadcast-live-video .dice-section {
    grid-template-columns: auto minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  body.view-stream.broadcast-live-video .topbar {
    grid-template-columns: 1fr;
  }

  body.view-stream.broadcast-live-video .race-grid {
    grid-template-columns: 1fr;
    max-width: 980px;
  }

  body.view-stream.broadcast-live-video .center-panel {
    order: 1;
  }

  body.view-stream.broadcast-live-video #leftPanel {
    order: 2;
  }

  body.view-stream.broadcast-live-video #rightPanel {
    order: 3;
  }

  body.view-stream.broadcast-live-video .live-video-card {
    min-height: clamp(260px, 56vw, 520px);
  }
}

@media (max-width: 720px) {
  body.view-stream.broadcast-live-video .broadcast-display-controls {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  body.view-stream.broadcast-live-video .broadcast-display-controls .muted-note {
    width: 100%;
  }
}

/* Public Stats view uses the broadcast data feed without crowding the live race screen. */
body.view-stream:not(.view-stats) .lower-grid {
  display: none !important;
}

body.view-stream.view-stats .race-grid,
body.view-stream.view-stats .race-chat-panel,
body.view-stream.view-stats .readiness-panel {
  display: none !important;
}

body.view-stream.view-stats .records-subtabs {
  display: flex !important;
  max-width: 1680px;
}

body.view-stream.view-stats .lower-grid {
  display: grid !important;
  grid-template-columns: 1fr;
  max-width: 1680px;
}

body.view-stream.view-stats .records-leaderboard-panel,
body.view-stream.view-stats .records-season-panel,
body.view-stream.view-stats .records-teams-panel,
body.view-stream.view-stats .records-roster-panel,
body.view-stream.view-stats .records-tools-panel {
  display: none !important;
}

body.view-stream.view-stats.records-tab-leaderboard .records-leaderboard-panel,
body.view-stream.view-stats.records-tab-season .records-season-panel,
body.view-stream.view-stats.records-tab-teams .records-teams-panel,
body.view-stream.view-stats.records-tab-roster .records-roster-panel {
  display: grid !important;
}

body.view-stream.view-stats .records-leaderboard-panel,
body.view-stream.view-stats .records-season-panel,
body.view-stream.view-stats .records-teams-panel,
body.view-stream.view-stats .records-roster-panel {
  min-height: 420px;
}

body.view-stream.view-stats .stream-record-controls {
  display: flex !important;
}

@media (max-width: 820px) {
  body.view-stream.view-stats .records-subtabs {
    scrollbar-width: thin;
  }

  body.view-stream.view-stats .records-subtab {
    flex: 0 0 auto;
    min-width: 118px;
  }

  body.view-stream.view-stats .ranked-roster {
    overflow: visible;
  }

  body.view-stream.view-stats .leaderboard-table table,
  body.view-stream.view-stats .ranked-roster table,
  body.view-stream.view-stats .leaderboard-table thead,
  body.view-stream.view-stats .ranked-roster thead,
  body.view-stream.view-stats .leaderboard-table tbody,
  body.view-stream.view-stats .ranked-roster tbody,
  body.view-stream.view-stats .leaderboard-table tr,
  body.view-stream.view-stats .ranked-roster tr,
  body.view-stream.view-stats .leaderboard-table td,
  body.view-stream.view-stats .ranked-roster td {
    display: block;
    min-width: 0;
    width: 100%;
  }

  body.view-stream.view-stats .leaderboard-table thead,
  body.view-stream.view-stats .ranked-roster thead {
    display: none;
  }

  body.view-stream.view-stats .leaderboard-table table,
  body.view-stream.view-stats .ranked-roster table {
    background: transparent;
  }

  body.view-stream.view-stats .leaderboard-table tr,
  body.view-stream.view-stats .ranked-roster tr {
    background: rgba(7, 8, 10, 0.7);
    border: 1px solid rgba(244, 234, 216, 0.16);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  body.view-stream.view-stats .leaderboard-table td,
  body.view-stream.view-stats .ranked-roster td {
    align-items: start;
    border-bottom: 1px solid rgba(244, 234, 216, 0.1);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(78px, 0.38fr) minmax(0, 1fr);
    padding: 10px 12px;
  }

  body.view-stream.view-stats .leaderboard-table td::before,
  body.view-stream.view-stats .ranked-roster td::before {
    color: var(--gold);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  body.view-stream.view-stats .leaderboard-table td:last-child,
  body.view-stream.view-stats .ranked-roster td:last-child {
    border-bottom: 0;
  }
}
