.button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 6px 0 var(--accent-soft);
  z-index: 1;
}
[data-debug-only] {
  display: none !important;
}
.debug-mode [data-debug-only] {
  display: inline-flex !important;
}
.schedule-match-live {
  border: 2.5px solid #e53935 !important;
  box-shadow: 0 0 8px 0 #e5393555;
}
:root {
  --bg: #09111c;
  --bg-alt: #111f31;
  --panel: rgba(9, 17, 28, 0.76);
  --panel-border: rgba(199, 133, 78, 0.22);
  --text: #edf3ff;
  --muted: #c6a27f;
  --accent: #f4511e;
  --accent-soft: #ff8359;
  --cool: #c7854e;
  --success: #18c78d;
  --warning: #ffb020;
  --danger: #ff6b6b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  background:
    linear-gradient(135deg, rgba(9, 17, 28, 0.92), rgba(17, 31, 49, 0.78)),
    url('/assets/bgImage.jpg') center / cover fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(244, 81, 30, 0.2), transparent 30%),
    radial-gradient(circle at bottom left, rgba(199, 133, 78, 0.18), transparent 28%);
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.launch-lock-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.launch-lock-panel {
  width: min(560px, 100%);
  padding: 32px;
  text-align: center;
}

.launch-lock-logo {
  width: 148px;
  height: 148px;
  object-fit: contain;
  margin-bottom: 12px;
}

.launch-lock-note {
  max-width: 34rem;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.launch-access-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  text-align: left;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding: 6px 24px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(6, 11, 19, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand img {
  width: 124px;
  height: 124px;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cool);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.04em;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 0.95;
}

h3 {
  font-size: 1.8rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: 160ms ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.hero,
.page-banner,
.panel,
.editor-card {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
  gap: 24px;
  padding: 32px;
  margin-bottom: 28px;
}

.hero-copy p:last-of-type,
.page-banner p:last-of-type {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-actions,
.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.button-danger {
  color: #fff;
  background: rgba(255, 107, 107, 0.18);
  border: 1px solid rgba(255, 107, 107, 0.4);
}

.stat-grid,
.content-grid,
.form-grid,
.editor-grid,
.editor-grid-team {
  display: grid;
  gap: 16px;
}

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

.stat-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.stat-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease;
}

.stat-card-link:hover,
.stat-card-link:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.7rem;
  font-weight: 700;
}

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

.schedule-field-grid {
  align-items: start;
}

.schedule-field-panel {
  min-width: 0;
}

.schedule-filter-panel {
  margin-bottom: 18px;
}

.schedule-filter-label {
  max-width: 340px;
}

.schedule-table-wrap {
  overflow-x: auto;
}

.schedule-mobile-list {
  display: none;
}

.schedule-match-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.schedule-match-card-topline,
.schedule-match-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-match-time,
.schedule-match-field {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schedule-matchup {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.schedule-matchup-stack {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-matchup-vertical {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.schedule-vs-pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.schedule-match-open {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.schedule-match-open-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.schedule-match-score {
  font-weight: 700;
}

.schedule-swipe-hint {
  display: none;
}

body.schedule-match-modal-open {
  overflow: hidden;
}

.schedule-match-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.84);
}

.schedule-match-modal[hidden] {
  display: none;
}

.schedule-match-modal-dialog {
  width: min(760px, 100%);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  padding: 20px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.schedule-match-modal-close {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.schedule-match-modal-header {
  margin-top: 10px;
}

.schedule-match-modal-teams {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.schedule-match-team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.schedule-match-team-card h4 {
  margin: 8px 0 8px;
  font-size: 1.3rem;
}

.schedule-match-team-card p {
  margin: 0;
  color: var(--muted);
}

.schedule-match-team-logo {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto;
  object-fit: contain;
}

.schedule-match-team-logo-placeholder {
  display: inline-block;
}

.schedule-match-modal-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scoreboard-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.5fr);
  gap: 20px;
}

.scoreboard-stage,
.scoreboard-sidecar {
  min-height: 100%;
}

.scoreboard-heading {
  margin-top: 18px;
}
.stage-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}
.stage-button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}
.stage-button.active {
  border-color: rgba(199, 133, 78, 0.45);
  background: rgba(199, 133, 78, 0.16);
  color: #fff;
}

.scoreboard-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

.group-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.elimination-board {
  padding: 24px;
}
.elimination-table td,
.elimination-table th {
  white-space: nowrap;
}

.group-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.group-button.active {
  border-color: var(--group-color);
  background: color-mix(in srgb, var(--group-color) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--group-color) 35%, transparent);
}

.group-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--group-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--group-color) 18%, transparent);
}

