/* ==========================================================================
   BingStream / PPVTV.ICU — "Broadcast Night" design system
   Pure CSS, no frameworks. Mobile-first.
   Thesis: the visual language of live sport — score-bugs, ON-AIR red,
   condensed poster type, crest "versus" lockups, angular badges.
   ========================================================================== */

:root {
  /* Palette — stadium at night */
  --bg:          #0a0d13;
  --bg-soft:     #0d1119;
  --surface:     #121722;
  --surface2:    #1a2130;
  --border:      #222b3c;
  --border-hi:   #33405a;

  --accent:      #ff4655;  /* ON-AIR red — LIVE + primary action */
  --accent-dark: #d92f3f;
  --accent-soft: rgba(255, 70, 85, 0.14);
  --upcoming:    #ffb454;  /* amber — upcoming / clocks */
  --live-green:  #2fe6a0;  /* success / copied */
  --team:        #4da3ff;  /* electric blue — links, focus, brand detail */

  --text:        #f2f5fa;
  --muted:       #94a1b8;
  --faint:       #5c6880;

  --radius:      14px;
  --radius-sm:   9px;
  --header-h:    60px;

  /* Type */
  --font-display: 'Anton', 'Barlow', 'Arial Narrow', -apple-system, sans-serif;
  --font-body: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--team);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   Header
   ========================================================================== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(10, 13, 19, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo .bolt {
  color: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

/* ON-AIR style live badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--accent);
  padding: 5px 11px;
  /* angular broadcast cut instead of a plain pill */
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
  border-radius: 0;
}

.live-badge::before {
  content: '●';
  color: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

/* ==========================================================================
   Layout
   ========================================================================== */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}

/* ==========================================================================
   Hero — the broadcast opening
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 22px 30px;
  margin-bottom: 20px;
  background:
    radial-gradient(120% 160% at 85% -20%, rgba(255, 70, 85, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* pitch centre-circle motif */
.hero::before {
  content: '';
  position: absolute;
  right: -120px;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  right: 38px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-kicker::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 6vw, 3.9rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
}
.hero-title .accent {
  color: var(--accent);
}

.hero-sub {
  margin-top: 12px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.98rem;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
}

.stat {
  min-width: 92px;
  padding: 14px 16px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.stat.is-live .stat-num {
  color: var(--accent);
}
.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-stats {
    width: 100%;
  }
  .stat {
    flex: 1;
  }
}

/* ==========================================================================
   Homepage search
   ========================================================================== */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 640px;
  margin-bottom: 14px;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: none;
}

#match-search {
  width: 100%;
  min-height: 46px;
  padding: 11px 46px 11px 42px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#match-search::placeholder {
  color: var(--faint);
}

#match-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.clear-search {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 50%;
}

.clear-search:hover {
  color: var(--text);
  background: var(--surface2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Category strip (sport filter pills)
   ========================================================================== */
.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex: 0 0 auto;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cat-pill:hover {
  color: var(--text);
  border-color: var(--border-hi);
}

.cat-pill.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ==========================================================================
   Sections (LIVE / UPCOMING) + league groups
   ========================================================================== */
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  margin: 30px 0 4px;
}
.section-title:first-child {
  margin-top: 12px;
}
.section-title .sec-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.section-title.is-upcoming .sec-dot {
  background: var(--upcoming);
}

.section-count {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  transform: translateY(-2px);
}

/* Smaller in-feed sub-headings (Live / Upcoming inside the Server 2 section) */
.feed-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  margin: 22px 0 2px;
}
.feed-sub .sec-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(45deg);
  flex: 0 0 auto;
}
.feed-sub.is-upcoming .sec-dot {
  background: var(--upcoming);
}

/* ---- League group ---- */
.league-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  margin-top: 12px;
  overflow: hidden;
}

.league-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface);
  border-bottom: 1px solid transparent;
  transition: background 0.15s;
}
.league-head:hover {
  background: var(--surface2);
}

