/* ============================================================
   PickUp USA Fitness — Court Dashboard
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue: #1e6bf0;
  --blue-dark: #0a3a9c;
  --red: #e7202d;
  --red-dark: #8a0d18;
  --gold: #f0b400;
  --gold-dark: #8a6300;
  --green: #25c66a;
  --white: #ffffff;
  --ink: #0a1226;

  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.18);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
}

html,
body {
  height: 100%;
  background: #050915;
  color: var(--white);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Background ===== */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('/assets/images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #2a1240;
  /* fallback while image loads / if missing */
}

/* Soft sweeping highlight on top of the photo */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(30, 107, 240, 0.18), transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(231, 32, 45, 0.18), transparent 55%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%);
  mix-blend-mode: screen;
}

/* ===== Logo (top-left, blended) ===== */
.logo {
  position: fixed;
  top: 24px;
  left: 36px;
  z-index: 6;
  /* above swoosh (5), below dashboard UI (10) */
  width: 384px;
  /* was 480 — reduced 20% */
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.6));
  pointer-events: none;
  object-fit: contain;
}

/* Decorative red/white swoosh behind the logo
   A thin curved accent that connects the LEFT edge to the TOP edge of the screen.
   z-index 5: above .bg (0) but BELOW the dashboard UI (10) */
.logo-swoosh {
  position: fixed;
  top: 0;
  left: 0;
  width: 540px;
  height: 340px;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.45));
  overflow: visible;
}

/* ===== Status / clock pills ===== */
.status-bar {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 30;
  display: flex;
  gap: 12px;
  align-items: center;
}

.status-pill {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  color: rgba(255, 255, 255, 0.92);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: var(--shadow);
}

.status-pill.live {
  color: #ff5867;
}

.status-pill .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff2e3e;
  margin-right: 6px;
  box-shadow: 0 0 10px #ff2e3e;
  animation: pulse 1.4s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.85);
  }
}

/* ===== Dashboard layout ===== */
.dashboard {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 24px;
  padding: 130px 32px 70px 28px;
  transition: grid-template-columns .6s ease, grid-template-rows .6s ease;
}

/* Horizontal layout: 3 teams in a row on top, waiting list full-width below */
.dashboard.layout-horizontal {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
}

/* ===== Teams region ===== */
.teams-region {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  align-items: stretch;
}

.team-row {
  display: flex;
  gap: 22px;
  min-height: 0;
  align-items: flex-start;
  /* don't stretch cards vertically */
}

.team-row-top {
  justify-content: center;
  /* Team 1 centered above Team 2/3 */
}

.team-row-top .team-card {
  flex: 0 1 calc(50% - 11px);
  /* match width of one of the bottom cards */
  max-width: calc(50% - 11px);
}

.team-row-bottom .team-card {
  flex: 1 1 0;
  min-width: 0;
}

/* Horizontal mode: flatten team-rows so all 3 cards become siblings */
.dashboard.layout-horizontal .teams-region {
  flex-direction: row;
  flex: 0 0 auto;
  align-items: stretch;
}

.dashboard.layout-horizontal .team-row {
  display: contents;
}

.dashboard.layout-horizontal .team-card {
  flex: 1 1 0;
  max-width: none;
}

/* compact team cards in horizontal mode (less vertical room) */
.dashboard.layout-horizontal .team-card .team-header {
  font-size: 22px;
  padding: 10px 16px;
}

.dashboard.layout-horizontal .team-card .player-list {
  padding: 6px 8px;
  gap: 4px;
}

.dashboard.layout-horizontal .player {
  padding: 6px 10px;
}

.dashboard.layout-horizontal .player .avatar {
  width: 36px;
  height: 36px;
}

/* ===== Team card ===== */
.team-card {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .4s ease;
}

