/* =========================================================
     🎨 BAM! PALETTE
     Oxford Blue  #070F3A   (deep bg)
     Zaffre       #0313A6   (card accent / active)
     Hot Pink     #F715A8   (CTA / highlights)
     Cyan         #34EDF3   (links / labels / glow)
     Derived:
       #0d1b4b  card bg
       #0d2060  subtle border
       #1a0030  champion bg
       #440033  disabled
       #334477  muted / inactive
       #6677aa  secondary text
       #aabbdd  labels
  ========================================================= */

  /* =========================================================
     🌐 BASE
     ========================================================= */
  body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: clip;
    background: #070F3A;
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
  }

  @media (max-width: 600px) {
    body { padding: 0; }
    th, td { padding: 6px 8px; font-size: 12px; }
  }

  /* =========================================================
     📊 TABLE
     ========================================================= */
  table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
  }

  th, td {
    padding: 10px;
    border: 1px solid #0d2060;
    text-align: center;
  }

  th {
    background: #0313A6;
    color: #ffffff;
    border-color: #0d2060;
  }

  td {
    background: #0d1b4b;
    color: #ffffff;
    border-color: #0d2060;
  }

  .team { text-align: left; font-weight: bold; }

  .col-sticky {
    position: sticky;
    left: 0;
    background: #0d1b4b;
    z-index: 1;
  }

  th.col-sticky { background: #0313A6; }

  /* =========================================================
     🗂 DIVISION TABS
     ========================================================= */
  #division-tabs {
    display: flex;
    gap: 8px;
    margin: 5px 0 0;
  }

  .div-tab {
    flex: 1;
    padding: 6px 16px;
    border: 2px solid #34EDF3;
    border-radius: 8px;
    background: transparent;
    color: #34EDF3;
    font-weight: bold;
    cursor: pointer;
    font-size: 4vw;
    font-family: 'Audiowide', sans-serif;
    text-align: center;
  }

  .div-tab--active {
    background: #F715A8;
    border-color: #F715A8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(247,21,168,0.5);
  }

  .division-section {
    border-top: 2px solid #0313A6;
    padding-top: 8px;
  }

  /* =========================================================
     🏆 TOURNAMENT BRACKET
     ========================================================= */
  .bracket-scroll {
    padding-bottom: 8px;
  }

  .bracket {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px 0 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .bracket-round {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .round-label {
    font-size: 3vw;
    font-family: 'Audiowide', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6677aa;
    margin-bottom: 12px;
    white-space: nowrap;
    text-align: center;
  }

  .bracket-matches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .bracket-matches--single {
    grid-template-columns: 1fr;
  }

  .bracket-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
  }

  .connector-top {
    width: 2px;
    height: 12px;
    background: #34EDF3;
  }

  .connector-arrow {
    color: #34EDF3;
    font-size: 14px;
    line-height: 1;
  }

  .connector-bottom {
    width: 2px;
    height: 12px;
    background: #34EDF3;
  }

  .bracket-match {
    border: 2px solid #0313A6;
    border-radius: 10px;
    overflow: hidden;
    background: #0d1b4b;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .bracket-match--qf {
    border-color: #34EDF3;
    box-shadow: 0 2px 8px rgba(52,237,243,0.25);
  }

  .bracket-match--sf {
    border-color: #F715A8;
    box-shadow: 0 2px 10px rgba(247,21,168,0.3);
  }

  .bracket-match--final {
    border-color: #FFD700;
    box-shadow: 0 2px 10px rgba(255,215,0,0.2);
  }

  .bracket-match--final.bracket-match--decided {
    box-shadow: 0 0 18px rgba(255,215,0,0.5), 0 0 40px rgba(255,215,0,0.2);
    animation: final-pulse 2.5s ease-in-out infinite;
  }

  @keyframes final-pulse {
    0%, 100% { box-shadow: 0 0 18px rgba(255,215,0,0.5), 0 0 40px rgba(255,215,0,0.2); }
    50%       { box-shadow: 0 0 30px rgba(255,215,0,0.9), 0 0 60px rgba(255,215,0,0.4); }
  }

  .bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 8px;
    min-height: 10vw;
    font-size: 3.5vw;
    border-bottom: 1px solid #0d2060;
    color: #ffffff;
    gap: 4px;
    box-sizing: border-box;
  }

  .team-name {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    line-height: 1.2;
  }

  .team-score {
    font-weight: bold;
    white-space: nowrap;
    color: #34EDF3;
    flex-shrink: 0;
    font-size: 3.5vw;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: -0.5px;
  }

  .bracket-team:last-of-type { border-bottom: none; }

  /* 4–5 sets: stack the scores under the team name so the name stays readable */
  .bracket-match[data-sets="4"] .bracket-team,
  .bracket-match[data-sets="5"] .bracket-team {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .bracket-match[data-sets="4"] .bracket-team .match-scores,
  .bracket-match[data-sets="5"] .bracket-team .match-scores {
    justify-content: flex-start;
    gap: 0.9ch;
  }
  .bracket-match[data-sets="4"] .bracket-team .team-name,
  .bracket-match[data-sets="5"] .bracket-team .team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .bracket-team.winner {
    background: #0313A6;
    color: #34EDF3;
    font-weight: bold;
    box-shadow: inset 0 0 8px rgba(247,21,168,0.3);
  }

  .bracket-team.champion {
    background: linear-gradient(90deg, #1a0030 0%, #2a0a00 40%, #1a0030 100%);
    background-size: 200% 100%;
    color: #FFD700;
    font-weight: bold;
    animation: champion-shimmer 2s ease-in-out infinite;
  }

  @keyframes champion-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  .bracket-team.tbd {
    color: #334477;
    font-style: italic;
  }

  .champion-badge {
    padding: 10px 14px;
    font-size: 4.5vw;
    font-weight: bold;
    color: #FFD700;
    background: #1a0030;
    border-top: 1px solid #FFD700;
    text-align: center;
    letter-spacing: 1px;
    animation: champion-pop 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
    text-shadow: 0 0 12px rgba(255,215,0,0.8);
  }

  .bracket-add-score {
    display: block;
    padding: 12px 14px;
    font-size: 4.5vw;
    font-weight: bold;
    color: #F715A8;
    text-decoration: none;
    background: #0d1b4b;
    border-top: 1px solid #0313A6;
    text-align: center;
  }

  /* =========================================================
     🏸 ENTRY PAGE
     ========================================================= */
  .entry-wrap {
    padding: 76px 12px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    flex: 1;
  }

  body:has(.entry-wrap) {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding: 0 0 70px;
    width: 100vw;
    overflow-x: clip;
  }

  .entry-context {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
  }

  .entry-division {
    font-family: 'Audiowide', sans-serif;
    font-size: 5.5vw;
    padding: 6px 16px;
    border-radius: 10px;
    border: 2px solid #34EDF3;
    color: #34EDF3;
    background: transparent;
  }

  .entry-context-sep {
    font-size: 5.5vw;
    color: #34EDF3;
    font-family: 'Audiowide', sans-serif;
  }

  .entry-phase {
    font-family: 'Audiowide', sans-serif;
    font-size: 5.5vw;
    font-weight: bold;
    padding: 6px 16px;
    border-radius: 10px;
    border: 2px solid;
    color: #ffffff;
  }

  /* Pool — cyan outline, no fill */
  .entry-phase--pool {
    background: transparent;
    border-color: #34EDF3;
    color: #34EDF3;
    box-shadow: 0 0 8px rgba(52,237,243,0.3);
  }

  /* Quarter-final — green */
  .entry-phase--quarter {
    background: #00C896;
    border-color: #00C896;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0,200,150,0.5);
  }

  /* Semi-final — orange */
  .entry-phase--semi {
    background: #FF6B00;
    border-color: #FF6B00;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255,107,0,0.5);
  }

  /* Final — gold gradient, dark text, pulsing glow */
  .entry-phase--final {
    background: linear-gradient(135deg, #FFD700, #E8A000);
    border-color: #FFD700;
    color: #3a2000;
    font-size: 6vw;
    box-shadow: 0 0 16px rgba(255,215,0,0.7), 0 0 32px rgba(255,215,0,0.3);
    animation: final-pulse 1.5s ease-in-out infinite;
  }

  @keyframes final-pulse {
    0%, 100% { box-shadow: 0 0 16px rgba(255,215,0,0.7), 0 0 32px rgba(255,215,0,0.3); }
    50%       { box-shadow: 0 0 24px rgba(255,215,0,1),   0 0 48px rgba(255,215,0,0.6); }
  }

  .entry-teams {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 44px;
    margin-bottom: 16px;
  }

  .entry-team {
    flex: 1;
    min-width: 0;
    font-size: 6vw;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    color: #ffffff;
    text-align: center;
    line-height: 1.4;
    overflow-wrap: break-word;
    hyphens: auto;
    background: linear-gradient(160deg, #0d1b4b, #0313A6 100%);
    border: 2px solid #34EDF3;
    border-radius: 14px;
    padding: 12px 10px;
    box-shadow: 0 0 14px rgba(52,237,243,0.3), inset 0 0 20px rgba(52,237,243,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 18vw;
  }

  .entry-vs {
    position: absolute;
    left: 50%;
    top: 75%;
    transform: translate(-50%, -50%);
    z-index: 10;
    font-size: 10vw;
    color: #F715A8;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    text-shadow:
      0 0 6px #070F3A,
      0 0 12px #070F3A,
      0 0 20px #F715A8,
      0 0 40px rgba(247,21,168,0.8);
    animation: vs-pulse 1.8s ease-in-out infinite;
    white-space: nowrap;
  }

  @keyframes vs-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1);    text-shadow: 0 0 6px #070F3A, 0 0 12px #070F3A, 0 0 20px #F715A8, 0 0 40px rgba(247,21,168,0.8); }
    50%       { transform: translate(-50%, -50%) scale(1.15); text-shadow: 0 0 6px #070F3A, 0 0 12px #070F3A, 0 0 28px #F715A8, 0 0 56px rgba(247,21,168,1);  }
  }

  .entry-sets {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
  }

  /* 5-set: shrink teams and set rows so everything fits without scrolling */
  .entry-wrap[data-sets="5"] .entry-context   { margin-bottom: 16px; }
  .entry-wrap[data-sets="5"] .entry-teams     { margin-bottom: 16px; gap: 32px; }
  .entry-wrap[data-sets="5"] .entry-team      { font-size: 4.5vw; min-height: 14vw; padding: 10px 8px; }

  .entry-set-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .entry-set-row input {
    width: 40vw;
    text-align: center;
    font-size: 11vw;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    padding: 8px 4px;
    border: 2px solid #0313A6;
    border-radius: 12px;
    box-sizing: border-box;
    background: #0d1b4b;
    color: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .entry-set-row input:focus {
    border-color: #F715A8;
    box-shadow: 0 0 12px rgba(247,21,168,0.5);
    outline: none;
  }

  .entry-set-label {
    font-size: 3.5vw;
    color: #aabbdd;
    font-family: 'Audiowide', sans-serif;
    min-width: 12vw;
    text-align: center;
  }

  .entry-btn-row {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    margin-bottom: 4px;
  }

  #saveBtn {
    flex: 1;
    display: block;
    padding: 10px;
    font-size: 5.5vw;
    font-family: 'Audiowide', sans-serif;
    font-weight: normal;
    letter-spacing: 0.05em;
    background: #F715A8;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(247,21,168,0.5);
  }

  #saveBtn:disabled { background: #440033; box-shadow: none; }

  #deleteBtn {
    padding: 10px;
    font-size: 5.5vw;
    font-family: 'Audiowide', sans-serif;
    background: #0d1b4b;
    color: #F715A8;
    border: 2px solid #F715A8;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
  }

  #deleteBtn:disabled { opacity: 0.4; cursor: default; }

  #deleteBtn.delete-armed {
    background: #F715A8;
    color: #fff;
    border-color: #F715A8;
    box-shadow: 0 0 16px rgba(247,21,168,0.6);
    animation: delete-pulse 0.4s ease-out;
  }

  @keyframes delete-pulse {
    0%   { transform: scale(1.08); }
    100% { transform: scale(1); }
  }

  /* =========================================================
     ✨ ANIMATIONS
     ========================================================= */
  @keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .lb-card  { animation: fade-up 0.35s ease both; }
  .match-card { animation: fade-up 0.35s ease both; }

  /* ⚡ Power-on glow sweep as cards enter (#9) */
  .lb-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(100deg, transparent 35%, rgba(52,237,243,0.45) 50%, transparent 65%);
    transform: translateX(-120%);
    animation: card-sweep 0.7s ease 0.15s both;
  }

  @keyframes card-sweep {
    to { transform: translateX(120%); }
  }

  /* 🎉 Champion spotlight (#3) */
  .champ-shake { animation: champ-shake 0.6s; }
  @keyframes champ-shake {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(-5px, 2px); }
    30% { transform: translate(5px, -2px); }
    45% { transform: translate(-4px, 1px); }
    60% { transform: translate(4px, -1px); }
    75% { transform: translate(-2px, 1px); }
  }

  .champ-flash {
    position: fixed;
    inset: 0;
    z-index: 850;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: radial-gradient(circle, rgba(255,215,0,0.18), rgba(7,15,58,0.82) 70%);
    pointer-events: none;
    animation: champ-flash-in 0.4s ease both;
  }
  .champ-flash.out { animation: champ-flash-out 0.5s ease both; }
  @keyframes champ-flash-in  { from { opacity: 0; } to { opacity: 1; } }
  @keyframes champ-flash-out { from { opacity: 1; } to { opacity: 0; } }

  .champ-flash-word {
    font-family: 'Press Start 2P', monospace;
    font-size: 6vw;
    color: #FFD700;
    text-shadow: 0 0 14px #FFD700, 0 0 28px rgba(255,215,0,0.6);
    animation: champ-pulse 0.6s ease-in-out infinite alternate;
  }
  .champ-flash-team {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 8vw;
    color: #fff;
    text-shadow: 0 0 12px rgba(52,237,243,0.7);
    text-align: center;
    padding: 0 16px;
  }
  @keyframes champ-pulse {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
  }

  @keyframes count-up {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
  }

  .lb-stat-val { display: inline-block; animation: count-up 0.4s ease both; }

  @keyframes champion-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }

  @keyframes retro-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
  }

  /* =========================================================
     🗓 SESSION DATE CHIP
     ========================================================= */
  .session-date-bar { text-align: center; margin: 10px 0 4px; }

  .session-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    background: rgba(52,237,243,0.07);
    border: 1.5px solid #34EDF3;
    border-radius: 22px;
    color: #34EDF3;
    font-family: 'Audiowide', sans-serif;
    font-size: 3.4vw;
    letter-spacing: 0.08em;
    box-shadow: 0 0 12px rgba(52,237,243,0.22);
    white-space: nowrap;
  }

  .session-date-label {
    color: #6677aa;
    font-size: 1.1em;
    letter-spacing: 0.05em;
  }

  .session-date-today {
    margin-left: 4px;
    padding: 2px 8px;
    background: #F715A8;
    color: #fff;
    border-radius: 12px;
    font-size: 2.6vw;
    letter-spacing: 0.1em;
    box-shadow: 0 0 8px rgba(247,21,168,0.5);
  }

  /* =========================================================
     🎮 RETRO LOADER — blinking LOADING text
     ========================================================= */
  .bam-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 5vw;
    color: #34EDF3;
    letter-spacing: 0.15em;
    text-shadow: 0 0 8px rgba(52,237,243,0.6);
  }

  .bam-loader::after {
    content: '█';
    margin-left: 4px;
    color: #34EDF3;
    animation: bam-blink 0.6s step-end infinite;
  }

  @keyframes bam-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
  }

  /* =========================================================
     📱 LEADERBOARD CARDS
     ========================================================= */
  .lb-card {
    display: flex;
    align-items: center;
    background: #0d1b4b;
    border: 1px solid #0313A6;
    border-radius: 10px;
    padding: 2px;
    margin-bottom: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    gap: 10px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
  }

  .lb-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 3px,
      rgba(0,0,0,0.10) 3px,
      rgba(0,0,0,0.10) 4px
    );
    pointer-events: none;
    border-radius: 10px;
  }

  .lb-card--first {
    background: linear-gradient(135deg, #1a1400 0%, #0d1b4b 60%);
    border-color: #FFD700;
    box-shadow: 0 0 12px rgba(255,215,0,0.25), 0 1px 3px rgba(0,0,0,0.4);
  }

  .lb-card--gold {
    background: linear-gradient(135deg, #1a1400 0%, #0d1b4b 60%);
    border-color: #FFD700;
    box-shadow: 0 0 16px rgba(255,215,0,0.35), 0 1px 3px rgba(0,0,0,0.4);
  }

  .lb-card--silver {
    background: linear-gradient(135deg, #141414 0%, #0d1b4b 60%);
    border-color: #C0C0C0;
    box-shadow: 0 0 10px rgba(192,192,192,0.25), 0 1px 3px rgba(0,0,0,0.4);
  }

  .lb-card--bronze {
    background: linear-gradient(135deg, #1a0d00 0%, #0d1b4b 60%);
    border-color: #CD7F32;
    box-shadow: 0 0 10px rgba(205,127,50,0.25), 0 1px 3px rgba(0,0,0,0.4);
  }

  .lb-crown {
    font-size: 5vw;
    display: block;
    line-height: 1;
    filter: drop-shadow(0 0 6px rgba(255,215,0,0.8));
    animation: crown-float 2.5s ease-in-out infinite;
  }

  @keyframes crown-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-3px); }
  }

  /* 🏆 Champion aura + floating crown (#1) */
  .lb-card--champ { position: relative; overflow: visible; }

  .lb-card--champ::before {
    content: '';
    position: absolute;
    inset: -30% -10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,215,0,0.20), transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: champ-aura 3s ease-in-out infinite;
  }

  @keyframes champ-aura {
    0%, 100% { transform: scale(0.85); opacity: 0.45; }
    50%       { transform: scale(1.08); opacity: 0.9; }
  }

  .lb-card--champ > * { position: relative; z-index: 1; }

  /* ▲▼ Rank-movement arrows (#5) */
  .rank-arrow {
    font-size: 2.6vw;
    margin-left: 3px;
    vertical-align: middle;
    display: inline-block;
    animation: rank-arrow-in 0.5s ease both;
  }
  .rank-arrow.up   { color: #00e676; text-shadow: 0 0 6px rgba(0,230,118,0.6); }
  .rank-arrow.down { color: #ff3355; text-shadow: 0 0 6px rgba(255,51,85,0.6); }
  .rank-arrow.same { color: #6677aa; }

  @keyframes rank-arrow-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .lb-tabs {
    display: flex;
    padding: 12px 12px 0;
    border-bottom: 1px solid #0d2060;
    margin-bottom: 2px;
  }

  .lb-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    color: #334477;
    font-weight: bold;
    cursor: pointer;
    font-size: 3.5vw;
    font-family: 'Audiowide', sans-serif;
    text-align: center;
    transition: color .2s;
    position: relative;
  }

  .lb-tab--active {
    color: #34EDF3;
    border-bottom-color: #34EDF3;
    box-shadow: 0 2px 8px -2px rgba(52,237,243,0.5);
  }

  .lb-division-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.8vw;
    font-weight: 700;
    color: #34EDF3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid #0313A6;
    padding: 18px 4px 6px;
    margin-bottom: 6px;
  }

  .lb-division-header:first-child { padding-top: 6px; }

  .lb-card-rank {
    font-size: 5.0625vw;
    font-weight: bold;
    color: #34EDF3;
    font-family: 'Orbitron', sans-serif;
    min-width: 40px;
    width: 40px;
    text-align: center;
  }

  .lb-card-body { flex: 1; min-width: 0; }

  .lb-card-team {
    display: block;
    font-size: 4vw;
    font-weight: bold;
    margin-bottom: 4px;
    color: #34EDF3 !important;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lb-card-stats {
    display: flex;
    gap: 0;
    justify-content: space-between;
  }

  .lb-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
  }

  .lb-stat-val {
    font-size: 4.5vw;
    font-weight: bold;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    line-height: 1;
  }

  .lb-stat-lbl {
    font-size: 2.25vw;
    color: #aabbdd;
    text-transform: uppercase;
    margin-top: 2px;
  }

  /* =========================================================
     🏆 PLAYOFF PENDING BANNER
     ========================================================= */
  .playoff-pending-banner {
    background: #0d1b4b;
    border: 1px solid #F715A8;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
  }

  .playoff-pending-icon {
    font-size: 8vw;
    text-align: center;
    margin-bottom: 8px;
  }

  .playoff-pending-title {
    font-size: 4.5vw;
    font-weight: bold;
    color: #F715A8;
    text-align: center;
    margin-bottom: 4px;
  }

  .playoff-pending-sub {
    font-size: 3.5vw;
    color: #aabbdd;
    text-align: center;
    margin-bottom: 12px;
  }

  .playoff-pending-progress {
    background: #0313A6;
    border-radius: 99px;
    height: 10px;
    overflow: hidden;
  }

  .playoff-pending-bar {
    background: #F715A8;
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
  }

  /* =========================================================
     📂 COLLAPSIBLE SECTIONS
     ========================================================= */
  .division-instructions {
    font-family: 'Audiowide', sans-serif;
    font-size: 3.75vw;
    color: #34EDF3;
    background: rgba(52, 237, 243, 0.07);
    border-left: 3px solid #34EDF3;
    padding: 6px 12px;
    border-radius: 0 6px 6px 0;
    margin: 4px 0 8px;
    line-height: 1.6;
  }

  .match-team--tappable {
    cursor: pointer;
    text-decoration: underline dotted rgba(255,255,255,0.3);
  }

  .roster-popover {
    position: absolute;
    z-index: 999;
    background: #0d1a4a;
    border: 1px solid #34EDF3;
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  }

  .roster-popover-team {
    font-family: 'Audiowide', sans-serif;
    font-size: 3vw;
    color: #34EDF3;
    margin-bottom: 2px;
  }

  .roster-popover-player {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3.5vw;
    color: #ccdaff;
  }

  .match-forfeit-badge {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3vw;
    color: #F715A8;
    opacity: 0.85;
    margin-left: 6px;
    white-space: nowrap;
  }

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #F715A8;
    color: #ffffff;
    font-size: 4vw;
    font-family: 'Audiowide', sans-serif;
    font-weight: normal;
    padding: 6px 16px;
    border-radius: 8px;
    margin: 4px 0 4px;
    cursor: pointer;
    user-select: none;
    letter-spacing: 0.5px;
  }

  .section-chevron { font-size: 3.5vw; }

  .section-body {
    overflow-x: visible;
    overflow-y: hidden;
    max-height: 5000px;
    transition: max-height 0.7s ease;
  }

  .section-body--collapsed {
    max-height: 0 !important;
    transition: max-height 0.7s ease;
  }

  /* =========================================================
     🎾 MATCH CARDS
     ========================================================= */
  .match-card {
    background: #0d1b4b;
    border: 1px solid #0313A6;
    border-radius: 10px;
    margin-bottom: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    /* columns set via inline style per card based on set count */
    display: grid;
  }

  .match-card--pending {
    border-color: #0313A6;
    display: block;
  }

  /* display:contents promotes children as direct grid items of .match-card */
  .match-row { display: contents; }

  /* each cell */
  .match-row > * {
    padding: 5px 8px;
    font-size: 4vw;
    color: #ffffff;
    align-self: stretch;
    display: flex;
    align-items: center;
  }

  /* separator between the two rows */
  .match-row:first-of-type > * { border-bottom: 1px solid #0d2060; }

  /* winner row: background on every cell */
  .match-row.match-winner > * {
    background: #0313A6;
    font-weight: bold;
    box-shadow: inset 0 0 10px rgba(247,21,168,0.25);
  }

  .match-team {
    padding-left: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ffffff !important;
  }

  .match-row.match-winner > .match-team { color: #34EDF3 !important; }

  /* pending cards keep flex layout */
  .match-card--pending .match-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 10px;
    border-bottom: 1px solid #0d2060;
    font-size: 4vw;
    color: #ffffff;
  }
  .match-card--pending .match-row:last-of-type { border-bottom: none; }

  /* individual set score cell in the grid */
  .match-set {
    justify-content: center;
    font-weight: bold;
    color: #34EDF3;
    font-family: 'Orbitron', sans-serif;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-left: 1em;
    padding-right: 0;
  }

  .match-row > *:last-child { padding-right: 14px; }

  a.match-set.match-scores--link,
  .match-scores--link {
    text-decoration: underline dotted;
    color: #34EDF3;
    font-family: 'Orbitron', sans-serif;
  }

  /* bracket / non-grid score containers */
  .match-scores {
    display: flex;
    gap: 0.5ch;
    justify-content: flex-end;
    font-weight: bold;
    color: #34EDF3;
    white-space: nowrap;
    font-family: 'Orbitron', sans-serif;
    font-variant-numeric: tabular-nums;
  }

  .match-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
  }
  .match-search-input {
    flex: 1;
    background: #0a0a14;
    border: 1px solid #34EDF3;
    border-radius: 8px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 4vw;
    padding: 7px 12px;
    outline: none;
  }
  .match-search-input::placeholder { color: #555; }
  .match-search-clear {
    background: none;
    border: 1px solid #555;
    border-radius: 6px;
    color: #aaa;
    font-size: 3.5vw;
    padding: 6px 10px;
    cursor: pointer;
  }

  .match-add-score {
    display: block;
    text-align: center;
    padding: 2px;
    font-size: 4vw;
    font-weight: bold;
    color: #F715A8;
    text-decoration: none;
    background: #0d1b4b;
    border-top: 1px solid #0313A6;
  }

  /* =========================================================
     📱 POOL STANDINGS TABLE
     ========================================================= */
  .pool-table { font-size: 4.5vw; white-space: nowrap; }
  .pool-table th, .pool-table td { padding: 2vw 3vw; }
  .pool-table .col-sticky-team { font-size: 5vw; }

  .col-sticky-team {
    position: sticky;
    left: 32px;
    background: #0d1b4b;
    z-index: 1;
    text-align: left;
    font-weight: bold;
  }

  .pool-table thead .col-sticky-team { background: #0313A6; }

  /* =========================================================
     📱 MOBILE SCROLL
     ========================================================= */
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
  }

  /* =========================================================
     🌌 STARFIELD WRAPPER
     ========================================================= */
  .glitch-wrap {
    position: relative;
    background: transparent;
  }

  #starfield {
    position: fixed;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 0;
    pointer-events: none;
    z-index: 0;
  }

  .glitch-wrap .glitch-header {
    position: relative;
    z-index: 1;
    background: transparent;
  }

  /* =========================================================
     🎮 GLITCH HEADER — LEADERBOARD
     ========================================================= */
  .glitch-header {
    position: relative;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 9vw;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.15em;
    padding: 20px 0;
    text-shadow: 0 0 10px rgba(52,237,243,0.6);
    background: #070F3A;
  }

  .glitch-header::before,
  .glitch-header::after {
    content: attr(data-text);
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    overflow: hidden;
  }

  .glitch-header::before {
    color: #34EDF3;
    animation: glitch-top 3s infinite linear;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    transform: translateX(-3px);
    opacity: 0.8;
  }

  .glitch-header::after {
    color: #F715A8;
    animation: glitch-bot 3s infinite linear;
    clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%);
    transform: translateX(3px);
    opacity: 0.8;
  }

  @keyframes glitch-top {
    0%   { transform: translateX(-3px); clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%); }
    10%  { transform: translateX(3px);  clip-path: polygon(0 5%, 100% 5%, 100% 20%, 0 20%); }
    20%  { transform: translateX(-2px); clip-path: polygon(0 0, 100% 0, 100% 40%, 0 40%); }
    30%  { transform: translateX(0);    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
    60%  { transform: translateX(0);    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0); }
    70%  { transform: translateX(-4px); clip-path: polygon(0 10%, 100% 10%, 100% 30%, 0 30%); }
    80%  { transform: translateX(2px);  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%); }
    100% { transform: translateX(-3px); clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%); }
  }

  @keyframes glitch-bot {
    0%   { transform: translateX(3px);  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); }
    10%  { transform: translateX(-3px); clip-path: polygon(0 70%, 100% 70%, 100% 90%, 0 90%); }
    20%  { transform: translateX(2px);  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%); }
    30%  { transform: translateX(0);    clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
    60%  { transform: translateX(0);    clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
    70%  { transform: translateX(4px);  clip-path: polygon(0 65%, 100% 65%, 100% 85%, 0 85%); }
    80%  { transform: translateX(-2px); clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); }
    100% { transform: translateX(3px);  clip-path: polygon(0 60%, 100% 60%, 100% 100%, 0 100%); }
  }