.group-titlebar {
  --group-accent: var(--cool);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 20px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--group-accent) 28%, transparent), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid color-mix(in srgb, var(--group-accent) 35%, transparent);
}

.scoreboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.scoreboard-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.scoreboard-table th {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.standings-matrix {
  width: 100%;
  table-layout: fixed;
}

.standings-matrix th,
.standings-matrix td {
  padding: 8px 6px;
}

.standings-matrix th:nth-child(1),
.standings-matrix td:nth-child(1) {
  width: 56px;
}

.standings-matrix th:nth-child(2),
.standings-matrix td:nth-child(2) {
  width: 160px;
}

.game-column {
  width: 68px;
  min-width: 68px;
  text-align: center;
}

.team-identity {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.standings-matrix .team-identity {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
}

.standings-matrix .team-identity > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.team-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.team-logo-expandable {
  cursor: zoom-in;
}

.team-logo-expandable:hover {
  transform: scale(1.06);
}

.team-logo-placeholder {
  display: inline-block;
}

.standings-matrix .team-logo,
.standings-matrix .team-logo-placeholder {
  width: 28px;
  height: 28px;
}

.scoreboard-table td:first-child,
.scoreboard-table th:first-child {
  width: 70px;
}

.game-result-cell {
  width: 68px;
  min-width: 68px;
  text-align: center;
  vertical-align: middle;
}

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

.game-result-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  padding: 5px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
  font-weight: 700;
}

.game-result-pill.pending {
  color: var(--warning);
  background: rgba(255, 176, 32, 0.14);
}

.game-result-pill.live {
  color: var(--success);
  background: rgba(24, 199, 141, 0.14);
}

.game-result-pill.final {
  color: var(--cool);
  background: rgba(199, 133, 78, 0.16);
}

.game-result-fraction {
  display: inline-grid;
  min-width: 50px;
  padding: 4px 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}

.game-result-fraction.pending {
  color: var(--warning);
  background: rgba(255, 176, 32, 0.14);
}

.game-result-fraction.live {
  color: var(--success);
  background: rgba(24, 199, 141, 0.14);
}

.game-result-fraction.final {
  color: var(--cool);
  background: rgba(199, 133, 78, 0.16);
}

.game-result-top {
  display: block;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
}

.game-result-bottom {
  display: block;
  padding-top: 2px;
}

.group-records {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.group-record-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.group-record-card .team-identity {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
}

.group-record-card .team-identity > span:last-child {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.05;
}

.group-record-card .team-logo,
.group-record-card .team-logo-placeholder {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
}

.group-record-card .team-logo {
  object-fit: contain;
  padding: 2px;
}

.group-record-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(199, 133, 78, 0.16);
  color: var(--cool);
  font-weight: 700;
}

.fullscreen-scoreboard {
  margin-bottom: 18px;
}

.fullscreen-scoreboard-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 18px;
}

.fullscreen-scoreboard-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

.fullscreen-groups {
  display: grid;
  grid-template-columns: repeat(var(--fullscreen-group-count, 3), minmax(0, 1fr));
  gap: 16px;
}

.fullscreen-groups.single-group {
  grid-template-columns: minmax(320px, 520px);
  justify-content: center;
}

.fullscreen-group-panel {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--group-color) 38%, transparent);
  background: color-mix(in srgb, var(--group-color) 10%, rgba(255, 255, 255, 0.03));
}

.fullscreen-group-heading {
  margin-bottom: 12px;
}

.fullscreen-group-heading .eyebrow {
  margin-bottom: 4px;
}

.fullscreen-standings-table {
  width: 100%;
}

.fullscreen-standings-table th,
.fullscreen-standings-table td {
  padding: 10px 8px;
}