.league-group[data-open='true'] .league-head {
  border-bottom-color: var(--border);
}

.lg-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.lg-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lg-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}

.lg-chev {
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}
.league-group[data-open='true'] .lg-chev {
  transform: rotate(180deg);
}

/* collapsible body via animated grid rows */
.league-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}
.league-group[data-open='true'] .league-body {
  grid-template-rows: 1fr;
}
.league-body > .league-grid-wrap {
  overflow: hidden;
}

.league-grid {
  padding: 14px;
}

/* ==========================================================================
   Match card grid + rich cards
   ========================================================================== */
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 14px;
}

.mcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}

.mcard:hover,
.mcard:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
  border-color: var(--border-hi);
}

.mcard.is-live {
  border-color: rgba(255, 70, 85, 0.4);
}
.mcard.is-live:hover {
  border-color: var(--accent);
}

/* ---- media ---- */
.mcard-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.mcard-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(120% 140% at 50% 0%, #1d2534 0%, #0a0d13 80%);
}

.mcard-fallback .vs {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--faint);
  letter-spacing: 0.05em;
}

.mcard-fallback .solo {
  font-size: 2.4rem;
  line-height: 1;
}

.mcard-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* status badge — angular broadcast cut */
.mcard-status {
  position: absolute;
  top: 10px;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(10, 13, 19, 0.72);
  backdrop-filter: blur(4px);
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.mcard-status.live {
  background: var(--accent);
}
.mcard-status.live::before {
  content: '●';
  animation: pulse 1.4s ease-in-out infinite;
}
.mcard-status.upcoming {
  background: rgba(255, 180, 84, 0.92);
  color: #1a1206;
}

/* category chip */
.mcard-cat {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(10, 13, 19, 0.72);
  backdrop-filter: blur(4px);
  padding: 4px 9px;
  border-radius: 5px;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- body ---- */
.mcard-body {
  padding: 12px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mcard-teams {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}
.mcard-teams .names {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mcard-teams .names em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--faint);
  padding: 0 2px;
}

.mcard-title {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mcard-meta {
  font-size: 0.76rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mcard-meta .dot {
  color: var(--faint);
}
.mcard-meta .time {
  color: var(--upcoming);
  font-weight: 600;
}
.mcard.is-live .mcard-meta .time {
  color: var(--accent);
}

/* ---- actions ---- */
.mcard-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 12px;
}

.btn-watch {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: background 0.15s, transform 0.1s;
}
.btn-watch:hover {
  background: var(--accent-dark);
}
.mcard:not(.is-live) .btn-watch {
  background: var(--surface2);
  border: 1px solid var(--border);
}
.mcard:not(.is-live) .btn-watch:hover {
  border-color: var(--border-hi);
  background: var(--border);
}

.icon-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-hi);
}
.icon-btn.copied {
  color: #06281c;
  background: var(--live-green);
  border-color: var(--live-green);
}

/* ==========================================================================
   Skeleton loading
   ========================================================================== */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.skeleton-card .sk-poster {
  aspect-ratio: 16 / 9;
}
.skeleton-card .sk-line {
  height: 12px;
  margin: 12px;
  border-radius: 4px;
}
.skeleton-card .sk-line.short {
  width: 50%;
}

.shimmer {
  background: linear-gradient(
    90deg,
    var(--surface2) 25%,
    #242e42 50%,
    var(--surface2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

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

/* ==========================================================================
   Empty state
   ========================================================================== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state .big {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

/* ==========================================================================
   Server 2 feed
   ========================================================================== */
.server-feed {
  margin-top: 48px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Watch page
   ========================================================================== */
.watch-main {
  max-width: 960px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s;
}

.back-btn:hover {
  color: var(--text);
}

#match-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 16px;
}

.player-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 16px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

#player {
  width: 100%;
  height: 100%;
  background: #000;
  display: block;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(8, 10, 15, 0.84);
  backdrop-filter: blur(3px);
}

.player-overlay.hidden {
  display: none;
}

.player-overlay img {
  max-width: 60%;
  max-height: 45%;
  object-fit: contain;
  border-radius: 8px;
  opacity: 0.85;
}

.player-overlay p {
  font-size: 0.95rem;
  color: var(--text);
  max-width: 420px;
}

.player-overlay .spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#btn-next-server {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  transition: background 0.15s;
}

#btn-next-server:hover {
  background: var(--accent-dark);
}

#btn-next-server.hidden {
  display: none;
}

