:root {
  color-scheme: dark;

  --bg:       #06090f;
  --bg-2:     #090d18;
  --panel:    #0d1220;
  --panel-2:  #111827;
  --panel-3:  #1a2235;

  --ink:   #eef2ff;
  --ink-2: #c7d2fe;
  --muted: #7c8db8;
  --quiet: #3d4f7a;

  --line:      #1e2d50;
  --line-soft: #131d38;

  --accent:      #2dd4bf;
  --accent-2:    #818cf8;
  --accent-soft: rgba(45, 212, 191, 0.1);
  --indigo-soft: rgba(129, 140, 248, 0.1);

  --gold:       #f59e0b;
  --gold-2:     #fcd34d;
  --gold-soft:  rgba(245, 158, 11, 0.12);
  --red:        #f87171;
  --amber:      #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.12);

  --shadow:      0 24px 64px rgba(0, 0, 0, 0.7);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.45);

  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(129, 140, 248, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(129, 140, 248, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

body > .app-shell {
  position: relative;
  z-index: 1;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #253050;
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ── Lucide icon fallbacks ─────────────────────────────── */

i[data-lucide] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.06rem;
  height: 1.06rem;
  flex: 0 0 auto;
  color: currentColor;
  font-style: normal;
}

i[data-lucide]:empty::before {
  content: attr(data-fallback);
  display: inline-block;
  max-width: 2.2rem;
  overflow: hidden;
  font-size: 0.55rem;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

svg {
  flex: 0 0 auto;
}

.icon-button i[data-lucide]:empty::before,
.ghost-button i[data-lucide]:empty::before,
.toggle-chip i[data-lucide]:empty::before,
.text-button i[data-lucide]:empty::before,
.load-more i[data-lucide]:empty::before,
.search-submit i[data-lucide]:empty::before {
  width: 0.78rem;
  height: 0.78rem;
  border-radius: 3px;
  background: currentColor;
  content: "";
  opacity: 0.55;
}

.brand-mark i[data-lucide]:empty::before,
.logo-box i[data-lucide]:empty::before,
.fifa-icon i[data-lucide]:empty::before {
  width: auto;
  height: auto;
  max-width: 2.4rem;
  color: currentColor;
  background: transparent;
  content: attr(data-fallback);
  font-size: 0.65rem;
  font-weight: 900;
  opacity: 1;
}

.header-search > i[data-lucide]:empty {
  position: relative;
  width: 18px;
  height: 18px;
}

.header-search > i[data-lucide]:empty::before {
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: transparent;
  content: "";
  opacity: 0.6;
}

.header-search > i[data-lucide]:empty::after {
  position: absolute;
  right: 1px;
  bottom: 3px;
  width: 7px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  opacity: 0.6;
  transform: rotate(45deg);
}

/* ── App shell ─────────────────────────────────────────── */

.app-shell {
  width: min(1720px, calc(100% - 28px));
  margin: 0 auto;
  padding: 10px 0 36px;
}

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  margin-bottom: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(6, 9, 15, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  color: #021a16;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.3);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.1;
}

.brand-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1.06rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  padding: 0 5px 0 16px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.header-search:focus-within {
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.07);
}

.header-search > i,
.header-search > svg {
  color: var(--muted);
  flex: 0 0 auto;
}

.header-search input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.93rem;
}

.header-search input::placeholder {
  color: var(--quiet);
}

.search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #021a16;
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms ease;
}

.search-submit:hover {
  opacity: 0.85;
  transform: scale(1.06);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Shared interactive base ────────────────────────────── */

.icon-button,
.ghost-button,
.toggle-chip,
.text-button,
.load-more,
.category-chip {
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease;
}

.icon-button:focus-visible,
.ghost-button:focus-visible,
.toggle-chip:focus-visible,
.text-button:focus-visible,
.load-more:focus-visible,
.category-chip:focus-visible,
.channel-card:focus-visible,
.fifa-hero:focus-visible,
input:focus,
select:focus {
  outline: 2px solid rgba(45, 212, 191, 0.55);
  outline-offset: 2px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--muted);
}

.icon-button:hover,
.icon-button.is-active {
  color: var(--accent);
  border-color: rgba(45, 212, 191, 0.4);
  background: var(--accent-soft);
}

.icon-button[disabled],
.ghost-button[disabled],
.toggle-chip[disabled],
.icon-button[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.32;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink-2);
  font-weight: 700;
}

.ghost-button:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--panel-3);
  color: var(--ink);
  transform: translateY(-1px);
}

/* ── Layout ─────────────────────────────────────────────── */

