:root {
  --bg: #080b12;
  --panel: #101622;
  --panel-2: #151d2b;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f7fb;
  --muted: #8e9aae;
  --accent: #64f58d;
  --accent-2: #37c969;
  --danger: #ff6577;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% -12%, rgba(100, 245, 141, 0.12), transparent 30rem),
    var(--bg);
}

button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 18, 0.86);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.brand b { color: var(--accent); }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #07110a;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(100, 245, 141, 0.22);
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.live-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(100, 245, 141, 0.09);
}

main { width: min(1440px, calc(100% - 40px)); margin: 0 auto; }

.hero {
  min-height: 600px;
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.72fr);
  gap: 28px;
  align-items: center;
  padding: 54px 0 38px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #05070b;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

video { width: 100%; height: 100%; object-fit: contain; background: #05070b; }

.player-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: radial-gradient(circle at 50% 35%, rgba(100, 245, 141, 0.10), transparent 35%), #090d14;
}

.player-message.hidden { display: none; }
.player-message strong { font-size: clamp(20px, 3vw, 34px); letter-spacing: -0.04em; }
.player-message small { color: var(--muted); }
.play-glyph {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  padding-left: 4px;
  margin-bottom: 12px;
  border-radius: 50%;
  color: #07110a;
  background: var(--accent);
  box-shadow: 0 0 50px rgba(100, 245, 141, 0.2);
}

.now-playing {
  padding: 34px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(21, 29, 43, 0.9), rgba(13, 18, 28, 0.9));
}

.eyebrow { color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: 0.16em; }
.now-playing h1 { margin: 12px 0 6px; font-size: clamp(34px, 4vw, 58px); line-height: 0.98; letter-spacing: -0.06em; }
.now-playing > p { color: var(--muted); line-height: 1.6; }
.now-playing label { display: block; margin: 28px 0 9px; color: #c8d0dc; font-size: 12px; font-weight: 700; }

.signal { display: flex; align-items: end; gap: 4px; height: 22px; color: var(--muted); font-size: 12px; }
.signal i { width: 3px; border-radius: 3px; background: var(--accent); }
.signal i:nth-child(1) { height: 5px; }
.signal i:nth-child(2) { height: 9px; }
.signal i:nth-child(3) { height: 13px; }
.signal i:nth-child(4) { height: 17px; }
.signal span { margin-left: 6px; }

.url-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.url-row input, .search input {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(5, 8, 13, 0.75);
}
.url-row input { min-width: 0; padding: 13px 14px; border-radius: 12px; }
.url-row input:focus, .search:focus-within { border-color: rgba(100, 245, 141, 0.55); }
.url-row button {
  border: 0;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 800;
  color: #07110a;
  background: var(--accent);
}
.url-row button:hover { background: #86f7a6; }
.status { min-height: 20px; margin: 10px 0 0 !important; font-size: 11px; }
.status.error { color: var(--danger); }

.browse { padding: 35px 0 80px; }
.browse-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.browse h2 { margin: 7px 0 0; font-size: 34px; letter-spacing: -0.05em; }
.search {
  width: min(320px, 45vw);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--panel);
}
.search input { height: 44px; border: 0; background: transparent; }

.categories { display: flex; gap: 8px; overflow-x: auto; padding: 25px 0 22px; scrollbar-width: none; }
.categories::-webkit-scrollbar { display: none; }
.category {
  flex: 0 0 auto;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}
.category.active { color: #07110a; border-color: var(--accent); background: var(--accent); }

.channel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.channel-card {
  position: relative;
  min-height: 188px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
  color: var(--text);
  background: var(--panel);
  transition: transform 160ms ease, border-color 160ms ease;
}
.channel-card::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  right: -52px;
  top: -62px;
  border-radius: 50%;
  background: var(--card-color);
  filter: blur(8px);
  opacity: 0.16;
}
.channel-card:hover, .channel-card:focus-visible { transform: translateY(-3px); border-color: rgba(100, 245, 141, 0.38); outline: none; }
.channel-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; font-size: 21px; font-weight: 900; color: #07110a; background: var(--card-color); }
.channel-card h3 { margin: 31px 0 4px; font-size: 17px; }
.channel-card p { margin: 0; color: var(--muted); font-size: 12px; }
.favorite {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(8, 11, 18, 0.68);
  z-index: 2;
}
.favorite.on { color: var(--accent); }
.empty { grid-column: 1 / -1; padding: 50px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; color: var(--muted); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
footer span:first-child { color: var(--text); font-weight: 800; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .now-playing { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; }
  .now-playing .eyebrow, .now-playing h1, .now-playing > p, .signal { grid-column: 1; }
  .now-playing label, .url-row, .status { grid-column: 2; }
  .now-playing label { grid-row: 1; margin: 0 0 9px; align-self: end; }
  .url-row { grid-row: 2 / span 2; align-self: center; }
  .status { grid-row: 4; }
  .channel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  main { width: min(100% - 24px, 1440px); }
  .topbar { height: 66px; padding-inline: 16px; }
  .hero { min-height: 0; gap: 14px; }
  .player-shell, .now-playing { border-radius: 17px; }
  .now-playing { display: block; padding: 23px; }
  .now-playing label { margin-top: 24px; }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-card { min-height: 164px; padding: 15px; }
  .browse-head { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  footer { flex-direction: column; padding-inline: 18px; }
}

@media (max-width: 420px) {
  .channel-grid { grid-template-columns: 1fr; }
  .live-pill { display: none; }
  .url-row { grid-template-columns: 1fr; }
  .url-row button { height: 44px; }
}