.team-card .team-header {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 2px;
  font-size: 24px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.team-card .team-header .team-meta {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  opacity: .85;
  letter-spacing: 1.2px;
}

/* color-coded headers */
.team-1 .team-header {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
}

.team-2 .team-header {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
}

.team-3 .team-header {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
}

.team-1 {
  border-top: 2px solid var(--blue);
}

.team-2 {
  border-top: 2px solid var(--red);
}

.team-3 {
  border-top: 2px solid var(--gold);
}

.team-card .player-list {
  list-style: none;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

/* ===== Player row ===== */
.player {
  display: grid;
  grid-template-columns: 28px 44px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  min-height: 60px;
  /* enforce uniform height across all rows */
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: background .25s, transform .25s;
}

.player:hover {
  background: rgba(255, 255, 255, 0.08);
}

.player .num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.player .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3a6a, #16203f);
  border: 2px solid rgba(255, 255, 255, 0.25);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3);
}

.player .info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player .name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info .name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.info .name-row .name {
  min-width: 0;
}

.guest-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #ffe9ad;
  background: linear-gradient(135deg, rgba(240, 180, 0, 0.32), rgba(240, 180, 0, 0.1));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(240, 180, 0, 0.55);
  border-radius: 999px;
  padding: 2px 8px 2px 6px;
  box-shadow: 0 0 8px rgba(240, 180, 0, 0.3);
}

