* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #101114;
  color: #f4f6f8;
  font-family: system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.35;
}
button, input { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
#app { height: 100%; }

.gate {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}
.card {
  width: 100%;
  max-width: 560px;
  background: #1b1e25;
  border: 1px solid #343a46;
  border-radius: 20px;
  padding: 32px 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffb020;
  display: inline-block;
}
.muted { color: #b7bec9; }
.stack { display: flex; flex-direction: column; gap: 14px; }
label { font-weight: 650; font-weight: 600; }
input[type="text"], input[type="password"], input[type="search"], input[name="iptv-password"] {
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid #3a404c;
  background: #101114;
  color: #f4f6f8;
}
input:focus, button:focus {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}
button {
  min-height: 56px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid #3a404c;
  background: #262b34;
  color: #f4f6f8;
}
button.primary {
  background: #ffb020;
  border-color: #ffb020;
  color: #1a1203;
  font-weight: 700;
}
button.danger { background: #3a2222; border-color: #8a3d3d; }
button[aria-pressed="true"], button.active {
  background: #ffb020;
  border-color: #ffb020;
  color: #1a1203;
  font-weight: 700;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; }
.alert {
  background: #3a1d1d;
  color: #ffd7d7;
  border: 1px solid #8a3d3d;
  border-radius: 14px;
  padding: 14px 16px;
}
.shell { height: 100%; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #171a20;
  border-bottom: 1px solid #2c313c;
}
.providers { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.layout { flex: 1; min-height: 0; display: flex; }
.sidebar {
  width: 300px;
  flex: none;
  overflow: auto;
  background: #171a20;
  border-right: 1px solid #2c313c;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar button { width: 100%; text-align: left; }
.sidebar .note { font-size: 16px; line-height: 1.3; }
.main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 12px 16px 16px; }
.tabs, .pager, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.channel {
  width: 100%;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: #1b1e25;
}
.channel .num { width: 3ch; color: #ffb020; font-weight: 700; flex: none; }
.logo, .ph {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex: none;
  background: #2a303a;
  object-fit: cover;
}
.ph { display: flex; align-items: center; justify-content: center; font-weight: 700; }
.meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.name { font-size: 20px; font-weight: 650; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty {
  margin: auto;
  text-align: center;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.empty h1 { font-size: 36px; margin: 0; }
.player {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  background: #000;
  display: flex;
  flex-direction: column;
}
.player.is-hidden { display: none; }
.stage { position: relative; flex: 1; min-height: 0; background: #000; }
.stage video { width: 100%; height: 100%; background: #000; object-fit: contain; }
.tap-play {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 240px;
  min-height: 88px;
  font-size: 28px;
  font-weight: 700;
  background: #ffb020;
  color: #1a1203;
  border: 0;
}
.tap-play.is-hidden { display: none; }
.player-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #121418;
  min-height: 96px;
}
.player-title { flex: 1; min-width: 180px; }
.player-title strong { display: block; font-size: 22px; }
.clock { font-size: 28px; font-variant-numeric: tabular-nums; min-width: 5ch; }
.epg { color: #d5dbe3; font-size: 18px; }
.type-switch { display: flex; gap: 8px; }
.type-switch button { flex: 1; }
@media (max-width: 800px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; max-height: 220px; flex-direction: row; overflow-x: auto; }
  .sidebar button { width: auto; flex: none; }
}
