﻿:root {
  --bg: #050914;
  --panel: #0a1020;
  --panel2: #08111f;
  --line: #263a5a;
  --cyan: #00eaff;
  --green: #00ff9c;
  --pink: #ff2bd6;
  --orange: #D19A63;
  --text: #F2F0EB;
  --muted: #9faed0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(0, 234, 255, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 43, 214, 0.10), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.page {
  padding: 18px;
  max-width: 1800px;
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  color: var(--cyan);
  font-weight: 800;
  margin: 0 0 8px;
}

h1 {
  font-size: 36px;
  margin: 0 0 8px;
}

h2 {
  margin: 0;
  font-size: 24px;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.stat-card {
  min-width: 170px;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(8, 17, 31, 0.96);
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 14px;
}

.stat-card strong {
  font-size: 34px;
  color: var(--green);
}

/* Prize pool values use the app's gold accent everywhere. */
#prizePool {
  color: #C49A6C !important;
}

.stat-card.cyan {
  border: 1px solid var(--cyan);
}

.stat-card.pink {
  border: 1px solid var(--pink);
}

.stat-card.orange {
  border: 1px solid var(--orange);
}

.panel {
  border: 1px solid var(--cyan);
  border-radius: 18px;
  background: rgba(8, 17, 31, 0.92);
  box-shadow: 0 0 22px rgba(0, 234, 255, 0.12);
  padding: 12px;
  margin-bottom: 18px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
}

#lastUpdated {
  color: var(--cyan);
  font-weight: 800;
}

.table-wrap {
  border: 1px solid var(--line);
  background: #050914;
  width: 100%;
  overflow: hidden;
}

.standings-split {
  display: flex;
  width: 100%;
  align-items: stretch;
}

table {
  border-collapse: collapse;
  table-layout: fixed;
}

.standings-fixed-table {
  flex: 0 0 372px;
  width: 372px;
  min-width: 372px;
  max-width: 372px;
}

.matches-scroll {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: scroll;
  overflow-y: hidden;
  scrollbar-gutter: stable;
}

.standings-matches-table {
  width: max-content;
  min-width: max-content;
}

th,
td {
  border: 1px solid var(--line);
  padding: 2px 5px;
  font-size: 11px;
  line-height: 1.05;
  text-align: left;
  white-space: nowrap;
  height: 24px;
}

th {
  background: #111a2d;
  color: var(--text);
  height: 24px;
}

thead tr:first-child th {
  height: 22px;
}

thead tr:nth-child(2) th {
  height: 18px;
}

td {
  background: #070d18;
  font-weight: 700;
}

.standings-fixed-table tbody tr,
.standings-matches-table tbody tr {
  height: 28px;
}

.standings-fixed-table tbody td,
.standings-matches-table tbody td {
  height: 28px;
  max-height: 28px;
  overflow: hidden;
}

.standings-fixed-table th:nth-child(1),
.standings-fixed-table td:nth-child(1) {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
}

.standings-fixed-table th:nth-child(2),
.standings-fixed-table td:nth-child(2) {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
}

.standings-fixed-table th:nth-child(3),
.standings-fixed-table td:nth-child(3) {
  width: 78px;
  min-width: 78px;
  max-width: 78px;
}

.standings-fixed-table th:nth-child(4),
.standings-fixed-table td:nth-child(4) {
  width: 70px;
  min-width: 70px;
  max-width: 70px;
}

.standings-matches-table th,
.standings-matches-table td {
  width: 47px;
  min-width: 47px;
  max-width: 47px;
}

.standings-matches-table thead tr:first-child th {
  width: 94px;
  min-width: 94px;
  max-width: 94px;
  text-align: center;
}

.standings-matches-table thead tr:nth-child(2) th {
  text-align: left;
}

.team-cell strong {
  display: block;
  color: var(--text);
  line-height: 1.02;
  margin-bottom: 0;
}

.team-cell span {
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.02;
}

.match-winner {
  background: rgba(0, 255, 156, 0.82) !important;
  color: #00140c;
}

.current-match,
.current-match-cell {
  box-shadow: inset 0 0 0 999px rgba(0, 255, 156, 0.08);
}

.on-match-point td.fixed-highlight {
  background: rgba(255, 210, 0, 0.20);
}

.winner {
  border: 1px solid var(--green);
  border-radius: 18px;
  background: rgba(0, 255, 156, 0.14);
  padding: 20px;
  margin-bottom: 18px;
  font-size: 24px;
  font-weight: 900;
  color: var(--green);
}

.hidden {
  display: none;
}

.top-fraggers {
  border-color: var(--pink);
}

.top-fraggers h2 {
  color: var(--pink);
  margin-bottom: 14px;
}

#topFraggersTable {
  max-width: 760px;
  min-width: 560px;
}

#topFraggersTable th,
#topFraggersTable td {
  height: 36px;
}

::-webkit-scrollbar {
  height: 16px;
  width: 16px;
}

::-webkit-scrollbar-track {
  background: #07101f;
  border: 1px solid #203454;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  border-radius: 999px;
  border: 2px solid #07101f;
}

@media (max-width: 900px) {
  .hero {
    flex-direction: column;
  }

  h1 {
    font-size: 32px;
  }

  .stats {
    justify-content: flex-start;
  }
}


