:root {
  --bg: oklch(0.11 0.012 260);
  --bg-darker: oklch(0.08 0.015 260);
  --card: oklch(0.15 0.015 260);
  --card-2: oklch(0.19 0.018 260);
  --line: oklch(0.98 0 0 / 0.08);
  --line-strong: oklch(0.98 0 0 / 0.16);
  --text: oklch(0.98 0 0);
  --muted: oklch(0.65 0.02 260);
  --red: oklch(0.58 0.22 27);
  --red-dark: oklch(0.48 0.22 27);
  --green: oklch(0.75 0.16 150);
  --amber: oklch(0.78 0.16 75);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Figtree", system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: oklch(0.28 0.02 260); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: oklch(0.38 0.02 260); }

a { color: var(--text); text-decoration: none; }
a:hover { color: oklch(0.85 0.15 27); }
[hidden] { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  color: #fff;
  transition: all 0.15s;
}
.btn-red { background: var(--red); }
.btn-red:hover { background: var(--red-dark); }
.btn-ghost { background: var(--card-2); border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { background: oklch(0.25 0.02 260); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon {
  background: var(--card-2);
  border: 1px solid var(--line);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-icon:hover { background: oklch(0.26 0.02 260); }

/* Giriş Ekranı */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, oklch(0.22 0.04 27 / 0.3), transparent 70%), var(--bg);
}
.auth-box {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.auth-logo { height: 30px; width: auto; }
.badge-webtv {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
}
.auth-box h1 { margin: 0; font-size: 24px; font-weight: 800; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: oklch(0.85 0 0); }
.form input {
  font: inherit;
  font-size: 14.5px;
  color: #fff;
  background: var(--bg-darker);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  min-height: 42px;
  padding: 0 14px;
}
.form input:focus {
  border-color: var(--red);
  outline: none;
  box-shadow: 0 0 0 3px oklch(0.58 0.22 27 / 0.25);
}
.alert-box {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: oklch(0.3 0.1 27);
  border: 1px solid oklch(0.5 0.18 27);
  color: #ff9999;
  font-size: 13px;
}
.auth-footer { text-align: center; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.auth-footer a { color: oklch(0.85 0.15 27); font-weight: 600; }
.back-link { font-size: 13px; color: var(--muted) !important; font-weight: normal !important; }

/* Player Ana Düzeni */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.app-header {
  height: 56px;
  background: oklch(0.09 0.015 260 / 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  flex: none;
  z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-logo img { height: 26px; width: auto; display: block; }
.webtv-pill {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
  background: oklch(0.2 0.02 260);
  border: 1px solid var(--line);
  color: var(--red);
}

.header-search {
  flex: 1 1 360px;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}
.header-search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.header-search input {
  width: 100%;
  min-height: 36px;
  padding-left: 36px;
  padding-right: 12px;
  border-radius: 999px;
  background: oklch(0.14 0.015 260);
  border: 1px solid var(--line-strong);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
}
.header-search input:focus {
  border-color: var(--red);
  outline: none;
  background: oklch(0.16 0.018 260);
}

.header-right { display: flex; align-items: center; gap: 12px; }
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: oklch(0.14 0.015 260);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}
.sub-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}
.sub-badge.active { background: oklch(0.25 0.1 150); color: var(--green); }
.sub-badge.expired { background: oklch(0.3 0.1 27); color: #ff9999; }

/* Kanal Listesi & Player Çoklu Sütun Alanı */
.player-container {
  display: grid;
  grid-template-columns: 320px 1fr 0px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  transition: grid-template-columns 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.player-container.hide-channels {
  grid-template-columns: 0px 1fr 0px;
}
.player-container.show-matches {
  grid-template-columns: 320px 1fr 340px;
}
.player-container.hide-channels.show-matches {
  grid-template-columns: 0px 1fr 340px;
}

/* Sol Sütun: Kanal Rehberi */
.sidebar-guide {
  background: oklch(0.10 0.015 260);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.player-container.hide-channels .sidebar-guide {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}
.guide-tabs {
  display: flex;
  background: oklch(0.13 0.015 260);
  border-bottom: 1px solid var(--line);
  padding: 6px;
  gap: 4px;
}
.tab-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn:hover { color: #fff; background: oklch(0.17 0.018 260); }
.tab-btn.is-active { background: var(--card); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

.btn-refresh-channels {
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-refresh-channels:hover { color: #fff; background: oklch(0.17 0.018 260); }
.btn-refresh-channels.is-spinning {
  animation: spin-refresh 0.8s linear infinite;
  pointer-events: none;
}
@keyframes spin-refresh {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.category-chips {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 8px 12px;
  background: oklch(0.11 0.015 260);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.category-chips::-webkit-scrollbar { height: 3px; }
.chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: oklch(0.15 0.015 260);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
  transition: all 0.15s;
}
.chip:hover { color: #fff; border-color: var(--line-strong); }
.chip.is-active { background: var(--red); border-color: var(--red); color: #fff; }

.channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list-loading { padding: 32px; text-align: center; color: var(--muted); font-size: 13.5px; }

.channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  position: relative;
}
.channel-item:hover { background: oklch(0.16 0.015 260); }
.channel-item.is-playing {
  background: oklch(0.18 0.02 260);
  border-color: var(--red);
  color: #fff;
}
.ch-logo-wrap {
  width: 42px;
  height: 32px;
  border-radius: 4px;
  background: oklch(0.14 0.015 260);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
  border: 1px solid var(--line);
}
.ch-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }
.ch-logo-fallback { font-size: 11px; font-weight: 800; color: var(--muted); }

.ch-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-cat { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-fav-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  opacity: 0.6;
}
.ch-fav-btn:hover { opacity: 1; color: #ffca28; }
.ch-fav-btn.is-fav { color: #ffca28; opacity: 1; }

/* Orta Panel: Sinematik Video Oynatıcı */
.theater {
  display: flex;
  flex-direction: column;
  background: #000;
  overflow: hidden;
  position: relative;
  height: 100%;
}
.video-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  transition: object-fit 0.2s ease;
}
/* Boşluksuz Tam Ekrana Yayma Modu (Cover / Fill Mode) */
.video-wrapper.is-fill-mode video {
  object-fit: cover;
}

/* Oynatıcı Kontrol Katmanı */
.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 25%, transparent 70%, rgba(0,0,0,0.85) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.video-wrapper:hover .player-overlay,
.player-overlay.show-controls {
  opacity: 1;
}
.overlay-top, .overlay-bottom, .overlay-center { pointer-events: auto; }

.now-playing { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.6); padding: 6px 14px; border-radius: 999px; backdrop-filter: blur(8px); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }
.now-ch { font-weight: 800; font-size: 14px; }
.now-cat { color: var(--muted); font-size: 12px; }

.overlay-center { display: flex; align-items: center; justify-content: center; }
.big-play-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 0;
  background: oklch(0.58 0.22 27 / 0.9);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 32px rgba(220, 38, 38, 0.5);
  transition: transform 0.2s;
}
.big-play-btn:hover { transform: scale(1.1); background: var(--red); }

.overlay-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.controls-left, .controls-right { display: flex; align-items: center; gap: 10px; }

.ctrl-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 0;
  background: rgba(255,255,255,0.1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.15s;
}
.ctrl-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }

.volume-group { display: flex; align-items: center; gap: 8px; }
#vol-slider { width: 80px; accent-color: var(--red); cursor: pointer; }

/* Tiyatro Alt Metin Bilgisi */
.theater-info {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  background: oklch(0.09 0.015 260);
}
.info-left-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.info-title { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -0.01em; }

/* Programme card: clear hierarchy, exact time range and quiet progress. */
.info-left-wrap { flex:1 1 520px; }
.theater-epg-box { display:flex; flex-direction:column; gap:0; width:100%; margin-top:6px; border:1px solid #ffffff14; border-radius:14px; overflow:hidden; background:linear-gradient(115deg,#211317,#11151d 70%); }
.epg-current { padding:16px 18px; display:grid; gap:10px; }
.epg-program-meta { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.epg-tag { font-size:10px; font-weight:800; letter-spacing:.12em; display:inline-flex; align-items:center; gap:7px; }
.epg-tag.live { color:#ff888e; background:none; animation:none; }
.epg-live-dot { width:6px; height:6px; border-radius:50%; background:#ff525d; box-shadow:0 0 10px #ff525d55; }
.epg-tag.next { color:#8c97aa; }
.epg-time { color:#aeb8c9; font-size:11px; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }
.epg-title { min-width:0; color:#f5f6fa; font-size:16px; line-height:1.45; font-weight:700; overflow-wrap:anywhere; }
.epg-progress-wrap { display:flex; align-items:center; gap:12px; margin-top:2px; }
.epg-progress-wrap[hidden] { display:none; }
.epg-progress { flex:1; height:4px; border-radius:10px; overflow:hidden; background:#ffffff12; }
.epg-progress span { display:block; height:100%; width:0; border-radius:inherit; background:linear-gradient(90deg,#b72c3c,#ff6571); transition:width .3s ease; }
.epg-remaining { color:#a6afbd; font-size:10px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.epg-next { display:grid; gap:6px; padding:12px 18px; border-top:1px solid #ffffff0c; background:#0b101b66; }
.epg-next .epg-title { font-size:13px; font-weight:500; color:#bbc3d1; }
@media (max-width:860px) {
  .theater-info { padding:14px 12px; }
  .info-left-wrap { flex-basis:100%; }
  .epg-current { padding:14px; }
  .epg-next { padding:11px 14px; }
  .epg-title { font-size:15px; }
  .theater-info .shortcuts-hint { display:none; }
}
.shortcuts-hint { display: flex; gap: 12px; flex-wrap: wrap; }
.shortcuts-hint span { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
kbd {
  padding: 2px 6px;
  border-radius: 4px;
  background: oklch(0.18 0.02 260);
  border: 1px solid var(--line-strong);
  font-family: inherit;
  font-weight: 700;
  color: var(--text);
  font-size: 11px;
}

/* Abonelik Süresi Doldu Ekranı */
.expired-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  padding: 24px;
}
.expired-card {
  max-width: 440px;
  background: var(--card);
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid oklch(0.5 0.18 27);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Mobil Uyumluluk */
@media (max-width: 860px) {
  .player-container { grid-template-columns: 1fr; }
  .video-wrapper { max-height: 40vh; }
  .sidebar-guide { max-height: 50vh; }
  .header-search { display: none; }
}

/* ========================================================
   PLAYER REKLAM VE LOGO ELEMANLARI (Ads Overlay System)
   ======================================================== */

/* 1. Köşe Logo / Watermark */
.player-watermark {
  position: absolute;
  z-index: 15;
  pointer-events: auto;
  max-width: 140px;
  max-height: 70px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.player-watermark:hover {
  transform: scale(1.04);
}
.player-watermark img {
  max-width: 100%;
  max-height: 70px;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
}
.player-watermark.pos-top-right { top: 16px; right: 16px; }
.player-watermark.pos-top-left { top: 16px; left: 16px; }
.player-watermark.pos-bottom-right { bottom: 64px; right: 16px; }
.player-watermark.pos-bottom-left { bottom: 64px; left: 16px; }

/* 2. Alt Bant Banner (Lower-Third) */
.player-banner {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  max-width: min(728px, 90%);
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  overflow: hidden;
  backdrop-filter: blur(10px);
  animation: slideUpBanner 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUpBanner {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.player-banner a {
  display: block;
  line-height: 0;
}
.player-banner img {
  max-width: 100%;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.banner-close-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all 0.15s;
}
.banner-close-btn:hover {
  background: var(--red);
  border-color: var(--red);
  transform: scale(1.1);
}

/* 3. Pre-Roll Reklam Katmanı */
.preroll-layer {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 35;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}
.preroll-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.85) 0%, transparent 100%);
  z-index: 2;
}
.preroll-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  background: #ffaa00;
  color: #000;
  border-radius: 4px;
}
.preroll-timer {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.btn-skip-ad {
  background: rgba(20, 20, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}
.btn-skip-ad:not([disabled]) {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 12px var(--red-glow);
}
.btn-skip-ad:not([disabled]):hover {
  background: var(--red-dark);
  transform: scale(1.03);
}
.btn-skip-ad[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.preroll-content {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.preroll-content a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.preroll-content img,
.preroll-content video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.preroll-bottom {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 2;
}
.preroll-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}
.preroll-cta-btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* ========================================================
   CANLI MAÇ MERKEZİ & FİKSTÜR YAN PANELİ (Match Center)
   ======================================================== */
.sidebar-matches {
  background: oklch(0.10 0.015 260);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 25;
}
.player-container:not(.show-matches) .sidebar-matches {
  display: none;
}

.matches-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: oklch(0.12 0.015 260);
  border-bottom: 1px solid var(--line);
}
.matches-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.live-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  animation: pulseGreen 1.5s infinite;
}
@keyframes pulseGreen {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.icon-btn-sm {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
  transition: all 0.15s;
}
.icon-btn-sm:hover { color: #fff; background: oklch(0.2 0.02 260); }

.match-tabs {
  display: flex;
  background: oklch(0.11 0.015 260);
  border-bottom: 1px solid var(--line);
  padding: 4px;
  gap: 4px;
}
.match-tab-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.match-tab-btn:hover { color: #fff; }
.match-tab-btn.is-active {
  background: var(--card);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Spor Branşları Filtresi */
.match-sport-chips {
  display: flex;
  background: oklch(0.09 0.015 260);
  border-bottom: 1px solid var(--line);
  padding: 4px 6px;
  gap: 4px;
  overflow-x: auto;
}
.match-sport-chip {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.match-sport-chip:hover { color: #fff; background: rgba(255,255,255,0.08); }
.match-sport-chip.is-active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  color: #93c5fd;
}

/* Mini Bahis Oranları (1 - X - 2) */
.match-mini-odds {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}
.match-odd-chip {
  flex: 1;
  text-align: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 800;
  color: #cbd5e1;
}
.match-odd-chip.odd-1 { color: #38bdf8; }
.match-odd-chip.odd-x { color: #94a3b8; }
.match-odd-chip.odd-2 { color: #f472b6; }

.match-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.match-card {
  background: oklch(0.13 0.015 260);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, transform 0.15s;
}
.match-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.match-card.has-channel {
  border-color: oklch(0.68 0.15 250 / 0.3);
}
.match-card.has-channel:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}
.match-channel-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: oklch(0.68 0.15 250 / 0.15);
  border: 1px solid oklch(0.68 0.15 250 / 0.35);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  margin-top: 4px;
  transition: all 0.15s;
}
.match-card:hover .match-channel-badge {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.match-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.match-league { font-weight: 700; color: oklch(0.8 0.05 260); }
.match-status-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
}
.match-status-badge.live { background: oklch(0.3 0.15 150); color: #4ade80; }
.match-status-badge.finished { background: oklch(0.2 0.02 260); color: var(--muted); }
.match-status-badge.scheduled { background: oklch(0.25 0.05 260); color: #93c5fd; }

.match-teams-table {
  width: 100%;
  border-collapse: collapse;
}
.match-team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
}
.match-team-name {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.team-flag {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  background: transparent;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.team-flag-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 14px;
  flex-shrink: 0;
}
.match-score {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 0 4px;
}
.match-score.scheduled-time {
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  background: oklch(0.25 0.05 260 / 0.5);
  padding: 2px 6px;
  border-radius: 4px;
}
.match-score.scheduled-vs {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}
.match-winner { color: #fff; }
.match-loser { color: var(--muted); }

.matches-footer {
  padding: 8px 12px;
  background: oklch(0.09 0.015 260);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.btn-refresh-matches {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-refresh-matches:hover { color: #fff; border-color: var(--line-strong); }

/* ==========================================================================
   Karşılaşma Detayı, Spor Analizi & Paket Yükseltme Modalı
   ========================================================================== */
.match-detail-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 7, 12, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: mdFadeIn 0.2s ease-out;
}

@keyframes mdFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.match-detail-dialog {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  background: oklch(0.13 0.016 260);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  animation: mdZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.match-detail-dialog::-webkit-scrollbar {
  width: 6px;
}
.match-detail-dialog::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

@keyframes mdZoomIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.match-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: oklch(0.11 0.015 260);
  border-radius: 18px 18px 0 0;
}

.match-detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.match-detail-sport-tag {
  background: oklch(0.24 0.04 260);
  border: 1px solid var(--line-strong);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.match-detail-league {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}

.match-detail-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.match-detail-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ef4444;
}

.match-detail-body {
  padding: 14px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Skor Paneli */
.match-detail-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: oklch(0.10 0.014 260);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.md-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.md-team-logo-wrap {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.md-team-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.md-team-logo-fallback {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.md-team-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
}

.md-team-form {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 20px;
}

.md-team-form .form-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.2px;
  user-select: none;
}

.md-team-form .form-badges-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
}

.form-badge {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: help;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.form-badge:hover {
  transform: scale(1.15);
}

.form-badge.win {
  background: #16a34a;
  border: 1px solid #22c55e;
}

.form-badge.draw {
  background: #64748b;
  border: 1px solid #94a3b8;
}

.form-badge.loss {
  background: #dc2626;
  border: 1px solid #ef4444;
}

.md-score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.md-status-pill {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
}

.md-status-pill.live {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: pulseLive 1.8s infinite;
}

.md-status-pill.finished {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.md-status-pill.upcoming {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.md-score-digits {
  font-family: monospace;
  font-size: 34px;
  font-weight: 900;
  color: #fde047;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(253, 224, 71, 0.3);
}

.md-match-time {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}

/* Bölümler */
.md-section {
  background: oklch(0.11 0.014 260);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.md-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* Oranlar */
.md-odds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.md-odd-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.md-odd-box .label {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
}

.md-odd-box .value {
  font-family: monospace;
  font-size: 16px;
  font-weight: 900;
  color: #93c5fd;
}

/* Analiz ve Yorum */
.md-analysis-card {
  font-size: 13px;
  line-height: 1.6;
  color: oklch(0.92 0 0);
  background: rgba(0, 0, 0, 0.25);
  border-left: 3px solid #f97316;
  padding: 10px 14px;
  border-radius: 6px;
}

.md-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.md-stat-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  text-align: center;
}

.md-stat-chip .s-label {
  font-size: 10px;
  color: var(--muted);
  display: block;
}

.md-stat-chip .s-val {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

/* Yayın Kanalı & Paket Durumu */
.md-broadcast-card {
  border-radius: 14px;
  overflow: hidden;
}

/* Paketinde Mevcut Durumu */
.md-channel-status.is-available {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 95, 70, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.md-channel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.md-channel-tag-available {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #34d399;
}

.pulse-green-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.md-channel-name-large {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.md-channel-hint {
  font-size: 12px;
  color: var(--muted);
}

.btn-watch-channel-now {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-watch-channel-now:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Paketinde Yok (Kilitli & Paket Yükseltme) Durumu */
.md-channel-status.is-locked {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(249, 115, 22, 0.08));
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.md-locked-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.md-locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: #f87171;
  text-transform: uppercase;
}

.md-upgrade-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.md-upgrade-title {
  font-size: 13.5px;
  font-weight: 900;
  color: #fed7aa;
  display: flex;
  align-items: center;
  gap: 6px;
}

.md-upgrade-desc {
  font-size: 11.5px;
  color: oklch(0.85 0 0);
  line-height: 1.45;
  margin: 0;
}

.md-upgrade-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.md-upgrade-features li {
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.md-upgrade-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.btn-upgrade-whatsapp {
  background: #25d366;
  color: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 800;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-upgrade-whatsapp:hover {
  background: #1eb956;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
}


/* Bouquet picker keeps the channel guide width independent of group count. */
.category-picker { padding: 10px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.category-picker-open { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-width:0; padding:11px 12px; border:1px solid var(--line); border-radius:12px; background:oklch(0.15 0.015 260); color:var(--text,#fff); text-align:left; font:inherit; cursor:pointer; }
.category-picker-open:hover { border-color:var(--line-strong); }
.category-picker-text { min-width:0; display:grid; gap:4px; }
.category-picker-text small { color:var(--muted); font-size:10px; letter-spacing:.09em; }
.category-picker-text strong { font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.category-picker-meta { display:flex; gap:12px; align-items:center; flex-shrink:0; font-size:11px; color:var(--muted); }
.category-dialog { box-sizing:border-box; width:min(520px,calc(100vw - 28px)); max-height:80dvh; padding:20px; border:1px solid var(--line); border-radius:18px; background:#11141c; color:#f1f5f9; box-shadow:0 24px 90px #0009; }
.category-dialog::backdrop { background:#000a; backdrop-filter:blur(4px); }
.category-dialog-head { display:flex; gap:12px; align-items:flex-start; justify-content:space-between; }
.category-dialog-head h2 { font-size:20px; margin:0; }
.category-dialog-head p { margin:6px 0 18px; font-size:12px; color:var(--muted); }
.category-dialog-head button { background:transparent; color:#fff; border:1px solid var(--line); border-radius:8px; padding:6px 10px; cursor:pointer; }
.category-search-label { display:block; font-size:12px; margin-bottom:6px; color:var(--muted); }
#category-search { box-sizing:border-box; width:100%; margin:0 0 12px; padding:12px; border:1px solid var(--line); border-radius:10px; background:#090c12; color:#fff; font:inherit; font-size:14px; }
.category-options { display:flex; flex-direction:column; gap:6px; overflow-y:auto; max-height:calc(80dvh - 195px); overscroll-behavior:contain; }
.category-option { display:flex; align-items:center; justify-content:space-between; gap:14px; width:100%; padding:12px; border:1px solid transparent; border-radius:10px; background:#191e29; color:#e2e8f0; font:inherit; text-align:left; cursor:pointer; }
.category-option[hidden] { display:none; }
.category-option:hover { border-color:var(--line-strong); }
.category-option.is-active { background:#34191e; border-color:var(--red); }
.category-option-name { min-width:0; overflow-wrap:anywhere; line-height:1.4; font-size:13px; }
.category-option-count { flex-shrink:0; font-size:11px; color:var(--muted); }
.category-empty { color:var(--muted); font-size:13px; text-align:center; padding:20px 0; }

/* Keep authenticated controls and channel search usable on narrow screens. */
@media (max-width: 860px) {
  .app-header { height:auto; min-height:56px; flex-wrap:wrap; gap:8px; padding:10px 12px; }
  .header-left { min-width:0; flex:1 1 100%; gap:10px; }
  .header-logo img { max-width:140px; object-fit:contain; }
  .header-right { min-width:0; flex:1 1 100%; flex-wrap:wrap; gap:6px; }
  .header-right .user-pill { order:-1; flex:1 1 100%; min-width:0; }
  .user-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .sub-badge { flex-shrink:0; white-space:nowrap; }
  .header-search { display:block; order:3; flex:1 1 100%; min-width:0; max-width:none; }
  .header-search input { box-sizing:border-box; width:100%; }
}
@media (max-width: 860px) {
  .app-layout { height:100dvh; }
  .player-container { display:flex; flex-direction:column; overflow-y:auto; overscroll-behavior:contain; }
  .theater { order:0; height:auto; flex:none; min-width:0; }
  .video-wrapper { flex:none; aspect-ratio:16/9; min-height:150px; max-height:40dvh; }
  .sidebar-guide { order:1; flex:none; height:50dvh; max-height:none; width:100%; }
  .player-container.hide-channels .sidebar-guide { display:none; }
  .sidebar-matches { order:2; flex:none; width:100%; height:60dvh; }
  .player-container:not(.show-matches) .sidebar-matches { display:none; }
}
