/* dev2.bagol.tv — YouTube/Blibli inspired sports streaming
   Dark mode, thumbnail-grid dominant, image-first */

:root {
  /* dark broadcast palette — neutral, content-first */
  --bg:           #0f0f0f;
  --bg-elev1:     #1a1a1a;
  --bg-elev2:     #232323;
  --bg-elev3:     #2d2d2d;
  --bg-hover:     rgba(255,255,255,0.08);

  --border:       rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);

  --text:         #f5f5f5;
  --text-2:       #b3b3b3;
  --text-3:       #8a8a8a;

  /* Warm broadcast amber (was SaaS blue) — harmonizes with live red */
  --primary:      #fbbf24;
  --primary-hover:#facc15;
  --primary-ink:  #0f0f0f;
  --primary-soft: rgba(251,191,36,0.12);

  --live:         #ef4444;
  --live-soft:    rgba(239,68,68,0.15);
  --live-glow:    rgba(239,68,68,0.5);

  --success:      #10b981;

  /* Neutral thumbnail base — subtle category tint, no rainbow */
  --thumb-base:      linear-gradient(160deg, #1f2937 0%, #0f172a 100%);
  --thumb-soccer:    linear-gradient(160deg, #1e293b 0%, #0c1220 100%);
  --thumb-mma:       linear-gradient(160deg, #2a1410 0%, #100808 100%);
  --thumb-volley:    linear-gradient(160deg, #1e1b2e 0%, #0f0d1a 100%);
  --thumb-motor:     linear-gradient(160deg, #2a1d10 0%, #110a05 100%);
  --thumb-wwe:       linear-gradient(160deg, #1f1015 0%, #0c0509 100%);
  --thumb-futsal:    linear-gradient(160deg, #102a1f 0%, #08120c 100%);

  --header-h: 56px;
  --sidebar-w: 240px;
  --sidebar-w-mini: 72px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-pill: 999px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Block horizontal scroll bleed WITHOUT breaking position:sticky.
   `overflow-x: clip` does not create a new scroll container, so sticky still works.
   Falls back to `hidden` on browsers that don't support clip yet. */
html {
  overflow-x: clip;
  max-width: 100%;
}
@supports not (overflow-x: clip) {
  html { overflow-x: hidden; }
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ============================================================
   HEADER — YouTube top bar style
   ============================================================ */
.header {
  position: sticky; top: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  z-index: 100;
}
.header__left {
  display: flex; align-items: center; gap: 12px;
  width: var(--sidebar-w);
}
.header__burger {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 20px;
  color: var(--text);
  transition: background 0.15s;
}
.header__burger:hover { background: var(--bg-hover); }

.brand {
  display: flex; align-items: center; gap: 8px;
}
.brand__mark {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--primary-ink);
  flex-shrink: 0;
}
.brand__mark svg {
  width: 20px; height: 20px;
  display: block;
}
.brand__name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand__name b {
  color: var(--primary);
  font-weight: 800;
}

.header__center {
  flex: 1;
  display: flex;
  justify-content: center;
}
.search {
  display: flex;
  width: 100%;
  max-width: 540px;
  height: 40px;
}
.search input {
  flex: 1;
  background: var(--bg-elev1);
  border: 1px solid var(--border-hover);
  border-right: 0;
  border-radius: 20px 0 0 20px;
  padding: 0 16px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.search button {
  width: 64px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: 0 20px 20px 0;
  color: var(--text);
  font-size: 15px;
  display: grid; place-items: center;
}
.search button:hover { background: var(--bg-elev3); }

.header__right {
  display: flex; align-items: center; gap: 8px;
  width: 200px;
  justify-content: flex-end;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text);
  font-size: 18px;
  transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn.has-dot::after {
  content: ""; position: absolute;
  width: 8px; height: 8px;
  background: var(--live);
  border-radius: 50%;
  margin-left: 14px; margin-top: -14px;
}
.btn-signin {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s;
}
.btn-signin:hover { background: var(--bg-hover); }
.btn-register {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 13px;
}
.btn-register:hover { background: var(--primary-hover); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--header-h));
  /* Grid items default to min-width:auto which lets content expand the
     track. Force min-width:0 on children so grid honors 1fr exactly
     and prevents horizontal overflow from inner long-content elements. */
  min-width: 0;
}
.app > * { min-width: 0; }
.main { min-width: 0; }

/* ============================================================
   SIDEBAR — YouTube-ish nav
   ============================================================ */
.sidebar {
  background: var(--bg);
  padding: 12px 0;
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: transparent; }
.sidebar:hover::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 4px; }

.sb-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sb-section:last-child { border-bottom: 0; }
.sb-section__title {
  padding: 8px 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.sb-link {
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
  height: 40px;
  border-radius: 0 999px 999px 0;
  margin-right: 12px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.sb-link:hover { background: var(--bg-hover); }
.sb-link.active {
  background: var(--bg-elev2);
  font-weight: 600;
}
.sb-link__icon {
  width: 24px;
  display: grid; place-items: center;
  font-size: 20px;
  color: var(--text);
}
.sb-link__label { flex: 1; }
.sb-link__count {
  font-size: 11px;
  color: var(--text-3);
  background: var(--bg-elev2);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-weight: 500;
}
.sb-link.active .sb-link__count {
  background: var(--live);
  color: #fff;
}
.sb-link__live-dot {
  width: 8px; height: 8px;
  background: var(--live);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--live);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main {
  padding: 24px;
}

/* Filter chip row (Blibli/YouTube-style horizontal scroll) */
.chips-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap;
  padding: 8px 14px;
  background: var(--bg-elev2);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { background: var(--bg-elev3); }
.chip.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
  font-weight: 700;
}
.chip.live {
  display: inline-flex; align-items: center; gap: 6px;
}
.chip.live::before {
  content: ""; width: 8px; height: 8px;
  background: var(--live);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

/* ============================================================
   SECTION HEADING
   ============================================================ */
.section { margin-bottom: 36px; }
.section__head {
  display: flex; align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 10px;
}
.section--live .section__title::before {
  content: ""; width: 10px; height: 10px;
  background: var(--live);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--live-glow);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.section__count {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.section__see-all {
  margin-left: auto;
  font-size: 14px;
  color: var(--text-2);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  transition: all 0.15s;
}
.section__see-all:hover { background: var(--bg-hover); color: var(--text); transform: translateX(2px); }

/* ============================================================
   THUMBNAIL GRID — YouTube style
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px 16px;
}

.tcard {
  display: block;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1);
  will-change: transform;
}
.tcard:hover {
  transform: translateY(-4px);
}
.tcard:active {
  transform: translateY(-2px) scale(0.985);
  transition-duration: 0.1s;
}
.tcard__thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--thumb-soccer);
  border: 1px solid var(--border);
  transition: border-color 0.18s, box-shadow 0.22s ease;
}
.tcard:hover .tcard__thumb {
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(0,0,0,0.55), 0 0 0 1px rgba(245,158,11,0.35);
}
@media (prefers-reduced-motion: reduce) {
  .tcard, .tcard:hover, .tcard:active { transform: none; transition: none; }
}
.tcard__thumb--soccer { background: var(--thumb-soccer); }
.tcard__thumb--mma { background: var(--thumb-mma); }
.tcard__thumb--volley { background: var(--thumb-volley); }
.tcard__thumb--motor { background: var(--thumb-motor); }
.tcard__thumb--wwe { background: var(--thumb-wwe); }
.tcard__thumb--futsal { background: var(--thumb-futsal); }

/* Subtle vignette only — no flashy radial decorations */
.tcard__thumb::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%);
}
/* LIVE CAROUSEL — appears when current match is locked (FT/pre-kickoff).
   Horizontally scrollable rail of currently-live matches, ranked by score.
   Mobile: 220px-wide cards with snap. Desktop: 240px cards, fits 4-5 visible. */
.live-carousel {
  margin: 14px 0 8px;
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, rgba(239,68,68,0.06) 0%, transparent 100%);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--r-lg);
}
.live-carousel__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.live-carousel__title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
}
.live-carousel__pulse {
  width: 8px; height: 8px;
  background: var(--live);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  box-shadow: 0 0 8px var(--live-glow);
}
.live-carousel__count {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
}
.live-carousel__rail {
  display: flex; gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.live-carousel__rail::-webkit-scrollbar { height: 6px; }
.live-carousel__rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.live-carousel__rail::-webkit-scrollbar-track { background: transparent; }

/* card */
.lcc {
  flex: 0 0 240px;
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  background: var(--bg-elev1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1), border-color 0.18s, box-shadow 0.22s;
}
.lcc:hover {
  transform: translateY(-3px);
  border-color: var(--live);
  box-shadow: 0 10px 22px rgba(239,68,68,0.25), 0 0 0 1px rgba(239,68,68,0.4);
}
.lcc__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, #1e293b 0%, #0c1220 100%);
  overflow: hidden;
}
.lcc__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.7) saturate(1.1);
  transition: transform 0.4s ease, filter 0.2s;
}
.lcc:hover .lcc__bg {
  transform: scale(1.05);
  filter: brightness(0.85) saturate(1.2);
}
.lcc__thumb::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 50%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.7));
  pointer-events: none;
}
.lcc__live {
  position: absolute;
  top: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--live);
  color: #fff;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 4px;
  box-shadow: 0 0 10px var(--live-glow);
  z-index: 2;
}
.lcc__live-dot {
  width: 5px; height: 5px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
.lcc__score {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 36px; font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 14px rgba(0,0,0,0.8);
  line-height: 0.9;
  z-index: 2;
}
.lcc__meta {
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.lcc__title {
  font-size: 13px; font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lcc__sub {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}
.lcc__sport {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--primary);
}
.lcc__dot {
  width: 3px; height: 3px;
  background: var(--text-3);
  border-radius: 50%;
  flex-shrink: 0;
}
.lcc__league {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

@media (max-width: 640px) {
  .live-carousel { padding: 12px 12px 10px; margin: 12px -4px 8px; }
  .live-carousel__head { margin-bottom: 10px; }
  .live-carousel__title { font-size: 13px; }
  .live-carousel__count { font-size: 11px; }
  .lcc { flex-basis: 200px; }
  .lcc__title { font-size: 12.5px; }
  .lcc__sub { font-size: 10.5px; }
  .lcc__score { font-size: 30px; }
  .lcc__live { font-size: 9.5px; padding: 2px 6px; }
}

/* CHAT LOCKED — match ended / not started yet. Replaces the full chat aside
   with a compact placeholder panel so mobile users don't see a useless empty
   chat tab and can immediately scroll the live carousel below. */
.watch__chat--locked {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 20px;
  min-height: 220px;
  max-height: 320px;
}
.chat-locked {
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
  text-align: center;
  max-width: 280px;
}
.chat-locked__icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.12);
}
.watch__chat--ended .chat-locked__icon { color: #94a3b8; }
.watch__chat--scheduled .chat-locked__icon { color: var(--primary); }
.chat-locked__title {
  font-size: 15px; font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}
.chat-locked__sub {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.45;
}
.chat-locked__cta {
  margin-top: 6px;
  display: inline-block;
  padding: 8px 16px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.18s;
}
.chat-locked__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245,158,11,0.35);
}
@media (max-width: 1024px) {
  /* Mobile — chat tab pill becomes muted; locked aside is compact card */
  .watch__chat--locked { min-height: 140px; max-height: 200px; padding: 16px; }
  .chat-locked__icon { width: 44px; height: 44px; }
  .chat-locked__icon svg { width: 22px; height: 22px; }
  .chat-locked__title { font-size: 14px; }
  .chat-locked__sub { font-size: 11.5px; }
}

