/* ————— FIFA26 Stream Hub — minimal dark ————— */

:root {
  --bg: #07090d;
  --panel: #0d1118;
  --panel-2: #111722;
  --line: rgba(255, 255, 255, 0.07);
  --text: #e9eef4;
  --muted: #828b98;
  --accent: #2ee08c;
  --accent-dim: rgba(46, 224, 140, 0.12);
  --danger: #ff5d6c;
  --radius: 14px;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", var(--font-ui);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #04130b; }

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

button { font: inherit; cursor: pointer; }

/* —— ambient glow —— */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 360px at 75% -8%, rgba(46, 224, 140, 0.13), transparent 65%),
    radial-gradient(800px 480px at 12% -12%, rgba(82, 120, 255, 0.10), transparent 65%);
}

/* —— top bar —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 56px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 20px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.brand-name em { font-style: normal; color: var(--accent); }
.brand-sub {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topnav { display: flex; align-items: center; gap: 22px; font-size: 13.5px; color: var(--muted); }
.topnav a:hover { color: var(--text); }

/* —— hero —— */
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(56px, 9vw, 110px) clamp(20px, 5vw, 56px) 36px;
  max-width: 1180px;
  margin: 0 auto;
}

.hero-kicker {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(42px, 7.5vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.hero h1 span {
  background: linear-gradient(92deg, var(--accent), #6ea8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 4vw, 56px);
  margin-top: 44px;
}
.stat .n {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.stat .l {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

/* —— toolbar —— */
.toolbar {
  position: sticky;
  top: 57px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 12px clamp(20px, 5vw, 56px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
}

.search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
  color: var(--muted);
}
.search-wrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  translate: 0 -50%;
}
.search-wrap input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.search-wrap input:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.search-wrap input::placeholder { color: #5a626e; }

#countrySelect {
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  max-width: 220px;
}

.chips { display: flex; gap: 6px; }

.chip {
  padding: 9px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  transition: 0.15s;
}
.chip:hover { color: var(--text); }
.chip.active {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.star-chip.active { color: #ffd76a; background: rgba(255, 215, 106, 0.1); border-color: rgba(255, 215, 106, 0.4); }

/* —— buttons —— */
.btn-ghost {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  transition: 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.22); }

.btn-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: 0.15s;
  flex: none;
}
.btn-icon:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }

/* —— grid —— */
main {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 4px clamp(20px, 5vw, 56px) 64px;
}

.result-line { margin: 6px 0 16px; font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; }

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: var(--panel-2);
  outline: none;
}

.card-top { display: flex; align-items: center; gap: 10px; }

.flag {
  width: 28px;
  height: 21px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--panel-2);
  outline: 1px solid var(--line);
  flex: none;
}
.flag-fallback {
  width: 28px;
  height: 21px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--panel-2);
  outline: 1px solid var(--line);
  flex: none;
}

