* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  background: radial-gradient(900px 500px at 50% -10%, rgba(22,119,255,.20), transparent 60%),
              radial-gradient(700px 400px at 85% 110%, rgba(34,211,238,.10), transparent 60%),
              linear-gradient(180deg, #050816 0%, #070d22 45%, #050816 100%);
  background-attachment: fixed;
  color: #eef2ff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%; max-width: 480px;
  margin: 0 auto; padding: 20px 16px 48px;
}

/* ---------- Header ---------- */
.app-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 18px; margin-bottom: 22px;
  border-bottom: 1px solid rgba(120,170,245,.16);
}
.app-header .logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #1677ff, #38a0ff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 14px rgba(22,119,255,.4);
}
.app-header h1 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin-right: auto; }
.app-header .back {
  display: inline-flex; align-items: center; gap: 6px;
  color: #9be7ff; background: rgba(22,119,255,.12);
  border: 1px solid rgba(120,170,245,.35);
  padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: background .18s, box-shadow .2s;
}
.app-header .back:hover { background: rgba(22,119,255,.26); box-shadow: 0 0 14px rgba(22,119,255,.3); }

/* ---------- Home / channel grid ---------- */
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8fa5c7; margin-bottom: 14px; }
.channel-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

@media (min-width: 480px) {
  .wrap { max-width: 760px; }
  .channel-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

.channel-card {
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; border-radius: 18px;
  background: rgba(18,32,68,.55);
  border: 1px solid rgba(120,170,245,.3);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 10px 34px rgba(2,10,28,.55);
  text-decoration: none; color: inherit;
  transition: transform .16s, box-shadow .22s, border-color .2s;
  cursor: pointer;
}
.channel-card:hover { transform: translateY(-3px); border-color: rgba(120,170,245,.6); box-shadow: 0 14px 40px rgba(2,10,28,.7), 0 0 40px rgba(22,119,255,.18); }
.channel-card:active { transform: scale(.98); }

.channel-thumb {
  position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden;
  background: radial-gradient(80% 80% at 50% 40%, rgba(22,119,255,.35), rgba(4,9,22,.95));
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; font-weight: 800; color: #9be7ff; letter-spacing: -.03em;
  border: 1px solid rgba(94,138,210,.25);
}
.channel-info h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.channel-info p { color: #8fa5c7; font-size: 13px; margin-top: 3px; }
.channel-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 4px; padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(135deg, #1677ff, #38a0ff); color: #fff;
  font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 20px rgba(22,119,255,.4);
  transition: box-shadow .2s, transform .15s;
}
.channel-card:hover .channel-cta { box-shadow: 0 8px 26px rgba(56,160,255,.55); }

/* ---------- LIVE badge ---------- */
.badge {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: #ff7a8f; background: rgba(255,59,92,.15);
  border: 1px solid rgba(255,59,92,.4);
  padding: 4px 10px; border-radius: 999px;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #ff3b5c; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{ box-shadow:0 0 0 0 rgba(255,59,92,.6);} 50%{ box-shadow:0 0 0 7px rgba(255,59,92,0);} }

/* ---------- Player page ---------- */
.player {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: #000; border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(94,138,210,.25);
}
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }

.ovl {
  position: absolute; inset: 0; z-index: 2; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px; color: #c8d6f0;
  background: radial-gradient(80% 80% at 50% 40%, rgba(8,18,38,.55), rgba(3,6,18,.92));
}
.ovl[hidden] { display: none; }
.ovl .spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(92,200,255,.15); border-top-color: #5cc8ff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(359deg); } }
.ovl.err { color: #ff8f9a; }
.ovl .sub { font-size: 13px; color: #8fa5c7; }
.ovl .big { font-size: 15px; font-weight: 700; color: #fff; }
.ovl.err .big { color: #ff8f9a; }

.player-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn-refresh {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px;
  border: 1px solid rgba(120,170,245,.4);
  background: rgba(22,119,255,.15); color: #9be7ff;
  cursor: pointer; font-size: 14px; font-weight: 700;
  transition: transform .15s, box-shadow .2s, background .18s;
}
.btn-refresh:hover:not(:disabled) { background: rgba(22,119,255,.28); box-shadow: 0 0 14px rgba(22,119,255,.4); }
.btn-refresh:active { transform: scale(.96); }
.btn-refresh:disabled { opacity: .5; cursor: not-allowed; }
.btn-refresh .spin-sm { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(155,231,255,.3); border-top-color: #9be7ff; animation: spin .8s linear infinite; display: none; }
.btn-refresh.loading .spin-sm { display: inline-block; }
.btn-refresh.loading .ico { display: none; }
.btn-refresh .ico { font-size: 16px; line-height: 1; }