/* Compact fixed live standings layout - final override */
.standings-fixed-table { flex-basis: 372px !important; width: 372px !important; min-width: 372px !important; max-width: 372px !important; }
.standings-fixed-table th:nth-child(1), .standings-fixed-table td:nth-child(1) { width: 44px !important; min-width: 44px !important; max-width: 44px !important; }
.standings-fixed-table th:nth-child(2), .standings-fixed-table td:nth-child(2) { width: 180px !important; min-width: 180px !important; max-width: 180px !important; }
.standings-fixed-table th:nth-child(3), .standings-fixed-table td:nth-child(3) { width: 78px !important; min-width: 78px !important; max-width: 78px !important; }
.standings-fixed-table th:nth-child(4), .standings-fixed-table td:nth-child(4) { width: 70px !important; min-width: 70px !important; max-width: 70px !important; }
.standings-fixed-table tbody tr, .standings-matches-table tbody tr { height: 28px !important; }
.standings-fixed-table tbody td, .standings-matches-table tbody td { height: 28px !important; max-height: 28px !important; }
.standings-fixed-table th, .standings-fixed-table td, .standings-matches-table th, .standings-matches-table td { font-size: 11px !important; padding: 1px 5px !important; }
.team-cell strong, .team-cell span { line-height: 1.02 !important; }
.standings-matches-table th, .standings-matches-table td { width: 47px !important; min-width: 47px !important; max-width: 47px !important; }
.standings-matches-table thead tr:first-child th { width: 94px !important; min-width: 94px !important; max-width: 94px !important; }


/* Team 10 fit fix - CSS only. Keeps layout/columns/scroll unchanged. */
.standings-fixed-table thead tr:first-child th,
.standings-matches-table thead tr:first-child th { height: 22px !important; }
.standings-fixed-table thead tr:nth-child(2) th,
.standings-matches-table thead tr:nth-child(2) th { height: 18px !important; }
.standings-fixed-table tbody tr,
.standings-matches-table tbody tr { height: 28px !important; }
.standings-fixed-table tbody td,
.standings-matches-table tbody td { height: 28px !important; max-height: 28px !important; padding-top: 1px !important; padding-bottom: 1px !important; }
.team-cell strong,
.team-cell span { line-height: 1 !important; }


/* Left fixed table spacer: keeps Team 10 visible above the match horizontal scrollbar.
   This mirrors the app layout where the scrollbar belongs under the match columns only. */
.fixed-scrollbar-spacer-row,
.fixed-scrollbar-spacer-row td {
  height: 16px !important;
  max-height: 16px !important;
  padding: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  background: #050914 !important;
  border-top: 1px solid var(--line) !important;
}


/* Bracket live view */
.bracket-live-view {
  display: flex;
  gap: 16px;
  overflow: auto;
  padding: 8px;
  min-height: 430px;
}

.bracket-section {
  flex: 0 0 auto;
  min-width: 720px;
  border: 1px solid var(--cyan);
  border-radius: 14px;
  background: rgba(7, 13, 24, 0.96);
  padding: 14px;
}

.bracket-section h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.bracket-rounds {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.bracket-round {
  flex: 0 0 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bracket-round-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  min-height: 20px;
}

.bracket-match-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #070d18;
  padding: 8px;
  min-height: 74px;
}

.bracket-match-header {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 6px;
}

.bracket-team-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  border: 1px solid #1f3150;
  background: #090f1c;
  padding: 5px 7px;
  min-height: 28px;
  font-size: 12px;
  font-weight: 800;
}

.bracket-team-row + .bracket-team-row {
  margin-top: 4px;
}

.bracket-team-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-team-row strong {
  text-align: right;
  color: var(--text);
}

.bracket-team-winner {
  background: rgba(0, 255, 156, 0.78);
  color: #00140c;
}

.bracket-team-winner strong {
  color: #00140c;
}

.bracket-team-loser {
  opacity: 0.72;
}

.bracket-empty {
  color: var(--muted);
  font-weight: 800;
  padding: 40px;
  text-align: center;
}

/* Bracket app-style live layout. Keeps Match Point layout untouched. */
.bracket-table-wrap {
  border: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
}

.bracket-app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  width: 100%;
  align-items: stretch;
}

.bracket-main-panel {
  min-width: 0;
  background: #0B0F12;
  border: 1px solid #8B5CF6;
  border-radius: 14px;
  padding: 10px;
  overflow: hidden;
}

.bracket-scroll-view {
  position: relative;
  height: min(700px, calc(100vh - 270px));
  min-height: 560px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.bracket-canvas {
  position: relative;
  min-width: 980px;
  min-height: 560px;
}

.bracket-connectors-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: visible;
  pointer-events: none;
}

.live-bracket-connector-line {
  stroke: #23304A;
  stroke-width: 2;
  stroke-linecap: square;
}

.live-bracket-section-bg {
  display: none;
}

.live-bracket-section-divider {
  position: absolute;
  z-index: 3;
  height: 2px;
  background: #C49A6C;
  opacity: 0.9;
  pointer-events: none;
}