/* ---- Server switcher ---- */
.server-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.server-btn {
  padding: 9px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.server-btn:hover {
  color: var(--text);
  border-color: var(--border-hi);
}

.server-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ---- Match meta (score-bug) ---- */
.match-meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.meta-teams {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.meta-teams .team-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.meta-teams em {
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: 0.05em;
}

.meta-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-info .status-badge {
  position: static;
}

.league-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

/* status badge (watch page meta + generic) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 5px;
  color: #fff;
  background: rgba(10, 13, 19, 0.7);
}
.status-badge.live {
  background: var(--accent);
}
.status-badge.live::before {
  content: '●';
  animation: pulse 1.4s ease-in-out infinite;
}
.status-badge.upcoming {
  background: var(--upcoming);
  color: #1a1206;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(140%);
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 13px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Team crest avatar (initials fallback — upstream logo CDN is unreliable)
   ========================================================================== */
.logo-av {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--s, 32px);
  height: var(--s, 32px);
  flex: 0 0 auto;
}
.logo-av i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border-hi);
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
  font-size: calc(var(--s, 32px) * 0.32);
  letter-spacing: -0.02em;
}
.logo-av img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ==========================================================================
   Embed-this-match box (watch page)
   ========================================================================== */
.embed-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
}
.embed-box.hidden {
  display: none;
}
.embed-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
}
.copy-btn {
  padding: 7px 15px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.copy-btn:hover {
  background: var(--accent-dark);
}
.copy-btn.copied {
  background: var(--live-green);
  color: #06281c;
}
.embed-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.copy-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.copy-btn.ghost:hover {
  background: var(--surface2);
}
.copy-btn.ghost.copied {
  background: var(--live-green);
  border-color: var(--live-green);
  color: #06281c;
}
.embed-code {
  width: 100%;
  min-height: 70px;
  resize: vertical;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ==========================================================================
   Telegram share page
   ========================================================================== */
.share-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px 0 40px;
}

.share-header {
  margin-bottom: 18px;
}

.share-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.share-header p {
  color: var(--muted);
}

.share-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.timezone-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

.timezone-picker select {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
}

.telegram-matches {
  display: grid;
  gap: 10px;
}

.telegram-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.telegram-row:hover,
.telegram-row.selected {
  border-color: rgba(255, 70, 85, 0.7);
  transform: translateY(-1px);
}

.telegram-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.telegram-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.telegram-info strong {
  font-weight: 700;
}

.telegram-info small {
  color: var(--muted);
}

/* shared row-time (used by telegram list) */
.row-time {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.row-time.live {
  color: var(--accent);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .match-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  #site-header {
    height: auto;
    min-height: var(--header-h);
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 8px 12px;
  }
  .header-right {
    gap: 10px;
    flex-wrap: wrap;
  }
  .logo {
    font-size: 1.05rem;
  }
  .nav-link {
    font-size: 0.8rem;
  }
  .match-grid {
    grid-template-columns: 1fr;
  }
  main {
    padding: 14px 12px 48px;
  }
  .hero {
    padding: 26px 18px 24px;
  }
  .mcard-actions {
    padding: 0 10px 10px;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   Clappr player container (fills the 16:9 .player-wrap)
   ========================================================================== */
#player [data-player],
#player .container,
#player video {
  width: 100% !important;
  height: 100% !important;
  background: #000;
}