.app-main {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.content-stack {
  display: grid;
  min-width: 0;
  gap: 14px;
}

/* ── Panel base ─────────────────────────────────────────── */

.control-panel,
.player-panel,
.catalog-section,
.site-footer {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: rgba(11, 16, 30, 0.97);
  box-shadow: var(--shadow);
}

/* ── Sidebar ─────────────────────────────────────────────── */

.control-panel {
  position: sticky;
  top: 82px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 0;
  gap: 0;
}

/* ── FIFA hero card ─────────────────────────────────────── */

.fifa-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 18px 16px;
  border: none;
  border-bottom: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.16) 0%,
    rgba(239, 68, 68, 0.09) 50%,
    rgba(129, 140, 248, 0.07) 100%
  );
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: all 200ms ease;
}

.fifa-hero:hover {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.24) 0%,
    rgba(239, 68, 68, 0.14) 50%,
    rgba(129, 140, 248, 0.1) 100%
  );
  border-color: rgba(245, 158, 11, 0.42);
}

.fifa-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 15% 50%, rgba(245, 158, 11, 0.2) 0%, transparent 65%);
  pointer-events: none;
}

.fifa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.38);
}

.fifa-icon svg {
  width: 22px;
  height: 22px;
}

.fifa-text {
  flex: 1;
  min-width: 0;
}

.fifa-text strong {
  display: block;
  color: var(--gold-2);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.fifa-text small {
  display: block;
  margin-top: 4px;
  color: rgba(252, 211, 77, 0.58);
  font-size: 0.72rem;
}

.fifa-live-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  flex-shrink: 0;
  animation: badge-pulse 2.2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px rgba(239, 68, 68, 0.55); }
  50%       { opacity: 0.7; box-shadow: 0 0 18px rgba(239, 68, 68, 0.25); }
}

.fifa-hero.is-active {
  border-bottom-color: rgba(245, 158, 11, 0.6);
  box-shadow: inset 3px 0 0 var(--gold);
}

/* ── Sports hero (sibling band below FIFA) ──────────────── */

.sports-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(
    135deg,
    rgba(45, 212, 191, 0.13) 0%,
    rgba(129, 140, 248, 0.08) 100%
  );
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.sports-hero:hover {
  background: linear-gradient(
    135deg,
    rgba(45, 212, 191, 0.22) 0%,
    rgba(129, 140, 248, 0.12) 100%
  );
}

.sports-hero.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
  border-bottom-color: rgba(45, 212, 191, 0.45);
}

.sports-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06231f;
  box-shadow: 0 4px 16px rgba(45, 212, 191, 0.32);
}

.sports-icon svg {
  width: 21px;
  height: 21px;
}

.sports-text {
  flex: 1;
  min-width: 0;
}

.sports-text strong {
  display: block;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.sports-text small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.71rem;
}

.sports-arrow {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 180ms ease, color 180ms ease;
}

.sports-hero:hover .sports-arrow {
  transform: translateX(3px);
  color: var(--accent);
}

.sports-arrow svg {
  width: 18px;
  height: 18px;
}

/* ── Filter block ───────────────────────────────────────── */

.filter-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.select-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg,  transparent 50%, var(--muted) 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 14px) 50% / 6px 6px no-repeat,
    var(--panel-2);
  appearance: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 150ms ease;
}

select:hover {
  border-color: rgba(45, 212, 191, 0.3);
}

option {
  color: var(--ink);
  background: #111827;
}

.quick-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.toggle-chip:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--panel-3);
  color: var(--ink-2);
  transform: translateY(-1px);
}

.toggle-chip.is-active {
  border-color: rgba(45, 212, 191, 0.55);
  background: var(--accent-soft);
  color: var(--accent);
}

.toggle-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Metrics ────────────────────────────────────────────── */

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-soft);
}

.metric-row > div {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px 10px;
  text-align: center;
  border-right: 1px solid var(--line-soft);
}

.metric-row > div:last-child {
  border-right: none;
}

.metric-row strong {
  display: block;
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1;
}

.metric-row span {
  display: block;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ── Category panel ─────────────────────────────────────── */

.category-panel {
  padding: 14px;
  overflow: auto;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--quiet);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
}

.text-button:hover {
  border-color: rgba(45, 212, 191, 0.28);
  color: var(--muted);
}

/* Tag cloud of category chips */
.category-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.category-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
}

.category-chip:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--panel-3);
  color: var(--ink-2);
  transform: translateY(-1px);
}

.category-chip.is-active {
  border-color: rgba(45, 212, 191, 0.6);
  background: var(--accent-soft);
  color: var(--accent);
}

