/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: white;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { background: rgba(0,230,118,0.15); border: 1px solid rgba(0,230,118,0.3); color: var(--green); }
#toast.error { background: rgba(255,69,96,0.15); border: 1px solid rgba(255,69,96,0.3); color: var(--danger); }
#toast.info { background: rgba(59,142,255,0.15); border: 1px solid rgba(59,142,255,0.25); color: var(--blue); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  /* Compact 2-row nav: brand + status dot + action icons on top, the tab
     strip scrolls sideways underneath — instead of a 4-row 193px stack. */
  .nav { flex-wrap: wrap; align-items: center; padding: 8px 12px; gap: 7px 8px; }
  .nav-title { display: inline-flex; font-size: 1.1em; letter-spacing: 2px; margin: 0; }
  .nav-live { padding: 5px 8px; }
  .nav-live #dbDotLabel { display: none; }         /* dot only on phones */
  .nav-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
  /* status + rare setup icons — reclaim the row on phones. The .nav-hide-mobile
     one needs body.*-mode specificity to beat `.superadmin-only { display:revert }`. */
  #roleBadge, #seasonBadge,
  body.admin-mode .nav-hide-mobile, body.superadmin-mode .nav-hide-mobile { display: none !important; }
  .nav-tabs { order: 5; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; gap: 4px; }
  .tab-btn { flex: 0 0 auto; font-size: 12.5px; padding: 7px 13px; }
  .scoreboard-wrapper { grid-template-columns: 1fr; padding: 20px 0; gap: 10px; }
  .score-vs { flex-direction: row; padding: 0 10px; min-width: unset; width: 100%; justify-content: center; }
  .vs-line { width: 30px; height: 1px; }
  #eventTitleBanner { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 12px; }
  .container { padding: 14px 12px; }
  .db-grid-2 { grid-template-columns: 1fr; }
  .match-card { padding: 0; }
  .live-score-num { font-size: 1.8em; }
  .trophy-content { padding: 30px 16px 60px; }
  #trophySpecialAwards { grid-template-columns: 1fr 1fr; gap: 10px; }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .container { padding: 20px 18px; }
  .nav { padding: 10px 16px; gap: 6px; }
  .tab-btn { font-size: 13px; padding: 8px 13px; }
  .match-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
  .scoreboard-wrapper { grid-template-columns: 1fr auto 1fr; gap: 0; padding: 20px 0; }
  .score-ring { width: clamp(180px, 22vw, 260px); height: clamp(180px, 22vw, 260px); }
  .score-digit { font-size: clamp(4em, 11vw, 7em); }
  .team-label { font-size: clamp(2em, 4.5vw, 3.5em); }
  .db-grid-2 { grid-template-columns: 1fr 1fr; }
  #matchNotiBox { width: min(560px, 92vw); }
  .live-score-num { font-size: clamp(2.2em, 5vw, 3.4em); }
  .perf-metrics { grid-template-columns: repeat(4, 1fr); }
}