.card-country { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card-fav {
  margin-left: auto;
  background: none;
  border: none;
  color: #4a515c;
  font-size: 15px;
  padding: 2px 4px;
  transition: 0.15s;
  flex: none;
}
.card-fav:hover { color: #ffd76a; transform: scale(1.15); }
.card-fav.faved { color: #ffd76a; }

.card-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16.5px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: auto; }

/* —— pinned —— */
.pinned-wrap { margin-bottom: 22px; }
.pinned-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 4px 0 14px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.pinned-sub {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e0b46e;
}
.card.is-pinned {
  border-color: rgba(255, 196, 106, 0.4);
  background: linear-gradient(160deg, rgba(255, 196, 106, 0.08), var(--panel) 55%);
}
.card.is-pinned:hover, .card.is-pinned:focus-visible {
  border-color: rgba(255, 196, 106, 0.7);
  background: linear-gradient(160deg, rgba(255, 196, 106, 0.12), var(--panel-2) 55%);
}
.pin-mark { margin-left: auto; font-size: 13px; line-height: 1; }
.card.is-pinned .card-fav { margin-left: 4px; }

.drm-badge {
  background: rgba(255, 196, 106, 0.14);
  color: #e7be78;
}

.badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  flex: none;
}
.badge.q-sd { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.badge.q-hd { background: rgba(110, 168, 255, 0.12); color: #6ea8ff; }

.card-broadcaster {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-sources { margin-left: auto; font-size: 11.5px; color: #5a626e; flex: none; }
.card-sources.vlc-tag { color: #e0b46e; }

.empty { text-align: center; padding: 80px 0; color: var(--muted); }

/* —— coverage —— */
.coverage {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(20px, 5vw, 56px) 72px;
  border-top: 1px solid var(--line);
}
.coverage h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 18px 0 22px;
}
.muted { color: var(--muted); font-weight: 400; }

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}
.coverage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  font-size: 12.5px;
}
.coverage-item .flag, .coverage-item .flag-fallback { width: 22px; height: 16px; }
.coverage-item b { font-weight: 600; flex: none; }
.coverage-item span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* —— footer —— */
footer {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px clamp(20px, 5vw, 56px) 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
footer a { color: var(--accent); }

/* ————————————— PLAYER ————————————— */

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
  background: rgba(4, 6, 9, 0.84);
  backdrop-filter: blur(10px);
}

.player-shell {
  width: min(1060px, 100%);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
  animation: pop 0.18s ease;
}
@keyframes pop { from { transform: scale(0.97); opacity: 0; } }

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
}
.player-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-flag { width: 34px; height: 25px; border-radius: 5px; object-fit: cover; outline: 1px solid var(--line); flex: none; }
.player-title h3 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-title p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* —— video area —— */
.video-wrap {
  position: relative;
  background: #000;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-wrap video { width: 100%; height: 100%; display: block; }
.video-wrap:fullscreen { aspect-ratio: auto; }
.video-wrap.idle { cursor: none; }
.video-wrap.idle .controls { opacity: 0; pointer-events: none; }

/* spinner */
.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* status overlay */
.video-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  background: rgba(5, 7, 10, 0.9);
  padding: 20px;
  z-index: 5;
}
.video-status p { margin: 0; color: var(--muted); font-size: 14px; max-width: 460px; }
.status-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* stats for nerds */
.stats-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  min-width: 250px;
  background: rgba(7, 9, 13, 0.88);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  font-size: 11.5px;
}
.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 5px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 10px;
}
.stats-close { background: none; border: none; color: var(--muted); font-size: 11px; padding: 0 2px; }
.stats-close:hover { color: var(--text); }
.stats-panel pre {
  margin: 0;
  padding: 4px 12px 10px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: #c4cdd8;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* —— control bar —— */
.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 26px 12px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  transition: opacity 0.2s;
}

.seek-row { padding: 0 4px 6px; }

/* range inputs */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  transition: transform 0.12s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.3); }
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
}

#seekBar { width: 100%; display: block; }
#volBar { width: 78px; }

.ctrl-row { display: flex; align-items: center; gap: 6px; }

.ctl {
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 8px;
  color: #dfe6ee;
  transition: 0.13s;
}
.ctl:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.ctl-text {
  width: auto;
  min-width: 36px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.ctrl-spacer { flex: 1; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding: 4px 10px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #cfd6de;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.live-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #5a626e; }
.live-badge.is-live { border-color: rgba(255, 93, 108, 0.5); color: #ff8d99; }
.live-badge.is-live .dot { background: var(--danger); box-shadow: 0 0 8px var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

.time-label { margin-left: 10px; font-size: 12px; color: #aab3bf; font-variant-numeric: tabular-nums; }

/* popover menus */
.menu-anchor { position: relative; }
.menu {
  position: absolute;
  bottom: 42px;
  right: 0;
  z-index: 8;
  min-width: 170px;
  max-height: 260px;
  overflow: auto;
  background: rgba(10, 13, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 5px;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 8px 11px;
  background: none;
  border: none;
  border-radius: 8px;
  color: #c8d0da;
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.menu-item.active { color: var(--accent); }
.menu-item.active::after { content: "✓"; font-size: 11px; }
.menu-label { padding: 7px 11px 3px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* —— player foot —— */
.player-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
}
.sources { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.source-pill {
  padding: 7px 12px;
  font-size: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  transition: 0.15s;
}
.source-pill:hover { color: var(--text); }
.source-pill.active {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}
.source-pill.dead { opacity: 0.4; text-decoration: line-through; }
.source-pill.vlc-only { border-style: dashed; border-color: rgba(255, 196, 106, 0.45); color: #e0b46e; }
.source-pill.vlc-only.active { background: rgba(255, 196, 106, 0.1); }

.kbd-hints { font-size: 11px; color: #4f5763; letter-spacing: 0.03em; }

#playerFav.faved { color: #ffd76a; border-color: rgba(255, 215, 106, 0.4); }

/* —— toast —— */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  translate: -50% 0;
  z-index: 200;
  padding: 10px 18px;
  background: #161d28;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  animation: rise 0.2s ease;
}
@keyframes rise { from { translate: -50% 12px; opacity: 0; } }

/* —— responsive —— */
@media (max-width: 700px) {
  .toolbar { top: 53px; }
  .topnav a { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 9px; }
  .card { padding: 13px; }
  .hero-sub { font-size: 14.5px; }
  .player-head-actions .btn-ghost { display: none; }
  #volBar, .time-label, .kbd-hints { display: none; }
}
