/* ==========================================================================
   ChikiAnimation — cinematic dark theme
   Palette: ink background, ember-red accent, gold for VIP
   ========================================================================== */

:root {
  --bg-deep: #0a0b10;
  --bg-surface: #13141c;
  --bg-elevated: #1b1d29;
  --bg-elevated-2: #232636;
  --border: #262a3a;
  --text: #f2f3f8;
  --text-muted: #9498ad;
  --text-faint: #5c6078;
  --ember: #7c5cfc;
  --ember-dim: #5b3ce0;
  --ember-glow: rgba(124, 92, 252, 0.35);
  --gold: #f4b740;
  --gold-dim: #caa14f;
  --success: #2fd67e;
  --danger: #ff4d5e;
  --danger-dim: rgba(255, 77, 94, 0.12);
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 20px;
  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-deep);
  background-image:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(124, 92, 252, 0.12), transparent 60%),
    radial-gradient(ellipse 700px 400px at 100% 0%, rgba(244, 183, 64, 0.06), transparent 55%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  padding-bottom: 72px; /* space for bottom nav on mobile */
}

@media (min-width: 900px) { body { padding-bottom: 0; } }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--ember); color: #fff; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin: 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 40px 0 18px;
}
.section-title h2 { font-size: 22px; color: var(--text); }
.section-title .slash { color: var(--ember); font-size: 22px; }
.section-title .more { margin-left: auto; font-size: 13px; color: var(--text-muted); font-family: var(--font-body); text-transform: none; }
.section-title .more:hover { color: var(--ember); }

/* ── Top nav ── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; white-space: nowrap; }
.logo .dot { color: var(--ember); }
.nav-links { display: none; gap: 22px; font-size: 14px; color: var(--text-muted); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
@media (min-width: 900px) { .nav-links { display: flex; } }

.search-form { flex: 1; max-width: 360px; display: none; position: relative; }
@media (min-width: 700px) { .search-form { display: block; } }
.search-form input {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 999px; padding: 9px 16px 9px 36px; color: var(--text); font-size: 14px;
}
.search-form input:focus { outline: none; border-color: var(--ember); }
.search-form .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); opacity: 0.5; font-size: 14px; }

.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 9px 18px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text);
  transition: all .15s ease;
}
.btn:hover { border-color: var(--ember); }
.btn-ember { background: linear-gradient(135deg, var(--ember), var(--ember-dim)); border: none; color: #fff; box-shadow: 0 6px 20px var(--ember-glow); }
.btn-ember:hover { filter: brightness(1.08); }
.btn-gold { background: linear-gradient(135deg, var(--gold), var(--gold-dim)); border: none; color: #201400; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-dim); }

.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--border); }
.vip-badge { font-family: var(--font-body); font-weight: 700; font-size: 10.5px; color: #201400; background: linear-gradient(135deg,var(--gold),var(--gold-dim)); padding: 2px 7px; border-radius: 999px; letter-spacing: .5px; }

/* ── Bottom nav (mobile) ── */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(15, 16, 23, 0.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); height: 62px;
}
@media (min-width: 900px) { .bottomnav { display: none; } }
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-faint); font-size: 10.5px; flex: 1; padding: 6px 0; }
.bn-item .bn-icon { font-size: 19px; }
.bn-item.active { color: var(--ember); }