/* ── SEASON SYSTEM ── */
.season-badge {
  display:inline-flex; align-items:center; gap:6px;
  padding:4px 12px; border-radius:20px; font-size:11px; font-weight:800;
  letter-spacing:2px; text-transform:uppercase;
  background:rgba(245,200,66,0.1); color:var(--gold);
  border:1px solid rgba(245,200,66,0.25); cursor:pointer; transition:all 0.2s;
}
.season-badge:hover { background:rgba(245,200,66,0.18); }
.wizard-steps { display:flex; margin-bottom:24px; border-radius:10px; overflow:hidden; border:1px solid var(--border); }
.wizard-step { flex:1; text-align:center; padding:10px 4px; font-size:10px; font-weight:700; letter-spacing:1px; color:var(--muted); background:var(--surface2); border-right:1px solid var(--border); transition:all 0.2s; }
.wizard-step:last-child { border-right:none; }
.wizard-step.active { background:rgba(245,200,66,0.1); color:var(--gold); }
.wizard-step.done   { background:rgba(0,230,118,0.07); color:var(--green); }
.reassign-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:8px; max-height:380px; overflow-y:auto; padding:4px 2px; }
.reassign-card { background:var(--surface2); border:1px solid var(--border); border-radius:10px; padding:10px 12px; display:flex; align-items:center; gap:10px; }
.reassign-name { flex:1; font-size:13px; font-weight:700; }
.career-season-card { background:var(--surface2); border:1px solid var(--border); border-radius:12px; padding:14px 16px; margin-bottom:10px; }
.career-season-label { font-size:10px; font-weight:800; letter-spacing:2px; color:var(--gold); margin-bottom:8px; }
.career-stat-row { display:flex; gap:8px; flex-wrap:wrap; }
.career-stat-box { flex:1; min-width:56px; text-align:center; background:var(--surface3); border-radius:8px; padding:6px 4px; }
.career-stat-val { font-family:'Bebas Neue',sans-serif; font-size:1.5em; line-height:1; }
.career-stat-lbl { font-size:9px; font-weight:700; color:var(--muted); letter-spacing:1px; margin-top:2px; }
.pd-tabs { display:flex; border-bottom:1px solid var(--border); margin:-4px -4px 16px; flex-wrap:wrap; }
.pd-tab-btn { padding:10px 14px; font-size:11px; font-weight:700; letter-spacing:1.5px; color:var(--muted); background:none; border:none; cursor:pointer; border-bottom:2px solid transparent; transition:all 0.2s; }
.pd-tab-btn.active { color:var(--gold); border-bottom-color:var(--gold); }
.pd-tab-btn:hover:not(.active) { color:var(--text2); }
.pd-tab-content { display:none; }
.pd-tab-content.active { display:block; }