/* "Chat off" muted tab pill (gray look + tiny indicator dot) */
.ab-btn.ab-btn--muted {
  opacity: 0.55;
}
.ab-btn.ab-btn--muted .ab-btn__label { color: var(--text-3); }
.ab-btn__off-dot {
  width: 6px; height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  margin-left: 4px;
  display: inline-block;
}

/* SERVERS LOCKED — match ended / not started yet. Blur grid, disable
   pointer events, show centered overlay message explaining state. */
.servers.is-locked-post,
.servers.is-locked-pre {
  position: relative;
}
.servers.is-locked-post .servers__grid,
.servers.is-locked-pre .servers__grid {
  filter: blur(3px) grayscale(0.6);
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}
.servers.is-locked-post .server-tile,
.servers.is-locked-pre .server-tile {
  cursor: not-allowed;
}
.servers__lock-overlay {
  position: absolute;
  inset: 50px 16px auto 16px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(15, 19, 26, 0.92);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 5;
  margin: auto;
  max-width: 440px;
  height: fit-content;
  align-self: center;
  justify-self: center;
}
.servers.is-locked-post .servers__lock-overlay { color: #cbd5e1; }
.servers.is-locked-pre  .servers__lock-overlay { color: #fef3c7; }
.servers.is-locked-post .servers__lock-overlay svg { color: #94a3b8; }
.servers.is-locked-pre  .servers__lock-overlay svg { color: var(--primary); }
.servers__lock-overlay strong { font-weight: 800; color: #fff; }
.servers.is-locked-post,
.servers.is-locked-pre {
  display: grid; grid-template-rows: auto 1fr;
  min-height: 180px;
}
.servers.is-locked-post .servers__lock-overlay,
.servers.is-locked-pre  .servers__lock-overlay {
  grid-row: 2; grid-column: 1;
  position: relative; inset: auto;
  margin: -120px auto 0 auto;
}
@media (max-width: 640px) {
  .servers__lock-overlay { font-size: 12px; padding: 10px 12px; }
}

/* PLAYER STATE — pre-kickoff / post-FT cinematic placeholder.
   Replaces the iframe with a designed panel + countdown / final score. */
.player-state {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #0c1016 0%, #060809 100%);
  overflow: hidden;
  isolation: isolate;
}
.player-state__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.32) saturate(1.15) blur(2px);
  z-index: 0;
}
.player-state__bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.7) 100%);
}
.player-state__content {
  position: relative; z-index: 1;
  text-align: center;
  padding: 32px 24px;
  color: #fff;
  max-width: 520px;
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
}
.player-state__icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.18);
  color: var(--primary);
  margin-bottom: 4px;
}
.player-state--ended .player-state__icon { color: #94a3b8; }
.player-state--scheduled .player-state__icon { color: var(--primary); }
.player-state__title {
  font-size: 22px; font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.player-state__sub {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.02em;
}
.player-state__cta {
  margin-top: 10px;
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 13px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.18s;
}
.player-state__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(245,158,11,0.45);
}
.player-state__countdown {
  display: inline-flex; gap: 4px; align-items: baseline;
  margin-top: 10px;
  padding: 12px 18px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
.player-state__cd-num {
  font-size: 28px; font-weight: 800;
  font-family: 'Bebas Neue', Impact, sans-serif;
  letter-spacing: 0.04em;
  color: #fff;
  min-width: 36px; text-align: center;
}
.player-state__cd-lbl {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 8px;
}
.player-state__cd-lbl:last-of-type { margin-right: 0; }
@media (max-width: 640px) {
  .player-state__icon { width: 56px; height: 56px; }
  .player-state__title { font-size: 18px; }
  .player-state__cd-num { font-size: 22px; min-width: 28px; }
}

/* Editorial photo background (DataForSEO News). Sits below content,
   darkened so logos + score still read clearly. */
.tcard__thumb-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: brightness(0.55) saturate(1.05);
  transition: filter 0.2s, transform 0.4s ease;
}
.tcard:hover .tcard__thumb-bg {
  filter: brightness(0.7) saturate(1.15);
  transform: scale(1.04);
}

/* Play-button overlay — appears on hover, scales/pulses on click. Click handled by
   the wrapping anchor, but the visual cue makes the card feel like a video tile. */
.tcard__play-overlay {
  position: absolute;
  top: 50%; left: 50%;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.94);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(245, 158, 11, 0.5);
}
.tcard__play-overlay::before {
  content: "";
  width: 0; height: 0;
  margin-left: 3px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #0a0a0a;
}
.tcard:hover .tcard__play-overlay {
  opacity: 1;
  transform: scale(1);
}
.tcard:active .tcard__play-overlay {
  transform: scale(0.92);
  animation: tcardPlayPulse 0.45s ease-out;
}
@keyframes tcardPlayPulse {
  0%   { box-shadow: 0 6px 18px rgba(0,0,0,0.4), 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70%  { box-shadow: 0 6px 18px rgba(0,0,0,0.4), 0 0 0 18px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 6px 18px rgba(0,0,0,0.4), 0 0 0 0 rgba(245, 158, 11, 0); }
}
@media (max-width: 640px) {
  .tcard__play-overlay { width: 36px; height: 36px; margin: -18px 0 0 -18px; }
  .tcard__play-overlay::before { border-width: 6px 0 6px 10px; margin-left: 2px; }
}
.tcard__thumb:has(.tcard__thumb-bg)::before {
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.6) 100%);
}