.category-chip.is-special {
  border-color: rgba(245, 158, 11, 0.32);
  background: var(--gold-soft);
  color: var(--gold);
}

.category-chip.is-special:hover,
.category-chip.is-special.is-active {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.17);
  color: var(--gold-2);
}

.chip-label {
  font-weight: 700;
}

.chip-count {
  opacity: 0.55;
  font-size: 0.69rem;
  font-weight: 600;
}

/* ── Eyebrow labels ──────────────────────────────────────── */

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Result pills ────────────────────────────────────────── */

.result-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Player panel ────────────────────────────────────────── */

.player-panel {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.player-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.player-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(129, 140, 248, 0.06) 0%, transparent 45%);
  pointer-events: none;
  z-index: 1;
}

.player-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
  z-index: 2;
}

.yt-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  z-index: 3;
}

.yt-frame[hidden] {
  display: none;
}

.player-stage video[hidden] {
  display: none;
}

.player-empty {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: min(520px, 88%);
  padding: 32px;
  text-align: center;
}

.player-empty.is-hidden {
  display: none;
}

.standby-screen {
  position: relative;
  display: grid;
  place-items: center;
  width: 120px;
  height: 76px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.standby-screen::after {
  position: absolute;
  right: 10px;
  bottom: 7px;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  content: "";
}

.standby-line {
  width: 68px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.5);
}

.standby-dot {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.16);
  animation: standby-blink 2.6s ease-in-out infinite;
}

@keyframes standby-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

.player-empty h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3.2vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1;
  background: linear-gradient(135deg, var(--ink) 30%, var(--ink-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.player-empty p {
  max-width: 34rem;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

.retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(45, 212, 191, 0.12);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease;
}

.retry-btn:hover {
  background: rgba(45, 212, 191, 0.22);
  transform: translateY(-1px);
}

.retry-btn svg {
  width: 17px;
  height: 17px;
}

/* ── Now playing bar ─────────────────────────────────────── */

.now-playing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
  background: rgba(7, 10, 20, 0.98);
}

.channel-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
}

.channel-info {
  min-width: 0;
}

/* Logo box */
.logo-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.logo-large {
  width: 56px;
  height: 56px;
}

.channel-icon {
  color: var(--accent-2);
  border-color: rgba(129, 140, 248, 0.22);
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.09), rgba(45, 212, 191, 0.06));
}

.channel-icon svg {
  width: 22px;
  height: 22px;
}

.now-playing h2 {
  margin: 0;
  overflow: hidden;
  max-width: 50vw;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.25;
}

#currentMeta {
  overflow: hidden;
  max-width: 52vw;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stream-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(9, 13, 24, 0.85);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.state-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--quiet);
  transition: background 300ms ease, box-shadow 300ms ease;
}

.state-dot.is-ready {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.65);
}

.state-dot.is-warn {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.55);
}

.state-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.55);
}

.player-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px;
}

.player-actions select {
  width: min(300px, 30vw);
  min-height: 42px;
}

/* ── Catalog section ─────────────────────────────────────── */

.catalog-section {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 1.88rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ── Catalog toolbar (search + sort + random) ───────────── */

.catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}

.catalog-search {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 8px 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.catalog-search:focus-within {
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.07);
}

.catalog-search > i,
.catalog-search > svg {
  color: var(--muted);
  flex-shrink: 0;
}

.catalog-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.88rem;
}

.catalog-search input::placeholder {
  color: var(--quiet);
}

.catalog-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--panel-3);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease;
}

.catalog-search-clear:hover {
  background: var(--line);
  color: var(--ink);
}

.catalog-search-clear svg {
  width: 14px;
  height: 14px;
}