.live-bracket-section-header {
  position: absolute;
  z-index: 4;
  height: 38px;
  display: flex;
  align-items: center;
  padding: 6px 10px 6px 12px;
  font-size: 19px;
  font-weight: 900;
}

.live-bracket-section-header span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.live-bracket-section-header button {
  width: 30px;
  height: 26px;
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.live-bracket-round-header {
  position: absolute;
  z-index: 3;
  height: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.live-bracket-match-card {
  position: absolute;
  z-index: 3;
  background: #121A20;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  padding: 6px 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr);
}

.live-bracket-match-card.compact {
  padding: 5px 7px;
}

.live-bracket-match-header {
  color: var(--cyan);
  font-size: 9.5px;
  line-height: 1.1;
  font-weight: 900;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 0 0 2px;
}

.live-bracket-match-card.compact .live-bracket-match-header {
  font-size: 8.5px;
  margin-bottom: 1px;
}

.live-bracket-team-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  opacity: 1;
}

.live-bracket-team-row span:first-child {
  color: var(--text);
  font-size: 13px;
  line-height: 1.1;
  font-weight: 800;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.live-bracket-team-row.compact span:first-child {
  font-size: 11.5px;
}

.live-bracket-team-row.winner-row span:first-child {
  color: var(--green);
  font-weight: 900;
}

.live-bracket-team-row.loser-row {
  opacity: 0.48;
}

.live-bracket-team-row.loser-row span:first-child {
  color: #8F969B;
}

.live-bracket-team-row.bye-row span:first-child {
  color: #8F969B;
  font-style: italic;
  font-weight: 700;
}

.live-bracket-divider {
  height: 1px;
  background: rgba(245, 247, 255, 0.78);
  margin: 1px 0;
}

.live-bracket-dots {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  min-width: 34px;
}

.live-bracket-dots i {
  display: block;
  width: 9px;
  height: 9px;
  border: 1.4px solid var(--text);
  border-radius: 50%;
  background: transparent;
}

.live-bracket-team-row.compact .live-bracket-dots i {
  width: 8px;
  height: 8px;
}

.live-bracket-dots i.filled {
  border-color: var(--green);
  background: var(--green);
}

.bracket-side-panel {
  width: 300px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bracket-side-accordion {
  background: #121A20;
  border: 1px solid var(--blue, #87939C);
  border-radius: 14px;
  padding: 14px;
}

.bracket-side-accordion.pink {
  border-color: var(--pink);
  box-shadow: 0 0 22px rgba(201, 133, 77, 0.14);
}

.bracket-side-accordion.blue {
  border-color: #87939C;
}

.bracket-side-header {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  text-align: left;
}

.bracket-side-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 900;
  min-width: 0;
}

.bracket-side-icon,
.bracket-side-toggle {
  color: var(--cyan);
  font-size: 22px;
  font-weight: 900;
}

.bracket-side-accordion.pink .bracket-side-icon,
.bracket-side-accordion.pink .bracket-side-toggle {
  color: var(--pink);
}

.bracket-side-toggle {
  text-align: center;
}

.bracket-side-body {
  margin-top: 12px;
  border-top: 1px solid #46515A;
  padding-top: 12px;
}

.bracket-info-grid {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr);
  row-gap: 10px;
  column-gap: 8px;
  font-size: 12px;
}

.bracket-info-grid span {
  color: var(--muted);
  white-space: nowrap;
}

.bracket-info-grid strong {
  color: var(--cyan);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.bracket-info-prize,
.bracket-info-winner {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  background: #1B1410;
  border: 1px solid #46515A;
  border-radius: 10px;
}

.bracket-info-prize > span,
.bracket-info-winner > span {
  color: var(--pink);
  font-size: 28px;
  text-align: center;
}

.bracket-info-winner > span {
  color: var(--green);
}

.bracket-info-prize small,
.bracket-info-winner small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 2px;
}

.bracket-info-prize strong,
.bracket-info-winner strong {
  display: block;
  color: var(--green);
  font-size: 26px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.bracket-team-status {
  background: #071A13;
  border: 1px solid var(--green);
  border-radius: 10px;
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
  padding: 10px;
  text-align: center;
  margin-bottom: 10px;
}

.bracket-side-list {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #0B0F12;
  border: 1px solid #46515A;
  border-radius: 10px;
  padding: 8px;
}

.bracket-side-team {
  position: relative;
  border: 1px solid #1f3150;
  border-radius: 9px;
  background: #08101f;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.bracket-side-team strong {
  display: block;
  color: var(--green);
  font-size: 13px;
  margin-bottom: 3px;
}

.bracket-side-team span {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}


@media (max-width: 1180px) {
  .bracket-app-shell {
    grid-template-columns: 1fr;
  }

  .bracket-side-panel {
    width: 100%;
    min-width: 0;
  }
}

/* Bracket live layout tightening - mirrors the app spacing without touching Match Point. */
body.bracket-live-mode .page {
  max-width: none;
  width: 100vw;
  min-height: 100vh;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.bracket-live-mode .hero {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  margin-bottom: 8px;
}

body.bracket-live-mode .eyebrow {
  margin-bottom: 4px;
}

body.bracket-live-mode h1 {
  font-size: clamp(30px, 2.25vw, 44px);
  line-height: 1.02;
  margin-bottom: 4px;
}

body.bracket-live-mode .muted {
  font-size: clamp(15px, 1.15vw, 20px);
  line-height: 1.15;
}

body.bracket-live-mode .stats {
  display: grid;
  grid-template-columns: minmax(250px, 360px) 175px 175px;
  gap: 12px;
  align-items: start;
  justify-content: end;
  flex-wrap: nowrap;
}

body.bracket-live-mode .stat-card {
  min-width: 0;
  min-height: 94px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.bracket-live-mode .stat-card span {
  font-size: 14px;
  margin-bottom: 5px;
}

body.bracket-live-mode .stat-card strong {
  font-size: clamp(30px, 2.4vw, 44px);
  line-height: 1.05;
  white-space: nowrap;
}

body.bracket-live-mode .winner {
  flex: 0 0 auto;
  margin-bottom: 8px;
  padding: 12px 18px;
  font-size: 22px;
}

body.bracket-live-mode .panel {
  flex: 1 1 auto;
  min-height: 0;
  margin-bottom: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
}

body.bracket-live-mode .panel-title {
  flex: 0 0 auto;
  margin-bottom: 8px;
}

body.bracket-live-mode .bracket-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

body.bracket-live-mode .bracket-app-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: stretch;
}

body.bracket-live-mode .bracket-main-panel {
  min-height: 0;
  height: 100%;
  padding: 10px;
}

body.bracket-live-mode .bracket-scroll-view {
  height: 100%;
  min-height: 0;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
}

body.bracket-live-mode .bracket-canvas {
  min-height: 0;
}

body.bracket-live-mode .live-bracket-section-bg {
  background: rgba(11, 16, 32, 0.72);
}

body.bracket-live-mode .bracket-side-panel {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.bracket-live-mode .bracket-side-accordion {
  flex: 0 0 auto;
}

body.bracket-live-mode .bracket-side-list {
  max-height: min(520px, calc(100vh - 430px));
}

@media (max-width: 1280px) {
  body.bracket-live-mode .hero {
    grid-template-columns: 1fr;
  }

  body.bracket-live-mode .stats {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    justify-content: stretch;
  }

  body.bracket-live-mode .page {
    overflow: auto;
  }

  body.bracket-live-mode .panel {
    min-height: 620px;
  }
}

/* Bracket overlap/accordion fix - keeps the collapsed bracket bar clear of match cards. */
body.bracket-live-mode .live-bracket-section-bg {
  overflow: hidden;
}

body.bracket-live-mode .live-bracket-section-header {
  z-index: 8;
}

body.bracket-live-mode .live-bracket-match-card {
  z-index: 5;
}

body.bracket-live-mode .bracket-connectors-svg {
  z-index: 2;
}


/* Bracket full-height utilisation fix - uses the blank space under the bracket area without touching Match Point. */
body.bracket-live-mode .panel {
  min-height: calc(100vh - 185px);
}

body.bracket-live-mode .bracket-table-wrap {
  height: 100%;
  min-height: calc(100vh - 245px);
}

body.bracket-live-mode .bracket-app-shell {
  height: 100%;
  min-height: calc(100vh - 245px);
}

body.bracket-live-mode .bracket-main-panel {
  height: 100%;
}

body.bracket-live-mode .bracket-scroll-view {
  height: calc(100vh - 265px) !important;
  min-height: 675px !important;
  max-height: none !important;
}

body.bracket-live-mode .bracket-canvas {
  min-height: 675px !important;
}

@media (max-height: 850px) {
  body.bracket-live-mode .bracket-scroll-view {
    height: calc(100vh - 235px) !important;
    min-height: 600px !important;
  }

  body.bracket-live-mode .bracket-canvas {
    min-height: 600px !important;
  }
}

/* Live header cleanup */
.stats {
  display: none !important;
}

body.bracket-live-mode .hero,
body.match-point-live-mode .hero {
  display: block !important;
  margin-bottom: 8px;
}

.matchpoint-main-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-areas:
    "title title"
    "table side";
  gap: 14px;
  align-items: start;
}

.matchpoint-main-panel .panel-title {
  grid-area: title;
}

.matchpoint-main-panel .table-wrap {
  grid-area: table;
  min-width: 0;
}

.matchpoint-side-panel {
  grid-area: side;
  width: 100%;
  min-width: 0;
}

@media (max-width: 1180px) {
  .matchpoint-main-panel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "side"
      "table";
  }
}

/* Caster embedded mode: used inside the caster output window for Stats Views. */
body.caster-embed-mode {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #02050b;
}

body.caster-embed-mode .page {
  width: 100vw;
  height: 100vh;
  max-width: none;
  margin: 0;
  padding: 0;
  display: block;
  overflow: hidden;
}

body.caster-embed-mode .hero,
body.caster-embed-mode .winner,
body.caster-embed-mode .panel-title,
body.caster-embed-mode #secondaryPanel,
body.caster-embed-mode .matchpoint-side-panel,
body.caster-embed-mode .bracket-side-panel {
  display: none !important;
}

body.caster-embed-mode .panel {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: #02050b;
  box-shadow: none;
  overflow: hidden;
}

body.caster-embed-mode .table-wrap {
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
}

body.caster-embed-mode.match-point-live-mode .table-wrap {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #D19A63 #181E22;
}

body.caster-embed-mode.match-point-live-mode .table-wrap::-webkit-scrollbar,
body.caster-embed-mode.match-point-live-mode .matches-scroll::-webkit-scrollbar,
body.caster-embed-mode.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

body.caster-embed-mode.match-point-live-mode .table-wrap::-webkit-scrollbar-track,
body.caster-embed-mode.match-point-live-mode .matches-scroll::-webkit-scrollbar-track,
body.caster-embed-mode.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar-track {
  background: #181E22;
  border-radius: 10px;
}

body.caster-embed-mode.match-point-live-mode .table-wrap::-webkit-scrollbar-thumb,
body.caster-embed-mode.match-point-live-mode .matches-scroll::-webkit-scrollbar-thumb,
body.caster-embed-mode.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #D19A63, #E0B184);
  border: 2px solid #181E22;
  border-radius: 10px;
}

body.caster-embed-mode.bracket-live-mode .bracket-table-wrap,
body.caster-embed-mode.bracket-live-mode .bracket-app-shell,
body.caster-embed-mode.bracket-live-mode .bracket-main-panel,
body.caster-embed-mode.bracket-live-mode .bracket-scroll-view {
  width: 100%;
  height: 100%;
  max-height: none;
}

body.caster-embed-mode.bracket-live-mode .bracket-app-shell {
  display: block;
  grid-template-columns: none;
}

body.caster-embed-mode.bracket-live-mode .bracket-main-panel {
  border: 1px solid rgba(139, 92, 246, 0.68);
  border-radius: 16px;
  background: rgba(8, 11, 18, 0.96);
  overflow: hidden;
}

body.caster-embed-mode.bracket-live-mode .bracket-scroll-view {
  overflow: auto;
}

body.caster-embed-mode.match-point-live-mode .standings-split {
  min-height: 100%;
}

body.caster-embed-mode.match-point-live-mode .standings-fixed-table,
body.caster-embed-mode.match-point-live-mode .standings-matches-table {
  font-size: clamp(12px, 1.1vw, 18px);
}

body.caster-embed-mode.match-point-live-mode th,
body.caster-embed-mode.match-point-live-mode td {
  padding-top: clamp(8px, 0.85vw, 14px);
  padding-bottom: clamp(8px, 0.85vw, 14px);
}

/* NAPZ_BRACKET_APP_PARITY_V1
   Browser live bracket mirrors the current WPF BracketView. */
body.bracket-live-mode {
  --bg: #060A14;
  --panel: #0E1728;
  --panel2: #0A1220;
  --line: #334765;
  --cyan: #8B5CF6;
  --blue: #5F7FE8;
  --green: #8FA8C7;
  --pink: #8B5CF6;
  --orange: #C49A6C;
  --text: #F4F5FB;
  --muted: #AAB2C5;
  color: #F4F5FB;
  font-family: "Segoe UI", Arial, sans-serif;
  background-color: #060A14 !important;
  background-image:
    radial-gradient(circle at 9px 9px, rgba(46, 75, 110, 0.28) 0, rgba(46, 75, 110, 0.28) 0.72px, transparent 0.8px),
    linear-gradient(135deg, #060A14 0%, #091321 45%, #130F25 100%) !important;
  background-size: 18px 18px, 100% 100% !important;
}

body.bracket-live-mode .eyebrow {
  color: #C49A6C;
}

body.bracket-live-mode h1,
body.bracket-live-mode h2 {
  color: #F4F5FB;
  font-family: "Segoe UI", Arial, sans-serif;
}

body.bracket-live-mode .muted {
  color: #AAB2C5;
}

/* The WPF bracket page does not have an extra card/title around the bracket + sidebar. */
body.bracket-live-mode .panel {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

body.bracket-live-mode .panel-title {
  display: none !important;
}

body.bracket-live-mode .bracket-table-wrap {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.bracket-live-mode .bracket-app-shell {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

/* Main bracket container: exact WPF panel colours/sizing. */
body.bracket-live-mode .bracket-main-panel {
  min-width: 0;
  background: #0A1220 !important;
  background-image: none !important;
  border: 1px solid #8B5CF6 !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  padding: 10px !important;
}

body.bracket-live-mode .live-bracket-section-bg {
  background: rgba(11, 16, 32, 0.72) !important;
  background-image: none !important;
  border: 1px solid #8B5CF6 !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}

body.bracket-live-mode .live-bracket-section-header {
  color: #8B5CF6 !important;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 19px;
  font-weight: 700;
}

body.bracket-live-mode .live-bracket-section-header button {
  color: #8B5CF6 !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

body.bracket-live-mode .live-bracket-round-header {
  color: #9CA7C2 !important;
  font-size: 13px;
  font-weight: 700;
}

body.bracket-live-mode .live-bracket-match-card {
  background: #0B1020 !important;
  background-image: none !important;
  border: 1px solid #C49A6C !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

body.bracket-live-mode .live-bracket-match-header {
  color: #C49A6C !important;
  font-weight: 700;
}

body.bracket-live-mode .live-bracket-team-row span:first-child {
  color: #F5F7FF;
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 600;
}

body.bracket-live-mode .live-bracket-team-row.winner-row span:first-child {
  color: #00F5A0;
  font-weight: 700;
}

body.bracket-live-mode .live-bracket-team-row.loser-row span:first-child,
body.bracket-live-mode .live-bracket-team-row.bye-row span:first-child {
  color: #6F7A96;
}

body.bracket-live-mode .live-bracket-divider {
  background: rgba(245, 247, 255, 0.78);
}

body.bracket-live-mode .live-bracket-dots i,
body.bracket-live-mode .live-bracket-dots i.filled {
  border-color: #C49A6C !important;
}

body.bracket-live-mode .live-bracket-dots i {
  background: transparent !important;
}

body.bracket-live-mode .live-bracket-dots i.filled {
  background: #C49A6C !important;
}

body.bracket-live-mode .live-bracket-team-row.winner-row .live-bracket-dots i {
  border-color: #00F5A0 !important;
}

body.bracket-live-mode .live-bracket-team-row.winner-row .live-bracket-dots i.filled {
  background: #00F5A0 !important;
}

body.bracket-live-mode .live-bracket-connector-line {
  stroke: #23304A !important;
  stroke-width: 2;
}

/* Right-side panels: Tournament Info and Teams mirror BracketView.xaml. */
body.bracket-live-mode .bracket-side-panel {
  width: 300px;
  min-width: 300px;
  gap: 12px;
}

body.bracket-live-mode .bracket-side-accordion {
  background: #0E1728 !important;
  background-image: none !important;
  border: 1px solid #5F7FE8 !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  padding: 14px !important;
}

body.bracket-live-mode .bracket-side-accordion.pink {
  border-color: #8B5CF6 !important;
  box-shadow: 0 0 22px rgba(139, 92, 246, 0.14) !important;
}

body.bracket-live-mode .bracket-side-accordion.blue {
  border-color: #5F7FE8 !important;
}

body.bracket-live-mode .bracket-side-header {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #F4F5FB !important;
  padding: 0 !important;
}

body.bracket-live-mode .bracket-side-title {
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
}

body.bracket-live-mode .bracket-side-icon,
body.bracket-live-mode .bracket-side-toggle,
body.bracket-live-mode .bracket-side-accordion.pink .bracket-side-icon,
body.bracket-live-mode .bracket-side-accordion.pink .bracket-side-toggle {
  color: #8B5CF6 !important;
  font-size: 22px;
  font-weight: 700;
}

body.bracket-live-mode .bracket-side-body {
  margin-top: 12px;
  border-top: 1px solid #334765;
  padding-top: 12px;
}

/* Teams in the WPF app has no divider directly below its header. */
body.bracket-live-mode .bracket-side-accordion.blue .bracket-side-body {
  border-top: 0;
  padding-top: 0;
}

body.bracket-live-mode .bracket-info-grid {
  grid-template-columns: 115px minmax(0, 1fr);
  row-gap: 0;
  column-gap: 0;
  font-size: 12px;
}

body.bracket-live-mode .bracket-info-grid span,
body.bracket-live-mode .bracket-info-grid strong {
  min-height: 30px;
  display: flex;
  align-items: center;
}

body.bracket-live-mode .bracket-info-grid span {
  color: #AAB2C5;
  font-weight: 400;
}

body.bracket-live-mode .bracket-info-grid strong {
  color: #8B5CF6;
  font-size: 12px;
  font-weight: 600;
}

body.bracket-live-mode .bracket-info-grid strong.info-money-value {
  color: #8FA8C7;
}

body.bracket-live-mode .bracket-info-prize,
body.bracket-live-mode .bracket-info-winner {
  grid-template-columns: 44px minmax(0, 1fr);
  margin-top: 14px;
  padding: 12px;
  background: #151126 !important;
  background-image: none !important;
  border: 1px solid #334765 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

body.bracket-live-mode .bracket-info-prize > span {
  color: #C49A6C;
  font-size: 28px;
}

body.bracket-live-mode .bracket-info-prize small,
body.bracket-live-mode .bracket-info-winner small {
  color: #AAB2C5;
  font-size: 13px;
  margin-bottom: 2px;
}

body.bracket-live-mode .bracket-info-prize strong {
  color: #C49A6C;
  font-size: 26px;
  font-weight: 700;
}

body.bracket-live-mode .bracket-info-winner > span,
body.bracket-live-mode .bracket-info-winner strong {
  color: #8FA8C7;
}

body.bracket-live-mode .bracket-team-status {
  background: #111B2C !important;
  background-image: none !important;
  border: 1px solid #8FA8C7 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  color: #8FA8C7 !important;
  font-size: 15px;
  font-weight: 700;
  padding: 10px;
  margin-bottom: 10px;
}

body.bracket-live-mode .bracket-side-list {
  max-height: 520px;
  background: #0A1220 !important;
  background-image: none !important;
  border: 1px solid #334765 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  padding: 8px;
}

body.bracket-live-mode .bracket-side-team {
  background: #07101A !important;
  background-image: none !important;
  border: 1px solid #FF2ECF !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  padding: 8px;
  margin-bottom: 10px;
}

body.bracket-live-mode .bracket-side-team strong {
  color: #F4F5FB !important;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

body.bracket-live-mode .bracket-side-team span {
  color: #9CA7C2 !important;
  font-size: 11px;
  line-height: 1.25;
}

/* Bracket horizontal scrollbar mirrors the WPF control palette. */
body.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar,
body.bracket-live-mode .bracket-side-list::-webkit-scrollbar {
  height: 18px;
  width: 14px;
}

body.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar-track,
body.bracket-live-mode .bracket-side-list::-webkit-scrollbar-track {
  background: #121D31;
  border: 1px solid #334765;
  border-radius: 6px;
}

body.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar-thumb,
body.bracket-live-mode .bracket-side-list::-webkit-scrollbar-thumb {
  background: #8B5CF6;
  border: 1px solid #8B5CF6;
  border-radius: 6px;
}
/* End NAPZ_BRACKET_APP_PARITY_V1 */

/* Unified bracket surface: Main/Lower share one scrollable form. */
body.bracket-live-mode .bracket-main-panel {
  border-color: #8B5CF6 !important;
  background: #0A1220 !important;
}

body.bracket-live-mode .bracket-scroll-view,
body.caster-embed-mode.bracket-live-mode .bracket-scroll-view {
  overflow: auto !important;
  scrollbar-gutter: stable;
}

body.bracket-live-mode .bracket-canvas,
body.caster-embed-mode.bracket-live-mode .bracket-canvas {
  max-width: none !important;
  max-height: none !important;
}

body.bracket-live-mode .live-bracket-section-bg,
body.caster-embed-mode.bracket-live-mode .live-bracket-section-bg {
  display: none !important;
}

body.bracket-live-mode .live-bracket-section-divider,
body.caster-embed-mode.bracket-live-mode .live-bracket-section-divider {
  display: block;
}

body.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar,
body.caster-embed-mode.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar {
  width: 18px;
  height: 18px;
}

body.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar-track,
body.caster-embed-mode.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar-track {
  background: #121D31;
  border: 1px solid #334765;
  border-radius: 6px;
}

body.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar-thumb,
body.caster-embed-mode.bracket-live-mode .bracket-scroll-view::-webkit-scrollbar-thumb {
  background: #8B5CF6;
  border: 1px solid #8B5CF6;
  border-radius: 6px;
}

/* NAPZ_CASTER_MATCH_POINT_EXPANSION_V2
 * Caster-embed-only layout and palette update. The normal browser live view,
 * bracket live view and all scoring/rendering JavaScript remain unchanged. */
body.caster-embed-mode.match-point-live-mode {
  --bg: #060A14;
  --panel: #0E1728;
  --panel2: #0A1220;
  --line: #334765;
  --cyan: #8B5CF6;
  --green: #8FA8C7;
  --pink: #8B5CF6;
  --orange: #C49A6C;
  --text: #F4F5FB;
  --muted: #AAB2C5;
  background: #060A14;
}

/* Remove the hidden title/side-panel grid tracks so the standings use the
 * complete iframe viewport rather than the old reduced lower-left grid cell. */
body.caster-embed-mode.match-point-live-mode .panel.matchpoint-main-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  background: #060A14;
}

body.caster-embed-mode.match-point-live-mode .table-wrap {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: hidden;
  background: #060A14;
  border-color: #334765;
}

/* Up to ten teams share the available height. The class is added only by the
 * caster-embed layout code once team eleven exists, so the normal app/live page
 * keeps its existing scrolling behaviour. */
body.caster-embed-mode.match-point-live-mode .table-wrap.caster-team-scroll {
  overflow-y: auto;
}

body.caster-embed-mode.match-point-live-mode .standings-split {
  width: 100%;
  height: max-content;
  min-height: 0;
  align-items: flex-start;
}

body.caster-embed-mode.match-point-live-mode .matches-scroll {
  height: auto;
  overflow-x: scroll;
  overflow-y: hidden;
}

/* Scale the existing fixed columns and match columns proportionally across the
 * caster surface without altering their order or the horizontal-scroll model. */
body.caster-embed-mode.match-point-live-mode .standings-fixed-table {
  flex-basis: clamp(480px, 32vw, 660px) !important;
  width: clamp(480px, 32vw, 660px) !important;
  min-width: clamp(480px, 32vw, 660px) !important;
  max-width: clamp(480px, 32vw, 660px) !important;
  height: auto !important;
}

body.caster-embed-mode.match-point-live-mode .standings-fixed-table th:nth-child(1),
body.caster-embed-mode.match-point-live-mode .standings-fixed-table td:nth-child(1) {
  width: clamp(60px, 4vw, 78px) !important;
  min-width: clamp(60px, 4vw, 78px) !important;
  max-width: clamp(60px, 4vw, 78px) !important;
}

body.caster-embed-mode.match-point-live-mode .standings-fixed-table th:nth-child(2),
body.caster-embed-mode.match-point-live-mode .standings-fixed-table td:nth-child(2) {
  width: clamp(250px, 17vw, 350px) !important;
  min-width: clamp(250px, 17vw, 350px) !important;
  max-width: clamp(250px, 17vw, 350px) !important;
}

body.caster-embed-mode.match-point-live-mode .standings-fixed-table th:nth-child(3),
body.caster-embed-mode.match-point-live-mode .standings-fixed-table td:nth-child(3) {
  width: clamp(90px, 6vw, 125px) !important;
  min-width: clamp(90px, 6vw, 125px) !important;
  max-width: clamp(90px, 6vw, 125px) !important;
}

body.caster-embed-mode.match-point-live-mode .standings-fixed-table th:nth-child(4),
body.caster-embed-mode.match-point-live-mode .standings-fixed-table td:nth-child(4) {
  width: clamp(80px, 5vw, 107px) !important;
  min-width: clamp(80px, 5vw, 107px) !important;
  max-width: clamp(80px, 5vw, 107px) !important;
}

body.caster-embed-mode.match-point-live-mode .standings-matches-table {
  width: max-content !important;
  min-width: max-content !important;
  height: auto !important;
  table-layout: fixed;
}

body.caster-embed-mode.match-point-live-mode .standings-matches-table th,
body.caster-embed-mode.match-point-live-mode .standings-matches-table td {
  width: clamp(52px, 3.4vw, 68px) !important;
  min-width: clamp(52px, 3.4vw, 68px) !important;
  max-width: clamp(52px, 3.4vw, 68px) !important;
}

body.caster-embed-mode.match-point-live-mode .standings-matches-table thead tr:first-child th {
  width: clamp(104px, 6.8vw, 136px) !important;
  min-width: clamp(104px, 6.8vw, 136px) !important;
  max-width: clamp(104px, 6.8vw, 136px) !important;
}

/* The fixed header uses row-spans, so its single visible row equals the two
 * 32px match-header rows. This keeps both halves pixel-aligned. */
body.caster-embed-mode.match-point-live-mode .standings-fixed-table thead tr:first-child th {
  height: 64px !important;
}

body.caster-embed-mode.match-point-live-mode .standings-matches-table thead tr:first-child th,
body.caster-embed-mode.match-point-live-mode .standings-matches-table thead tr:nth-child(2) th {
  height: 32px !important;
}

body.caster-embed-mode.match-point-live-mode .standings-fixed-table th,
body.caster-embed-mode.match-point-live-mode .standings-matches-table th {
  padding: 3px clamp(6px, 0.55vw, 10px) !important;
  font-size: clamp(12px, 0.85vw, 15px) !important;
  background: #0E1728;
  border-color: #334765;
}

body.caster-embed-mode.match-point-live-mode .standings-fixed-table tbody tr:not(.fixed-scrollbar-spacer-row),
body.caster-embed-mode.match-point-live-mode .standings-matches-table tbody tr {
  height: var(--caster-standing-row-height, 58px) !important;
}

body.caster-embed-mode.match-point-live-mode .standings-fixed-table tbody tr:not(.fixed-scrollbar-spacer-row) td,
body.caster-embed-mode.match-point-live-mode .standings-matches-table tbody td {
  height: var(--caster-standing-row-height, 58px) !important;
  max-height: var(--caster-standing-row-height, 58px) !important;
  padding: clamp(6px, 0.7vw, 12px) !important;
  font-size: clamp(13px, 1.05vw, 18px) !important;
  vertical-align: middle;
  background: #07101A;
  border-color: #334765;
}

body.caster-embed-mode.match-point-live-mode .team-cell strong {
  font-size: clamp(14px, 1.15vw, 20px) !important;
}

body.caster-embed-mode.match-point-live-mode .team-cell span {
  margin-top: 3px;
  font-size: clamp(12px, 0.95vw, 17px) !important;
}

/* Reserve exactly the app-style horizontal scrollbar height under the fixed
 * columns; do not let the general caster row sizing enlarge this spacer. */
body.caster-embed-mode.match-point-live-mode .standings-fixed-table tbody tr.fixed-scrollbar-spacer-row,
body.caster-embed-mode.match-point-live-mode .standings-fixed-table tbody tr.fixed-scrollbar-spacer-row td {
  height: 18px !important;
  max-height: 18px !important;
  padding: 0 !important;
  background: #060A14 !important;
  border-top-color: #334765 !important;
}

/* Caster Match Point scrollbars now mirror the WPF slate-blue/purple controls. */
body.caster-embed-mode.match-point-live-mode .table-wrap,
body.caster-embed-mode.match-point-live-mode .matches-scroll {
  scrollbar-color: #8B5CF6 #121D31;
}

body.caster-embed-mode.match-point-live-mode .table-wrap::-webkit-scrollbar,
body.caster-embed-mode.match-point-live-mode .matches-scroll::-webkit-scrollbar {
  width: 18px;
  height: 18px;
}

body.caster-embed-mode.match-point-live-mode .table-wrap::-webkit-scrollbar-track,
body.caster-embed-mode.match-point-live-mode .matches-scroll::-webkit-scrollbar-track {
  background: #121D31;
  border: 1px solid #334765;
  border-radius: 6px;
}

body.caster-embed-mode.match-point-live-mode .table-wrap::-webkit-scrollbar-thumb,
body.caster-embed-mode.match-point-live-mode .matches-scroll::-webkit-scrollbar-thumb {
  background: #8B5CF6;
  border: 1px solid #8B5CF6;
  border-radius: 6px;
}
/* End NAPZ_CASTER_MATCH_POINT_EXPANSION_V2 */
