/* SuperCrowd.tv web player — brand: Nunito on deep indigo. */

:root {
  --bg-dark: #1D0033;
  --bg-mid: #3A0A5C;
  --purple: #47017E;
  --purple-bright: #BC67FE;
  --pink: #CA0362;
  --pink-bright: #FD68B0;
  --text-light: #F4E6FF;
  --text-dim: #C8B0DC;
  --card-bg: #2A0748;
}

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

/* The hidden attribute must always win, even over display:flex rules. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--text-light);
  background:
    radial-gradient(circle at 80% 0%, rgba(253,104,176,0.10), transparent 40%),
    linear-gradient(165deg, var(--bg-dark) 0%, #2A0648 55%, var(--bg-dark) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(29, 0, 51, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(244,230,255,0.08);
}

.brand-chip {
  display: inline-block;
  background: #fff;
  border-radius: 12px;
  padding: 6px 12px;
  line-height: 0;
}
.brand-chip img { height: 34px; width: auto; display: inline-block; }

.searchwrap { margin-left: auto; flex: 0 1 420px; }

#search {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-light);
  background: rgba(244,230,255,0.10);
  border: 1px solid rgba(244,230,255,0.18);
  border-radius: 999px;
  padding: 10px 18px;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
}
#search::placeholder { color: var(--text-dim); }
#search:focus { border-color: var(--purple-bright); background: rgba(244,230,255,0.14); }

/* ---------- Loading ---------- */

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18vh 20px;
  color: var(--text-dim);
  font-weight: 600;
}
.spinner {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(244,230,255,0.15);
  border-top-color: var(--pink-bright);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: clamp(320px, 52vw, 480px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: saturate(1.05);
}
.hero-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg-dark) 4%, rgba(29,0,51,0.55) 45%, rgba(29,0,51,0.15) 100%),
    linear-gradient(to right, rgba(29,0,51,0.85) 0%, transparent 60%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: clamp(18px, 4vw, 48px);
  max-width: 760px;
}

.hero-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #1D0033;
  background: linear-gradient(135deg, var(--purple-bright), var(--pink-bright));
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(22px, 3.6vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 8px;
  text-shadow: 0 2px 18px rgba(0,0,0,0.45);
}

.hero-sub { font-weight: 700; color: var(--pink-bright); margin-bottom: 10px; }

.hero-desc {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.playbtn {
  font-family: inherit;
  font-size: 17px;
  font-weight: 800;
  color: #1D0033;
  background: linear-gradient(135deg, var(--purple-bright), var(--pink-bright));
  border: none;
  border-radius: 999px;
  padding: 13px 34px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(188,103,254,0.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.playbtn:hover { transform: translateY(-2px); box-shadow: 0 14px 38px rgba(253,104,176,0.45); }

/* ---------- Rows ---------- */

.row-section { padding: 26px 0 4px; }

.row-title {
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 800;
  padding: 0 clamp(16px, 4vw, 48px);
  margin-bottom: 12px;
}
.row-title .dot {
  display: inline-block;
  width: 0.55em; height: 0.55em;
  background: #F44336;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: baseline;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.row-scroller-wrap { position: relative; }

.row-scroller {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px clamp(16px, 4vw, 48px) 16px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(188,103,254,0.5) transparent;
}
.row-scroller::-webkit-scrollbar { height: 8px; }
.row-scroller::-webkit-scrollbar-thumb { background: rgba(188,103,254,0.35); border-radius: 999px; }
.row-scroller::-webkit-scrollbar-track { background: transparent; }

/* ---------- Cards ---------- */

.card {
  flex: 0 0 auto;
  width: clamp(220px, 26vw, 320px);
  cursor: pointer;
  scroll-snap-align: start;
  border-radius: 12px;
  outline: none;
  transition: transform .16s ease;
}
.card:hover, .card:focus-visible { transform: translateY(-4px) scale(1.02); }
.card:focus-visible .thumb { box-shadow: 0 0 0 3px var(--purple-bright); }

.card.live-card { width: clamp(260px, 32vw, 380px); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--card-bg), var(--purple));
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.thumb .ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 800; color: rgba(244,230,255,0.35);
}

.live-banner {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--pink);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  padding: 7px 10px;
}

.card-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  margin: 9px 2px 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-sub {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Player overlay ---------- */

.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  flex-direction: column;
}
.player[hidden] { display: none; }

.player-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(0,0,0,0.75);
}
.player-title-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-top h3 {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-chip {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  background: var(--pink);
  border-radius: 999px;
  padding: 3px 10px;
}
.player-close {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 50%;
  width: 40px; height: 40px;
  cursor: pointer;
  transition: background .15s ease;
}
.player-close:hover { background: var(--pink); }

#video {
  flex: 1;
  width: 100%;
  min-height: 0;
  background: #000;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 200;
  max-width: min(92vw, 560px);
  background: rgba(29,0,51,0.96);
  border: 1px solid rgba(188,103,254,0.5);
  border-radius: 14px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

/* ---------- Footer ---------- */

.foot {
  padding: 44px clamp(16px, 4vw, 48px) 56px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}
.foot a { color: var(--purple-bright); text-decoration: none; font-weight: 700; }
.foot a:hover { text-decoration: underline; }

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .topbar { gap: 10px; }
  .brand-chip img { height: 26px; }
  .card { width: 62vw; }
  .card.live-card { width: 74vw; }
}
