:root {
  --bg: #0b0f1a;
  --surface: #0f172a;
  --ink: #e5e7eb;
  --muted: #93a4be;
  --line: #1e293b;
  --card: #101827;
  --soft: #0f213d;
  --accent: #1d4ed8;
  --accent-2: #22d3ee;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
  height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto
}

.wrap {
  max-width: 1240px;
  margin: auto;
  padding: 14px 16px
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #0b1222, #0f1f3a);
  border-bottom: 1px solid #0f1a33;
  box-shadow: 0 6px 24px #0007
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px
}

.brand .logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: inset 0 0 0 2px #93c5fd22, 0 8px 24px #0008;
  font: 700 14px Outfit, system-ui;
  color: #fff
}

.brand .title {
  display: flex;
  flex-direction: column
}

.brand strong {
  font: 700 18px Outfit, Inter
}

.brand small {
  color: var(--muted)
}

nav.top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-link {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
}

.lang-link:hover {
  background-color: #13223f;
  color: var(--ink);
}

.lang-link.active {
  background-color: var(--accent);
  color: #fff;
}

.search {
  display: flex;
  gap: 8px;
  width: min(520px, 100%)
}

.search input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  outline: none;
  background: #0b1428;
  color: #e2e8f0
}

.search button {
  border: 1px solid var(--line);
  background: #13223f;
  color: #cbd5e1;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer
}

.menu {
  display: flex;
  gap: 16px;
  margin-top: 10px
}

.menu a {
  padding: 8px 12px;
  border-radius: 10px;
  background: #0c1830;
  border: 1px solid var(--line);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 14px
}

.menu a:hover {
  background: #0e213f
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 18px;
  flex: 1 0 auto;
}

@media(min-width:1100px) {
  .layout {
    grid-template-columns: 1fr 300px
  }
}

/* Billboard Ad */
.billboard {
  border: 1px dashed #263248;
  border-radius: var(--radius);
  background: #0d1c37;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9fb0c8;
  box-shadow: var(--shadow)
}

/* Grid */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, 1fr)
}

@media(min-width:760px) {
  .grid {
    grid-template-columns: repeat(3, 1fr)
  }
}

@media(min-width:1180px) {
  .grid {
    grid-template-columns: repeat(4, 1fr)
  }
  .layout .grid { /* Specific rule for related channels on player pages */
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease
}

.card:hover {
  transform: translateY(-4px);
  border-color: #3754e0;
  box-shadow: 0 20px 40px rgba(29, 78, 216, .25)
}

.frame {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px #0005);
}

.label {
  margin-top: 10px;
  background: #000;
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between
}

.label b {
  font-size: 13px;
  letter-spacing: .3px
}

.label span {
  font-size: 11px;
  color: #a5b4fc
}

/* Pagination */
.pager {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 0
}

.pager a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1428;
  color: #cbd5e1
}

.pager a.active {
  background: #1d4ed8;
  border-color: #3754e0;
  color: #fff
}

/* Right rail */
.rail {
  position: sticky;
  top: 96px;
  height: fit-content;
  display: grid;
  gap: 16px
}

.ad {
  border: 1px dashed #263248;
  border-radius: 16px;
  min-height: 300px;
  background: #0d1c37;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center
}

/* Footer */
footer {
  margin-top: 18px;
  border-top: 1px solid #0f1a33;
  background: #0b1222
}

.foot {
  color: #93a4be;
  font-size: 14px
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0
}

/* Channel Page Specific */
.crumbs {
  color: #9fb0c8;
  font-size: 14px
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px
}

.player {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #0b0b0b
}

.player iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: 0
}

.sources {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap
}

.sources button {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0b1428;
  color: #cbd5e1;
  cursor: pointer
}

.sources button.active {
  background: #1d4ed8;
  border-color: #3754e0;
  color: #fff
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px
}

.fact {
  background: #0b1428;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px
}

.channel-description {
  margin-top: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--muted);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.1rem;
  line-height: 1.7;
}
