/* Xem Tiếp — giao diện ưu tiên di động (iPhone, cảm ứng) */
:root {
  --bg: #0b0b10; --bg-2: #101018; --surface: #16161f; --surface-2: #1f1f2b; --surface-3: #2a2a39;
  --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .16);
  --text: #f4f4f8; --muted: #a0a0b4; --faint: #6d6d82;
  --accent: #ff6a4d; --accent-2: #ffb23e; --accent-ink: #1b0a04;
  --grad: linear-gradient(135deg, #ff4d6d 0%, #ff6a4d 45%, #ffb23e 100%);
  --ok: #3ddc97; --danger: #ff5d6c;
  --radius: 16px; --radius-sm: 12px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --topbar-h: 52px; --tabbar-h: 60px; --pad: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); min-height: 100dvh;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }

/* ---------- khung ứng dụng ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) calc(var(--pad) + var(--safe-r)) 0 calc(var(--pad) + var(--safe-l));
  background: rgba(11, 11, 16, .82); backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -.3px; min-height: 44px; }
.brand-name b { font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark { width: 28px; height: 28px; border-radius: 9px; background: var(--grad); position: relative; box-shadow: 0 4px 14px rgba(255, 106, 77, .45); }
.brand-mark::after { content: ""; position: absolute; left: 11px; top: 8px; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.topnav { display: none; gap: 4px; margin-left: 18px; }
.topnav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.topnav a:hover { color: var(--text); background: var(--surface); }
.topnav a.on { color: var(--text); background: var(--surface-2); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.icon-btn:active { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; text-transform: uppercase; }

main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); min-height: 70dvh; outline: none; }
.page { padding: 16px calc(var(--pad) + var(--safe-r)) 0 calc(var(--pad) + var(--safe-l)); max-width: 1180px; margin: 0 auto; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); align-items: start;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding: 6px calc(8px + var(--safe-r)) var(--safe-b) calc(8px + var(--safe-l));
  background: rgba(16, 16, 24, .86); backdrop-filter: saturate(160%) blur(20px); -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 48px; color: var(--faint); font-size: 10.5px; font-weight: 600; }
.tab svg.i { width: 24px; height: 24px; }
.tab.on { color: var(--text); }
.tab.on svg.i { color: var(--accent); }
.tab-add { position: relative; }
.tab-add span.plus { width: 50px; height: 50px; margin-top: -14px; border-radius: 18px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(255, 90, 80, .5); }
.tab-add:active span.plus { transform: scale(.94); }
.tab-add svg.i { width: 26px; height: 26px; stroke-width: 2.6; color: #fff !important; }

/* ---------- nút, ô nhập ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 14px; font-weight: 700; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); white-space: nowrap;
}
.btn:active { transform: scale(.98); filter: brightness(1.15); }
.btn.primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 22px rgba(255, 90, 80, .35); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line-2);
  font-size: 16px; /* ≥16px để iPhone không tự phóng to khi gõ */ outline: none; appearance: none; -webkit-appearance: none;
}
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 106, 77, .2); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.hint { font-size: 13px; color: var(--muted); }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { min-height: 40px; border-radius: 10px; font-weight: 700; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.seg button svg.i { width: 18px; height: 18px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px var(--pad) 4px; margin: 0 calc(-1 * var(--pad)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: #fff; color: #111; border-color: #fff; }
.chip small { opacity: .6; font-weight: 600; }

/* ---------- thẻ phim ---------- */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.section-head a, .section-head button { color: var(--muted); font-size: 14px; font-weight: 600; min-height: 32px; }
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 0 var(--pad) 6px; margin: 0 calc(-1 * var(--pad)); scroll-padding-left: var(--pad); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: none; scroll-snap-align: start; width: min(62vw, 250px); }
.rail.ranked > * { width: min(70vw, 280px); }
.grid { display: grid; gap: 14px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card { display: block; position: relative; }
.card:active .poster { transform: scale(.98); }
.poster {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2);
  transition: transform .15s ease; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .ph { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 10px; font-weight: 800; font-size: 14px; line-height: 1.2; letter-spacing: -.2px; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.poster .ph span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .55)); pointer-events: none; }
.badge { position: absolute; z-index: 2; font-size: 11.5px; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: rgba(0, 0, 0, .72); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: inline-flex; align-items: center; gap: 4px; }
.badge.dur { right: 7px; bottom: 9px; font-variant-numeric: tabular-nums; }
.badge.tl { left: 7px; top: 7px; }
.badge.private { background: rgba(20, 20, 30, .8); }
.badge.done { background: var(--ok); color: #05301d; }
.badge svg.i { width: 12px; height: 12px; stroke-width: 2.6; }
.pbar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .22); }
.pbar i { display: block; height: 100%; background: var(--grad); border-radius: 0 2px 2px 0; }
.card .t { margin-top: 8px; font-weight: 700; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .m { margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank { position: absolute; z-index: 3; left: -4px; bottom: -14px; font-size: 64px; line-height: 1; font-weight: 900; font-style: italic; letter-spacing: -4px;
  color: var(--bg); -webkit-text-stroke: 2px rgba(255, 255, 255, .85); text-shadow: 0 4px 18px rgba(0, 0, 0, .6); pointer-events: none; }
.ranked .card .t, .ranked .card .m { padding-left: 46px; }

/* hàng danh sách (thư viện, playlist) */
.rows { display: grid; gap: 10px; }
.row { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.row.current { border-color: var(--accent); background: linear-gradient(90deg, rgba(255, 106, 77, .14), var(--surface) 60%); }
.row .poster { width: 132px; flex: none; border-radius: 10px; box-shadow: none; }
.row .info { flex: 1; min-width: 0; display: block; padding: 2px 0; }
.row .t { font-weight: 700; font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .m { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; }
.row .m .acc { color: var(--accent-2); font-weight: 700; }
.row .more { width: 40px; height: 44px; flex: none; display: grid; place-items: center; color: var(--muted); border-radius: 12px; }
.row .more:active { background: var(--surface-2); }
.row .num { width: 22px; flex: none; text-align: center; font-weight: 800; color: var(--faint); font-variant-numeric: tabular-nums; }
.row .handle { width: 36px; height: 48px; flex: none; display: grid; place-items: center; color: var(--faint); touch-action: none; cursor: grab; }
.row.dragging { position: relative; z-index: 5; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); border-color: var(--accent); background: var(--surface-2); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.pill.pub { background: rgba(61, 220, 151, .14); color: var(--ok); }
.pill svg.i { width: 12px; height: 12px; stroke-width: 2.6; }

/* hàng playlist trên điện thoại: thu nhỏ ảnh để tên phim đủ chỗ */
.rows.tight .row { gap: 8px; padding: 8px 4px 8px 8px; }
.rows.tight .row .poster { width: 96px; }
.rows.tight .row .more { width: 34px; }
.rows.tight .row .handle { width: 32px; }
.rows.tight .row .num { width: 18px; font-size: 13px; }
@media (min-width: 700px) { .rows.tight .row { gap: 12px; padding: 8px; } .rows.tight .row .poster { width: 168px; } }

/* ---------- trang chủ ---------- */
.hero { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); scrollbar-width: none; }
.hero::-webkit-scrollbar { display: none; }
.hero-slide { flex: none; width: 100%; scroll-snap-align: center; position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 5; max-height: 62dvh; background: var(--surface-2); display: block; }
.hero-slide img, .hero-slide .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 16, .1) 30%, rgba(11, 11, 16, .78) 68%, rgba(11, 11, 16, .97)); }
.hero-body { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 18px; display: grid; gap: 10px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--accent-2); }
.hero-title { font-size: 24px; font-weight: 900; line-height: 1.15; letter-spacing: -.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 2px 14px rgba(0, 0, 0, .6); }
.hero-meta { font-size: 13px; color: #d9d9e6; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.hero-actions { display: flex; gap: 10px; margin-top: 4px; }
.hero-actions .btn { flex: 1; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-3); transition: all .2s; }
.dots i.on { width: 18px; background: var(--accent); border-radius: 3px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { padding: 12px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.stat b { display: block; font-size: 20px; font-weight: 900; letter-spacing: -.4px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.plcard .stack { position: relative; aspect-ratio: 16 / 9; }
.plcard .stack .poster { position: absolute; inset: 0; aspect-ratio: auto; }
.plcard .stack::before, .plcard .stack::after { content: ""; position: absolute; left: 6%; right: 6%; height: 100%; border-radius: var(--radius-sm); background: var(--surface-3); top: -7px; opacity: .7; }
.plcard .stack::after { left: 12%; right: 12%; top: -13px; opacity: .4; }
.plcard .count { position: absolute; z-index: 2; right: 0; top: 0; bottom: 0; width: 38%; background: rgba(0, 0, 0, .72); display: grid; place-items: center; align-content: center; gap: 2px; font-weight: 800; font-size: 18px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.plcard .count small { font-size: 11px; color: var(--muted); font-weight: 700; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty .big { width: 72px; height: 72px; border-radius: 24px; background: var(--surface); display: grid; place-items: center; color: var(--accent); }
.empty .big svg.i { width: 34px; height: 34px; }
.empty h3 { color: var(--text); font-size: 18px; }

/* ---------- trang xem ---------- */
.stage-wrap { position: sticky; top: calc(var(--topbar-h) + var(--safe-t)); z-index: 20; background: #000; }
.stage { position: relative; width: 100%; max-width: 1180px; margin: 0 auto; background: #000; display: grid; place-items: center; min-height: 56.25vw; }
.stage.pulse::after { content: ""; position: absolute; inset: 0; border: 3px solid var(--accent-2); pointer-events: none; animation: pulse 1.1s ease-in-out 4; }
@keyframes pulse { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
#mount { width: 100%; margin: 0 auto; }
#mount > .fb-video, #mount > .fb-video > span, #mount iframe { display: block !important; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); font-size: 14px; pointer-events: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.watch { padding-top: 14px; }
.watch h1 { font-size: 20px; font-weight: 800; line-height: 1.25; letter-spacing: -.3px; }
.watch .meta { margin-top: 6px; color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.status { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 178, 62, .1); border: 1px solid rgba(255, 178, 62, .28); color: #ffd9a0; font-size: 14px; }
.status b { color: #fff; }
.scrub { position: relative; height: 44px; margin-top: 10px; touch-action: none; cursor: pointer; }
.scrub .track { position: absolute; left: 0; right: 0; top: 19px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.scrub .fill { position: absolute; left: 0; top: 19px; height: 6px; border-radius: 3px; background: var(--grad); width: 0; }
.scrub .knob { position: absolute; top: 12px; left: 0; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); transition: transform .12s; }
.scrub.drag .knob { transform: scale(1.35); }
.scrub .tip { position: absolute; bottom: 40px; transform: translateX(-50%); padding: 5px 10px; border-radius: 10px; background: #fff; color: #111; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; display: none; white-space: nowrap; }
.scrub.drag .tip { display: block; }
.times { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -4px; }
.times b { color: var(--text); }
.transport { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.tbtn { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: 13px; color: var(--text); position: relative; }
.tbtn:active { background: var(--surface-3); transform: scale(.95); }
.tbtn:disabled { opacity: .35; }
.tbtn small { position: absolute; font-size: 9.5px; font-weight: 800; top: 22px; }
.tbtn svg.i { width: 30px; height: 30px; stroke-width: 1.8; }
.tbtn.play { width: 72px; height: 72px; background: var(--grad); border: 0; color: #fff; box-shadow: 0 10px 26px rgba(255, 90, 80, .45); }
.tbtn.play svg.i { width: 32px; height: 32px; }
.jumps { display: flex; gap: 8px; margin-top: 14px; overflow-x: auto; scrollbar-width: none; padding: 0 var(--pad); margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad)); }
.jumps::-webkit-scrollbar { display: none; }
.jumps .chip { font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.act { display: grid; justify-items: center; gap: 5px; padding: 10px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); min-height: 62px; }
.act svg.i { color: var(--text); }
.act.on { color: var(--accent-2); border-color: rgba(255, 178, 62, .4); }
.act.on svg.i { color: var(--accent-2); }
.act:active { background: var(--surface-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.nextup { margin-top: 16px; padding: 14px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(255, 77, 109, .2), rgba(255, 178, 62, .14)); border: 1px solid rgba(255, 178, 62, .35); display: grid; gap: 10px; }
.note-box { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; color: #d6d6e2; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- trang cá nhân ---------- */
.profile { display: flex; align-items: center; gap: 14px; }
.profile .avatar { width: 60px; height: 60px; font-size: 26px; flex: none; }
.profile h1 { font-size: 22px; font-weight: 900; letter-spacing: -.4px; }
.profile p { color: var(--muted); font-size: 13.5px; }
.stats.six { grid-template-columns: repeat(3, 1fr); }
.toolbar { display: flex; gap: 8px; align-items: center; margin: 14px 0 10px; }
.toolbar .input { min-height: 44px; }
.panel { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-top: 14px; }
.panel h2 { font-size: 16px; margin-bottom: 12px; }
.plhead { display: grid; gap: 10px; }
.plhead h1 { font-size: 24px; font-weight: 900; letter-spacing: -.4px; line-height: 1.2; }
.plprog { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.plprog i { display: block; height: 100%; background: var(--grad); }

/* ---------- đăng nhập ---------- */
.auth { max-width: 420px; margin: 0 auto; padding-top: 6vh; }
.auth .logo { width: 64px; height: 64px; border-radius: 20px; background: var(--grad); margin: 0 auto 16px; position: relative; box-shadow: 0 14px 36px rgba(255, 90, 80, .45); }
.auth .logo::after { content: ""; position: absolute; left: 25px; top: 18px; border-left: 20px solid #fff; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.auth h1 { text-align: center; font-size: 26px; font-weight: 900; letter-spacing: -.5px; }
.auth > p { text-align: center; color: var(--muted); margin: 6px 0 22px; }
.auth .switch { text-align: center; margin-top: 18px; color: var(--muted); }
.auth .switch a { color: var(--accent-2); font-weight: 700; padding: 10px 4px; display: inline-block; }

/* ---------- bảng trượt (bottom sheet) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .18s ease; }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 24px 24px 0 0; border-top: 1px solid var(--line-2);
  padding-bottom: var(--safe-b); animation: up .24s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -20px 60px rgba(0, 0, 0, .6);
}
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 8px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 20px; flex: none; }
.sheet-head h2 { font-size: 18px; font-weight: 800; }
.sheet-body { padding: 6px 20px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.menu { display: grid; gap: 2px; margin: 0 -8px; }
.menu button, .menu a { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 0 12px; border-radius: 14px; font-weight: 600; font-size: 16px; text-align: left; width: 100%; }
.menu button:active, .menu a:active { background: var(--surface-2); }
.menu .danger { color: var(--danger); }
.menu svg.i { color: var(--muted); }
.menu .danger svg.i { color: var(--danger); }
.check { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.check .box { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--line-2); display: grid; place-items: center; color: transparent; }
.check.on .box { background: var(--grad); border-color: transparent; color: #fff; }
.check .box svg.i { width: 16px; height: 16px; stroke-width: 3; }
.check .poster { width: 84px; flex: none; border-radius: 8px; box-shadow: none; }
.check .lbl { flex: 1; min-width: 0; font-weight: 600; }
.check .lbl small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.sheet-foot { position: sticky; bottom: -20px; margin: 14px -20px -20px; padding: 12px 20px 20px; background: linear-gradient(180deg, transparent, var(--surface) 30%); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }

.toasts { position: fixed; z-index: 80; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 480px; padding: 12px 16px; border-radius: 14px; background: #fff; color: #14141c; font-weight: 700; font-size: 14.5px; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); display: flex; align-items: center; gap: 12px; animation: toast .25s cubic-bezier(.2, .8, .2, 1); }
.toast.err { background: #ff5d6c; color: #fff; }
.toast button { color: var(--accent); font-weight: 800; min-height: 32px; }
@keyframes toast { from { transform: translateY(16px); opacity: 0; } }
.skel { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- máy tính bảng / máy tính ---------- */
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; }
  .hero-slide { aspect-ratio: 21 / 9; max-height: 460px; }
  .hero-title { font-size: 34px; max-width: 70%; }
  .hero-actions { max-width: 380px; }
  .stats { grid-template-columns: repeat(3, 1fr); max-width: 560px; }
  .stats.six { grid-template-columns: repeat(6, 1fr); max-width: none; }
  .rail > * { width: 240px; }
  .rail.ranked > * { width: 280px; }
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(520px, 92vw); max-height: 86dvh; border-radius: 24px; border: 1px solid var(--line-2); animation: pop .2s ease; padding-bottom: 0; }
  .sheet-grip { display: none; }
  .sheet-head { padding-top: 12px; }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -46%); } }
  .row .poster { width: 168px; }
}
@media (min-width: 960px) {
  :root { --topbar-h: 60px; --pad: 28px; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  main { padding-bottom: 60px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toasts { bottom: 28px; }
  .stage-wrap { position: static; padding-top: 18px; background: transparent; }
  .stage { border-radius: 18px; overflow: hidden; min-height: 0; aspect-ratio: 16 / 9; max-width: 1040px; }
  .watch { max-width: 1040px; }
  .watch h1 { font-size: 26px; }
  .actions { max-width: 520px; }
  .card:hover .poster { transform: translateY(-3px); }
  .rail { scrollbar-width: thin; }
}
@media (orientation: landscape) and (max-height: 480px) {
  /* iPhone xoay ngang: nhường tối đa chỗ cho video */
  .stage-wrap { position: static; }
  .stage { min-height: 0; }
  #mount { max-width: calc((100dvh - var(--topbar-h)) * 16 / 9); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
