/* ============================================================
   fan24.pk — Match / Watch page styles
   Shares design tokens with the index page.
   ============================================================ */

:root {
  --bg:       #0b0b0d;
  --bg2:      #141418;
  --bg3:      #1c1c22;
  --bg4:      #242430;
  --surface-hover: rgba(255,255,255,0.04);

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

  --text:      #f3f3f5;
  --text-soft: #c4c4cc;
  --muted:     #8a8a95;

  --red:        #e03131;
  --red-soft:   rgba(224,49,49,0.14);
  --red-ring:   rgba(224,49,49,0.30);
  --gold:       #f59f00;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --ease: cubic-bezier(0.2, 0, 0.1, 1);
}

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

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  background-image:
    radial-gradient(1000px 500px at 50% -10%, rgba(224,49,49,0.05), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

.page-grow { flex: 1; display: flex; flex-direction: column; }


/* ============================================================
   NAV
   ============================================================ */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,11,13,0.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  height: 60px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  flex-shrink: 0;
  transition: opacity 0.15s var(--ease);
}
.logo:hover { opacity: 0.9; }

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(224,49,49,0.35));
}
.logo-text {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}
.logo-accent { color: var(--red); }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
  white-space: nowrap;
  font-family: inherit;
}
.btn-back:hover {
  background: var(--bg4);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.btn-back svg { color: var(--muted); transition: color 0.15s var(--ease); }
.btn-back:hover svg { color: var(--text); }

.btn-discord {
  background: #5865F2;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
  flex-shrink: 0;
}
.btn-discord:hover { background: #4752c4; transform: translateY(-1px); }


/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 26px 26px 60px;
}


/* ============================================================
   MATCH HEADER
   ============================================================ */
.match-header {
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.match-title-block { min-width: 0; flex: 1 1 auto; }

.match-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.match-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.match-meta .cat-pill {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}
.match-meta .time-txt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}


/* ============================================================
   CONTENT GRID — player + streams panel
   ============================================================ */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 22px;
  align-items: start;
}


/* ============================================================
   PLAYER
   ============================================================ */
.player-section {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,0.45));
}
.player-section iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.player-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f0f13, #07070a);
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 20px;
}


/* ============================================================
   STREAMS PANEL
   ============================================================ */
.streams-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: calc(100vh - 130px);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 80px;
}
.streams-panel-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(255,255,255,0.01);
}
.streams-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.streams-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}
.streams-scroll::-webkit-scrollbar { width: 6px; }
.streams-scroll::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }


/* ============================================================
   SOURCE GROUP
   ============================================================ */
.source-group {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.source-group:last-child { border-bottom: none; margin-bottom: 0; }

.source-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 10px;
}
.source-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  text-transform: capitalize;
  letter-spacing: -0.005em;
}
.source-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 3px;
}
.source-tag svg { width: 11px; height: 11px; color: var(--gold); }
.source-count-badge {
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--red-ring);
  white-space: nowrap;
}


/* ============================================================
   STREAM ROW
   ============================================================ */
.stream-rows { padding: 2px 0 6px; }
.stream-row {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.12s var(--ease), border-color 0.12s var(--ease);
  position: relative;
  border-left: 3px solid transparent;
  gap: 10px;
}
.stream-row:hover { background: var(--surface-hover); }
.stream-row.active {
  background: var(--red-soft);
  border-left-color: var(--red);
}

.quality-badge {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  flex-shrink: 0;
}
.quality-badge.hd { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-ring); }
.quality-badge.sd { background: rgba(255,255,255,0.06); color: var(--muted); border: 1px solid var(--border); }

.stream-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.stream-current {
  font-size: 0.7rem;
  color: var(--red);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stream-current::before { content: '✓'; font-size: 0.72rem; }
.stream-lang {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  margin-left: auto;
  flex-shrink: 0;
}
.stream-lang svg { width: 12px; height: 12px; opacity: 0.6; }


/* ============================================================
   LOADING / EMPTY
   ============================================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.9rem;
  gap: 12px;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}


/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a48; }


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  margin-top: 40px;
  background: rgba(0,0,0,0.2);
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-soft);
}
.site-footer p {
  font-size: 0.76rem;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.6;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 1300px) {
  .content-grid { grid-template-columns: 1fr 420px; }
}

@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr 320px; gap: 18px; }
}

@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .streams-panel {
    position: static;
    max-height: 440px;
  }
}

@media (max-width: 640px) {
  nav {
    padding: 0 14px;
    gap: 10px;
    height: 56px;
  }
  .logo-text { font-size: 1.08rem; }
  .logo-mark svg { width: 24px; height: 24px; }
  .btn-back {
    padding: 8px 12px;
    font-size: 0.78rem;
  }
  .btn-back span { display: none; }
  .btn-back svg { width: 16px; height: 16px; }
  .btn-discord { width: 36px; height: 36px; }

  .page { padding: 16px 14px 40px; }

  .match-title { font-size: 1.15rem; }
  .match-header { margin-bottom: 14px; gap: 10px; }
  .match-meta { margin-top: 6px; gap: 8px; }
  .match-meta .cat-pill { font-size: 0.68rem; padding: 3px 10px; }
  .match-meta .time-txt { font-size: 0.75rem; }

  .streams-panel {
    max-height: 420px;
    border-radius: var(--radius);
  }
  .streams-panel-header { padding: 14px 16px 12px; }
  .player-section { border-radius: var(--radius); }

  .stream-row { padding: 11px 16px; }
  .source-group-header { padding: 12px 16px 10px; }
  .stream-label { font-size: 0.82rem; }
}

@media (max-width: 380px) {
  .match-title { font-size: 1rem; }
  .player-placeholder-inner span { font-size: 0.82rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
