:root {
  --bg: #08080c;
  --bg-raise: #101018;
  --bg-card: #16161f;
  --border: #262633;
  --text: #f2f2f7;
  --text-dim: #9a9aad;
  --accent: #ff2d55;
  --accent-2: #7b5cff;
  --radius: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
}

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

/* Author styles like .player-modal { display: grid } outrank the UA [hidden] rule,
   so the hidden attribute needs to win explicitly. */
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 8, 12, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 19px;
  color: #fff;
}

.logo-text { font-weight: 800; letter-spacing: 1.5px; font-size: 17px; }
.logo-text em { font-style: normal; color: var(--accent); }

.nav { display: flex; gap: 4px; }

.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  transition: 0.18s;
}
.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link.active { color: var(--text); background: var(--bg-card); }

.search-wrap { margin-left: auto; position: relative; }

.search-wrap input {
  width: 250px;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: 0.18s;
}
.search-wrap input:focus {
  border-color: var(--accent);
  width: 300px;
}

.admin-link {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  transition: 0.18s;
  flex-shrink: 0;
}
.admin-link:hover { color: var(--text); border-color: var(--accent); }

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

.hero {
  position: relative;
  padding: 90px 24px 70px;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 12% 0%, rgba(123, 92, 255, 0.28), transparent 65%),
    radial-gradient(700px 380px at 88% 20%, rgba(255, 45, 85, 0.22), transparent 62%),
    var(--bg-raise);
  border-bottom: 1px solid var(--border);
}

.hero-content { max-width: 660px; margin: 0 auto; text-align: center; }

.hero-badge {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 800;
  line-height: 1.05;
  margin: 18px 0 14px;
  letter-spacing: -1.5px;
}

.hero-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-overview {
  color: #c9c9d6;
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 26px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */

.btn {
  border: none;
  border-radius: 10px;
  padding: 13px 26px;
  font-size: 15px;
  font-weight: 700;
  transition: 0.18s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.14); transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); }
.btn-icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  width: 48px;
  padding: 13px 0;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.btn-icon:hover { background: rgba(255, 255, 255, 0.2); }
.btn-icon.is-active { background: var(--accent); }

/* ---------- Toolbar ---------- */

.toolbar {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  transition: 0.18s;
}
.chip:hover { color: var(--text); border-color: #3d3d52; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.sort-select {
  padding: 9px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

/* ---------- Grid ---------- */

.row-section { max-width: 1400px; margin: 0 auto; padding: 34px 24px 70px; }

.row-title { font-size: 22px; font-weight: 800; margin-bottom: 20px; letter-spacing: -0.4px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: 0.22s;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow); }

.card-thumb {
  position: relative;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #1e1e2c, #101018);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb-fallback {
  padding: 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: #5a5a72;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.card-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  font-size: 11px;
  font-weight: 700;
}

.card-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 45, 85, 0.82);
  font-size: 42px;
  opacity: 0;
  transition: 0.22s;
}
.card:hover .card-play { opacity: 1; }

.card-body { padding: 13px 14px 15px; }
.card-title {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-sub { font-size: 12.5px; color: var(--text-dim); }

.empty-msg { text-align: center; color: var(--text-dim); padding: 60px 0; font-size: 15px; }

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

.player-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; }
.player-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.9); }

.player-dialog {
  position: relative;
  width: min(1000px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.player-dialog video {
  width: 100%;
  max-height: 62vh;
  background: #000;
  border-radius: 10px;
  display: block;
}

.player-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  z-index: 2;
}
.player-close:hover { background: var(--accent); }

.player-info { padding: 16px 6px 6px; }
.player-info h2 { font-size: 22px; font-weight: 800; margin-bottom: 7px; }
.player-info p { color: var(--text-dim); font-size: 14.5px; line-height: 1.6; }
.player-meta { color: var(--accent) !important; font-size: 13px !important; margin-bottom: 8px; font-weight: 600; }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  background: var(--bg-raise);
}
.footer-small { font-size: 12.5px; margin-top: 8px; opacity: 0.75; }

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 120;
  box-shadow: var(--shadow);
}

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 12px; }
  .search-wrap { order: 3; width: 100%; margin-left: 0; }
  .search-wrap input, .search-wrap input:focus { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .nav { order: 2; }
}