/* ── COMPARE MODAL ── */
#compareModal { display:none; }
#compareModal.open { display:flex !important; }
.compare-slot {
  display:flex; align-items:center; gap:8px;
  background:var(--surface2); border:1.5px dashed var(--border);
  border-radius:10px; padding:10px 14px;
  font-size:13px; color:var(--muted); font-weight:600; min-height:48px;
}
.compare-slot.filled { border-style:solid; color:var(--text); }
.compare-slot.slot-a.filled { border-color:var(--red);  background:rgba(255,59,92,0.06); }
.compare-slot.slot-b.filled { border-color:var(--blue); background:rgba(59,142,255,0.06); }
.compare-bar-section { flex:1; min-width:200px; }
.compare-bar-row { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
.compare-bar-label { font-size:10px; font-weight:700; letter-spacing:1.5px; color:var(--muted); text-transform:uppercase; min-width:72px; }


/* ── PLAY STYLE BADGES ── */
.style-badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:3px 9px; border-radius:20px; font-size:10px; font-weight:700;
  letter-spacing:0.5px; border:1px solid; cursor:default;
}
.style-attacker   { background:rgba(255,59,92,0.12);  color:#ff6b8a; border-color:rgba(255,59,92,0.3); }
.style-defender   { background:rgba(59,142,255,0.12); color:#6ba4ff; border-color:rgba(59,142,255,0.3); }
.style-allround   { background:rgba(245,200,66,0.12); color:#f5c842; border-color:rgba(245,200,66,0.3); }
.style-controller { background:rgba(168,85,247,0.12); color:#c084fc; border-color:rgba(168,85,247,0.3); }
.style-speed      { background:rgba(0,230,118,0.12);  color:#4ade80; border-color:rgba(0,230,118,0.3); }
.style-deceptive  { background:rgba(251,146,60,0.12); color:#fb923c; border-color:rgba(251,146,60,0.3); }
.style-power      { background:rgba(239,68,68,0.12);  color:#f87171; border-color:rgba(239,68,68,0.3); }
.style-netmaster  { background:rgba(20,184,166,0.12); color:#2dd4bf; border-color:rgba(20,184,166,0.3); }

/* ── FORM TRACKER ── */
.form-badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 8px; border-radius:12px; font-size:10px; font-weight:800;
  letter-spacing:1px;
}
.form-hot    { background:rgba(255,100,0,0.15); color:#ff6400; border:1px solid rgba(255,100,0,0.3); }
.form-normal { background:rgba(255,255,255,0.06); color:var(--muted); border:1px solid var(--border); }
.form-cold   { background:rgba(100,150,255,0.1); color:#6496ff; border:1px solid rgba(100,150,255,0.3); }

/* ── COMPARE BTN on player card ── */
.compare-btn {
  width:28px; height:28px; border-radius:8px; border:1px solid var(--border);
  background:var(--surface2); color:var(--muted); font-size:12px;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:all 0.15s; flex-shrink:0;
}
.compare-btn:hover { border-color:var(--gold); color:var(--gold); background:rgba(245,200,66,0.08); }
.compare-btn.selected-a { border-color:var(--red); color:var(--red); background:rgba(255,59,92,0.1); }
.compare-btn.selected-b { border-color:var(--blue); color:var(--blue); background:rgba(59,142,255,0.1); }

/* ── EXPORT/IMPORT BTNS ── */
.export-import-bar {
  display:flex; gap:8px; flex-wrap:wrap; align-items:center;
  padding:10px 14px; background:var(--surface2);
  border-radius:10px; border:1px solid var(--border);
  margin-bottom:16px;
}

/* ══════════════════════════════════════════════════
   MOBILE UX FIXES — CSS only, no JS touched
   ══════════════════════════════════════════════════

   Fix 1: Trophy SVG — prevent overflow on narrow screens (≤360px)
   Fix 2: Compare modal — stack radar + bars vertically on mobile
   Fix 3: Profile Scout tab — stack radar + bars vertically on mobile
   Fix 4: Navbar superadmin — hide non-critical on ≤480px
   Fix 5: iOS fullscreen — add -webkit-full-screen-ancestor fallback
   ══════════════════════════════════════════════════ */

/* ── Fix 1: Trophy SVG responsive ── */
#trophySvgWrap svg {
  max-width: 90vw;
  height: auto;
}

/* ── Fix 2: Compare modal — stack radar + bars on mobile ── */
@media (max-width: 560px) {
  #compareRadarWrap {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
  }
  #compareRadarSvg {
    width: 200px !important;
    height: 218px !important;
  }
  #compareBarSection {
    min-width: 0 !important;
    width: 100% !important;
  }
  /* Compare modal padding on small screens */
  #compareModalContent {
    padding: 0 14px 16px !important;
  }
  /* Compare slot buttons fit better */
  #compareSlotA, #compareSlotB {
    font-size: 12px !important;
    padding: 8px 10px !important;
  }
}

/* ── Fix 3: Profile Scout tab radar + bars — stack on mobile ── */
@media (max-width: 520px) {
  /* Radar + bars container — was flex-row, force column */
  #pdTabScout .profile-body > div > div[style*="display:flex"],
  #pdTabScout [style*="flex-wrap:wrap"][style*="gap:28px"] {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
  }
  #pdRadarSvg {
    width: 180px !important;
    height: 180px !important;
  }
  #pdAbilityBars {
    min-width: 0 !important;
    width: 100% !important;
  }
  /* Profile body padding: reduce from 28px to 14px on mobile */
  .profile-body {
    padding: 18px 14px !important;
  }
  /* Profile header padding */
  .profile-header {
    padding: 18px 14px 14px !important;
  }
  /* Profile stats bar — allow 2 cols instead of 4 */
  .profile-stats-bar {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .profile-stat-cell:nth-child(2) { border-right: none; }
  .profile-stat-cell:nth-child(3) { border-top: 1px solid var(--border); }
}

/* ── Fix 4: Navbar — hide non-critical elements on small screens ── */
@media (max-width: 480px) {
  /* Hide season badge and New Season button — admin-only anyway */
  #seasonBadge { display: none !important; }
  /* Reduce nav-actions gap */
  .nav-actions { gap: 3px !important; }
  /* Shrink Full / Exit buttons */
  .btn-fs { padding: 5px 8px !important; font-size: 11px !important; }
  /* Hide db status dot label text, keep dot */
  #dbDotLabel { display: none !important; }
  #dbStatusDot { padding: 5px 6px !important; }
}

@media (max-width: 380px) {
  /* Ultra-small: hide New Season btn entirely */
  .btn-fs[onclick*="openSeasonWizard"] { display: none !important; }
  /* Nav title shorter */
  .nav-title { font-size: 1.1em !important; letter-spacing: 2px !important; }
}

/* ── Fix 5: iOS Safari fullscreen — additional vendor prefix ── */
:-webkit-full-screen-ancestor .fs-bottom-nav { display: flex; }
:-webkit-full-screen-ancestor .fs-trigger-zone { display: block; }
:-webkit-full-screen-ancestor .container { padding-bottom: 72px !important; }


/* ══════════════════════════════════════════
   PLAYER AVATAR — one look everywhere a face appears
   ══════════════════════════════════════════ */
.pav {
  --pav-size: 38px;
  width: var(--pav-size);
  height: var(--pav-size);
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid;
  background: var(--surface2);
  vertical-align: middle;
  position: relative;
}
.pav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pav-initials {
  font-family: 'Bebas Neue', sans-serif;
  font-size: calc(var(--pav-size) * 0.36);
  letter-spacing: 1px;
  line-height: 1;
}
.pav-red   { border-color: var(--red);  color: var(--red);  background: rgba(255,59,92,0.1); }
.pav-blue  { border-color: var(--blue); color: var(--blue); background: rgba(59,142,255,0.1); }
/* inline in a sentence / table cell */
.pav-inline { --pav-size: 22px; border-width: 1px; margin-right: 6px; }

/* ══════════════════════════════════════════
   PLAYER DIRECTORY CARD
   One accent per card, not six: the photo is the anchor, PTS is the
   only large number, and the secondary stats sit on one quiet line.
   ══════════════════════════════════════════ */
#playersTabGrid { display: block; }

/* ── Podium: top 3 of the current ranking ── */
.pdir-podium {
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}
.pod {
  position: relative;
  border-radius: 16px;
  padding: 18px 14px 15px;
  text-align: center;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(170deg, var(--surface2), var(--surface));
  border: 1px solid var(--border);
  transition: transform 0.14s, border-color 0.18s;
}
.pod:hover { transform: translateY(-2px); }
.pod::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; }
.pod.p1 { padding-top: 24px; border-color: rgba(255,213,74,0.4);
  background: linear-gradient(170deg, rgba(255,213,74,0.1), var(--surface));
  box-shadow: 0 0 40px -12px rgba(255,213,74,0.4); }
