/* =========================================================
     🎨 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: 12px;
    box-sizing: border-box;
    overflow-x: clip;
    background: #070F3A;
    color: #ffffff;
    font-family: 'Rajdhani', sans-serif;
  }

  @media (max-width: 600px) {
    body { padding: 10px; }
    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: 16px 0 0;
  }

  .div-tab {
    flex: 1;
    padding: 8px 0;
    border: 2px solid #34EDF3;
    border-radius: 8px;
    background: transparent;
    color: #34EDF3;
    font-weight: bold;
    cursor: pointer;
    font-size: 3.5vw;
    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 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    position: relative;
    left: -12px;
    width: 100vw;
  }

  .bracket {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 8px 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .bracket-round {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 0 0 calc(50% - 19px);
    min-width: 0;
  }

  .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: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    width: 100%;
  }

  .bracket-connector {
    display: flex;
    flex-direction: column;
    width: 14px;
    flex-shrink: 0;
    align-self: stretch;
    margin-top: 28px;
  }

  .connector-top {
    flex: 1;
    border-right: 2px solid #0313A6;
    border-bottom: 2px solid #0313A6;
    border-bottom-right-radius: 6px;
  }

  .connector-bottom {
    flex: 1;
    border-right: 2px solid #0313A6;
    border-top: 2px solid #0313A6;
    border-top-right-radius: 6px;
  }

  .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--final {
    border-color: #F715A8;
    box-shadow: 0 2px 10px rgba(247,21,168,0.35);
  }

  .bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 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; }

  .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: #1a0030;
    color: #F715A8;
    font-weight: bold;
    box-shadow: inset 0 0 12px rgba(247,21,168,0.5);
  }

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

  .champion-badge {
    padding: 10px 14px;
    font-size: 4.5vw;
    font-weight: bold;
    color: #F715A8;
    background: #1a0030;
    border-top: 1px solid #F715A8;
    text-align: center;
  }

  .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: 8px 12px;
    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;
    width: 100vw;
    overflow-x: clip;
  }

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

  .entry-division {
    font-family: 'Audiowide', sans-serif;
    font-size: 5.5vw;
    padding: 10px 22px;
    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: 10px 22px;
    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: 36px;
  }

  .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: 24px 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: 28vw;
  }

  .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: 14px;
    margin-bottom: 32px;
  }

  /* 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: 13vw;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    padding: 16px 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: 12px;
    margin-bottom: 24px;
  }

  #saveBtn {
    flex: 1;
    display: block;
    padding: 20px;
    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: 20px 22px;
    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; }

  @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; }
  }

  /* =========================================================
     📱 LEADERBOARD CARDS
     ========================================================= */
  .lb-card {
    display: flex;
    align-items: center;
    background: #0d1b4b;
    border: 1px solid #0313A6;
    border-radius: 10px;
    padding: 6px 10px;
    margin-bottom: 6px;
    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); }
  }

  .lb-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 12px 0;
  }

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

  .lb-tab--active {
    background: #F715A8;
    border-color: #F715A8;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(247,21,168,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
     ========================================================= */
  .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: 7px 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: 8px;
    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: 10px 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: 10px 14px;
    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-add-score {
    display: block;
    text-align: center;
    padding: 10px;
    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: sticky;
    top: 56px;
    overflow: hidden;
    background: #070F3A;
    z-index: 99;
  }

  #starfield {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    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 {
    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: 10px 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: 140px;
  }

#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;
  }