.top-bar-nav {
  display: none;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #000000;
    border-bottom: 1px solid #0313A6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 101;
    padding: 0 16px;
    overflow: visible;
  }

  .top-bar img {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 0 6px #34EDF3) drop-shadow(0 0 12px rgba(52,237,243,0.35));
  }

  .top-bar-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5vw;
    color: #34EDF3;
    white-space: nowrap;
    letter-spacing: 1px;
    font-style: italic;
  }

  body {
    padding-top: 66px;
  }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: #000000;
    border-top: 1px solid #0313A6;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.5);
    z-index: 100;
  }

  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 0;
    text-decoration: none;
    color: #999;
    font-size: 3vw;
    font-family: 'Audiowide', sans-serif;
    gap: 6px;
    transition: color 0.15s;
  }

  .bottom-nav a.active {
    color: #34EDF3;
  }

  .bottom-nav a:hover {
    color: #34EDF3;
  }

  .bottom-nav-icon {
    font-size: 6vw;
  }

  /* Push page content above the nav bar */
  body {
    padding-bottom: 70px;
  }

#ptr-indicator {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 0;
    overflow: hidden;
    background: #000000;
    z-index: 98;
    transition: height 0.15s ease;
    font-family: 'Orbitron', sans-serif;
    font-size: 3vw;
    color: #34EDF3;
    letter-spacing: 0.1em;
  }

  #ptr-indicator.ptr-pulling  { height: 56px; }
  #ptr-indicator.ptr-ready    { height: 56px; color: #F715A8; }
  #ptr-indicator.ptr-spinning { height: 56px; }

  #ptr-arrow {
    font-size: 5vw;
    display: inline-block;
    transition: transform 0.2s ease;
  }
  #ptr-indicator.ptr-ready #ptr-arrow { transform: rotate(180deg); }

  #ptr-spinner {
    display: none;
    width: 5vw;
    height: 5vw;
    border: 2px solid #334477;
    border-top-color: #34EDF3;
    border-radius: 50%;
    animation: ptr-spin 0.7s linear infinite;
  }
  #ptr-indicator.ptr-spinning #ptr-arrow  { display: none; }
  #ptr-indicator.ptr-spinning #ptr-spinner { display: block; }

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