/* ── Hero ── */
.hero { position: relative; height: 78vh; min-height: 420px; max-height: 640px; overflow: hidden; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.55); }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg-deep) 4%, rgba(10,11,16,.15) 55%, rgba(10,11,16,.55) 100%), linear-gradient(90deg, rgba(10,11,16,.85) 0%, transparent 55%); }
.hero-content { position: absolute; left: 0; bottom: 0; padding: 0 20px 44px; max-width: 640px; }
.hero-eyebrow { color: var(--ember); font-size: 12.5px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.hero-title { font-size: clamp(30px, 5vw, 54px); line-height: 1.02; margin-bottom: 14px; text-shadow: 0 4px 30px rgba(0,0,0,.5); }
.hero-desc { color: var(--text-muted); font-size: 14.5px; max-width: 500px; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 12px; }
.hero-dots { position: absolute; right: 24px; bottom: 44px; display: flex; gap: 8px; }
.hero-dots span { width: 22px; height: 3px; background: rgba(255,255,255,.25); border-radius: 2px; cursor: pointer; }
.hero-dots span.active { background: var(--ember); }

/* ── Cards / rails ── */
.rail { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; -ms-overflow-style: none; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }

.card { scroll-snap-align: start; width: 150px; flex: none; }
.grid .card { width: auto; }
.card-thumb { position: relative; border-radius: var(--radius-m); overflow: hidden; aspect-ratio: 2/3; background: var(--bg-elevated); border: 1px solid var(--border); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-thumb img { transform: scale(1.06); }
.card-badge { position: absolute; top: 7px; left: 7px; background: rgba(10,11,16,.75); color: var(--text); font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 5px; backdrop-filter: blur(4px); }
.card-badge.type { left: auto; right: 7px; background: var(--ember); }
.card-score { position: absolute; bottom: 7px; left: 7px; display: flex; align-items: center; gap: 3px; background: rgba(10,11,16,.75); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px; color: var(--gold); }
.card-title { margin-top: 9px; font-size: 13px; font-weight: 600; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.card-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }

.ep-card { display: flex; gap: 12px; padding: 10px; border-radius: var(--radius-m); background: var(--bg-surface); border: 1px solid var(--border); align-items: center; }
.ep-card:hover { border-color: var(--ember-dim); }
.ep-card img { width: 76px; height: 100px; object-fit: cover; border-radius: var(--radius-s); flex: none; }
.ep-card .ep-title { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.ep-card .ep-sub { font-size: 12px; color: var(--text-muted); }
.ep-num-pill { background: var(--ember); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; display: inline-block; margin-bottom: 5px; }

/* ── Genre chips ── */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { padding: 7px 15px; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
.chip:hover, .chip.active { color: #fff; border-color: var(--ember); background: rgba(124,92,252,.14); }

/* ── Forms ── */
.auth-wrap { max-width: 420px; margin: 60px auto; padding: 0 20px; }
.panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 30px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 11px 14px; color: var(--text); font-size: 14px; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ember); }
.field-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; }
.form-alt { text-align: center; margin-top: 18px; font-size: 13px; color: var(--text-muted); }
.form-alt a { color: var(--ember); font-weight: 600; }

.alert { padding: 12px 16px; border-radius: var(--radius-s); font-size: 13.5px; margin-bottom: 16px; border: 1px solid; }
.alert-error { background: var(--danger-dim); border-color: var(--danger); color: #ffb3ba; }
.alert-success { background: rgba(47,214,126,.1); border-color: var(--success); color: #6bf0a8; }
.alert-info { background: rgba(244,183,64,.1); border-color: var(--gold-dim); color: var(--gold); }

/* ── Player / episode page ── */
.player-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius-m); overflow: hidden; }
.player-wrap iframe { width: 100%; height: 100%; border: 0; }
.player-wrap:fullscreen, .player-wrap:-webkit-full-screen { border-radius: 0; }
.player-wrap:fullscreen iframe, .player-wrap:-webkit-full-screen iframe { width: 100vw; height: 100vh; }
.server-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.server-tab { padding: 8px 14px; font-size: 12.5px; font-weight: 600; border-radius: var(--radius-s); background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); }
.server-tab.active { color: #fff; border-color: var(--ember); background: rgba(124,92,252,.15); }

.gate-overlay {
  position: absolute; inset: 0; background: rgba(6,6,10,.96); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 20px; z-index: 5; gap: 10px;
}
.gate-locked, .gate-waiting { display: flex; flex-direction: column; align-items: center; }
.gate-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 260px; }
.gate-ring { width: 78px; height: 78px; border-radius: 50%; border: 4px solid var(--bg-elevated-2); border-top-color: var(--ember); animation: spin 1s linear infinite; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 22px; }
@keyframes spin { to { transform: rotate(360deg); } }

.ep-nav { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0; }
.ep-strip { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; }
.ep-pill { flex: none; min-width: 46px; text-align: center; padding: 9px 6px; border-radius: var(--radius-s); background: var(--bg-elevated); border: 1px solid var(--border); font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.ep-pill.active { background: var(--ember); color: #fff; border-color: var(--ember); }
.ep-pill.locked::after { content: '🔒'; display: block; font-size: 9px; margin-top: 2px; }

/* ── VIP / pricing ── */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 26px; }
.plan-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-l); padding: 26px; text-align: center; position: relative; }
.plan-card.featured { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 12px 40px rgba(244,183,64,.12); }
.plan-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg,var(--gold),var(--gold-dim)); color: #201400; font-size: 11px; font-weight: 800; padding: 4px 12px; border-radius: 999px; }
.plan-name { font-family: var(--font-display); font-size: 18px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); }
.plan-price { font-family: var(--font-display); font-size: 42px; margin: 10px 0; color: var(--text); }
.plan-price span { font-size: 14px; color: var(--text-faint); font-family: var(--font-body); }
.plan-features { list-style: none; padding: 0; margin: 18px 0; text-align: left; font-size: 13.5px; color: var(--text-muted); }
.plan-features li { padding: 7px 0; border-top: 1px solid var(--border); }
.plan-features li:before { content: '✓ '; color: var(--success); font-weight: 800; }

/* ── Ads ── */
.ad-slot { display: flex; align-items: center; justify-content: center; overflow: hidden; margin: 18px 0; min-height: 0; }
.ad-slot--banner-top { margin-top: 0; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 40px 0 90px; color: var(--text-faint); font-size: 13px; }
@media (min-width: 900px) { .site-footer { padding-bottom: 40px; } }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ── Misc ── */
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-muted); }
.empty-state .ico { font-size: 44px; margin-bottom: 14px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 34px 0; flex-wrap: wrap; }
.pg-num, .pg-btn { padding: 8px 13px; border-radius: var(--radius-s); background: var(--bg-elevated); border: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.pg-num.active { background: var(--ember); border-color: var(--ember); color: #fff; }
.pg-dots { color: var(--text-faint); padding: 0 4px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.table tr:hover td { background: var(--bg-elevated); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag-vip { background: rgba(244,183,64,.15); color: var(--gold); }
.tag-free { background: rgba(148,152,173,.15); color: var(--text-muted); }
.tag-suspended { background: var(--danger-dim); color: var(--danger); }
.tag-active { background: rgba(47,214,126,.15); color: var(--success); }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }

.page-head { padding: 34px 0 10px; }
.page-head h1 { font-size: 28px; }
.page-head p { color: var(--text-muted); margin-top: 8px; font-size: 14px; }

.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ── Reveal-on-scroll ── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