.pod.p1::before { background: linear-gradient(90deg, transparent, #ffd54a, transparent); }
.pod.p2::before { background: linear-gradient(90deg, transparent, #cfd3dc, transparent); }
.pod.p3::before { background: linear-gradient(90deg, transparent, #d98a4b, transparent); }
.pod-medal { font-size: 1.5em; line-height: 1; margin-bottom: 6px; }
.pod-av { margin-bottom: 9px; }
.pod-av .pav { border-width: 2.5px; }
.pod.is-red  .pod-av .pav { box-shadow: 0 0 20px rgba(255,59,92,0.28); }
.pod.is-blue .pod-av .pav { box-shadow: 0 0 20px rgba(59,142,255,0.28); }
.pod-name { font-size: 1.15em; font-weight: 800; line-height: 1.1; }
.pod.p1 .pod-name { font-size: 1.35em; }
.pod-sub { display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: 0.5px; margin-top: 4px; }
.pod-tdot { width: 7px; height: 7px; border-radius: 50%; }
.pod-tdot.red { background: var(--red); } .pod-tdot.blue { background: var(--blue); }
.pod-pts { font-family: 'Bebas Neue', sans-serif; font-size: 2.6em; line-height: 0.85;
  color: var(--gold); margin: 10px 0 8px; }
.pod.p1 .pod-pts { font-size: 3.2em; }
.pod-pts small { display: block; font-size: 8px; font-weight: 800; letter-spacing: 2px;
  color: var(--muted); margin-top: 3px; }
.pod-pills { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pod-pills .pill { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  background: var(--surface3); border: 1px solid var(--border); }
.pod .pdir-actions { position: absolute; top: 8px; right: 8px; }

/* list of ranks 4+ */
.pdir-list-h {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10.5px; font-weight: 800; letter-spacing: 2.5px;
  color: var(--muted); text-transform: uppercase;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.pdir-list {
  display: grid;
  /* 340px min → 2 columns on a tablet (~700-1000px) instead of one very wide,
     sparse card per row; still 3 across on desktop and 1 on a phone. */
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 10px;
}
@media (max-width: 640px) {
  .pdir-podium { grid-template-columns: 1fr; align-items: stretch; }
  /* Desktop shows big faces, but a phone lists ~54 players — shrink the
     avatars so it isn't an endless scroll, and drop the row edit/delete
     controls (edit a player from their profile instead). */
  #playersTabGrid .pdir-list .pav { --pav-size: 56px !important; }
  #playersTabGrid .pod-av .pav { --pav-size: 84px !important; }
  .pdir-card { padding: 12px 14px; gap: 12px; }
  #playersTabGrid .pdir-actions { display: none !important; }
}
.pdir-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.14s;
}
.pdir-card:hover { background: var(--surface2); transform: translateY(-1px); }
.pdir-card:active { transform: scale(0.995); }
.pdir-card.is-red  { border-left-color: rgba(255,59,92,0.55); }
.pdir-card.is-blue { border-left-color: rgba(59,142,255,0.55); }
.pdir-card.is-red:hover  { border-color: rgba(255,59,92,0.35); }
.pdir-card.is-blue:hover { border-color: rgba(59,142,255,0.35); }

.pdir-rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5em;
  color: var(--muted);
  min-width: 26px;
  text-align: center;
  flex-shrink: 0;
}
.pdir-rank.r1 { color: #FFD700; }
.pdir-rank.r2 { color: #C0C0C0; }
.pdir-rank.r3 { color: #CD7F32; }

.pdir-body { flex: 1; min-width: 0; }
.pdir-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdir-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pdir-unit { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: var(--muted2); text-transform: uppercase; margin-left: -2px; }
.pdir-meta .sep { color: var(--border2); }
.pdir-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--surface3);
  color: var(--text2);
}
.pdir-hot { background: rgba(255,107,53,0.12); color: #ff6b35; }
.pdir-cold { background: rgba(96,165,250,0.12); color: #60a5fa; }
.pdir-stat { font-weight: 700; font-variant-numeric: tabular-nums; }
.pdir-wait { font-size: 10.5px; color: var(--muted2); font-style: italic; }
.pdir-you {
  display: inline-block; vertical-align: middle;
  font-size: 8.5px; font-weight: 800; letter-spacing: 1px;
  color: #14140c; background: var(--gold);
  border-radius: 5px; padding: 1px 6px; margin-left: 6px;
}
/* YOU pill already marks "me" here, so drop the global ⭐ badge */
.pdir-card.is-mine::after, .pod.is-mine::after { content: none; }

.pdir-pts { text-align: right; flex-shrink: 0; }
.pdir-pts b {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.4em;
  line-height: 0.85;
  color: var(--gold);
}
.pdir-pts.zero b { color: var(--muted2); }
.pdir-pts span {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--muted);
}

/* Row actions live on the card only for admins, and stay quiet until
   the card is hovered/focused so 54 cards are not 108 loud buttons. */
.pdir-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.16s;
}
.pdir-card:hover .pdir-actions,
.pdir-card:focus-within .pdir-actions { opacity: 1; }
@media (hover: none) { .pdir-actions { opacity: 0.55; } }
.pdir-actions .btn { font-size: 11px; padding: 4px 7px; }

/* ══ SEASON WIZARD — step 3 (roster for the new season) ══ */
.wz-keep-count { font-size: 11px; color: var(--muted); font-weight: 700; }
.wz-keep-count b { color: var(--gold); font-size: 12.5px; }

.reassign-card .wz-keep { display: flex; align-items: center; flex-shrink: 0; }
.reassign-card .wz-keep input { accent-color: var(--green); width: 17px; height: 17px; cursor: pointer; }
.reassign-card.wz-dropped { opacity: 0.42; }
.reassign-card.wz-dropped .reassign-name { text-decoration: line-through; }
.wz-pid {
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  color: var(--muted); margin-left: 7px;
}

.wz-newblock {
  margin-top: 16px; padding: 13px 15px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.wz-newrow { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.wz-newrow input[type="text"] { flex: 1; min-width: 150px; font-size: 13px; padding: 8px 11px; }
.wz-newrow select { font-size: 13px; padding: 8px 9px; }
.wz-newlist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wz-newchip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  padding: 4px 6px 4px 11px; border-radius: 20px;
  border: 1px solid var(--border2);
}
.wz-newchip.is-red  { background: rgba(255,59,92,0.1);  color: var(--red);  border-color: rgba(255,59,92,0.3); }
.wz-newchip.is-blue { background: rgba(59,142,255,0.1); color: var(--blue); border-color: rgba(59,142,255,0.3); }
.wz-newchip b { font-size: 10px; opacity: 0.75; }
.wz-newchip button {
  background: none; border: none; color: inherit; cursor: pointer;
  opacity: 0.6; font-size: 12px; padding: 0 3px;
}
.wz-newchip button:hover { opacity: 1; }

/* ══════════════════════════════════════════
   "ME" BAR — spectator/player shortcut
   ══════════════════════════════════════════ */
.me-bar {
  max-width: 1340px;
  margin: 0 auto;
  padding: 10px 24px 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;   /* compact chip, top-right — not a full-width bar */
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 6;
}
body.tv-mode .me-bar { display: none; }

.me-cta {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: var(--text2);
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.me-cta:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.28); color: var(--text); }
.me-cta-sub { display: none; }   /* keep the chip compact — no long tagline */

.me-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 13px 7px 8px;
  background: var(--surface);
  border: 1px solid rgba(245,200,66,0.28);
  border-radius: 30px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s;
  min-width: 0;
}
.me-chip:hover { background: var(--surface2); border-color: var(--gold); }
.me-chip-txt { min-width: 0; line-height: 1.25; }
.me-chip-txt b { display: block; font-size: 13.5px; color: var(--text); }
.me-chip-txt span { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.me-live {
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(0,230,118,0.12); color: var(--green);
  border: 1px solid rgba(0,230,118,0.3);
  animation: mePulse 1.6s ease-in-out infinite;
}
@keyframes mePulse { 0%,100%{opacity:1} 50%{opacity:0.55} }

.me-switch {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  padding: 6px 12px; border-radius: 20px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: all 0.15s;
}
.me-switch:hover { color: var(--text); border-color: var(--border2); }

/* "only my matches" toggle used on Ongoing / Finished */
.me-filter-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  padding: 7px 13px; border-radius: 20px;
  border: 1px solid rgba(245,200,66,0.28);
  background: rgba(245,200,66,0.06);
  color: var(--gold); cursor: pointer; white-space: nowrap;
  transition: all 0.16s;
}
.me-filter-btn:hover { background: rgba(245,200,66,0.13); }
.me-filter-btn.on {
  background: linear-gradient(135deg, var(--gold), #ffb340);
  color: #14140c; border-color: var(--gold);
}

/* rows / cards that involve me */
.is-mine { position: relative; }
.is-mine::after {
  content: '⭐';
  position: absolute; top: 6px; right: 8px;
  font-size: 11px; opacity: 0.9; pointer-events: none;
}
.frow.is-mine, .court-card.is-mine, .pdir-card.is-mine {
  border-color: rgba(245,200,66,0.45) !important;
  background: rgba(245,200,66,0.045);
}

/* ── Picker overlay ── */
.me-picker {
  display: none; position: fixed; inset: 0; z-index: 900;
  background: rgba(4,4,12,0.9); backdrop-filter: blur(14px);
  align-items: flex-end; justify-content: center;
}
.me-picker.open { display: flex; }
.me-picker-box {
  width: min(460px, 100%);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px 20px 0 0;
  padding: 18px 18px 14px;
  animation: fadeUp 0.24s ease both;
}
.me-picker-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.me-picker-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.5em; letter-spacing: 3px; color: var(--gold); }
.me-picker-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.me-picker-close {
  margin-left: auto; background: none; border: none; color: var(--muted);
  font-size: 20px; cursor: pointer; padding: 0 4px;
}
#meSearch {
  width: 100%; padding: 11px 14px; font-size: 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 11px; color: var(--text); outline: none; margin-bottom: 10px;
}
#meSearch:focus { border-color: var(--gold); }
.me-picker-list { overflow-y: auto; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.me-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 11px;
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; text-align: left; transition: all 0.14s;
}
.me-opt:hover { background: var(--surface3); border-color: var(--border2); }
.me-opt.on { background: rgba(245,200,66,0.1); border-color: rgba(245,200,66,0.4); }
.me-opt-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-opt-meta { font-size: 11px; font-weight: 700; flex-shrink: 0; }
.me-opt-meta.is-red { color: var(--red); }
.me-opt-meta.is-blue { color: var(--blue); }
.me-opt-check { color: var(--gold); font-weight: 800; }
.me-empty { text-align: center; padding: 28px; color: var(--muted); font-size: 13px; }
.me-clear {
  margin-top: 10px; padding: 9px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer;
}
.me-clear:hover { color: var(--text); border-color: var(--border2); }

@media (max-width: 640px) {
  .me-bar { padding: 8px 12px 0; }
  .me-cta-sub { display: none; }
}

/* ── court number + match status label (WP2) — the live arena, the Ongoing tab and the admin cards ── */
.court-no, .lv-courtno {
  display: inline-block; padding: 2px 10px; border-radius: 20px; white-space: nowrap;
  font-weight: 800; letter-spacing: .3px; color: #14120a; background: var(--gold);
}
.court-no { font-size: 12px; }
.m-status {
  display: inline-block; padding: 2px 10px; border-radius: 20px; white-space: nowrap;
  font-size: 11px; font-weight: 800; letter-spacing: .3px; color: #14120a; background: var(--gold);
}
.m-status.stuck { background: #ff8a8a; }
.m-status:empty { display: none; }
/* the public card header may need a second line once it carries the court and the label */
.court-card-header { flex-wrap: wrap; row-gap: 6px; }
/* admin card: status on the left, court picker on the right */
.match-court-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; min-height: 32px; }
.court-select {
  margin-left: auto; min-height: 32px; padding: 4px 8px; border-radius: 8px;
  background: var(--surface2); color: var(--text); border: 1px solid var(--border2);
  font: 700 12px 'Space Grotesk', sans-serif;
}
/* taken by an umpire, no first point yet — calm, not the green LIVE */
.court-ready {
  display: inline-block; padding: 2px 10px; border-radius: 20px; white-space: nowrap;
  font-size: 11px; font-weight: 800; letter-spacing: .3px;
  color: var(--text2); background: var(--surface3); border: 1px solid var(--border2);
}