.fullscreen-standings-table th:first-child,
.fullscreen-standings-table td:first-child {
  width: 72px;
}

.fullscreen-standings-table th:last-child,
.fullscreen-standings-table td:last-child {
  width: 78px;
}

.fullscreen-standings-table .team-identity {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
}

.fullscreen-standings-table .team-identity > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fullscreen-standings-table .team-logo,
.fullscreen-standings-table .team-logo-placeholder {
  width: 32px;
  height: 32px;
}

/* ── Team Card Modal ─────────────────────────────────── */
.team-card-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.team-card-modal[hidden] { display: none !important; }

.team-card-dialog {
  background: var(--bg-card, #1e1e2e);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
  color: var(--text-primary, #fff);
}

.team-card-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: none;
  border: none;
  color: var(--text-secondary, #aaa);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: .25rem .5rem;
  border-radius: 6px;
}
.team-card-close:hover { color: #fff; background: rgba(255,255,255,.1); }

.team-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.team-card-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 8px;
}
.team-card-logo-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255,255,255,.3);
}

.team-card-name {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

.team-card-points {
  font-size: .9rem;
  color: var(--accent-gold, #f5c518);
  font-weight: 600;
}

.team-card-section {
  margin-bottom: 1rem;
}
.team-card-section-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-secondary, #aaa);
  margin-bottom: .4rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-bottom: .25rem;
}

.team-card-match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .3rem 0;
  font-size: .82rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.team-card-match-row:last-child { border-bottom: none; }
.team-card-match-opp { flex: 1; font-weight: 500; }
.team-card-match-field { color: var(--text-secondary, #aaa); font-size: .75rem; margin: 0 .5rem; }
.team-card-match-score { font-weight: 700; white-space: nowrap; }
.team-card-match-score.win  { color: #4ade80; }
.team-card-match-score.loss { color: #f87171; }
.team-card-match-score.tie  { color: #facc15; }
.team-card-match-score.pending { color: var(--text-secondary, #aaa); font-weight: 400; }

.team-card-empty {
  font-size: .82rem;
  color: var(--text-secondary, #aaa);
  font-style: italic;
}
/* ─────────────────────────────────────────────────────── */

.fullscreen-points-cell {
  font-weight: 700;
  text-align: right;
}

.fullscreen-group-panel .rank-chip {
  background: color-mix(in srgb, var(--group-color, var(--cool)) 22%, transparent);
  color: color-mix(in srgb, var(--group-color, var(--cool)) 82%, white 12%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--group-color, var(--cool)) 38%, transparent);
}

.fullscreen-group-panel .fullscreen-points-cell {
  color: color-mix(in srgb, var(--group-color, var(--cool)) 82%, white 12%);
}

.fullscreen-standings-table tr.fullscreen-cutoff-row td {
  border-top: 3px solid color-mix(in srgb, var(--group-color, var(--cool)) 70%, white 10%);
}

.panel,
.page-banner {
  padding: 24px;
}

.page-banner {
  margin-bottom: 24px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.collapsible-content[hidden] {
  display: none;
}

.collapse-toggle {
  min-width: 110px;
}

.panel-heading a {
  color: var(--cool);
}

.stack-list {
  display: grid;
  gap: 14px;
}


.match-card,
.standing-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  transition: border 0.2s;
}

.match-live {
  border: 2.5px solid #e53935 !important;
  box-shadow: 0 0 8px 0 #e5393555;
}

.match-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.match-row strong {
  font-size: 1.12rem;
}

.meta-line,
.status-text,
th {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge.pending {
  background: rgba(255, 176, 32, 0.14);
  color: var(--warning);
}

/* LIVE badge: red */
.badge.live {
  background: rgba(229, 57, 53, 0.18);
  color: #e53935;
}

/* FINAL badge: green */
.badge.final {
  background: rgba(24, 199, 141, 0.18);
  color: #18c78d;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.standings-matrix tr.prelim-cutoff-row td {
  border-top: 3px solid color-mix(in srgb, var(--group-accent, var(--cool)) 70%, white 10%);
}

.rank-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(244, 81, 30, 0.2);
  color: var(--accent-soft);
  font-weight: 700;
}

.scoreboard-stage .rank-chip {
  background: color-mix(in srgb, var(--group-accent, var(--cool)) 22%, transparent);
  color: color-mix(in srgb, var(--group-accent, var(--cool)) 82%, white 12%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--group-accent, var(--cool)) 38%, transparent);
}

.scoreboard-stage .game-result-pill,
.scoreboard-stage .game-result-fraction {
  color: color-mix(in srgb, var(--group-accent, var(--cool)) 82%, white 12%);
  background: color-mix(in srgb, var(--group-accent, var(--cool)) 18%, transparent);
}

.scoreboard-stage .mobile-standings-score strong {
  color: color-mix(in srgb, var(--group-accent, var(--cool)) 82%, white 12%);
}

.mobile-score-total {
  font-weight: 700;
  text-align: right;
  color: var(--text);
}

.mobile-standings {
  display: none;
  gap: 12px;
}

.mobile-standings[hidden] {
  display: none !important;
}

.mobile-standings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mobile-standings-list {
  display: grid;
  gap: 10px;
}

.mobile-standings-cutoff {
  padding: 4px 0;
  text-align: center;
  background: linear-gradient(
    to bottom,
    transparent calc(50% - 1.5px),
    color-mix(in srgb, var(--group-accent, var(--cool)) 70%, white 10%) calc(50% - 1.5px),
    color-mix(in srgb, var(--group-accent, var(--cool)) 70%, white 10%) calc(50% + 1.5px),
    transparent calc(50% + 1.5px)
  );
}

.mobile-standings-cutoff span {
  display: inline-block;
  padding: 0 12px;
  background: color-mix(in srgb, var(--surface, #101010) 92%, transparent);
  color: color-mix(in srgb, var(--group-accent, var(--cool)) 82%, white 12%);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.mobile-standings-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.mobile-standings-team .team-identity {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.mobile-standings-team .team-identity > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-standings-team .team-logo,
.mobile-standings-team .team-logo-placeholder {
  width: 34px;
  height: 34px;
}

.mobile-standings-score {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.mobile-standings-score-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.mobile-scoreboard-mode .scoreboard-controls,
body.mobile-scoreboard-mode .scoreboard-sidecar,
body.mobile-scoreboard-mode .group-switcher,
body.mobile-scoreboard-mode .fullscreen-scoreboard,
body.mobile-scoreboard-mode .scoreboard-heading,
body.mobile-scoreboard-mode #standings-table-scroll {
  display: none !important;
}

body.mobile-scoreboard-mode .scoreboard-shell {
  display: block;
}

body.mobile-scoreboard-mode .scoreboard-stage {
  padding: 18px;
}

body.mobile-scoreboard-mode .group-titlebar {
  gap: 8px;
  margin-bottom: 12px;
}

body.mobile-scoreboard-mode .group-titlebar .eyebrow {
  display: none;
}

body.mobile-scoreboard-mode .group-titlebar h3 {
  font-size: 1.9rem;
}

body.mobile-scoreboard-mode .scoreboard-meta {
  font-size: 0.92rem;
}

body.mobile-scoreboard-mode .scoreboard-meta span:not(:first-child) {
  display: none;
}

body.mobile-scoreboard-mode .mobile-standings {
  display: grid !important;
}

body.mobile-scoreboard-mode .mobile-standings-header {
  display: none;
}

body.mobile-scoreboard-mode .mobile-standings-card {
  padding: 12px 10px;
  border-radius: 16px;
}

body.mobile-scoreboard-mode .mobile-standings-score strong {
  font-size: 1.3rem;
}

body.mobile-scoreboard-mode .group-titlebar[data-swipe-enabled="true"]::after {
  content: 'Swipe to change group';
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  body[data-page="scoreboard"] .scoreboard-controls,
  body[data-page="scoreboard"] .scoreboard-sidecar,
  body[data-page="scoreboard"] .group-switcher,
  body[data-page="scoreboard"] .fullscreen-scoreboard,
  body[data-page="scoreboard"] .scoreboard-heading,
  body[data-page="scoreboard"] #standings-table-scroll {
    display: none !important;
  }

  body[data-page="scoreboard"] .scoreboard-shell {
    display: block;
  }

  body[data-page="scoreboard"] .scoreboard-stage {
    padding: 18px;
  }

  body[data-page="scoreboard"] .group-titlebar {
    gap: 8px;
    margin-bottom: 12px;
  }

  body[data-page="scoreboard"] .group-titlebar .eyebrow {
    display: none;
  }

  body[data-page="scoreboard"] .group-titlebar h3 {
    font-size: 1.9rem;
  }

  body[data-page="scoreboard"] .scoreboard-meta {
    font-size: 0.92rem;
  }

  body[data-page="scoreboard"] .scoreboard-meta span:not(:first-child) {
    display: none;
  }

  body[data-page="scoreboard"] .mobile-standings {
    display: grid !important;
  }

  body[data-page="scoreboard"] .mobile-standings-header {
    display: none;
  }

  body[data-page="scoreboard"] .mobile-standings-card {
    padding: 12px 10px;
    border-radius: 16px;
  }

  body[data-page="scoreboard"] .mobile-standings-score strong {
    font-size: 1.3rem;
  }

  body[data-page="scoreboard"] .group-titlebar[data-swipe-enabled="true"]::after {
    content: 'Swipe to change group';
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }
}

.admin-layout {
  display: grid;
  gap: 20px;
}

.auth-panel {
  max-width: 560px;
  margin-bottom: 20px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

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

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

.editor-grid-team {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.editable-list {
  display: grid;
  gap: 10px;
}

.match-filter-row {
  margin-bottom: 12px;
}

.match-filter-label {
  max-width: 320px;
}

.editor-card {
  padding: 12px;
}

.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 28px;
}

.team-logo-field {
  gap: 4px;
  align-content: start;
}

.team-logo-field input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.team-logo-preview {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

option {
  color: #111;
}

textarea {
  resize: vertical;
}

.full-width {
  grid-column: 1 / -1;
}

.admin-actions {
  justify-content: flex-start;
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero,
  .content-grid,
  .scoreboard-grid,
  .scoreboard-shell,
  .form-grid,
  .editor-grid,
  .editor-grid-team,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .site-header,
  .panel-heading,
  .match-row,
  .group-titlebar {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
  }

  .brand img {
    width: 96px;
    height: 96px;
  }

  .fullscreen-groups {
    grid-template-columns: 1fr;
  }

  .scoreboard-controls {
    display: none;
  }

  .fullscreen-scoreboard {
    display: none !important;
  }

  .scoreboard-sidecar {
    display: none;
  }

  .scoreboard-shell {
    display: block;
  }

  .scoreboard-heading {
    display: none;
  }

  .scoreboard-stage {
    padding: 18px;
  }

  .group-switcher {
    display: none;
  }

  .group-titlebar {
    gap: 8px;
    margin-bottom: 12px;
  }

  .group-titlebar .eyebrow {
    display: none;
  }

  .group-titlebar h3 {
    font-size: 1.9rem;
  }

  .scoreboard-meta {
    font-size: 0.92rem;
  }

  .scoreboard-meta span:not(:first-child) {
    display: none;
  }

  .group-titlebar[data-swipe-enabled="true"]::after {
    content: 'Swipe to change group';
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }

  body[data-page="schedule"] .schedule-table-wrap {
    display: none;
  }

  body[data-page="schedule"] .schedule-mobile-list {
    display: grid;
    gap: 12px;
  }

  body[data-page="schedule"] .schedule-field-grid {
    gap: 16px;
  }

  body[data-page="schedule"] .schedule-field-panel {
    display: none;
  }

  body[data-page="schedule"] .schedule-field-panel.is-active {
    display: block;
  }

  body[data-page="schedule"] .schedule-field-panel[data-swipe-enabled="true"] .schedule-swipe-hint {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
  }

  body[data-page="schedule"] .schedule-field-panel,
  body[data-page="schedule"] .panel {
    min-width: 0;
  }

  body[data-page="schedule"] .schedule-match-modal-dialog {
    padding: 16px;
  }

  body[data-page="schedule"] .schedule-match-modal-teams {
    grid-template-columns: 1fr;
  }

  body[data-page="schedule"] .schedule-matchup-vertical {
    display: inline-flex;
    flex-direction: row;
    grid-template-columns: unset;
    gap: 10px;
    text-align: left;
  }

  .mobile-standings-header {
    display: none;
  }

  .mobile-standings-card {
    padding: 12px 10px;
    border-radius: 16px;
  }

  .mobile-standings-score strong {
    font-size: 1.3rem;
  }

  body[data-page="scoreboard"] #elimination-board .table-scroll {
    overflow-x: auto;
  }
}

body.scoreboard-fullscreen-active .site-nav,
body.scoreboard-fullscreen-active .site-header,
body.scoreboard-fullscreen-active .page-banner,
body.scoreboard-fullscreen-active #prelims-board,
body.scoreboard-fullscreen-active #elimination-board {
  display: none !important;
}

body.scoreboard-fullscreen-active {
  overflow: hidden;
}

body.scoreboard-fullscreen-active .page-shell {
  width: calc(100vw - 8px);
  max-width: none;
  min-height: 100vh;
  padding: 4px 0 6px;
}

body.scoreboard-fullscreen-active main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 6px;
  min-height: 100%;
}

body.scoreboard-fullscreen-active .scoreboard-controls {
  margin-bottom: 0;
}

body.scoreboard-fullscreen-active .stage-switcher {
  gap: 6px;
  margin: 0;
}

body.scoreboard-fullscreen-active .stage-button,
body.scoreboard-fullscreen-active .button-secondary {
  min-height: 44px;
  padding: 0 14px;
  font-size: 1.05rem;
}

body.scoreboard-fullscreen-active .fullscreen-scoreboard {
  margin-bottom: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 8px 10px 6px;
  min-height: 0;
  height: 100%;
}

body.scoreboard-fullscreen-active .fullscreen-scoreboard-header {
  gap: 10px;
  margin-bottom: 6px;
}

body.scoreboard-fullscreen-active .fullscreen-scoreboard-logo {
  width: 132px;
  height: 132px;
}

body.scoreboard-fullscreen-active .fullscreen-scoreboard h3 {
  font-size: 2rem;
}

body.scoreboard-fullscreen-active .fullscreen-groups {
  gap: 8px;
  align-items: stretch;
  min-height: 0;
  height: 100%;
}

body.scoreboard-fullscreen-active .fullscreen-group-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 8px;
  min-width: 0;
  min-height: 0;
}

body.scoreboard-fullscreen-active .fullscreen-group-heading {
  margin-bottom: 4px;
}

body.scoreboard-fullscreen-active .fullscreen-group-heading .eyebrow {
  margin-bottom: 1px;
  font-size: 0.78rem;
}

body.scoreboard-fullscreen-active .fullscreen-group-heading h3 {
  font-size: 1.65rem;
}

body.scoreboard-fullscreen-active .fullscreen-standings-table th,
body.scoreboard-fullscreen-active .fullscreen-standings-table td {
  padding: 4px 4px;
}

body.scoreboard-fullscreen-active .fullscreen-standings-table th {
  font-size: 0.92rem;
}

body.scoreboard-fullscreen-active .fullscreen-standings-table td {
  font-size: 1.08rem;
}

body.scoreboard-fullscreen-active .fullscreen-standings-table th:first-child,
body.scoreboard-fullscreen-active .fullscreen-standings-table td:first-child {
  width: 60px;
}

body.scoreboard-fullscreen-active .fullscreen-standings-table th:last-child,
body.scoreboard-fullscreen-active .fullscreen-standings-table td:last-child {
  width: 60px;
}

body.scoreboard-fullscreen-active .fullscreen-standings-table .team-identity {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 7px;
}

body.scoreboard-fullscreen-active .fullscreen-standings-table .team-logo,
body.scoreboard-fullscreen-active .fullscreen-standings-table .team-logo-placeholder {
  width: 26px;
  height: 26px;
}

body.scoreboard-fullscreen-active .fullscreen-standings-table .team-identity > span:last-child {
  font-size: 1.06rem;
}

body.scoreboard-fullscreen-active .rank-chip {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}