*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg:    #08080F;
  --card:  #111120;
  --surf:  #161625;
  --bord:  #1E1E2E;
  --gold:  #E8B84B;
  --red:   #E84545;
  --text:  #E8E8F0;
  --mut:   #6868A0;
  --nav-h: 64px;
}
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.c-gold { color: var(--gold); }

/* ── Loading ───────────────────────────── */
#loading-screen { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; z-index: 1000; }
.loading-logo { font-size: 28px; font-weight: 700; letter-spacing: 2px; }
.loading-spinner { width: 28px; height: 28px; border: 2px solid var(--bord); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── App Shell ─────────────────────────── */
#app { height: 100%; display: flex; flex-direction: column; }
.screen-view { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; padding-bottom: var(--nav-h); }
.screen-view.hidden { display: none; }

/* ── Bottom Nav ────────────────────────── */
.bottom-nav { height: var(--nav-h); background: #0C0C1C; border-top: 0.5px solid var(--bord); display: flex; flex-shrink: 0; }
.nav-btn { flex: 1; background: none; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; color: var(--mut); font-size: 10px; padding-bottom: 6px; }
.nav-btn i { font-size: 22px; }
.nav-btn.active { color: var(--gold); }

/* ── Auth ──────────────────────────────── */
#auth-screen { position: fixed; inset: 0; background: var(--bg); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-wrap { width: 100%; max-width: 360px; }
.auth-logo { font-size: 30px; font-weight: 700; letter-spacing: 2px; text-align: center; margin-bottom: 6px; }
.auth-tagline { text-align: center; color: var(--mut); font-size: 13px; margin-bottom: 2rem; }
.auth-tabs { display: flex; background: var(--card); border-radius: 8px; padding: 3px; margin-bottom: 1.5rem; }
.auth-tab { flex: 1; background: none; border: none; color: var(--mut); padding: 8px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; }
.auth-tab.active { background: var(--surf); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.inp-wrap { position: relative; }
.inp-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mut); font-size: 16px; }
.inp-wrap input { background: var(--card); border: 1px solid var(--bord); border-radius: 10px; color: var(--text); padding: 12px 14px 12px 38px; font-size: 14px; width: 100%; outline: none; }
.inp-wrap input:focus { border-color: var(--gold); }
.btn-primary-full { background: var(--gold); color: #08080F; border: none; border-radius: 10px; padding: 13px; font-size: 14px; font-weight: 600; width: 100%; cursor: pointer; }
.btn-ghost-full { background: var(--card); color: var(--mut); border: 1px solid var(--bord); border-radius: 10px; padding: 12px; font-size: 13px; width: 100%; cursor: pointer; margin-top: 4px; }
.auth-error { background: var(--red)18; color: var(--red); border-radius: 8px; padding: 10px 14px; font-size: 13px; }

/* ── Section Headings ──────────────────── */
.section-header { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; margin-bottom: 10px; }
.section-title { font-size: 15px; font-weight: 600; }
.section-link { color: var(--gold); font-size: 12px; cursor: pointer; }

/* ── App Bar ───────────────────────────── */
.app-bar { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.app-logo { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.app-bar-icons { display: flex; gap: 14px; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text); font-size: 22px; padding: 2px; }

/* ── Featured Card ─────────────────────── */
.featured-card { margin: 0 16px 16px; border-radius: 14px; overflow: hidden; cursor: pointer; }
.featured-inner { height: 220px; position: relative; padding: 16px; display: flex; flex-direction: column; justify-content: flex-end; }
.featured-badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; padding: 3px 8px; font-size: 10px; font-weight: 600; margin-bottom: 8px; width: fit-content; }
.featured-title { font-size: 20px; font-weight: 600; line-height: 1.1; }
.featured-meta { color: #AAAACC; font-size: 12px; margin: 4px 0 12px; }
.featured-actions { display: flex; gap: 8px; }
.btn-watch { background: var(--gold); color: #08080F; border: none; border-radius: 20px; padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.btn-list { background: rgba(255,255,255,.12); color: #fff; border: 0.5px solid rgba(255,255,255,.2); border-radius: 20px; padding: 9px 16px; font-size: 13px; cursor: pointer; }
.featured-tag { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.6); border-radius: 4px; padding: 3px 8px; display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; }

/* ── Cat Pills ─────────────────────────── */
.cat-scroll { overflow-x: auto; padding: 0 16px 0; scrollbar-width: none; white-space: nowrap; margin-bottom: 14px; }
.cat-pill { display: inline-block; background: var(--surf); border: 0.5px solid var(--bord); border-radius: 20px; padding: 7px 14px; margin-right: 8px; font-size: 12px; color: var(--mut); cursor: pointer; }
.cat-pill.active { background: var(--gold); color: #08080F; font-weight: 600; border-color: var(--gold); }

/* ── Drama Cards ───────────────────────── */
.h-scroll { overflow-x: auto; display: flex; gap: 10px; padding: 0 16px; scrollbar-width: none; }
.drama-card { flex-shrink: 0; width: 138px; border-radius: 10px; overflow: hidden; cursor: pointer; }
.drama-card-inner { height: 160px; position: relative; }
.drama-card-badge { position: absolute; top: 8px; left: 8px; border-radius: 4px; padding: 2px 6px; font-size: 10px; font-weight: 500; }
.drama-card-rating { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.65); border-radius: 4px; padding: 2px 5px; display: flex; align-items: center; gap: 3px; font-size: 10px; }
.drama-card-info { padding: 8px 6px 6px; }
.drama-card-title { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drama-card-meta { font-size: 10px; color: var(--mut); margin-top: 2px; }

/* ── Continue Watching ─────────────────── */
.cw-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.cw-item { background: var(--card); border-radius: 10px; padding: 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; border: 0.5px solid var(--bord); }
.cw-thumb { width: 52px; height: 52px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cw-info { flex: 1; min-width: 0; }
.cw-title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-sub { font-size: 11px; color: var(--mut); margin-top: 2px; }
.cw-progress { background: var(--bord); border-radius: 2px; height: 3px; margin-top: 6px; overflow: hidden; }
.cw-bar { background: var(--gold); height: 100%; border-radius: 2px; }

/* ── Player Screen ─────────────────────── */
.player-back { padding: 10px 16px; display: flex; }
.back-btn { background: rgba(255,255,255,.1); border: none; border-radius: 20px; padding: 5px 12px; color: var(--text); font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.video-box { position: relative; }
.video-box video { width: 100%; max-height: 55vw; background: #000; display: block; }
.video-placeholder { height: 200px; display: flex; align-items: center; justify-content: center; }
.play-btn { background: rgba(0,0,0,.55); border: none; border-radius: 50%; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.play-btn i { color: #fff; font-size: 24px; }
.ep-tag { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.7); border-radius: 4px; padding: 3px 8px; font-size: 11px; }
.progress-row { padding: 0 14px 8px; }
.prog-bar { background: rgba(255,255,255,.2); border-radius: 2px; height: 3px; overflow: hidden; cursor: pointer; }
.prog-fill { background: var(--gold); height: 100%; border-radius: 2px; }
.prog-times { display: flex; justify-content: space-between; margin-top: 3px; font-size: 10px; color: var(--mut); }
.player-meta { padding: 12px 16px; }
.player-top { display: flex; justify-content: space-between; align-items: flex-start; }
.player-title { font-size: 17px; font-weight: 600; }
.player-genre { font-size: 12px; color: var(--mut); margin-top: 2px; }
.player-actions { display: flex; gap: 14px; flex-shrink: 0; }
.action-btn { background: none; border: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--mut); font-size: 10px; }
.action-btn i { font-size: 22px; }
.action-btn.liked i { color: var(--red); }
.player-desc { font-size: 12px; color: #AAAAC0; margin-top: 8px; line-height: 1.6; }
.player-tabs { display: flex; border-bottom: 0.5px solid var(--bord); padding: 0 16px; }
.ptab { background: none; border: none; padding: 10px 0; margin-right: 20px; cursor: pointer; font-size: 13px; color: var(--mut); border-bottom: 2px solid transparent; }
.ptab.active { color: var(--gold); border-bottom-color: var(--gold); }
.ep-list { padding: 6px 8px; }
.ep-item { background: transparent; border-radius: 8px; padding: 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 3px 0; }
.ep-item.playing { background: var(--card); border: 0.5px solid var(--bord); }
.ep-thumb { width: 44px; height: 44px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ep-item-info .ep-name { font-size: 13px; }
.ep-item-info .ep-sub { font-size: 11px; color: var(--mut); margin-top: 2px; }
.ep-now { margin-left: auto; font-size: 10px; font-weight: 600; border-radius: 4px; padding: 2px 6px; }
.comments-box { padding: 10px 16px; }
.comment-input-row { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
.comment-input { flex: 1; background: var(--surf); border: 0.5px solid var(--bord); border-radius: 20px; padding: 9px 14px; color: var(--text); font-size: 13px; outline: none; }
.send-btn { background: var(--gold); border: none; border-radius: 20px; padding: 9px 13px; cursor: pointer; flex-shrink: 0; }
.send-btn i { color: #08080F; font-size: 16px; }
.comment-item { display: flex; gap: 10px; margin-bottom: 14px; }
.c-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.c-name { font-size: 12px; font-weight: 500; }
.c-time { font-size: 10px; color: var(--mut); }
.c-text { font-size: 12px; color: #AAAABB; margin-top: 3px; line-height: 1.5; }
.c-like-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; gap: 4px; color: var(--mut); font-size: 11px; margin-top: 6px; }

/* ── Discover ──────────────────────────── */
.search-bar { margin: 0 16px 16px; background: var(--surf); border: 0.5px solid var(--bord); border-radius: 20px; padding: 10px 16px; display: flex; align-items: center; gap: 8px; }
.search-bar i { color: var(--mut); font-size: 18px; }
.search-bar input { background: none; border: none; color: var(--text); font-size: 13px; outline: none; flex: 1; }
.genre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.genre-tile { border-radius: 12px; height: 90px; padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer; border: 0.5px solid transparent; }
.genre-label { font-size: 10px; font-weight: 600; margin-bottom: 3px; }
.genre-name { font-size: 13px; font-weight: 600; color: var(--text); }

/* ── Profile ───────────────────────────── */
.profile-header { text-align: center; padding: 24px 16px 16px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; font-size: 28px; }
.profile-name { font-size: 17px; font-weight: 600; }
.profile-since { font-size: 12px; color: var(--mut); margin-top: 4px; }
.profile-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; padding: 0 16px 16px; }
.p-stat { background: var(--card); border-radius: 10px; padding: 12px; text-align: center; border: 0.5px solid var(--bord); }
.p-stat-val { font-size: 20px; font-weight: 700; color: var(--gold); }
.p-stat-lbl { font-size: 11px; color: var(--mut); margin-top: 3px; }
.profile-menu { padding: 0 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.p-menu-item { background: var(--card); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; border: 0.5px solid var(--bord); }
.p-menu-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.p-menu-label { font-size: 13px; flex: 1; }
.p-menu-sub { font-size: 11px; color: var(--mut); }
.coins-display { display: inline-flex; align-items: center; gap: 4px; background: var(--gold)18; border: 0.5px solid var(--gold)40; border-radius: 20px; padding: 6px 12px; color: var(--gold); font-size: 13px; font-weight: 500; margin-top: 8px; }

/* ── Toast ─────────────────────────────── */
.toast { position: fixed; bottom: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%); background: var(--card); color: var(--text); border: 1px solid var(--bord); border-radius: 8px; padding: 10px 18px; font-size: 13px; z-index: 500; white-space: nowrap; transition: opacity 0.3s; }
.toast.hidden { opacity: 0; pointer-events: none; }

/* ── Loading state ─────────────────────── */
.skeleton { background: var(--surf); border-radius: 8px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:.8} }

/* ── Coins shop ────────────────────────── */
.coins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.coin-pack { background: var(--card); border: 1px solid var(--bord); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; }
.coin-pack.featured { border-color: var(--gold); background: var(--gold)10; }
.coin-pack-amount { font-size: 24px; font-weight: 700; color: var(--gold); }
.coin-pack-name { font-size: 12px; color: var(--mut); margin: 4px 0 10px; }
.coin-pack-price { background: var(--gold); color: #08080F; border: none; border-radius: 20px; padding: 7px 14px; font-size: 12px; font-weight: 600; cursor: pointer; width: 100%; }

.hidden { display: none !important; }