#boot-overlay {
    position: fixed;
    inset: 0;
    background: #000000;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2vw;
    padding: 20px;
    transition: opacity 0.5s ease;
  }

  #boot-overlay.active {
    display: flex;
  }

  #boot-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
  }

  .boot-line {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5vw;
    color: #34EDF3;
    letter-spacing: 0.15em;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-align: center;
  }

  .boot-line.visible { opacity: 1; }
  .boot-line.dim     { opacity: 0.35; color: #334477; }

  .boot-line--title {
    font-size: 8vw;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 10px #34EDF3, 0 0 24px rgba(52,237,243,0.5);
    margin-bottom: 2vw;
  }

  .boot-line--ready {
    color: #F715A8;
    font-weight: 900;
    font-size: 5vw;
    text-shadow: 0 0 12px #F715A8;
    animation: boot-blink 0.5s step-end infinite;
  }

  @keyframes boot-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
  }

  .boot-cursor::after {
    content: '█';
    animation: boot-blink 0.6s step-end infinite;
    margin-left: 4px;
    color: #34EDF3;
  }


/* =========================================================
   📤 SHARE BUTTON
   ========================================================= */
.bam-share-btn {
  background: transparent;
  border: 1.5px solid #F715A8;
  color: #F715A8;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  padding: 8px 24px;
  border-radius: 4px;
  cursor: pointer;
  text-shadow: 0 0 8px #F715A8;
  box-shadow: 0 0 8px rgba(247,21,168,0.3);
  transition: background 0.15s, box-shadow 0.15s;
}
.bam-share-btn:active {
  background: rgba(247,21,168,0.15);
  box-shadow: 0 0 16px rgba(247,21,168,0.6);
}