.tcard__thumb-content {
  position: absolute; inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}
.tcard__team {
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}
.tcard__team-logo {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.96);
  color: #0a0a0a;
  display: grid; place-items: center;
  font-family: 'Bebas Neue', Impact;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.9);
}
.tcard__team-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.tcard__team-abbr {
  font-size: 13px;
  font-weight: 800;
  color: rgba(255,255,255,0.98);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  text-align: center;
  line-height: 1.2;
  min-height: calc(13px * 1.2 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: normal;
  hyphens: auto;
  max-width: 100%;
}

.tcard__center {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
}
.tcard__score {
  font-family: 'Bebas Neue', Impact;
  font-size: 56px;
  font-weight: 700;
  line-height: 0.9;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 12px rgba(0,0,0,0.7);
}
.tcard__score--vs {
  font-family: 'Bebas Neue', Impact;
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 3px 12px rgba(0,0,0,0.7);
}
.tcard__time {
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  letter-spacing: 0.05em;
}

/* badges absolute positioned on thumbnail. LIVE = top-LEFT, ribbon = top-RIGHT.
   Both positions are explicit (no media-query swap) so they never overlap. */
.tcard__live-badge {
  position: absolute;
  top: 10px; left: 10px; right: auto;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--live);
  color: #fff;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 0 12px var(--live-glow);
  z-index: 3;
}
.tcard__live-badge::before {
  content: ""; width: 5px; height: 5px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.tcard__viewers-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  z-index: 3;
  display: inline-flex; align-items: center; gap: 4px;
}

.tcard__duration-badge {
  position: absolute;
  bottom: 10px; right: 10px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: var(--r-sm);
  z-index: 3;
  letter-spacing: 0.04em;
}

/* BIG MATCH / HOT corner ribbon — top-RIGHT so it doesn't overlap LIVE badge */
.tcard__bigmatch-ribbon {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  z-index: 3;
  box-shadow: 0 2px 12px rgba(251,191,36,0.4);
}
.tcard__bigmatch-ribbon--hot {
  background: #f97316;
  color: #fff;
  box-shadow: 0 2px 12px rgba(249,115,22,0.6);
  /* Stronger visual distinction from amber BIG MATCH */
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  border: 1px solid #fb923c;
  letter-spacing: 0.1em;
}
/* Add a tiny pulsing flame indicator to HOT to make it visually unmistakable */
.tcard__bigmatch-ribbon--hot::before {
  content: "🔥";
  margin-right: 3px;
  font-size: 9px;
}

/* Header bell notification badge */
.bell-wrap {
  position: relative;
  display: grid;
  place-items: center;
}
.bell-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 16px; height: 16px;
  background: var(--live);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  display: grid; place-items: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
}

/* SVG icon sprite container (offscreen) */
.svg-sprite { position: absolute; width: 0; height: 0; }