.catalog-toolbar select {
  width: auto;
  min-width: 148px;
  min-height: 42px;
  flex-shrink: 0;
  font-size: 0.83rem;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.toolbar-btn:hover {
  border-color: rgba(45, 212, 191, 0.4);
  color: var(--accent);
  background: var(--panel-3);
}

.toolbar-btn svg {
  width: 16px;
  height: 16px;
}

.status-line {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.status-line:empty {
  display: none;
}

/* ── Channel grid ────────────────────────────────────────── */

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

.channel-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 74px;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.channel-card:hover {
  transform: translateY(-2px);
  border-color: rgba(45, 212, 191, 0.38);
  background: var(--panel-3);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(45, 212, 191, 0.07);
}

.channel-card.is-active {
  border-color: rgba(45, 212, 191, 0.62);
  background: rgba(45, 212, 191, 0.07);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.14), inset 0 0 40px rgba(45, 212, 191, 0.035);
}

/* Card logo box (50x50) */
.channel-card .logo-box {
  width: 50px;
  height: 50px;
}

.channel-main {
  min-width: 0;
}

.channel-main strong {
  display: block;
  overflow: hidden;
  font-size: 0.91rem;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.channel-meta {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.77rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.channel-badges {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.quality-badge,
.favorite-mark,
.tag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 21px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.quality-badge {
  color: #021a16;
  background: var(--accent);
}

.quality-badge.is-low {
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--panel);
}

.favorite-mark {
  color: var(--gold);
  background: var(--gold-soft);
}

.tag-badge {
  color: var(--quiet);
  border: 1px solid var(--line);
  background: var(--panel);
}

/* ── Load more ───────────────────────────────────────────── */

.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
}

.load-more:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--panel-3);
  color: var(--ink-2);
  transform: translateY(-1px);
}

/* ── Skeleton loading ────────────────────────────────────── */

.skeleton-card {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.038), transparent),
    var(--panel-2);
  background-size: 240% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  to { background-position: -240% 0; }
}

/* ── Footer ─────────────────────────────────────────────── */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  margin-top: 14px;
  padding: 16px;
  color: var(--muted);
  font-size: 0.83rem;
  box-shadow: none;
}

.site-footer span:first-child {
  color: var(--ink-2);
  font-weight: 800;
}

.site-footer a {
  color: var(--accent);
  font-weight: 700;
}

.site-footer a:hover {
  color: var(--ink);
}

/* ── Live Rooms section ──────────────────────────────────── */

/* ── Live matches / FIFA World Cup section ──────────────── */

.matches-section {
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(245, 158, 11, 0.1) 0%, transparent 42%),
    radial-gradient(120% 80% at 100% 0%, rgba(45, 212, 191, 0.07) 0%, transparent 42%);
  scroll-margin-top: 14px;
}

.matches-section::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--red) 45%, var(--accent-2) 100%);
}

.matches-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.matches-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--gold-2);
}

.matches-head h2 {
  margin: 2px 0 0;
  font-size: clamp(1.3rem, 2.2vw, 1.88rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}

.matches-sub {
  margin: 8px 0 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.wc-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.6);
  animation: wc-live-pulse 1.8s ease-out infinite;
}

@keyframes wc-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(248, 113, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0); }
}

.matches-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--red));
  color: #fff;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.matches-badge svg { width: 23px; height: 23px; }

.server-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.server-tab {
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.server-tab:hover {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--ink-2);
}

.server-tab.is-active {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.14);
  color: var(--gold-2);
}

.matches-embed-wrap {
  position: relative;
  height: clamp(680px, 90vh, 1180px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #06090f;
}

.matches-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #06090f;
}

.matches-frame[hidden] { display: none; }

.matches-launch {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 28px 22px;
  background:
    radial-gradient(80% 70% at 50% 35%, rgba(245, 158, 11, 0.12) 0%, transparent 70%),
    var(--panel-2);
}

.matches-launch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--gold), var(--red));
  color: #fff;
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.4);
  margin-bottom: 4px;
}

.matches-launch-icon svg { width: 30px; height: 30px; }

.matches-launch-label {
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.matches-launch-sub {
  margin: 0;
  max-width: 30rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.matches-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 12px 26px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold), var(--red));
  color: #1a1206;
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 130ms ease, box-shadow 130ms ease;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.matches-launch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.42);
}

.matches-launch-btn svg { width: 18px; height: 18px; }

.matches-newtab {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.matches-newtab:hover { color: var(--accent); }

/* ── Native match cards grid ─────────────────────────────── */

.matches-grid-wrap {
  margin-top: 16px;
}

.matches-grid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.matches-grid-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.matches-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.matches-refresh:hover { border-color: rgba(45, 212, 191, 0.4); color: var(--accent); }
.matches-refresh svg { width: 14px; height: 14px; }

.matches-grid-status {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}
.matches-grid-status:empty { display: none; }

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

.match-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 120ms ease;
}

.match-card:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: var(--panel-3);
  transform: translateY(-1px);
}

.match-card.is-playing {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.match-card.is-live {
  border-color: rgba(248, 113, 113, 0.4);
}

.match-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 50px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #06090f;
  color: var(--muted);
}

.match-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.match-thumb svg { width: 20px; height: 20px; }

.match-live-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.match-body { min-width: 0; }

.match-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.match-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.match-card.is-live .match-meta { color: var(--red); font-weight: 700; }

.rooms-section {
  padding: 18px;
}