/* =========================================================
   🏆 TEAM PICKER MODAL
   ========================================================= */
#team-picker-modal {
  overscroll-behavior: contain;
}
#team-picker-list button:active {
  filter: brightness(1.3);
}

/* =========================================================
   📱 PORTRAIT LOCK — show rotate prompt in landscape on mobile
   ========================================================= */
#rotate-prompt {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #070F3A;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Audiowide', sans-serif;
  color: #34EDF3;
  text-align: center;
  gap: 24px;
}
#rotate-prompt .rotate-icon {
  font-size: 14vw;
  animation: rotate-hint 1.5s ease-in-out infinite;
}
#rotate-prompt p {
  font-size: 4.5vw;
  letter-spacing: 1px;
  color: #fff;
  margin: 0;
}
@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg);   }
  50%       { transform: rotate(-90deg); }
}
@media screen and (orientation: landscape) and (max-height: 500px) {
  #rotate-prompt { display: flex; }
}

/* =========================================================
   🖥️ DESKTOP — 768px+ breakpoint (BAM-10)
   ========================================================= */
@media (min-width: 768px) {
  /* Content centering */
  body {
    padding-bottom: 0;
  }

  #app, .page-content, #divisions-container, #table-wrap,
  #lb-teams-panel, #lb-players-panel, .admin-content,
  #session-list, #suggest-panel, #new-session-editor {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Top bar: spread logo+title left, nav right */
  .top-bar {
    justify-content: space-between;
    padding: 0 24px;
  }

  .top-bar-title {
    font-size: 16px;
    flex: 1;
    padding-left: 12px;
  }

  /* Show desktop nav, hide mobile nav */
  .top-bar-nav {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .top-bar-nav a {
    font-family: 'Audiowide', sans-serif;
    font-size: 12px;
    color: #999;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
  }

  .top-bar-nav a.active {
    color: #34EDF3;
    background: rgba(52, 237, 243, 0.08);
  }

  .top-bar-nav a:hover {
    color: #34EDF3;
  }

  .bottom-nav {
    display: none;
  }

  /* ---- Clamp ALL vw font sizes to their ~390px-viewport equivalent ----
     Mobile uses vw units; on desktop (1400px+) those become enormous.
     These overrides pin every vw declaration to the px value it would
     produce on a 390px mobile screen, so mobile design is unchanged.    */

  /* Division tabs & section headers */
  .div-tab                  { font-size: 16px; }
  .section-header           { font-size: 16px; }
  .section-chevron          { font-size: 14px; }
  .division-instructions    { font-size: 15px; }
  .roster-popover-team      { font-size: 12px; }
  .roster-popover-player    { font-size: 14px; }
  .match-forfeit-badge      { font-size: 12px; }

  /* Tournament bracket */
  .bracket-team     { font-size: 14px; min-height: 40px; }
  .team-score       { font-size: 14px; }
  .round-label      { font-size: 12px; }
  .champion-badge   { font-size: 18px; }
  .bracket-add-score { font-size: 18px; }

  /* Entry (score entry) page */
  .entry-division, .entry-context-sep, .entry-phase { font-size: 21px; }
  .entry-phase--final  { font-size: 23px; }
  .entry-team          { font-size: 23px; min-height: 70px; }
  .entry-wrap[data-sets="5"] .entry-team { font-size: 18px; min-height: 55px; }
  .entry-vs            { font-size: 40px; }
  .entry-set-row input { font-size: 44px; }
  .entry-set-label     { font-size: 14px; }
  #saveBtn, #deleteBtn { font-size: 21px; }

  /* Leaderboard cards */
  .glitch-header      { font-size: 36px; }
  .lb-tab             { font-size: 14px; }
  .lb-division-header { font-size: 15px; }
  .lb-card-rank       { font-size: 20px; }
  .lb-card-team       { font-size: 16px; }
  .lb-stat-val        { font-size: 18px; }
  .lb-stat-lbl        { font-size: 9px; }
  .lb-crown           { font-size: 20px; }
  .rank-arrow         { font-size: 10px; }
  .bam-loader         { font-size: 20px; }

  /* Champion flash overlay */
  .champ-flash-word { font-size: 23px; }
  .champ-flash-team { font-size: 31px; }

  /* Playoff pending banner */
  .playoff-pending-icon  { font-size: 31px; }
  .playoff-pending-title { font-size: 18px; }
  .playoff-pending-sub   { font-size: 14px; }

  /* Match cards (Arena page) */
  .match-row > *               { font-size: 16px; }
  .match-card--pending .match-row { font-size: 16px; }
  .match-add-score             { font-size: 16px; }
  .match-search-input          { font-size: 16px; }
  .match-search-clear          { font-size: 14px; }

  /* Pool standings table */
  .pool-table                  { font-size: 18px; }
  .pool-table .col-sticky-team { font-size: 20px; }

  /* Session date chip */
  .session-date-chip  { font-size: 13px; }
  .session-date-today { font-size: 10px; }

  /* Boot overlay */
  .boot-line        { font-size: 14px; }
  .boot-line--title { font-size: 31px; }
  .boot-line--ready { font-size: 20px; }

  /* PTR & top bar */
  .top-bar-title   { font-size: 16px; }
  .bottom-nav a    { font-size: 12px; }
  .bottom-nav-icon { font-size: 22px; }
  #ptr-indicator   { font-size: 12px; }
  #ptr-arrow       { font-size: 20px; }
}
