:root {
  --ink: #13211d;
  --muted: #607069;
  --paper: #f4f1e8;
  --surface: #fffdf7;
  --forest: #10261f;
  --green: #1f7152;
  --lime: #d8ee7d;
  --coral: #e8694f;
  --line: #d7d8cd;
  --shadow: 0 14px 35px rgb(16 38 31 / 12%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgb(16 38 31 / 8%) 0.7px, transparent 0.7px);
  background-size: 9px 9px;
  font-family: "Avenir Next", "Century Gothic", sans-serif;
}

button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.topbar {
  min-height: 64px;
  padding: 10px clamp(18px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  background: var(--forest);
  border-bottom: 1px solid rgb(255 255 255 / 14%);
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--forest); background: var(--lime); font: 800 16px Georgia, serif; }
.catalog-state { display: flex; align-items: center; gap: 9px; color: #d7e3dd; font-size: 13px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px rgb(216 238 125 / 12%); }

.player-band { padding: clamp(24px, 4vw, 56px) clamp(18px, 5vw, 76px) 32px; color: white; background: var(--forest); }
.player-shell { position: relative; width: min(1100px, 100%); margin: 0 auto; aspect-ratio: 16 / 9; overflow: hidden; background: #050a08; box-shadow: 0 24px 65px rgb(0 0 0 / 34%); }
.player-shell video { display: block; width: 100%; height: 100%; object-fit: contain; }
.player-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; color: #a8bbb2; background: linear-gradient(145deg, #0b1713, #152e25); }
.player-empty[hidden] { display: none; }
.signal-lines { width: 72px; height: 42px; border: solid var(--lime); border-width: 0 5px; opacity: .8; transform: skew(-18deg); }
.now-playing { width: min(1100px, 100%); min-height: 100px; margin: 0 auto; padding-top: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.eyebrow { margin: 0 0 5px; color: var(--lime); font-size: 11px; font-weight: 800; }
.now-playing h1 { margin: 0; font: 600 clamp(23px, 3vw, 38px) Georgia, serif; }
.now-playing p:last-child { margin: 8px 0 0; color: #9fb2a9; }
.player-actions { min-height: 42px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.mode-label { color: #b7c7c0; font-size: 12px; white-space: nowrap; }

.icon-button, .action-button, .more-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
}
.icon-button { width: 42px; display: inline-grid; place-items: center; flex: 0 0 42px; }
.icon-button svg, .action-button svg { width: 18px; height: 18px; }
.icon-button:disabled { cursor: default; opacity: .4; }
.action-button { padding: 0 14px; display: flex; align-items: center; gap: 8px; }
.player-actions .icon-button, .player-actions .action-button { color: white; background: transparent; border-color: #50665d; }
.player-actions .action-button { color: var(--forest); background: var(--lime); border-color: var(--lime); }

.catalog-band { padding: 34px clamp(18px, 5vw, 76px) 80px; }
.filters { display: grid; grid-template-columns: minmax(220px, 1.7fr) repeat(5, minmax(135px, 1fr)) 42px; gap: 10px; max-width: 1500px; margin: 0 auto 36px; }
.filters select, .search-field { min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.filters select { padding: 0 34px 0 12px; color: var(--ink); }
.search-field { padding: 0 12px; display: flex; align-items: center; gap: 9px; }
.search-field svg { width: 18px; color: var(--muted); }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; }
.reset-button { height: 44px; }
.result-line { max-width: 1500px; margin: 0 auto 16px; display: flex; align-items: baseline; gap: 12px; }
.result-line h2 { margin: 0; font: 600 27px Georgia, serif; }
.result-line span { color: var(--muted); font-size: 13px; }

.channel-grid { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.channel-card { min-width: 0; padding: 0; text-align: left; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; color: inherit; background: var(--surface); box-shadow: 0 2px 0 rgb(16 38 31 / 3%); transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.channel-card:hover { transform: translateY(-3px); border-color: #aeb8af; box-shadow: var(--shadow); }
.channel-card.active { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
.logo-field { height: 126px; display: grid; place-items: center; padding: 22px; background: #e9ebe2; }
.logo-field img { max-width: 100%; max-height: 82px; object-fit: contain; }
.logo-fallback { font: 700 34px Georgia, serif; color: var(--green); }
.channel-info { padding: 14px; }
.channel-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.channel-detail { min-height: 34px; margin: 6px 0 11px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.quality { color: var(--muted); }
.health { display: inline-flex; align-items: center; gap: 6px; }
.health::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa49f; }
.health.up::before { background: #2d9a65; }
.health.down::before { background: var(--coral); }
.empty-state { max-width: 1500px; margin: 40px auto; padding: 46px; text-align: center; color: var(--muted); border: 1px dashed #abb5ad; }
.more-button { display: block; min-width: 160px; margin: 28px auto 0; padding: 0 20px; }

@media (max-width: 1050px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
  .search-field { grid-column: span 2; }
}

@media (max-width: 680px) {
  .topbar { min-height: 58px; }
  .catalog-state { max-width: 45%; text-align: right; }
  .player-band { padding-left: 0; padding-right: 0; padding-top: 0; }
  .now-playing { padding: 18px 18px 0; flex-direction: column; }
  .player-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .catalog-band { padding-top: 26px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .reset-button { width: 100%; }
  .channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .logo-field { height: 98px; padding: 15px; }
  .logo-field img { max-height: 62px; }
  .channel-info { padding: 11px; }
}

@media (max-width: 390px) {
  .channel-grid { grid-template-columns: 1fr; }
}