:root {
  --bg: #0f0f1a;
  --bg-2: #161627;
  --panel: #1d1d33;
  --panel-2: #26264a;
  --text: #f3f3fb;
  --muted: #9a9ac0;
  --accent: #7c5cff;
  --accent-2: #a78bff;
  --hot: #ff4d8d;
  --new: #22d3a6;
  --radius: 14px;
  --sidebar: 230px;
  --topbar: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Nunito", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* ── Top bar ─────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: rgba(15, 15, 26, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #ffffff10;
}
.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer;
}
.icon-btn:hover { background: var(--panel); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; }
.brand-mark { width: 34px; height: 34px; display: block; transition: transform .2s; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { letter-spacing: -.01em; }
.search {
  flex: 1; min-width: 0; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 42px; border-radius: 999px;
  background: var(--panel); color: var(--muted);
  border: 1px solid transparent; transition: border-color .15s;
}
.search:focus-within { border-color: var(--accent); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: 15px;
}
.submit-btn {
  padding: 10px 16px; border-radius: 999px; font-weight: 800; font-size: 14px;
  background: var(--accent); white-space: nowrap;
}
.submit-btn:hover { background: var(--accent-2); }
.support-btn {
  padding: 9px 15px; border-radius: 999px; font-weight: 800; font-size: 14px; white-space: nowrap;
  border: 1.5px solid #ffdd0066; color: #ffe566; transition: background .15s, border-color .15s;
}
.support-btn:hover { background: #ffdd0014; border-color: #ffdd00; }
.footer-links { display: block; margin-top: 6px; }
.footer-links a { color: var(--accent-2); font-weight: 700; }

/* ── Layout ─────────────────────────── */
.layout { display: flex; }
.sidebar {
  position: sticky; top: var(--topbar);
  width: var(--sidebar); flex-shrink: 0;
  height: calc(100vh - var(--topbar)); overflow-y: auto;
  padding: 14px 10px;
  background: var(--bg-2);
  border-right: 1px solid #ffffff08;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; text-align: left;
  font-weight: 700; font-size: 15px; color: var(--muted);
}
.sidebar li button:hover { background: var(--panel); color: var(--text); }
.sidebar li button.active { background: var(--panel-2); color: var(--text); }
.sidebar .count { margin-left: auto; font-size: 12px; opacity: .7; }
.sidebar .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sidebar hr { border: 0; border-top: 1px solid #ffffff10; margin: 10px 4px; }

.content { flex: 1; min-width: 0; padding: 22px 26px 40px; }

/* ── Hero ─────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.3fr 1fr; align-items: stretch;
  min-height: 300px; margin-bottom: 30px;
  border-radius: 20px; background: var(--panel);
}
.hero-media { position: relative; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-body { padding: 30px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.hero-kicker { color: var(--accent-2); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.05; font-weight: 900; }
.hero p { margin: 0; color: var(--muted); line-height: 1.5; }
.play-btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px; border-radius: 999px; font-weight: 900; font-size: 16px;
  background: linear-gradient(135deg, var(--accent), var(--hot));
  box-shadow: 0 8px 24px -8px var(--accent);
  transition: transform .15s;
}
.play-btn:hover { transform: translateY(-2px); }
.hero-dots { position: absolute; bottom: 14px; right: 18px; display: flex; gap: 6px; }
.hero-dots button {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
  background: #ffffff40; cursor: pointer;
}
.hero-dots button.active { background: #fff; width: 22px; border-radius: 5px; }

/* ── Sections & grid ─────────────────────────── */
.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 21px; font-weight: 900; }
.section-head .sub { color: var(--muted); font-size: 14px; }
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); background: var(--panel);
  transition: transform .18s, box-shadow .18s;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 30px -10px #000, 0 0 0 2px var(--accent);
  outline: none;
}
.card .thumb { aspect-ratio: 16 / 9; position: relative; background: var(--panel-2); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb .fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 34px; font-weight: 900; color: #ffffffcc;
}
.card .overlay {
  position: absolute; inset: 0 0 auto 0; aspect-ratio: 16 / 9; display: flex; align-items: flex-end;
  padding: 12px; opacity: 0; transition: opacity .18s;
  background: linear-gradient(to top, rgba(10,10,20,.95) 10%, rgba(10,10,20,.2) 70%, transparent);
}
.card:hover .overlay, .card:focus-visible .overlay { opacity: 1; }
.card .overlay p {
  margin: 0; font-size: 13px; line-height: 1.4; color: #e6e6f5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { padding: 10px 12px 12px; }
.card .title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cat { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.card .ext { margin-left: auto; opacity: .6; }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .04em;
}
.badge.new { background: var(--new); color: #04241c; }
.badge.soon { background: #ffffffe0; color: #222; }
.card.soon { cursor: default; }
.card.soon .thumb img { filter: grayscale(.8) brightness(.6); }
.card.soon:hover { transform: none; box-shadow: none; }

.card.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  aspect-ratio: auto; min-height: 100%;
  border: 2px dashed #ffffff22; background: transparent; color: var(--muted);
  text-align: center; padding: 20px; font-weight: 700;
}
.card.add-card .plus { font-size: 34px; line-height: 1; color: var(--accent-2); }
.card.add-card:hover { color: var(--text); border-color: var(--accent); }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

.footer {
  padding: 22px; text-align: center; color: var(--muted); font-size: 13px;
  border-top: 1px solid #ffffff08; margin-left: var(--sidebar);
}

/* ── Responsive ─────────────────────────── */
.menu-btn { display: none; }
@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar); z-index: 15;
    transform: translateX(-100%); transition: transform .2s;
    box-shadow: 10px 0 30px #0008;
  }
  body.nav-open .sidebar { transform: none; }
  .footer { margin-left: 0; }
  .hero { grid-template-columns: 1fr; }
  .hero-media { aspect-ratio: 16 / 9; }
  .hero-body { padding: 20px; }
  .content { padding: 16px; }
}
@media (max-width: 600px) {
  .brand-name, .sb-long { display: none; }
  .submit-btn { padding: 9px 13px; font-size: 13px; flex-shrink: 0; }
  .support-btn { padding: 8px 11px; font-size: 14px; flex-shrink: 0; }
  .topbar { gap: 8px; padding: 0 12px; }
  .brand-mark { flex-shrink: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card .overlay { display: none; }
}