.room-tabs {
  display: flex;
  gap: 6px;
}

.room-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
}

.room-tab:hover {
  border-color: rgba(45, 212, 191, 0.35);
  color: var(--ink-2);
}

.room-tab.is-active {
  border-color: rgba(45, 212, 191, 0.6);
  background: var(--accent-soft);
  color: var(--accent);
}

.room-tab svg {
  width: 14px;
  height: 14px;
}

.room-embed-wrap {
  position: relative;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
}

/* Launch state (before iframe loads) */
.room-launch-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 420px;
  padding: 32px;
  text-align: center;
}

.room-launch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--panel-3), var(--panel-2));
  border: 1px solid var(--line);
  color: var(--accent-2);
  margin-bottom: 6px;
}

.room-launch-icon svg {
  width: 30px;
  height: 30px;
}

.room-launch-label {
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.room-launch-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  max-width: 28rem;
  line-height: 1.55;
}

.room-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  margin-top: 6px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #021a16;
  font-size: 0.93rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 160ms ease;
}

.room-launch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 212, 191, 0.28);
}

.room-launch-btn svg {
  width: 17px;
  height: 17px;
}

.room-newtab-link {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 150ms ease;
}

.room-newtab-link:hover {
  color: var(--accent);
}

/* The embedded iframe itself */
.room-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  background: #000;
}

/* ── Toast ───────────────────────────────────────────────── */

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #021a16;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: toast-in 200ms ease;
}

@keyframes toast-in {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 1220px) {
  .app-main {
    grid-template-columns: 284px minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .app-main {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
    max-height: none;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 16px, 1720px);
    padding-top: 8px;
  }

  .site-header {
    gap: 10px;
  }

  .brand-copy small {
    display: none;
  }

  .ghost-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .ghost-button {
    width: 42px;
    padding: 0;
  }

  /* 2-column channel grid on mobile */
  .channel-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }

  /* Compact card for 2-col mobile layout */
  .channel-card {
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: auto;
    gap: 0 9px;
    padding: 9px 10px;
    align-items: start;
  }

  .channel-card .logo-box {
    width: 38px;
    height: 38px;
    grid-row: 1 / 3;
    align-self: center;
  }

  .channel-main {
    grid-column: 2;
    grid-row: 1;
  }

  .channel-main strong {
    font-size: 0.8rem;
    line-height: 1.25;
  }

  .channel-meta {
    font-size: 0.69rem;
    margin-top: 3px;
  }

  .channel-badges {
    grid-column: 2;
    grid-row: 2;
    justify-items: start;
    grid-template-columns: auto;
    margin-top: 5px;
    gap: 3px;
  }

  .quality-badge {
    font-size: 0.62rem;
    min-height: 18px;
    padding: 0 5px;
  }

  /* hide secondary badges on mobile to keep cards clean */
  .favorite-mark,
  .tag-badge {
    display: none;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .now-playing {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .now-playing h2,
  #currentMeta {
    max-width: calc(100vw - 120px);
  }

  .player-actions {
    flex-wrap: wrap;
  }

  .player-actions select {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    order: -1;
  }

  /* Catalog toolbar: search on its own row, sort + random share the next */
  .catalog-toolbar {
    flex-wrap: wrap;
  }

  .catalog-search {
    flex: 1 1 100%;
  }

  .catalog-toolbar select {
    flex: 1;
    min-width: 0;
  }

  .toolbar-btn {
    flex-shrink: 0;
  }

  .player-empty {
    width: 90%;
    padding: 22px;
  }

  .room-launch-state {
    min-height: 300px;
    padding: 24px 20px;
  }

  /* Live-matches section: tabs scroll horizontally, shorter embed */
  .server-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .server-tabs::-webkit-scrollbar { display: none; }

  .server-tab { flex: 0 0 auto; }

  .matches-embed-wrap {
    height: clamp(520px, 84vh, 860px);
  }

  .matches-badge { display: none; }
}

@media (max-width: 480px) {
  .quick-filters {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .header-search input::placeholder {
    font-size: 0.8rem;
  }

  /* Keep the compact 2-column grid (inherited from ≤720px) so the channel
     section stays a tight grid instead of a long single-column list. */
  .channel-grid {
    gap: 6px;
  }

  .channel-card {
    padding: 8px 9px;
  }

  .channel-card .logo-box {
    width: 34px;
    height: 34px;
  }

  .channel-main strong {
    font-size: 0.77rem;
  }

  .channel-meta {
    font-size: 0.65rem;
  }

  .quality-badge {
    font-size: 0.6rem;
    min-height: 17px;
    padding: 0 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