.guest-chip::before {
  content: "";
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

.player .rank-label {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jersey,
.trophy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
}

.jersey {
  width: 38px;
  min-width: 38px;
}

.trophy {
  min-width: 56px;
}

.jersey svg,
.trophy svg {
  width: 28px;
  height: 28px;
  display: block;
}

.trophy span {
  white-space: nowrap;
}

.player .trophy span {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}

/* ===== Tier rank badge (Rocket-League style) ===== */
.tier {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

/* Radial progress ring (outermost layer) */
.tier svg.progress-ring {
  width: 100%;
  height: 100%;
  position: absolute;
  transform: rotate(90deg);
  /* start at 6 o'clock (bottom), fill clockwise */
  z-index: 1;
}

.tier .progress-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 3.5;
}

.tier .progress-fill {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
}

/* Badge icon (smaller, centered inside the ring) */
.tier svg.tier-icon {
  width: 32px;
  height: 32px;
  position: absolute;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Fallback for simple badges (no progress ring, e.g. tier reference) */
.tier svg:not(.progress-ring):not(.tier-icon) {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.tier .roman {
  position: absolute;
  z-index: 3;
  /* above badge icon (2) and progress ring (1) */
  font-family: 'Bebas Neue', sans-serif;
  font-size: 12px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* For the player row we use a slightly different grid to fit a tier badge */
.player.with-tier {
  grid-template-columns: 26px 38px 44px 1fr auto auto;
}

/* ===== Right region (panels) ===== */
.right-region {
  position: relative;
  min-width: 0;
  min-height: 0;
}

/* In horizontal mode the "right region" becomes the bottom row */
.dashboard.layout-horizontal .right-region {
  min-height: 0;
}

.dashboard.layout-horizontal .panel-body {
  flex-direction: column;
}

.panel {
  position: absolute;
  inset: 0;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity .55s ease, transform .55s ease;
  pointer-events: none;
}

.panel.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 3px;
  font-size: 30px;
  font-weight: 400;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.panel-header .subtitle {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}

.header-monthly {
  background: linear-gradient(135deg, #122b6a, #0a1f5c);
}

.header-waiting {
  background: linear-gradient(135deg, #0a3a5c, #0a1f3c);
}

.header-leaderboard {
  background: linear-gradient(135deg, #6a0d18, #2a0a14);
}

.header-tiers {
  background: linear-gradient(135deg, #3a1a6a, #1a0a3a);
}

.header-earnxp {
  background: linear-gradient(135deg, #6a4a0a, #2a1a05);
}

.panel-body {
  flex: 1;
  padding: 14px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== Waiting list rows ===== */
.waiting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.waiting-row .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a3a6a, #16203f);
  border: 2px solid rgba(255, 255, 255, 0.25);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.waiting-row .info {
  flex: 0 1 auto;
  min-width: 100px;
  max-width: 200px;
}

.waiting-row .info .name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waiting-row .info .rank-label {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  white-space: nowrap;
}

/* Multi-column layout for waiting list */
.waiting-columns {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
}

.waiting-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.waiting-col-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 12px;
  flex-shrink: 0;
}

.waiting-row .num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

.waiting-row .wait-time {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 999px;
}

/* ===== Leaderboard rows ===== */
.lb-row {
  display: grid;
  grid-template-columns: 38px 44px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.lb-row .gym {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

.lb-row .xp {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--gold);
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(240, 180, 0, 0.45);
}

.lb-row.gold {
  background: linear-gradient(90deg, rgba(240, 180, 0, 0.18), rgba(240, 180, 0, 0.04));
  border-color: rgba(240, 180, 0, 0.4);
}

.lb-row.silver {
  background: linear-gradient(90deg, rgba(200, 210, 225, 0.18), rgba(200, 210, 225, 0.04));
  border-color: rgba(200, 210, 225, 0.35);
}

.lb-row.bronze {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.18), rgba(205, 127, 50, 0.04));
  border-color: rgba(205, 127, 50, 0.35);
}

/* ===== Casey Queue logo (bottom-right, behind UI) ===== */
.logo-br {
  position: fixed;
  bottom: 14px;
  right: 18px;
  z-index: 6;
  /* above bg (0), below dashboard (10) */
  width: 70px;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  object-fit: contain;
  opacity: 0.85;
}

/* ===== Tier ranking rows ===== */
.tier-ref-row {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.tier-ref-row .tier-label {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.tier-ref-row .tier-sub {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

.tier-ref-row .tier-xp {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  text-shadow: 0 0 8px rgba(240, 180, 0, 0.4);
}

/* ===== How to earn XP rows =====
   Each row carries its own --accent so the medal, rail and XP badge
   all read as one colour block. */
.panel-earn-xp .panel-body {
  justify-content: center;
  gap: 16px;
  padding: 20px 18px;
}

.xp-earn-row {
  --accent: var(--gold);
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px 16px 26px;
  border-radius: 16px;
  overflow: hidden;
  /* Plain fallbacks first — color-mix() is progressive enhancement */
  background: rgba(8, 12, 30, 0.45);
  background:
    linear-gradient(115deg,
      color-mix(in srgb, var(--accent) 26%, transparent),
      rgba(255, 255, 255, 0.03) 55%),
    rgba(8, 12, 30, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Coloured rail down the leading edge */
.xp-earn-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 5px;
  border-radius: 0 999px 999px 0;
  background: var(--accent);
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 30%, black));
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* Slow diagonal sheen so the panel never looks static on a TV */
.xp-earn-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
      transparent 35%,
      rgba(255, 255, 255, 0.14) 50%,
      transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}

.panel-earn-xp.active .xp-earn-row::after {
  animation: xpSheen 4.5s ease-in-out infinite;
}

.panel-earn-xp.active .xp-earn-row:nth-child(2)::after {
  animation-delay: .5s;
}

.panel-earn-xp.active .xp-earn-row:nth-child(3)::after {
  animation-delay: 1s;
}

@keyframes xpSheen {
  0% {
    transform: translateX(-120%);
  }

  45%,
  100% {
    transform: translateX(120%);
  }
}

.xp-play {
  --accent: var(--blue);
}

.xp-win {
  --accent: var(--gold);
}

.xp-streak {
  --accent: var(--red);
}

/* ---- Medal: ringed disc with the action glyph inside ---- */
.xp-earn-medal {
  position: relative;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  background:
    radial-gradient(circle at 35% 28%,
      color-mix(in srgb, var(--accent) 85%, white 15%),
      color-mix(in srgb, var(--accent) 55%, black 45%) 68%,
      #0a0a0a 100%);
  box-shadow:
    0 0 18px color-mix(in srgb, var(--accent) 55%, transparent),
    inset 0 2px 6px rgba(255, 255, 255, 0.25);
}

.xp-earn-medal .medal-ring {
  position: absolute;
  inset: -5px;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
}

.xp-earn-medal .medal-ring circle {
  fill: none;
  stroke: var(--accent);
  stroke: color-mix(in srgb, var(--accent) 80%, white 20%);
  stroke-width: 2.5;
  opacity: .85;
}

.xp-earn-medal .medal-glyph {
  position: relative;
  width: 42px;
  height: 42px;
  color: #fff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.xp-win .medal-glyph {
  color: #ffe9a8;
}

/* ---- Copy ---- */
.xp-earn-row .xp-earn-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 2px;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.xp-earn-row .xp-earn-sub {
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

/* One pip per win needed for the streak bonus */
.streak-pips {
  display: inline-flex;
  gap: 4px;
}

.streak-pips i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 80%, transparent);
}

/* ---- XP badge ---- */
.xp-earn-row .xp-earn-value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 8px 16px;
  border-radius: 12px;
  font-family: 'Bebas Neue', sans-serif;
  color: #fff;
  background: var(--accent);
  background: linear-gradient(160deg,
      color-mix(in srgb, var(--accent) 92%, white 8%),
      color-mix(in srgb, var(--accent) 55%, black 45%));
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 6px 16px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.xp-earn-value .plus {
  font-size: 24px;
  opacity: .85;
}

.xp-earn-value .num {
  font-size: 40px;
  line-height: .9;
  letter-spacing: 1px;
}

.xp-earn-value .unit {
  font-size: 18px;
  letter-spacing: 2px;
  opacity: .9;
}

.xp-earn-foot {
  margin-top: 4px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== View indicator ===== */
.view-indicator {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 50;
  background: rgba(8, 12, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.vi-dot {
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background .4s, width .4s;
}

.vi-dot.active {
  background: linear-gradient(90deg, var(--blue), var(--red));
  width: 60px;
}

/* ===== Responsive nudges (for various TV sizes) ===== */
@media (max-width: 1500px) {
  .panel-header h2 {
    font-size: 24px;
  }

  .player .name {
    font-size: 14px;
  }

  .team-card .team-header {
    font-size: 22px;
  }
}

/* ===== Mobile / portrait: stack everything linearly, no carousel ===== */
@media (max-width: 900px) {

  html,
  body {
    overflow-y: auto;
  }

  body {
    height: auto;
  }

  .logo {
    width: 70vw;
    max-width: 320px;
    top: 10px;
    left: 10px;
  }

  .logo-swoosh {
    width: 100vw;
    height: auto;
    max-height: 50vw;
  }

  .status-bar {
    top: 14px;
    right: 14px;
    gap: 6px;
  }

  .status-pill {
    padding: 6px 10px;
    font-size: 10px;
    letter-spacing: 1px;
  }

  /* Hide the rotating carousel — show everything stacked instead */
  .view-indicator {
    display: none;
  }

  .dashboard,
  .dashboard.layout-horizontal {
    height: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
    padding: calc(46vw + 20px) 14px 24px 14px;
    gap: 16px;
  }

  .teams-region,
  .dashboard.layout-horizontal .teams-region {
    flex-direction: column;
    gap: 16px;
  }

  .team-row,
  .dashboard.layout-horizontal .team-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .team-row-top .team-card,
  .team-row-bottom .team-card,
  .dashboard.layout-horizontal .team-card {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
  }

  /* Right region: show BOTH panels stacked, fully visible */
  .right-region {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
  }

  .panel {
    position: relative;
    /* override absolute */
    inset: auto;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .player {
    grid-template-columns: 24px 36px 40px 1fr auto auto;
    gap: 8px;
    padding: 8px 10px;
  }

  .player .avatar {
    width: 40px;
    height: 40px;
  }

  .team-card .team-header {
    font-size: 20px;
    padding: 10px 14px;
  }

  .panel-header h2 {
    font-size: 22px;
  }

  .waiting-row {
    grid-template-columns: 24px 36px 40px 1fr auto auto;
    gap: 8px;
    padding: 8px 10px;
  }

  .lb-row {
    grid-template-columns: 36px 40px 1fr auto auto;
    gap: 8px;
    padding: 8px 10px;
  }

  .lb-row .avatar,
  .waiting-row .avatar {
    width: 40px;
    height: 40px;
  }
}


.queue-info {
  display: block;
  column-gap: 2.5rem;
  column-fill: auto;
  column-width: 400px;
  max-height: 40vh;
}

.queue-player{
  margin-bottom: 5px;
  break-inside: avoid;
}

/* ===== Full-screen queue / Next Up overlay ===== */
.queue-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .55s ease, transform .55s ease;
  transform: translateX(30px);
}

.queue-overlay.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* Matches .panel-header + .header-waiting */
.queue-overlay-header {
  flex-shrink: 0;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(135deg, #0a3a5c, #0a1f3c);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Matches .panel-header h2 */
.queue-overlay-header h2 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 3px;
  font-size: 30px;
  font-weight: 400;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Matches .panel-header .subtitle */
.queue-overlay-count {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 600;
}

/* Top-to-bottom column flow: 1 col → 2 col → 3 col as players fill up */
.queue-overlay-grid {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  /* Wider than the old 420px so the wait column doesn't squeeze names */
  columns: 480px;
  column-gap: 8px;
  column-fill: auto;
}

/* Matches .lb-row */
.queue-overlay-row {
  position: relative;
  display: grid;
  grid-template-columns: 28px 38px 44px minmax(0, 1fr) auto auto 78px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  break-inside: avoid;
  margin-bottom: 8px;
  overflow: hidden;
}

.queue-pos {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

/* ===== Wait indicator — how many games until this player is on =====
   Rows carry --wait as an urgency tone: green on deck, amber next,
   muted for everyone further back. */
.queue-overlay-row.wait-on-deck {
  --wait: var(--green);
  background: linear-gradient(90deg, rgba(37, 198, 106, 0.16), rgba(255, 255, 255, 0.04) 45%);
  border-color: rgba(37, 198, 106, 0.45);
}

.queue-overlay-row.wait-soon {
  --wait: var(--gold);
}

.queue-overlay-row.wait-later {
  --wait: rgba(255, 255, 255, 0.45);
}

/* Urgency rail on the leading edge */
.queue-overlay-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--wait, transparent);
  opacity: .9;
}

.queue-overlay-row.wait-on-deck::before {
  box-shadow: 0 0 12px var(--green);
}

/* Long names shrink instead of pushing the wait column out of the row */
.queue-overlay-row .info {
  min-width: 0;
}

.queue-overlay-row .info .name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.queue-wait .wait-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  line-height: .9;
  letter-spacing: 1px;
  color: var(--wait, #fff);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.queue-wait .wait-cap {
  font-size: 9px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
}

/* On-deck players get a pill instead of a count */
.queue-wait .wait-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .8px;
  white-space: nowrap;
  color: #062d17;
  background: linear-gradient(180deg, #48e08b, var(--green));
  box-shadow: 0 0 14px rgba(37, 198, 106, 0.55);
}

.wait-pill .wait-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #062d17;
  animation: waitPulse 1.6s ease-in-out infinite;
}

@keyframes waitPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .35;
    transform: scale(.7);
  }
}

/* Header chip: how many get on in the next game */
.queue-ondeck-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-style: normal;
  color: #d8ffe9;
  background: rgba(37, 198, 106, 0.16);
  border: 1px solid rgba(37, 198, 106, 0.45);
}

.queue-ondeck-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: waitPulse 1.6s ease-in-out infinite;
}

/* ===== Full-screen advertisement overlay ===== */
.cs-xs-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .55s ease;
}

.cs-xs-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.ads_cc_image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ads_cc_video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-header,
.panel-header,
.queue-overlay-header {
    font-style: italic;
}

/* ===== Game On Banner ===== */
.game-on-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(10, 18, 38, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 36px 8px 36px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.06) inset;
  animation: game-on-pop .45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  white-space: nowrap;
}

@keyframes game-on-pop {
  from { opacity: 0; transform: translateX(-50%) scale(0.82); }
  to   { opacity: 1; transform: translateX(-50%) scale(1);    }
}

.game-on-team {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 3px;
  font-style: italic;
  line-height: 1;
}

.game-on-vs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1;
}

.vs-ball {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(231, 32, 45, 0.7));
  animation: vs-spin 6s linear infinite;
}

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

/* Team colour classes — match v3's three team header gradients */
.team-color-T1 {
  color: var(--blue);
  text-shadow: 0 0 18px rgba(30, 107, 240, 0.65), 0 2px 6px rgba(0,0,0,0.5);
}

.team-color-T2 {
  color: var(--red);
  text-shadow: 0 0 18px rgba(231, 32, 45, 0.65), 0 2px 6px rgba(0,0,0,0.5);
}

.team-color-T3 {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(240, 180, 0, 0.65), 0 2px 6px rgba(0,0,0,0.5);
}