:root {
  --bg: #0b0f17;
  --panel: #121826;
  --panel-2: #1a2336;
  --line: #243049;
  --text: #e8edf6;
  --muted: #8b97ad;
  --accent: #19c37d;
  --accent-2: #2f7bff;
  --live: #ff3b54;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #16213a 0%, var(--bg) 55%);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px;
  background: rgba(11,15,23,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--live); box-shadow: 0 0 12px var(--live); animation: pulse 1.6s infinite; }
.brand span { color: var(--accent); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.search {
  margin-left: auto; flex: 0 1 360px; display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 14px;
}
.search input { background: transparent; border: none; outline: none; color: var(--text); width: 100%; font-size: 14px; }
.search svg { flex: none; opacity: .6; }

/* ---------- Sport tabs ---------- */
.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 22px 4px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap; cursor: pointer; user-select: none;
  padding: 8px 16px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  font-size: 14px; font-weight: 600; transition: .15s;
}
.tab:hover { color: var(--text); border-color: #36456a; }
.tab.active { background: var(--accent); color: #04130c; border-color: var(--accent); }

/* ---------- Match grid ---------- */
.wrap { padding: 16px 22px 60px; max-width: 1280px; margin: 0 auto; }
.section-title { font-size: 17px; color: var(--text); margin: 22px 4px 12px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-title .badge-count { font-size: 12px; color: var(--muted); font-weight: 600; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; position: relative;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent-2); box-shadow: 0 10px 30px rgba(0,0,0,.45); }

.card .poster { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #0c1220; display:block; }
.card .cat {
  position: absolute; top: 10px; inset-inline-start: 10px;
  background: rgba(0,0,0,.6); border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.card .live-badge {
  position: absolute; top: 10px; inset-inline-end: 10px;
  background: var(--live); color: #fff; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; display: flex; align-items: center; gap: 6px;
  box-shadow: 0 2px 10px rgba(255,59,84,.5);
}
.card .live-badge .d { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }

.card .body { padding: 14px; }
.card .teams { display: flex; align-items: center; gap: 10px; }
.card .team { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.card .team.away { flex-direction: row-reverse; text-align: right; }
.card .team img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.card .team .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .vs { color: var(--muted); font-weight: 800; font-size: 12px; }
.card .title-only { font-weight: 700; font-size: 15px; }
.card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.card .watch { color: var(--accent); font-weight: 800; }

.site-footer { margin-top: 40px; padding: 28px 4px 10px; border-top: 1px solid var(--line); color: var(--muted); }
.site-footer h2 { font-size: 18px; color: var(--text); margin: 0 0 10px; }
.site-footer p { font-size: 13.5px; line-height: 1.8; margin: 0 0 10px; max-width: 820px; }
.site-footer .disclaimer { font-size: 12px; opacity: .8; }
.site-footer .copy { font-weight: 700; }

.empty, .loading { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 15px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Watch page ---------- */
.player-wrap { max-width: 1100px; margin: 0 auto; padding: 18px 22px 60px; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.player-title { font-size: 22px; font-weight: 800; margin: 4px 0 14px; }
.player-title small { color: var(--muted); font-weight: 600; font-size: 14px; text-transform: capitalize; margin-left: 8px; }

.player-frame {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.player-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Tap-to-play overlay (needed for autoplay on phones) */
.tap-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; cursor: pointer;
  background: radial-gradient(circle at center, rgba(25,195,125,.15), rgba(0,0,0,.85));
  color: #fff; font-weight: 800; font-size: 16px;
}
.tap-overlay .play-btn {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--accent); color: #04130c; font-size: 34px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(25,195,125,.5); transition: transform .15s;
}
.tap-overlay:hover .play-btn { transform: scale(1.08); }

/* Player action buttons */
.player-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.pbtn {
  flex: 1; min-width: 140px; text-align: center; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px 16px; font-weight: 800; font-size: 14px; transition: .15s;
}
.pbtn:hover { border-color: var(--accent-2); }

/* Live strip (horizontal "live now" row, like other sites) */
.live-strip-wrap { margin: 10px 0 4px; }
.live-strip-title { font-size: 15px; font-weight: 800; margin: 6px 4px 10px; display: flex; align-items: center; gap: 8px; }
.live-strip {
  display: flex; gap: 12px; overflow-x: auto; padding: 4px 4px 12px; scrollbar-width: thin;
}
.live-strip::-webkit-scrollbar { height: 6px; }
.live-strip::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
.live-mini {
  flex: 0 0 auto; width: 200px; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--live); border-radius: 12px; padding: 12px; position: relative;
}
.live-mini .lm-badge { position: absolute; top: 8px; inset-inline-end: 8px; background: var(--live); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.live-mini .lm-cat { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.live-mini .lm-team { display: flex; align-items: center; gap: 7px; margin: 4px 0; }
.live-mini .lm-team img { width: 20px; height: 20px; object-fit: contain; }
.live-mini .lm-team .nm { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-mini .lm-watch { margin-top: 8px; color: var(--accent); font-weight: 800; font-size: 12px; }

/* Private watch lock screen */
.lock-screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding: 24px; color: var(--text);
  background: radial-gradient(circle at center, #16213a 0%, #000 80%);
}
.lock-screen .lock-big { font-size: 46px; }
.lock-screen h2 { margin: 0; font-size: 20px; }
.lock-screen p { margin: 0; color: var(--muted); font-size: 14px; max-width: 360px; }
.lock-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.lock-form input {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 12px 16px; outline: none; font-size: 15px; min-width: 180px; text-align: center;
}
.lock-form button {
  background: var(--accent); color: #04130c; border: none; border-radius: 10px;
  padding: 12px 22px; font-weight: 800; font-size: 15px; cursor: pointer;
}
.lock-msg { color: var(--live); font-weight: 700; font-size: 13px; min-height: 18px; }

.streams { margin-top: 18px; }
.streams h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 0 0 10px; }
.stream-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.sbtn {
  cursor: pointer; padding: 10px 16px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; transition: .15s;
}
.sbtn:hover { border-color: var(--accent-2); }
.sbtn.active { background: var(--accent); color: #04130c; border-color: var(--accent); }
.sbtn .hd { font-size: 10px; background: var(--accent-2); color: #fff; padding: 2px 6px; border-radius: 5px; font-weight: 800; }
.sbtn.active .hd { background: #04130c; color: var(--accent); }

.hint { margin-top: 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.hint a { color: var(--accent-2); }
.hint code { background: var(--panel); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); }
.warn { color: var(--live); font-weight: 700; }

/* Arabic stream highlighting */
.sbtn.arabic { border-color: var(--accent); }
.sbtn .viewers { opacity: .7; font-size: 11px; font-weight: 600; }
.ar-tag, .stream-btns .ar-tag {
  background: var(--accent); color: #04130c; font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 5px;
}

/* RTL: flip the back arrow */
[dir="rtl"] .back { content: ""; }

/* ---------- Ads ---------- */
.ad-slot {
  position: relative; margin: 14px auto; max-width: 1280px;
  border: 1px dashed var(--line); border-radius: 12px; overflow: hidden;
  background: var(--panel); min-height: 70px;
  display: flex; align-items: center; justify-content: center;
}
.ad-slot .ad-tag {
  position: absolute; top: 6px; inset-inline-start: 8px;
  font-size: 9px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase;
}
.ad-ph {
  color: var(--muted); font-weight: 800; font-size: 16px; text-align: center; padding: 22px;
  display: flex; flex-direction: column; gap: 4px;
}
.ad-ph small { font-size: 10px; opacity: .6; font-weight: 600; }
.ad-top, .ad-footer, .ad-watch { width: calc(100% - 44px); }
.ad-self { display: block; line-height: 0; }
.ad-self img { max-width: 100%; height: auto; display: block; margin: auto; border-radius: 8px; }
.ad-frame { display: block; }
.adfree .ad-slot { display: none !important; }

/* ---------- Unlock (remove-ads) UI ---------- */
.unlock-box {
  position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 100;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 10px 8px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.unlock-box .lock { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.unlock-box input {
  width: 110px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  color: var(--text); padding: 7px 12px; outline: none; font-size: 13px;
}
.unlock-box button {
  background: var(--accent); color: #04130c; border: none; border-radius: 999px;
  padding: 8px 14px; font-weight: 800; cursor: pointer; font-size: 13px;
}
.relock-btn {
  position: fixed; inset-inline-end: 16px; bottom: 16px; z-index: 100;
  background: var(--panel); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 700; cursor: pointer; opacity: .6;
}
.relock-btn:hover { opacity: 1; }

/* Toast */
#toast {
  position: fixed; inset-inline-start: 50%; transform: translateX(50%); bottom: 80px; z-index: 200;
  background: var(--accent); color: #04130c; font-weight: 800; padding: 12px 22px;
  border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
[dir="ltr"] #toast { transform: translateX(-50%); }
#toast.show { opacity: 1; }

@media (max-width: 560px) {
  .unlock-box input { width: 84px; }
  .unlock-box .lock { display: none; }

  /* 2 cards per row on phones, like other sites */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .wrap { padding: 12px 12px 80px; }
  .card .team .nm { font-size: 12px; }
  .card .body { padding: 10px; }
  .card .vs { font-size: 11px; }

  /* bigger, edge-to-edge player on phones */
  .player-wrap { padding: 12px 10px 80px; }
  .player-title { font-size: 18px; }
  .pbtn { min-width: 0; }
  .topbar { padding: 12px 14px; }
  .tabs { padding: 12px 12px 4px; }
}