/* meta below thumbnail — info-dense, no avatar noise */
.tcard__meta {
  padding: 0 2px;
}
.tcard__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}
.tcard__channel {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 3px;
  display: flex; align-items: center; gap: 6px;
}
.tcard__league-pill {
  display: inline-flex; align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 4px;
  background: var(--bg-elev2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
}
.tcard__stats {
  font-size: 12px;
  color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.tcard__stats-dot {
  width: 3px; height: 3px;
  background: var(--text-3);
  border-radius: 50%;
  display: inline-block;
}
.tcard__live-clock {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--live);
  font-weight: 700;
}
.tcard__live-clock::before {
  content: ""; width: 6px; height: 6px;
  background: var(--live);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* ============================================================
   TEAM COLOR TOKENS (extracted from inline styles)
   ============================================================ */
.tlogo-bvb     { background: #fde047; color: #000; }
.tlogo-fra     { background: #fff;    color: #dc2626; }
.tlogo-lev     { background: #0046a8; color: #fff; }
.tlogo-osa     { background: #dc2626; color: #fff; }
.tlogo-tor     { background: #7f1d1d; color: #fff; }
.tlogo-sas     { background: #16a34a; color: #000; }
.tlogo-len     { background: #fbbf24; color: #000; }
.tlogo-nan     { background: #fde047; color: #15803d; }
.tlogo-fcb     { background: #dc2626; color: #fff; }
.tlogo-shb     { background: #fff;    color: #000; }
.tlogo-nas     { background: #fde047; color: #1e3a8a; }
.tlogo-per     { background: #1a1a1a; color: #fff; border-color: #444; }
.tlogo-rak     { background: #fff;    color: #000; }
.tlogo-jkm     { background: #fff;    color: #dc2626; }
.tlogo-sbe     { background: #1e40af; color: #fff; }
.tlogo-int     { background: #1e40af; color: #fff; }
.tlogo-mil     { background: #dc2626; color: #000; }
.tlogo-mun     { background: #dc2626; color: #fff; }
.tlogo-che     { background: #1e40af; color: #fff; }
.tlogo-f1      { background: #dc2626; color: #fff; }
.tlogo-wwe     { background: #fbbf24; color: #000; }

/* Server tile brand color tokens */
.slogo-sky     { background: #0c5fb8; color: #fff; font-weight: 800; }
.slogo-skyr    { background: #cc0000; color: #fff; font-weight: 800; }
.slogo-dzn     { background: #000;    color: #fbbf24; font-weight: 800; }
.slogo-bin     { background: #1d2c4f; color: #fff; font-weight: 800; }
.slogo-stn     { background: #0d3b66; color: #fff; font-weight: 800; }
.slogo-cnl     { background: #e2231a; color: #fff; font-weight: 800; }
.slogo-nov     { background: #003c8c; color: #fff; font-weight: 800; }
.slogo-esp     { background: #1a1a1a; color: #ef4444; font-weight: 800; }

/* Featured-card variant — F1 / WWE single big logo + label */
.tcard__team--featured {
  grid-column: 1 / 4;
  flex-direction: row;
  justify-content: center;
  gap: 14px;
}
.tcard__team-logo--lg {
  width: 72px; height: 72px;
  font-size: 24px;
}
.tcard__team-logo--md {
  width: 64px; height: 64px;
  font-size: 20px;
}
.tcard__featured-label {
  text-align: left;
}
.tcard__featured-title {
  font-family: 'Bebas Neue', Impact;
  font-size: 32px;
  font-weight: 700;
  line-height: 0.9;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 12px rgba(0,0,0,0.7);
}
.tcard__featured-title--sm { font-size: 30px; }
.tcard__featured-sub {
  font-size: 13px;
  font-weight: 800;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

/* TONTON REPLAY CTA inline link styling */
.tcard__replay-cta {
  color: var(--primary);
  font-weight: 700;
}
.tcard__replay-cta:hover { color: var(--primary-hover); }

/* Inline icon tweaks */
.viewers-meta {
  display: inline-flex; align-items: center; gap: 4px;
}
.chat-head__icon {
  vertical-align: -3px;
  margin-right: 4px;
}

/* Chat avatar color variants (small set, semantic by hue) */
.msg__avatar--red    { background: #dc2626; }
.msg__avatar--green  { background: #10b981; }
.msg__avatar--purple { background: #7c3aed; }
.msg__avatar--amber  { background: #f59e0b; }
.msg__avatar--cyan   { background: #06b6d4; }
.msg__avatar--pink   { background: #ec4899; }

/* Side-title size override */
.side-title--sm { font-size: 18px; }

/* Tiny BIG ribbon variant on rail card */
.tcard__bigmatch-ribbon--sm {
  font-size: 9px;
  padding: 2px 6px;
}

/* Generic centered text helper for placeholders */
.text-center { text-align: center; }

/* ============================================================
   STATE VARIANTS
   ============================================================ */
.tcard.is-live .tcard__thumb {
  border-color: var(--live);
  box-shadow: 0 0 0 1px var(--live), 0 0 28px rgba(239,68,68,0.25);
}
.tcard.is-live:hover .tcard__thumb {
  box-shadow: 0 0 0 1px var(--live), 0 0 36px rgba(239,68,68,0.4);
}
.tcard.is-finished { opacity: 0.78; }
.tcard.is-finished:hover { opacity: 1; }
.tcard.is-finished .tcard__thumb { filter: grayscale(0.18); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 32px 24px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  margin-top: 48px;
}
.footer__cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto 24px;
}
.footer__brand-block { padding-right: 16px; }
.footer__brand {
  font-weight: 800;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.footer__brand b { color: var(--primary); }
.footer__tagline { font-size: 12px; line-height: 1.5; color: var(--text-2); }
.footer__col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer__col ul { list-style: none; padding: 0; }
.footer__col li { margin-bottom: 8px; }
.footer__col a { font-size: 13px; color: var(--text-2); transition: color 0.15s; }
.footer__col a:hover { color: var(--text); }
.footer__notice {
  max-width: 1200px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  background: var(--bg-elev1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.footer__notice b { color: var(--text); }
.footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 1024px) {
  .footer__cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer__brand-block { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer__cols { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   MATCH PAGE
   ============================================================ */
.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  padding: 20px;
  min-width: 0;
}
@media (min-width: 1600px) {
  .watch { grid-template-columns: minmax(0, 1fr) 380px; }
}

/* Inline chat panel (replaces FAB drawer on desktop) */
.watch__chat {
  background: var(--bg-elev1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h) - 40px);
  position: sticky;
  top: calc(var(--header-h) + 20px);
  overflow: hidden;
}
.watch__chat .chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev1);
  flex-shrink: 0;
}
.watch__chat .chat-head__title {
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.watch__chat .chat-head__count {
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-elev2);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  font-weight: 600;
}
.chat-head__live-pip {
  width: 8px; height: 8px;
  background: var(--live);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--live);
  animation: pulse 2s infinite;
  margin-left: auto;
  flex-shrink: 0;
}
.watch__chat .chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column;
  gap: 10px;
}
.watch__chat .chat-body::-webkit-scrollbar { width: 6px; }
.watch__chat .chat-body::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
.watch__chat .chat-input {
  display: flex; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elev1);
  flex-shrink: 0;
}

/* Matches rail (was right side, now horizontal below player) */
.matches-rail {
  margin-top: 24px;
}
.matches-rail__head {
  display: flex; align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.matches-rail__title {
  margin: 0;
}
.matches-rail__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.rail-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.rail-card__thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.rail-card:hover .rail-card__thumb { border-color: var(--border-hover); }
.rail-card.is-live .rail-card__thumb {
  border-color: var(--live);
  box-shadow: 0 0 0 1px var(--live), 0 0 16px rgba(239,68,68,0.2);
}
.rail-card__thumb-content {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 12px;
  gap: 8px;
  z-index: 2;
}
.rail-card__thumb::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%);
}
.rail-card__title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rail-card__meta {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
}

.watch__main { min-width: 0; }
.watch__side { min-width: 0; }

.player-frame {
  position: relative;
  background: #000;
  border: 1px solid var(--border-hover);
  border-radius: var(--r-lg);
  aspect-ratio: 16/9;
  overflow: hidden;
  margin-bottom: 16px;
  transition: box-shadow 0.2s;
}
/* Sentinel observed by JS to flip player into mini mode after scrolling past */
.player-sentinel {
  width: 100%;
  height: 1px;
  margin-top: -1px;
  pointer-events: none;
}

/* MINI PLAYER MODE — Vidio/Mola pattern.
   Activated by app.js when sentinel scrolls off-screen.
   Player shrinks to 240×135 fixed bottom-right; stream keeps playing. */
.player-frame.is-mini {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 76px); /* clear bottom-nav */
  right: 16px;
  width: 240px;
  height: 135px;
  aspect-ratio: auto;
  z-index: 80;
  margin-bottom: 0;
  border-radius: var(--r-md);
  box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06);
  animation: miniIn 0.25s ease-out;
}
@keyframes miniIn {
  from { transform: translate(20px, 20px) scale(0.85); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
/* Mini-mode overlay scales down */
.player-frame.is-mini .player-frame__overlay { gap: 4px; top: 4px; left: 4px; right: 4px; }
.player-frame.is-mini .player-frame__overlay-team { padding: 2px 5px; }
.player-frame.is-mini .player-frame__overlay-logo { width: 14px; height: 14px; font-size: 7px; }
.player-frame.is-mini .player-frame__overlay-score { font-size: 11px; }
.player-frame.is-mini .player-frame__overlay-dash { font-size: 8px; }
.player-frame.is-mini .player-frame__overlay-live { font-size: 8px; padding: 2px 5px; }
.player-frame.is-mini .play-btn { width: 36px; height: 36px; font-size: 14px; margin-bottom: 0; }
.player-frame.is-mini .player-placeholder__hint { display: none; }

/* Close-mini button (added by JS) */
.player-mini-close {
  position: absolute;
  top: 4px; right: 4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  display: none;
  place-items: center;
  font-size: 14px;
  z-index: 5;
  border: 0;
  cursor: pointer;
}
.player-frame.is-mini .player-mini-close { display: grid; }

/* Bottom nav must clear mini-player position (only on mobile) */
@media (max-width: 1024px) {
  .player-frame.is-mini { width: 200px; height: 113px; right: 12px; }
}
@media (min-width: 1025px) {
  .player-frame.is-mini { display: none; }
  .player-sentinel { display: none; }
}
/* Persistent overlay strip on top of player (replaces redundant score-panel) */
.player-frame__overlay {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  z-index: 5;
  display: flex; align-items: center; gap: 10px;
  pointer-events: none;
}
.player-frame__overlay-team {
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  padding: 6px 10px;
  border-radius: var(--r-md);
}
.player-frame__overlay-logo {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'Bebas Neue', Impact;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.player-frame__overlay-score {
  font-family: 'Bebas Neue', Impact;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.player-frame__overlay-dash {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  font-weight: 700;
}
.player-frame__overlay-meta { margin-left: auto; }
.player-frame__overlay-live {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--live);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  box-shadow: 0 0 12px var(--live-glow);
}
.player-frame__overlay-live::before {
  content: ""; width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
.player-frame iframe,
.player-frame__placeholder {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.player-frame__placeholder {
  background: linear-gradient(180deg, #0c0c0c, #000);
  display: grid; place-items: center;
}
.play-btn {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: #1a1a1a;
  display: grid; place-items: center;
  font-size: 32px;
  cursor: pointer;
  transition: transform 0.15s;
  margin-bottom: 16px;
}
.play-btn:hover { transform: scale(1.1); }
.player-placeholder__hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  font-family: monospace;
}

.watch-title-block {
  margin-bottom: 16px;
}
.watch__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.watch__live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--live);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  letter-spacing: 0.08em;
  box-shadow: 0 0 12px var(--live-glow);
}
.watch__live-badge::before {
  content: ""; width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
.watch__meta {
  font-size: 13px;
  color: var(--text-2);
  display: flex; gap: 6px; align-items: center;
  flex-wrap: wrap;
}

.watch-actions {
  display: flex;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.action-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--bg-elev2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.15s;
}
.action-btn:hover { background: var(--bg-elev3); }
.action-btn.primary {
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
}
.action-btn.primary:hover { background: var(--primary-hover); }

/* Score panel */
.score-panel {
  background: var(--bg-elev1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.score-panel__top {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 14px;
}
.score-panel__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.score-panel__team {
  display: flex; align-items: center; gap: 12px;
}
.score-panel__team.away { flex-direction: row-reverse; }
.score-panel__team-logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg-elev2);
  display: grid; place-items: center;
  font-family: 'Bebas Neue', Impact;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.score-panel__team-name {
  font-size: 16px;
  font-weight: 700;
}
.score-panel__score {
  text-align: center;
  font-family: 'Bebas Neue', Impact;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  min-width: 100px;
}
.score-panel__score.live { color: var(--live); }
.score-panel__time {
  font-family: 'Roboto', Inter;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.08em;
  margin-top: 4px;
  text-transform: uppercase;
}

.servers__title {
  display: inline-flex; align-items: center; gap: 6px;
}
.servers__title::before {
  content: ""; width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Mobile-only: tab bar. Hidden on desktop where every panel renders inline. */
.watch-actionbar { display: none; }
.servers__head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.servers__title {
  font-size: 14px;
  font-weight: 700;
}
.servers__hint { font-size: 12px; color: var(--text-2); margin-left: auto; }
.servers__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.server-tile {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--bg-elev2);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  min-width: 0;
  overflow: hidden;
}
.server-tile:hover { background: var(--bg-elev3); }
.server-tile.active {
  border-color: var(--live);
  background: var(--live-soft);
}
.server-tile__logo {
  width: 32px; height: 24px;
  border-radius: 3px;
  background: var(--bg-elev3);
  flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 10px;
  font-family: 'Bebas Neue', Impact, sans-serif;
  letter-spacing: 0.04em;
}
.server-tile__info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.server-tile__name {
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1;
}
.server-tile__load {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.server-tile__load.load-good { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.server-tile__load.load-mid  { background: #f59e0b; }
.server-tile__load.load-bad  { background: var(--live); }
.servers__more {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: transparent;
  border: 1px dashed var(--border-hover);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.servers__more:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* Side rail — recommended matches */
.side-list {
  display: flex; flex-direction: column;
  gap: 12px;
}
.side-item {
  display: flex; gap: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.side-item__thumb {
  position: relative;
  width: 168px;
  aspect-ratio: 16/9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--thumb-soccer);
  flex-shrink: 0;
}
.side-item__thumb-content {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
  z-index: 2;
}
.side-item__thumb::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.4) 100%);
}
.side-item__abbr {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  text-align: center;
}
.side-item__mini-logo {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: 'Bebas Neue', Impact;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 auto;
  border: 1.5px solid rgba(255,255,255,0.7);
}
.side-item__score {
  font-family: 'Bebas Neue', Impact;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.side-item__kickoff {
  font-family: 'Bebas Neue', Impact;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
  letter-spacing: 0.02em;
}
.tcard__bigmatch-pill {
  display: inline-block;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.side-item__live-badge {
  position: absolute; top: 6px; left: 6px;
  background: var(--live);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  z-index: 3;
}
.side-item__info { flex: 1; min-width: 0; }
.side-item__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.side-item__channel {
  font-size: 12px;
  color: var(--text-2);
}
.side-item__stats {
  font-size: 11px;
  color: var(--text-2);
}

/* Side title */
.side-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.side-title.section--live::before {
  content: ""; width: 8px; height: 8px;
  background: var(--live);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--live-glow);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-head__title { font-weight: 700; font-size: 14px; }
.chat-head__count {
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-elev2);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.chat-head__close { margin-left: auto; font-size: 18px; color: var(--text-2); width: 32px; height: 32px; border-radius: 50%; }
.chat-head__close:hover { background: var(--bg-hover); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column;
  gap: 12px;
}
/* Single-line Twitch/IRC pattern — name + text + time on one line.
   Applies on every viewport; mobile only adjusts sizing. */
.msg {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 0;
}
.msg.right { flex-direction: row; }   /* no reverse — keep avatar left */
.msg__avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  display: grid; place-items: center;
  font-size: 8.5px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  align-self: center;
}
.msg__body {
  display: inline;
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.msg__name {
  display: inline;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 4px 0 0;
}
.msg__name::after { content: ":"; opacity: 0.6; margin-left: 1px; }
.msg__text,
.msg.right .msg__text {
  display: inline;
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: #ffffff;
  font-size: 11.5px;
  line-height: 1.4;
  font-weight: 400;
}
.msg__time {
  display: inline;
  margin-left: 5px;
  font-size: 9px;
  color: var(--text-3);
  opacity: 0.55;
}
/* Blank line between consecutive messages — visual separator per user. */
.chat-body { gap: 10px !important; }

.chat-input {
  display: flex; gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.chat-input input {
  flex: 1;
  height: 38px;
  background: var(--bg-elev2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.chat-input input:focus { border-color: var(--primary); }
.chat-input button {
  height: 38px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 12px;
}
.chat-input button:hover { background: var(--primary-hover); }

/* Emoji trigger — ghost circular button to the LEFT of the input */
.chat-input .chat-emoji-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--bg-elev2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
}
.chat-input .chat-emoji-btn:hover {
  background: var(--bg-elev2);
  border-color: var(--primary);
}

/* Emoji picker — popup grid above the input */
.chat-emoji-picker {
  display: none;
  background: var(--bg-elev1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  margin: 0 12px;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}
.chat-emoji-picker.show { display: grid; }
.chat-emoji-picker button {
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 18px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.chat-emoji-picker button:hover { background: var(--bg-elev2); }

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 1024px) {
  .header__left { width: auto; }
  /* header__center display:none removes the desktop flex:1 spacer.
     Push header__right to the far right edge with margin-left: auto
     so Daftar pill sits flush to the right padding, not centered. */
  .header__right { width: auto; gap: 4px; margin-left: auto; }
  .header__center { display: none; }
  .header__search-icon { display: grid; }

  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: var(--header-h); left: 0;
    width: 0;                              /* collapse layout when closed */
    overflow: hidden;                      /* clip children → no scrollWidth bleed */
    transform: translateX(-100%);
    z-index: 100;
    transition: transform 0.25s, width 0s linear 0.25s;
    background: var(--bg);
  }
  .sidebar.open {
    width: 250px;
    overflow-y: auto;
    transform: translateX(0);
    box-shadow: 8px 0 24px rgba(0,0,0,0.4);
    transition: transform 0.25s, width 0s;
  }
  .sidebar-backdrop {
    position: fixed; inset: var(--header-h) 0 0 0;
    background: rgba(0,0,0,0.6);
    z-index: 95;
    display: none;
  }
  .sidebar-backdrop.show { display: block; }

  .main { padding: 16px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }

  /* === MATCH PAGE MOBILE — JalaLive pattern ===
     Stream + chat = primary always-visible content.
     Server / Info / Lainnya hidden by default, accessible via bottom-sheets
     triggered from the fixed action bar above bottom-nav. */
  .watch {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    /* Match page hides the bottom-nav (see body.watch-body rule below).
       Tabbar (44px) lives INSIDE this container, so it's already accounted
       for by the flex children — only subtract header + safe-area. */
    height: calc(100dvh - var(--header-h) - env(safe-area-inset-bottom, 0px));
    padding: 0;
    gap: 0;
    overflow: hidden;
  }
  .watch__main { display: contents; }

  /* Player — flush top, fixed 16:9 */
  .player-frame {
    flex: 0 0 auto;
    aspect-ratio: 16/9;
    width: 100%;
    background: #000;
    border-radius: 0;
    border: none;
    margin: 0;
  }
  .player-sentinel { display: none; }

  /* Chat panel — fills remaining viewport, internal scroll */
  .watch__chat {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-elev1);
    overflow: hidden;
    margin: 0;
    max-height: none;
  }
  .watch__chat .chat-head {
    flex: 0 0 auto;
    padding: 10px 12px;
    background: var(--bg-elev1);
    border-bottom: 1px solid var(--border);
    cursor: default;
  }
  .watch__chat .chat-head__title { font-size: 13px; }
  .watch__chat .chat-head__count { font-size: 10px; padding: 2px 6px; }
  .watch__chat .chat-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 10px 12px;
    gap: 6px;
  }
  .watch__chat .chat-input {
    flex: 0 0 auto;
    padding: 8px 10px;
    background: var(--bg-elev1);
    border-top: 1px solid var(--border);
  }
  .watch__chat .chat-input input { height: 40px; font-size: 13px; }
  .watch__chat .chat-input button { height: 40px; min-width: 60px; padding: 0 14px; font-size: 13px; }

  /* Mobile chat — tighter than desktop base */
  .msg { gap: 4px; }
  .msg__avatar { width: 11px; height: 11px; font-size: 6px; }
  .msg__name { font-size: 8.5px; margin-right: 2px; }
  .msg__text,
  .msg.right .msg__text { font-size: 8.5px; line-height: 1.3; }
  .msg__time { font-size: 7.5px; margin-left: 3px; opacity: 0.5; }
  /* Blank-line separator between messages */
  .watch__chat .chat-body { gap: 5px; }

  /* === TAB BAR — sits between player and panels (in flow, not fixed) ===
     4 tabs: Chat (default) / Server / Info / Lainnya.
     Active tab content shows in the panel area below; other tabs hidden. */
  .watch-actionbar {
    position: static;
    flex: 0 0 auto;
    height: 44px;
    background: var(--bg-elev1);
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: auto;
  }
  .ab-btn {
    background: none; border: none;
    color: var(--text-2);
    font-size: 12px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px;
    min-height: 44px;
    cursor: pointer;
    padding: 0 6px;
    position: relative;
  }
  .ab-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
  .ab-btn__count {
    background: var(--primary);
    color: var(--primary-ink);
    font-size: 9.5px; font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 1px;
    line-height: 1.2;
  }
  /* Active tab: amber text + amber underline (Twitch/YouTube pattern) */
  .ab-btn.is-active { color: var(--primary); }
  .ab-btn.is-active::after {
    content: "";
    position: absolute;
    left: 14%; right: 14%;
    bottom: -1px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
  }

  /* === TAB PANELS — only the .is-active panel renders === */
  .servers,
  .watch-info-block,
  .matches-rail,
  .watch__chat { display: none; }
  .servers.is-active,
  .watch-info-block.is-active,
  .matches-rail.is-active {
    display: block;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg);
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    margin: 0;
    border-radius: 0;
  }
  .watch__chat.is-active {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
  }

  /* Match page: drop body bottom-padding (chat fills viewport) AND hide
     bottom-nav entirely — match page is full-immersion stream + tabs,
     primary nav surface is the tab bar (Chat/Server/Info/Lainnya). */
  body.watch-body { padding-bottom: 0; overflow: hidden; }
  body.watch-body .bottom-nav { display: none; }

  /* Match page: drop body bottom-padding (chat fills viewport) AND hide
     bottom-nav entirely — match page is full-immersion stream + chat,
     primary nav surface is the action-bar (Server/Info/Lainnya). */
  body.watch-body { padding-bottom: 0; overflow: hidden; }
  body.watch-body .bottom-nav { display: none; }

  /* === SHEET CONTENT — server matrix, info, related === */
  .servers { padding: 12px; background: transparent; border: none; }
  .servers__head { flex-wrap: wrap; gap: 4px 10px; padding-bottom: 8px; }
  .servers__hint { margin-left: 0; flex-basis: 100%; font-size: 11px; line-height: 1.35; }
  .servers__grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .server-tile { padding: 10px; min-height: 52px; gap: 8px; }
  .server-tile__logo { width: 30px; height: 22px; font-size: 10px; flex-shrink: 0; }
  .server-tile__name { font-size: 12.5px; letter-spacing: -0.01em; }
  .server-tile__load { width: 8px; height: 8px; flex: 0 0 8px; }
  .servers__more {
    border-style: solid;
    border-color: rgba(251,191,36,0.35);
    background: rgba(251,191,36,0.06);
    border-radius: 10px;
    padding: 12px;
    min-height: 44px;
  }

  /* Info sheet content */
  .watch-info-block { padding: 0; background: transparent; border: none; }
  .watch__title { font-size: 17px; line-height: 1.3; gap: 8px; flex-wrap: wrap; }
  .watch__live-badge { font-size: 10px; padding: 3px 7px; flex-shrink: 0; }
  .watch__meta { font-size: 12px; gap: 6px; row-gap: 4px; }
  .watch-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
  }

  /* Related sheet — vertical list (not horizontal rail) */
  .matches-rail::after { display: none; }
  .matches-rail__head { padding: 0 0 8px; }
  .matches-rail__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0;
    overflow: visible;
  }
  .rail-card {
    flex: none;
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 10px;
    padding: 8px;
    background: var(--bg);
    border-radius: 10px;
    border: 1px solid var(--border);
  }
  .rail-card__thumb { width: 88px; height: 50px; }
  .rail-card__title { font-size: 13px; line-height: 1.3; padding: 0; }
  .rail-card__meta { font-size: 11px; padding: 0; }

  /* Player overlay strip */
  .player-frame__overlay { gap: 6px; top: 8px; left: 8px; right: 8px; }
  .player-frame__overlay-team { padding: 4px 8px; gap: 6px; }
  .player-frame__overlay-logo { width: 22px; height: 22px; font-size: 9px; }
  .player-frame__overlay-score { font-size: 18px; }
  .player-frame__overlay-live { font-size: 10px; padding: 4px 7px; }

  /* === HOME-PAGE mobile bits (still need these) === */
  .side-item__thumb { width: 140px; }
  .tcard.is-live .tcard__thumb {
    border-color: transparent;
    box-shadow: 0 0 0 1.5px var(--live), 0 0 16px rgba(239,68,68,0.3);
  }
  .chip { min-height: 40px; display: inline-flex; align-items: center; }
  .btn-signin { display: none; }
  .section__head { gap: 10px; flex-wrap: nowrap; min-height: 44px; }
  .section__title { font-size: 20px; line-height: 1.2; letter-spacing: -0.015em; }
  .section--live .section__title::before { width: 9px; height: 9px; transform: translateY(-1px); flex-shrink: 0; }
  .section__count { font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  .section__see-all { min-height: 44px; padding: 11px 14px; font-size: 13px; flex-shrink: 0; display: inline-flex; align-items: center; }
  .sidebar { will-change: transform; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .sb-link { min-height: 48px; gap: 20px; }
  .sb-link__icon { width: 22px; }
  .sidebar-backdrop { display: block; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .tcard__league-pill { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.45); color: var(--primary); }
  .tcard__meta { padding: 0; }
  .tcard__title { padding-right: 2px; }
  .tcard__stats { flex-wrap: nowrap; min-width: 0; }
  .tcard__stats > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tcard__stats-dot { width: 4px; height: 4px; flex: none; }
  .tcard__replay-cta { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 4px; }
}

@media (max-width: 480px) {
  /* Header: tap targets ≥44px, room for cluster on right */
  .header { padding: 0 12px; gap: 8px; }
  .header__right { gap: 6px; }
  .icon-btn { width: 44px; height: 44px; }
  .header__burger { width: 44px; height: 44px; }
  .btn-register { padding: 0 14px; font-size: 13px; height: 36px; }
  .brand__name { font-size: 18px; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__mark svg { width: 19px; height: 19px; }
  .bell-badge { top: -4px; right: -4px; padding: 1px 5px; }

  .grid { grid-template-columns: 1fr; }
  /* Lock card thumb size on mobile — explicit height as ultimate fallback.
     iPhone 14 = 390 viewport, content width ~358, 16:9 = 201px. */
  .grid > .tcard > .tcard__thumb,
  .tcard__thumb {
    aspect-ratio: 16 / 9 !important;
    height: calc((100vw - 32px) * 9 / 16) !important;
    max-height: 220px !important;
    min-height: 180px !important;
    padding: 0 !important;
  }
  /* Hero card density: tighter logo + bottom gradient floor under abbr */
  .tcard__thumb-content { padding: 0 12px; gap: 6px; }
  .tcard__team-logo { width: 46px; height: 46px; font-size: 16px; }
  .tcard__score { font-size: clamp(36px, 11vw, 44px); line-height: 0.9; }
  .tcard__score--vs { font-size: clamp(24px, 7.5vw, 32px); letter-spacing: 0.03em; }
  .tcard__team-abbr { font-size: 11px; letter-spacing: 0.03em; min-height: calc(11px * 1.2 * 2); -webkit-line-clamp: 2; }
  .tcard__title { font-size: 14.5px; line-height: 1.4; padding-right: 2px; }
  .tcard__stats { font-size: 11px; gap: 5px; }
  .tcard__channel { font-size: 11px; }
  /* Mobile: LIVE locked top-LEFT, ribbon (BIG MATCH/HOT) locked top-RIGHT, viewers top-RIGHT below ribbon */
  .tcard__live-badge      { top: 8px; left: 8px;  right: auto; font-size: 11px; padding: 4px 9px; letter-spacing: 0.06em; }
  .tcard__bigmatch-ribbon { top: 8px; right: 8px; left: auto;  font-size: 9.5px; padding: 2px 6px; }
  .tcard__viewers-badge   { top: 8px; right: 8px; left: auto;  font-size: 9.5px; padding: 2px 6px; }

  /* Bottom darkening floor under team-abbr so text reads on bright logo bg */
  .tcard__thumb::after {
    content: ""; position: absolute; inset: auto 0 0 0; height: 38%;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.55));
    z-index: 1;
  }

  /* Featured cards (F1/WWE) shrink */
  .tcard__featured-title { font-size: 22px; line-height: 0.95; }
  .tcard__featured-title--sm { font-size: 20px; }
  .tcard__featured-sub { font-size: 11px; }
  .tcard__team-logo--lg { width: 54px; height: 54px; font-size: 18px; }
  .tcard__team-logo--md { width: 46px; height: 46px; font-size: 15px; }

  .score-panel__score { font-size: 36px; min-width: 80px; }
  .score-panel__team-logo { width: 40px; height: 40px; font-size: 13px; }
  .score-panel__team-name { font-size: 14px; }

  .chips-row {
    position: relative;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    gap: 8px;
    /* Was margin: 0 -16px which propagates parent overflow.
       Use padding-only for edge-to-edge effect, contain via overflow. */
    margin: 0 0 20px;
    padding: 0 16px 8px;
    scroll-padding-left: 16px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .chip { scroll-snap-align: start; padding: 10px 14px; font-size: 13px; min-height: 40px; }

  /* Section heading tighter */
  .section { margin-bottom: 22px; }
  .section__title { font-size: 20px; }
  .section__count { font-size: 12px; }

  /* Match player frame: compact overlay strip */
  .player-frame { border-radius: var(--r-md); border-width: 0; }
  .player-frame__overlay { gap: 4px; top: 6px; left: 6px; right: 6px; }
  .player-frame__overlay-team { padding: 3px 6px; gap: 4px; backdrop-filter: none; background: rgba(0,0,0,0.78); }
  .player-frame__overlay-logo { width: 18px; height: 18px; font-size: 8px; }
  .player-frame__overlay-score { font-size: 15px; }
  .player-frame__overlay-dash { font-size: 11px; }
  .player-frame__overlay-live { font-size: 9px; padding: 3px 6px; letter-spacing: 0.04em; }
  .play-btn { width: 56px; height: 56px; font-size: 22px; margin-bottom: 10px; }
  .player-placeholder__hint { font-size: 10.5px; max-width: 92%; line-height: 1.3; padding: 0 8px; }

  /* Chat panel polish — looks like a card, not a screen */
  .watch__chat { border-radius: var(--r-md); }
  .watch__chat .chat-body { padding: 12px; gap: 10px; }
  .watch__chat .chat-input { padding: 10px; }

  /* Footer: 44px tap row + amber column dividers, bottom padding clears FAB overlap */
  .footer { padding: 24px 16px 20px; padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .footer__brand { font-size: 20px; }
  .footer__col-title { font-size: 13px; margin-bottom: 14px; }
  .footer__col li { margin: 0; border-bottom: 1px solid var(--border); }
  .footer__col a { display: block; padding: 12px 0; font-size: 14px; min-height: 44px; }
  .footer__col + .footer__col { border-top: 1px solid var(--border); padding-top: 16px; }
  .footer__notice { padding: 14px 16px; font-size: 12px; }
  .footer__bottom { font-size: 12px; gap: 8px; padding-top: 20px; }
}

/* Mobile search icon (hidden on desktop, visible <1024px) */
.header__search-icon { display: none; }

/* ============================================================
   MOBILE BOTTOM NAV — fixed 4-tab, hidden on desktop
   ============================================================ */
.bottom-nav { display: none; }

@media (max-width: 1024px) {
  .bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    z-index: 90;
  }
  .bottom-nav__item {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: color 0.15s;
    position: relative;
  }
  .bottom-nav__item svg {
    width: 22px; height: 22px;
    stroke-width: 2;
  }
  .bottom-nav__item:hover { color: var(--text); }
  .bottom-nav__item.active {
    color: var(--primary);
  }
  .bottom-nav__item.active::before {
    content: "";
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 24px; height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
  }
  .bottom-nav__live-dot {
    position: absolute;
    top: 8px; right: calc(50% - 16px);
    width: 6px; height: 6px;
    background: var(--live);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--live);
    animation: pulse 2s infinite;
  }

  /* Body needs bottom padding so footer doesn't hide behind nav */
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================
   GLOBAL A11Y + MOTION (mobile review v2 — Tier 3)
   ============================================================ */

/* Visible focus rings (was killed by global outline:none) */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
.sb-link:focus-visible,
.chip:focus-visible,
.tcard:focus-visible,
.server-tile:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Touch-only: kill sticky-pressed hover state on transform hovers */
@media (hover: none) and (pointer: coarse) {
  .tcard:hover .tcard__thumb { transform: none; }
}

/* Respect reduced-motion preference (mobile review #7) */
@media (prefers-reduced-motion: reduce) {
  .tcard__live-badge::before,
  .player-frame__overlay-live::before,
  .section--live .section__title::before,
  .tcard__live-clock::before,
  .sb-link__live-dot,
  .chat-head__live-pip,
  .chip.live::before,
  .brand__live-dot { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* Pulse animation: floor 0.4 → 0.25 (less anxious "blink", more cinematic) */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* Finished card: amber CTA pops above grayscale (replay isolated) */
.tcard.is-finished { opacity: 1; }
.tcard.is-finished .tcard__thumb { filter: grayscale(0.55) brightness(0.82); }

/* Bug-fix: badges INSIDE .tcard__thumb inherit grayscale filter on finished cards.
   Override so FT badge stays vivid + readable. */
.tcard.is-finished .tcard__duration-badge,
.tcard.is-finished .tcard__live-badge,
.tcard.is-finished .tcard__bigmatch-ribbon { filter: none; }

/* TONTON REPLAY CTA — STANDALONE block.
   Now sits as sibling of .tcard__stats (HTML restructured), so cascade clean.
   Hard-code color values to bypass any var-resolution issue and force
   system-ui font for guaranteed glyph coverage. */
.tcard.is-finished .tcard__replay-cta {
  display: block;
  /* Clamp to viewport width minus side padding — defends against
     parent containers that overflow due to negative margins elsewhere */
  width: 100%;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  min-height: 44px;
  padding: 12px 14px;
  margin-top: 10px;
  background: #fbbf24;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  color: #0f0f0f;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-align: center;
  text-decoration: none;
  filter: none;
  opacity: 1;
  cursor: pointer;
}
.tcard.is-finished .tcard__replay-cta:hover {
  background: #facc15;
  border-color: #facc15;
}
.tcard.is-finished .tcard__replay-cta:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
/* Hide the inline dot-separator that immediately precedes the CTA in stats row */
.tcard.is-finished .tcard__stats { flex-wrap: wrap; }
.tcard.is-finished .tcard__stats > .tcard__stats-dot:nth-last-of-type(1) { display: none; }
