* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0f;
  color: #fff;
  min-height: 100vh;
}

/* HEADER */
.hero-header {
  background: #0a0a0f;
  border-bottom: 1px solid rgba(0,120,255,0.2);
  padding: 32px 24px 22px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-header::before {
  content: '';
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 400px; height: 200px;
  background: radial-gradient(ellipse, rgba(0,120,255,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.logo-badge {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(0,120,255,0.1); border: 1px solid rgba(0,120,255,0.35);
  padding: 6px 18px; border-radius: 999px;
  font-size: 11px; letter-spacing: 2px; color: #5599ff; font-weight: 500;
  margin-bottom: 14px; text-transform: uppercase;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff3b3b; animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.5; transform:scale(1.4); }
}
.main-title {
  font-size: clamp(30px, 7vw, 56px);
  font-weight: 800; letter-spacing: -1px; line-height: 1.1;
}
.main-title .star { color: #1a7fff; }
.subtitle {
  font-size: 13px; color: rgba(255,255,255,0.4);
  margin-top: 8px; letter-spacing: 1px;
}

/* COUNT BAR */
.count-bar {
  background: #0d0d14;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 12px 20px;
  font-size: 12px; color: rgba(255,255,255,0.4);
  display: flex; align-items: center; gap: 8px;
}
.count-pill {
  background: rgba(0,120,255,0.15); color: #5599ff;
  padding: 3px 10px; border-radius: 999px;
  font-weight: 600; font-size: 12px;
}

/* SECTION TITLE */
.section-title {
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  color: #1a7fff; text-transform: uppercase;
  padding: 22px 20px 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: rgba(0,120,255,0.2);
}

/* GRID */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 10px; padding: 0 16px 20px;
}

/* CARD */
.channel-card {
  background: #111118;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px; padding: 16px 12px;
  cursor: pointer; text-align: center;
  position: relative; overflow: hidden;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.channel-card:hover {
  border-color: #1a7fff; background: #131a2e;
  transform: translateY(-2px);
}
.channel-card:hover .play-btn { opacity: 1; transform: scale(1); }

.channel-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(0,120,255,0.15); color: #4499ff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; font-size: 13px; font-weight: 800;
}
.channel-name {
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,0.85); line-height: 1.3; margin-bottom: 6px;
}
.hd-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  background: rgba(0,120,255,0.2); color: #5599ff;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.5px;
}
.play-btn {
  position: absolute; bottom: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #1a7fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.7);
  transition: opacity 0.2s, transform 0.2s;
  font-size: 10px; color: #fff;
}

/* TELEGRAM POPUP */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.78); z-index: 9999;
  align-items: center; justify-content: center;
}
.overlay.show { display: flex; }

.popup {
  background: #0f1520; border: 1px solid rgba(0,120,255,0.3);
  border-radius: 20px; padding: 32px 28px;
  max-width: 360px; width: 90%;
  text-align: center; position: relative;
}
.popup-close {
  position: absolute; top: 14px; right: 16px;
  background: rgba(255,255,255,0.08); border: none;
  color: rgba(255,255,255,0.5);
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.tg-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #0088cc;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 28px;
}
.popup h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: #fff; }
.popup p { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 20px; line-height: 1.6; }
.popup-channel-name {
  font-size: 12px;
  background: rgba(0,120,255,0.12); border: 1px solid rgba(0,120,255,0.25);
  color: #5599ff; padding: 4px 14px; border-radius: 999px;
  display: inline-block; margin-bottom: 20px;
}
.btn-join {
  display: block; width: 100%; padding: 13px;
  background: #0088cc; border: none; border-radius: 12px;
  color: #fff; font-size: 15px; font-weight: 600;
  cursor: pointer; margin-bottom: 10px;
  text-decoration: none; transition: background 0.2s;
}
.btn-join:hover { background: #006fa8; }
.btn-already {
  display: block; width: 100%; padding: 11px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; color: rgba(255,255,255,0.55);
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.btn-already:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* PLAYER */
.player-overlay {
  display: none; position: fixed; inset: 0;
  background: #000; z-index: 10000;
  flex-direction: column; align-items: center; justify-content: center;
}
.player-overlay.show { display: flex; }
.player-header {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}
.player-header span { font-size: 15px; font-weight: 600; }
.back-btn {
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.back-btn:hover { background: rgba(255,255,255,0.18); }
.player-box {
  width: 90%; max-width: 860px; aspect-ratio: 16/9;
  background: #111; border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.08); gap: 16px;
}
.player-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: #1a7fff; border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-label { font-size: 14px; color: rgba(255,255,255,0.5); }

/* FOOTER */
.footer {
  text-align: center; padding: 22px;
  font-size: 11px; color: rgba(255,255,255,0.2); letter-spacing: 1px;
  border-top: 1px solid rgba(255,255,255,0.05); margin-top: 4px;
}

/* MOBILE */
@media (max-width: 480px) {
  .channels-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; padding: 0 10px 16px; }
  .popup { padding: 24px 18px; }
}
