/* =========================================================
   Drama24 — modern dark UI (mobile-first, PWA-ready)
   ========================================================= */
:root {
  --bg: #0a0b10;
  --bg-soft: #0f1118;
  --surface: #141722;
  --surface-2: #1a1e2b;
  --card: #141722;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #f2f3f7;
  --muted: #8f96ab;
  --accent: #ff4d7d;
  --accent-2: #8b5cf6;
  --grad: linear-gradient(135deg, #ff4d7d, #8b5cf6);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --nav-h: 68px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1100px 560px at 85% -8%, rgba(139, 92, 246, .13), transparent 62%),
    radial-gradient(900px 480px at -10% 2%, rgba(255, 77, 125, .10), transparent 58%),
    var(--bg);
  color: var(--text);
  font-family: "Prompt", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: 0 0 auto; }
.muted { color: var(--muted); font-size: .82rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  min-height: 62px;
  padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: #0a0b10;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 1.02rem; }
.brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 16px rgba(255, 130, 40, .3); }
.brand span {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topnav { display: none; align-items: center; gap: 2px; margin-left: 10px; }
.topnav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  color: var(--muted); font-size: .82rem;
  transition: background .18s ease, color .18s ease;
}
.topnav a .ico { width: 17px; height: 17px; }
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.topnav a.is-active { color: var(--text); background: rgba(255, 255, 255, .08); }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.inline-form { margin: 0; }

.lang-select {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%238f96ab'/></svg>") no-repeat right 10px center;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 26px 7px 12px;
  font-size: .74rem;
  max-width: 140px;
  cursor: pointer;
}
.lang-select:hover { border-color: var(--line-strong); }
/* ปุ่มเลือกแอป (แทน dropdown) */
.app-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px 5px 6px;
  color: var(--text);
  font-size: .76rem;
  cursor: pointer;
  max-width: 176px;
  transition: border-color .18s ease, background .18s ease;
}
.app-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.app-btn img { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; }
.app-btn span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-btn .app-chev { width: 14px; height: 14px; color: var(--muted); }

.lang-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px 5px 6px;
  color: var(--text);
  font-size: .74rem;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.lang-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.lang-btn img { width: 24px; height: 18px; border-radius: 4px; object-fit: cover; }
.lang-btn .app-chev { width: 12px; height: 12px; color: var(--muted); }
.flag-emoji { display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; line-height: 1; }
.lang-btn .flag-emoji { font-size: 1.05rem; }

/* แผงเลือกแอป */
.app-sheet {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(0, 0, 0, .64);
  display: flex; align-items: flex-end; justify-content: center;
}
.app-sheet-panel {
  width: 100%; max-width: 640px; max-height: 78dvh;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  animation: sheetUp .22s ease both;
}
.sheet-grab {
  width: 42px; height: 4px; border-radius: 99px;
  background: rgba(255, 255, 255, .18);
  margin: 0 auto 12px;
}
.app-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: .92rem; }
.app-search {
  width: 100%;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 16px; font-size: .84rem;
  margin-bottom: 12px;
}
.app-search::placeholder { color: #6c7286; }
.app-search:focus { outline: none; border-color: rgba(255, 77, 125, .5); }
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 12px 6px;
  overflow-y: auto; padding: 2px;
}
.app-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 4px; border-radius: 14px;
}
.app-logo {
  width: 50px; height: 50px; border-radius: 14px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.app-logo img { width: 100%; height: 100%; object-fit: cover; }
.app-name {
  font-size: .6rem; color: var(--muted); text-align: center; line-height: 1.25;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-tile.is-active .app-logo { border-color: transparent; box-shadow: 0 0 0 2px var(--accent); }
.app-tile.is-active .app-name { color: #fff; }
.app-check {
  position: absolute; top: 0; right: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: .58rem;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-soft);
}
.app-lock {
  position: absolute; top: -4px; left: -4px;
  font-size: .48rem; font-weight: 700; letter-spacing: .04em;
  color: #fff; background: rgba(255, 77, 125, .92);
  border-radius: 6px; padding: 1px 4px;
  pointer-events: none;
}
.more-btn { border: 0; background: transparent; cursor: pointer; padding: 0; }

/* แผงเลือกภาษา */
.lang-sheet {
  position: fixed; inset: 0; z-index: 230;
  background: rgba(0, 0, 0, .64);
  display: flex; align-items: flex-end; justify-content: center;
}
.lang-panel {
  width: 100%; max-width: 520px;
  max-height: 82dvh; overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  animation: sheetUp .22s ease both;
}
.lang-list { display: flex; flex-direction: column; gap: 8px; }
.lang-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px;
  color: var(--text); cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.lang-opt:hover { background: var(--surface-2); }
.lang-opt img { width: 42px; height: 30px; border-radius: 6px; object-fit: cover; }
.lang-opt .flag-emoji { width: 42px; height: 30px; font-size: 1.55rem; flex: 0 0 42px; }
.lang-opt-txt { flex: 1; display: flex; flex-direction: column; }
.lang-opt-txt b { font-size: .86rem; }
.lang-opt-txt i { font-style: normal; font-size: .68rem; color: var(--muted); }
.lang-opt.is-active {
  border-color: rgba(255, 77, 125, .5);
  background: linear-gradient(135deg, rgba(255, 77, 125, .12), rgba(139, 92, 246, .12));
}
.lang-opt-check {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: .7rem;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Shell / bottom nav ---------- */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom));
}

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10, 11, 16, .95);
  border-top: 1px solid var(--line);
  border-radius: 0;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, .35);
}
.bottomnav a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px;
  font-size: .64rem;
  color: var(--muted);
  border-radius: 14px;
  transition: color .18s ease;
}
.bottomnav a .ico { width: 23px; height: 23px; stroke-width: 1.7; }
.bottomnav a.is-active { color: #fff; }
.bottomnav a.is-active .ico { color: var(--accent); }
.bottomnav a.is-active::before {
  content: ""; position: absolute; top: -8px;
  width: 22px; height: 3px; border-radius: 99px; background: var(--grad);
}

/* ---------- Install banner / modal ---------- */
.install-banner {
  position: fixed; left: 10px; right: 10px;
  bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
  z-index: 70;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(20, 23, 34, .96);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  animation: sheetUp .24s ease both;
}
.install-banner img { width: 42px; height: 42px; border-radius: 12px; }
.install-banner-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.install-banner-txt b { font-size: .8rem; }
.install-banner-txt span { font-size: .66rem; color: var(--muted); }
.install-x {
  border: 0; background: transparent; color: var(--muted);
  width: 28px; height: 28px; border-radius: 50%;
  font-size: .9rem; cursor: pointer; flex: 0 0 28px;
}
.install-x:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: .76rem; }

.install-modal {
  position: fixed; inset: 0; z-index: 210;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .64);
}
.install-modal-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px 22px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: sheetUp .24s ease both;
}
.install-modal-x { position: absolute; top: 12px; right: 12px; }
.install-app-icon { width: 74px; height: 74px; border-radius: 20px; margin: 0 auto 12px; box-shadow: 0 10px 26px rgba(255, 77, 125, .3); }
.install-modal-card h2 { font-size: 1.12rem; }
.install-modal-card p { color: var(--muted); font-size: .8rem; margin: 6px 0 16px; }
.install-steps { display: flex; flex-direction: column; gap: 9px; text-align: left; margin-bottom: 16px; }
.install-steps div { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.install-steps b { display: block; font-size: .76rem; }
.install-steps span { font-size: .72rem; color: var(--muted); }

.login-install {
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; padding: 10px 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.login-install img { width: 40px; height: 40px; border-radius: 11px; }
.login-install-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.login-install-txt b { font-size: .78rem; }
.login-install-txt span { font-size: .66rem; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 420px;
  display: flex; align-items: flex-end;
  border-radius: 24px;
  border: 1px solid var(--line);
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 18%;
  transform: scale(1.03);
  opacity: .82;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 11, 16, .45) 0%, rgba(10, 11, 16, .05) 28%, rgba(10, 11, 16, .55) 62%, rgba(10, 11, 16, .98) 100%);
}
.hero-body { position: relative; z-index: 1; padding: 24px 20px; width: 100%; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
  font-size: .66rem; letter-spacing: .16em; text-transform: uppercase;
  color: #ffd3de; font-weight: 600;
}
.hero h1 { font-size: clamp(1.7rem, 7vw, 3rem); line-height: 1.1; margin-bottom: 10px; }
.hero-desc { color: #c7cad6; font-size: .84rem; margin: 10px 0 0; max-width: 640px; }
.hero-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  font-size: .68rem; color: #d9dbe6;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 3px 10px; border-radius: 999px;
}

/* สไลด์แนะนำ (auto carousel) */
.hero-slider { position: relative; display: grid; margin-bottom: 26px; }
.hero-slider .hero { grid-area: 1 / 1; margin-bottom: 0; opacity: 0; transition: opacity .55s ease; pointer-events: none; }
.hero-slider .hero.is-active { opacity: 1; pointer-events: auto; }
.hero-dots {
  position: absolute; right: 18px; bottom: 16px; z-index: 3;
  display: flex; align-items: center; gap: 6px;
}
.hero-dot {
  width: 8px; height: 8px; padding: 0;
  border: 0; border-radius: 99px;
  background: rgba(255, 255, 255, .35);
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}
.hero-dot.is-active { width: 22px; background: var(--accent); }

/* ---------- Rails / grid / cards ---------- */
.rail-block { margin-bottom: 26px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 1.02rem; }
.section-head .more { font-size: .76rem; color: var(--muted); }
.section-head .more:hover { color: #fff; }
.rail {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail .card { flex: 0 0 136px; scroll-snap-align: start; }

/* แนวหนัง */
.genre-row {
  display: flex; gap: 7px;
  overflow-x: auto; padding: 2px 2px 10px;
  scrollbar-width: none;
  margin-bottom: 4px;
}
.genre-row::-webkit-scrollbar { display: none; }
.genre-chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .74rem;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.genre-chip:hover { color: var(--text); border-color: var(--line-strong); }
.genre-chip.is-active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  font-weight: 500;
}

/* หมวดหมู่หนัง (ไอคอนแอป) */
.cat-row {
  display: flex; gap: 14px;
  overflow-x: auto; padding: 4px 2px 8px;
  scrollbar-width: none;
}
.cat-row::-webkit-scrollbar { display: none; }
.cat-tile {
  position: relative;
  flex: 0 0 auto;
  width: 82px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.cat-logo {
  width: 70px; height: 70px;
  border-radius: 20px; overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cat-logo img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile:hover .cat-logo { transform: translateY(-2px); }
.cat-tile.is-active .cat-logo {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--accent), 0 10px 24px rgba(255, 77, 125, .26);
}
.cat-name {
  font-size: .7rem; color: var(--muted);
  text-align: center; line-height: 1.3;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-tile.is-active .cat-name { color: #fff; font-weight: 500; }
.cat-check {
  position: absolute; top: -4px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--grad); color: #fff;
  font-size: .62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 20px 12px;
}
.card { position: relative; display: block; min-width: 0; }
.card-link { display: block; }
.card-play {
  position: absolute; top: 8px; right: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 9, 13, .68);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.9);
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
}
.card:hover .card-play, .card:focus-within .card-play { opacity: 1; transform: scale(1); }
.card-play:hover { background: rgba(255, 77, 125, .85); }
.card-play .ico { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.card-cover {
  position: relative; border-radius: 15px; overflow: hidden;
  aspect-ratio: 2 / 3;
  background: linear-gradient(150deg, #181c2b, #10121a);
  border: 1px solid var(--line);
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover .card-cover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .45); }
@media (hover: none) {
  .card-play { opacity: 1; transform: scale(1); }
}
.card-cover img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.card-cover img.fallback { opacity: .55; }
.card:hover .card-cover img { transform: scale(1.045); }
.card-badge {
  position: absolute; left: 6px; bottom: 6px;
  font-size: .58rem; font-weight: 600;
  background: rgba(8, 9, 13, .8);
  border: 1px solid rgba(255, 255, 255, .14);
  padding: 2px 7px; border-radius: 999px;
  color: #fff;
  backdrop-filter: blur(4px);
}
.card-badge.card-resume {
  background: var(--grad);
  border-color: transparent;
  font-weight: 600;
}
.card-badge.card-like-badge {
  background: rgba(255, 77, 125, .9);
  border-color: transparent;
}
.card-title {
  margin-top: 7px;
  font-size: .76rem; line-height: 1.35;
  color: #d9dbe6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { margin-top: 2px; font-size: .64rem; color: var(--muted); }
.card-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 4px; background: rgba(255, 255, 255, .16);
}
.card-progress i {
  display: block; height: 100%;
  background: var(--grad);
  border-radius: 0 99px 99px 0;
}

/* ---------- Buttons ---------- */
.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: .8rem;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .15s ease;
  white-space: nowrap;
}
.ghost-btn .ico { width: 17px; height: 17px; }
.ghost-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.ghost-btn:active { transform: scale(.98); }
.ghost-btn.is-disabled { opacity: .36; pointer-events: none; }
.ghost-btn.danger { color: #ff8aa6; border-color: rgba(255, 77, 125, .3); background: rgba(255, 77, 125, .08); }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--grad);
  color: #fff;
  border: 0; border-radius: 999px;
  padding: 11px 20px;
  font-weight: 600; font-size: .86rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(255, 77, 125, .26);
  transition: transform .15s ease, filter .15s ease;
}
.btn-primary .ico { width: 18px; height: 18px; }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-play {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; color: #0a0b10;
  border: 0; border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700; font-size: .9rem;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
  transition: transform .15s ease, filter .15s ease;
}
.btn-play svg { width: 18px; height: 18px; }
.btn-play:hover { transform: translateY(-1px); filter: brightness(.94); }
.btn-play:active { transform: scale(.98); }
/* ปุ่มรอง: รูปทรง/ขนาดเดียวกับ .btn-play แต่ใช้สีโปร่งใสแทนสีขาว */
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255, 255, 255, .1); color: #fff;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600; font-size: .9rem;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn-ghost svg { width: 18px; height: 18px; }
.btn-ghost:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .17); border-color: rgba(255, 255, 255, .34); }
.btn-ghost:active { transform: scale(.98); }
.like-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: .8rem;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.like-btn .ico { width: 17px; height: 17px; }
.like-btn.is-liked {
  color: #ff7aa0;
  border-color: rgba(255, 77, 125, .5);
  background: rgba(255, 77, 125, .12);
}
.like-btn.is-liked .ico { fill: currentColor; }

/* ---------- Page head / tabs / search ---------- */
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 1.35rem; }
.page-head .muted { margin-top: 3px; }
.page-head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tabs { display: flex; gap: 8px; margin-top: 12px; }
.tab {
  font-size: .8rem; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); background: var(--surface);
}
.tab.is-active { background: var(--grad); color: #fff; border-color: transparent; }
.filter-row { margin: 0 0 16px; }
.filter-label { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.filter-label select {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 10px; font-size: .78rem;
}

.searchbar { display: flex; gap: 8px; margin-bottom: 18px; }
.searchbar input {
  flex: 1; min-width: 0;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 18px; font-size: .9rem;
}
.searchbar input::placeholder { color: #6c7286; }
.searchbar input:focus { outline: none; border-color: rgba(255, 77, 125, .5); }
.result-count { color: var(--muted); font-size: .78rem; margin: 0 0 12px; }

/* ---------- Notices / empty / pager ---------- */
.notice {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
  font-size: .84rem; color: var(--muted);
}
.notice strong { color: var(--text); }
.notice-error { border-color: rgba(255, 77, 125, .4); background: rgba(255, 77, 125, .07); }
.empty {
  padding: 42px 16px; text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  font-size: .88rem;
}
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 48px 20px; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px;
}
.empty-state[hidden] { display: none; }
.empty-ico {
  width: 62px; height: 62px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .05); color: var(--muted);
  margin-bottom: 4px;
}
.empty-ico .ico { width: 28px; height: 28px; }
.empty-state b { font-size: .98rem; }
.empty-state span { color: var(--muted); font-size: .8rem; max-width: 300px; }
.empty-state .btn-primary { margin-top: 10px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; }
.pager-num { font-size: .78rem; color: var(--muted); }

/* ---------- Detail ---------- */
.detail-back { margin-bottom: 14px; }
.detail-top { display: flex; gap: 16px; align-items: flex-start; }
.detail-cover {
  flex: 0 0 136px; aspect-ratio: 2 / 3;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h1 { font-size: clamp(1.15rem, 5vw, 1.65rem); line-height: 1.25; }
.meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.meta-pill {
  font-size: .66rem; color: #cfd2e0;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
}
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.detail-desc { margin-top: 26px; }
.detail-desc h2, .detail-eps h2 { font-size: 1rem; margin-bottom: 8px; }
.detail-desc p { color: #c3c6d4; font-size: .85rem; line-height: 1.75; margin: 0; }
.detail-eps { margin-top: 26px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.ep {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 46px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px;
  font-size: .82rem; font-weight: 500; color: #dfe1ec;
}
a.ep:hover { border-color: rgba(255, 77, 125, .5); background: var(--surface-2); }
.ep.is-current { background: var(--grad); border-color: transparent; color: #fff; }
.ep.is-locked { color: #565c72; background: #0e1017; }
.ep-lock { position: absolute; top: 3px; right: 5px; font-size: .5rem; font-style: normal; opacity: .8; }

/* ---------- Watch ---------- */
.watch-body {
  display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
  background: #000;
}
.watch-top {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top));
  background: #08090d;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.watch-back {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
  font-size: 1rem;
}
.watch-heading { min-width: 0; flex: 1; }
.watch-heading b { display: block; font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-heading span { display: block; font-size: .68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch-sub { display: flex; align-items: center; gap: 5px; min-width: 0; margin-top: 2px; }
.watch-ep-chip {
  border: 0; background: rgba(255, 255, 255, .1); color: #fff;
  border-radius: 999px; padding: 2px 8px;
  font-size: .64rem; cursor: pointer; white-space: nowrap;
}
.watch-ep-chip:hover { background: rgba(255, 255, 255, .16); }
.watch-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.watch-icon-btn {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.watch-icon-btn .ico { width: 17px; height: 17px; }
.watch-icon-btn.is-liked {
  color: var(--accent);
  border-color: rgba(255, 77, 125, .5);
  background: rgba(255, 77, 125, .14);
}
.watch-icon-btn.is-liked .ico { fill: currentColor; }
.watch-list-btn {
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .08);
  color: #fff; border-radius: 999px; padding: 7px 14px;
  font-size: .76rem; cursor: pointer;
}
.watch-stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000;
}
.player { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-msg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; text-align: center;
  background: rgba(5, 6, 10, .85);
  font-size: .88rem;
}
.player-msg[hidden] { display: none; }
.player-msg span { color: var(--muted); font-size: .78rem; max-width: 420px; }
/* แถบตอนแนวนอน */
.ep-strip-wrap {
  background: rgba(8, 9, 13, .96);
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: 8px 0 2px;
}
.ep-strip-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 6px;
  font-size: .74rem;
}
.ep-strip-more {
  border: 0; background: none; color: var(--accent);
  font-size: .72rem; font-weight: 600; cursor: pointer; padding: 0;
}
.ep-strip {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 0 14px 8px;
  scrollbar-width: none;
}
.ep-strip::-webkit-scrollbar { display: none; }
.ep-chip {
  flex: 0 0 auto;
  min-width: 42px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  font-size: .76rem; color: #cfd2e0;
}
.ep-chip.is-current { background: var(--grad); color: #fff; border-color: transparent; }
.ep-chip.is-locked { opacity: .35; }

/* drawer เลือกตอน (ปัดซ้าย) */
.ep-drawer-backdrop {
  position: fixed; inset: 0; z-index: 240;
  background: rgba(0, 0, 0, .55);
  display: flex; justify-content: flex-end;
}
.ep-drawer {
  width: min(360px, 86vw); height: 100%;
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  animation: drawerIn .22s ease both;
}
@keyframes drawerIn {
  from { transform: translateX(26px); opacity: .4; }
  to { transform: none; opacity: 1; }
}
.ep-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.ep-drawer-head b { display: block; font-size: .95rem; }
.ep-drawer-head span { display: block; font-size: .68rem; color: var(--muted); margin-top: 2px; }
.ep-drawer-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 7px; overflow-y: auto; padding: 2px;
}
.ep-drawer-grid .ep { min-height: 42px; }
.unmute-btn {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(10, 11, 16, .85);
  color: #fff; font-size: .74rem; cursor: pointer;
  backdrop-filter: blur(8px);
}

/* ---------- จบตอนแล้วไปตอนถัดไปอัตโนมัติ ---------- */
.next-up {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 260;
  display: flex; justify-content: center;
  padding: 0 14px calc(14px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.next-up[hidden] { display: none; }
.next-up-card {
  pointer-events: auto;
  width: min(430px, 100%);
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(14, 16, 23, .97);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: sheetUp .22s ease both;
}
.next-up-text { min-width: 0; flex: 1; }
.next-up-text span { display: block; font-size: .66rem; color: var(--muted); }
.next-up-text b {
  display: block; font-size: .82rem; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.next-up-text b span { display: inline; color: var(--accent); font-weight: 700; }
.next-up-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.next-up .btn-primary,
.next-up .ghost-btn { padding: 8px 13px; font-size: .74rem; }

/* ---------- 1 คีย์ = 1 อุปกรณ์ ---------- */
.device-gate-body {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 460px at 80% -10%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(700px 420px at 0% 0%, rgba(255, 77, 125, .12), transparent 55%),
    var(--bg);
}
.device-gate { width: min(420px, 100%); }
.device-gate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.device-gate-ico {
  width: 64px; height: 64px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 77, 125, .18), rgba(139, 92, 246, .18));
  border: 1px solid rgba(255, 77, 125, .3);
}
.device-gate-ico .ico { width: 30px; height: 30px; }
.device-gate-card h1 { font-size: 1.15rem; margin-bottom: 8px; }
.device-gate-sub { color: var(--muted); font-size: .78rem; margin: 0; }
.device-gate-name {
  display: inline-block;
  margin: 8px auto 10px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  font-size: .95rem; font-weight: 600;
}
.device-gate-meta { color: var(--muted); font-size: .7rem; line-height: 1.6; margin: 0 0 16px; }
.device-gate-card form { margin-bottom: 8px; }
.device-gate-card .ghost-btn { margin-top: 8px; }
.device-gate-card .notice { text-align: left; }

.device-conflict {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.device-conflict-card {
  width: min(380px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  text-align: center;
  box-shadow: var(--shadow);
}
.device-conflict-card b { display: block; font-size: 1rem; margin-bottom: 6px; }
.device-conflict-card span { display: block; color: var(--muted); font-size: .78rem; line-height: 1.6; margin-bottom: 16px; }
.device-conflict-card strong { color: #fff; }

.watch-tools {
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(8, 9, 13, .96);
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.source-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.source-picker:empty { display: none; }
.source-picker button {
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06);
  color: #cfd2e0; border-radius: 999px; padding: 5px 12px;
  font-size: .7rem; cursor: pointer;
}
.source-picker button.is-active { background: var(--grad); color: #fff; border-color: transparent; }
.watch-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.watch-nav .ghost-btn { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.watch-fail {
  margin: auto; padding: 32px 20px; text-align: center;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.watch-fail h1 { font-size: 1.15rem; }
.watch-fail p { color: var(--muted); margin: 0; font-size: .88rem; }

/* ---------- Sheet / toast ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .62);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-backdrop[hidden] { display: none; }
.sheet-panel {
  width: 100%; max-width: 640px; max-height: 72dvh;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: sheetUp .22s ease both;
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: .9rem; }
.sheet-close {
  border: 0; background: rgba(255, 255, 255, .08); color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: .85rem;
}
.sheet-open { overflow: hidden; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: rgba(20, 23, 34, .97);
  border: 1px solid var(--line);
  color: #fff; font-size: .76rem;
  padding: 9px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 300; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Page loading ---------- */
.page-loader {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 9999;
  background: rgba(255, 255, 255, .06);
  overflow: hidden;
}
.page-loader::before {
  content: ""; display: block;
  width: 38%; height: 100%;
  background: var(--grad);
  animation: loaderSlide 1s ease-in-out infinite;
}
@keyframes loaderSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}
.load-overlay {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(7, 8, 12, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.load-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 20px 26px;
  box-shadow: var(--shadow);
}
.load-card img { width: 64px; height: 64px; border-radius: 50%; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-card b { font-size: .78rem; color: var(--muted); font-weight: 500; }

/* ---------- Login ---------- */
.login-body {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(10, 11, 16, .55), rgba(10, 11, 16, .95) 72%),
    url("cinema.webp") center / cover no-repeat,
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: rgba(16, 19, 29, .82);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.login-logo { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; margin: 0 auto 16px; display: block; box-shadow: 0 12px 32px rgba(255, 130, 40, .3); }
.login-card h1 { font-size: 1.45rem; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: .82rem; margin: 0 0 20px; }
.login-card label { display: block; font-size: .78rem; color: #c9ccda; margin-bottom: 14px; }
.login-card input[type="text"] {
  width: 100%; margin-top: 6px;
  background: #0c0e15; color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px;
  font-size: .84rem; letter-spacing: .02em;
}
.login-card input[type="text"]:focus { outline: none; border-color: rgba(255, 77, 125, .55); }
.login-key-hint { display: block; margin-top: 6px; font-size: .68rem; color: var(--muted); }
.login-help { color: var(--muted); font-size: .72rem; text-align: center; margin: 16px 0 0; }
.login-card .notice { margin-bottom: 16px; }
.buy-note {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 18px; padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 77, 125, .12), rgba(139, 92, 246, .12));
  border: 1px solid rgba(255, 77, 125, .26);
  border-radius: 14px;
  font-size: .78rem; color: #d9dbe6; line-height: 1.55;
}
.buy-note b { color: #fff; font-size: .74rem; letter-spacing: .04em; }

/* ---------- Profile ---------- */
.pf-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 77, 125, .16), rgba(139, 92, 246, .16)), var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  margin-bottom: 14px;
}
.pf-hero::after {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 77, 125, .32), transparent 70%);
  pointer-events: none;
}
.pf-avatar {
  width: 62px; height: 62px; flex: 0 0 62px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff;
  box-shadow: 0 12px 28px rgba(255, 77, 125, .32);
}
.pf-avatar .ico { width: 30px; height: 30px; }
.pf-id { min-width: 0; }
.pf-id h1 { font-size: 1.12rem; }
.pf-id span { display: block; margin-top: 2px; font-size: .72rem; color: var(--muted); }
.pf-status {
  position: relative; z-index: 1;
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .66rem; font-weight: 600; color: #7ee2a8;
  background: rgba(126, 226, 168, .1);
  border: 1px solid rgba(126, 226, 168, .35);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.pf-status i {
  width: 7px; height: 7px; border-radius: 50%; background: #7ee2a8;
  animation: pfPulse 2s infinite;
}
@keyframes pfPulse {
  0% { box-shadow: 0 0 0 0 rgba(126, 226, 168, .5); }
  70% { box-shadow: 0 0 0 8px rgba(126, 226, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(126, 226, 168, 0); }
}
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pf-stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px;
}
.pf-stat span { display: block; font-size: .64rem; color: var(--muted); margin-bottom: 4px; }
.pf-stat b { font-size: .82rem; font-weight: 600; line-height: 1.3; }
.pf-stat--accent {
  background: linear-gradient(135deg, rgba(255, 77, 125, .16), rgba(139, 92, 246, .16));
  border-color: rgba(255, 77, 125, .3);
}
.pf-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
}
.pf-card h2 { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin-bottom: 12px; }
.pf-card h2 .ico { width: 18px; height: 18px; color: var(--accent); }
.pf-card p { margin: 0 0 12px; }
.pf-card p:last-child { margin-bottom: 0; }
.pf-app { display: flex; align-items: center; gap: 12px; }
.pf-app-logo {
  width: 48px; height: 48px; flex: 0 0 48px;
  border-radius: 14px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line);
}
.pf-app-logo img { width: 100%; height: 100%; object-fit: cover; }
.pf-app-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pf-app-info span { font-size: .66rem; color: var(--muted); }
.pf-app-info b { font-size: .9rem; }
.pf-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.pf-shortcut {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; font-size: .8rem; color: #dfe1ec;
  transition: background .18s ease, border-color .18s ease;
}
.pf-shortcut .ico { width: 18px; height: 18px; color: var(--accent); }
.pf-shortcut:hover { background: var(--surface-2); border-color: var(--line-strong); }
.pf-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .82rem; }
.kv:last-child { border-bottom: 0; padding-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; word-break: break-all; font-weight: 500; }
.kv b.ok { color: #7ee2a8; }
.hint { color: var(--muted); font-size: .7rem; margin: 10px 0 0; line-height: 1.6; }

/* ---------- Short feed (แนวตั้งสไตล์ TikTok) ---------- */
.short-body .shell { max-width: none; padding: 0; }
.short-feed {
  height: calc(100dvh - 62px - var(--nav-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 420px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  background: #000;
}
.short-feed::-webkit-scrollbar { display: none; }
.short-slide {
  position: relative; height: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden;
  display: flex; align-items: flex-end;
}
.short-bg { position: absolute; inset: 0; z-index: 0; }
.short-bg img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 18%;
  transform: scale(1.04);
}
.short-media { position: absolute; inset: 0; z-index: 1; background: transparent; }
.short-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}
.short-loader {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.short-media[data-loaded="1"] .short-loader,
.short-media[data-loaded="error"] .short-loader { display: none; }
.short-media-note {
  position: absolute; left: 50%; top: 16%;
  transform: translateX(-50%);
  max-width: 84%;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(10, 11, 16, .72);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #e6e8f0; font-size: .7rem; text-align: center;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.short-fade {
  position: absolute; inset: 0; z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 6, 10, .35) 0%, rgba(5, 6, 10, 0) 32%,
    rgba(5, 6, 10, .55) 62%, rgba(5, 6, 10, .97) 100%);
}
.short-info { position: relative; z-index: 3; width: 100%; max-width: 680px; padding: 18px 78px 26px 18px; }
.short-app {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .66rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: #ffd3de;
}
.short-app img { width: 20px; height: 20px; border-radius: 6px; object-fit: cover; }
.short-dub {
  font-style: normal; letter-spacing: 0;
  text-transform: none; font-size: .6rem; font-weight: 600;
  color: #0a0b10; background: var(--accent);
  border-radius: 999px; padding: 1px 7px;
}
.short-info h2 { font-size: clamp(1.4rem, 6vw, 2.1rem); line-height: 1.15; margin: 8px 0 6px; }
.short-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: .74rem; color: #ccd0dd; }
.short-meta span {
  background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px; padding: 2px 9px;
}
.short-actions { display: flex; align-items: center; gap: 8px; margin-top: 15px; flex-wrap: wrap; }
.short-actions .btn-play { padding: 10px 20px; font-size: .82rem; }

/* แถบปุ่มด้านขวาแบบ TikTok */
.short-rail {
  position: absolute; right: 8px; bottom: 128px; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.short-rail-btn {
  width: 58px; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: transparent; color: #fff;
  font-size: .6rem; cursor: pointer;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .65);
  transition: transform .15s ease, color .15s ease;
}
.short-rail-btn .ico {
  width: 30px; height: 30px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .55));
}
.short-rail-btn:active { transform: scale(.9); }
.short-rail-btn.is-liked { color: var(--accent); }
.short-rail-btn.is-liked .ico { fill: currentColor; }

.short-progress {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  height: 2px; background: rgba(255, 255, 255, .14);
}
.short-progress i { display: block; height: 100%; width: 0; background: var(--grad); }

.short-heart-burst {
  position: fixed; z-index: 80;
  font-size: 72px; line-height: 1; color: var(--accent);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.3);
  opacity: 0;
  text-shadow: 0 8px 30px rgba(255, 77, 125, .55);
}
.short-heart-burst.play { animation: heartBurst .65s ease forwards; }
@keyframes heartBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -65%) scale(.95); }
}

.short-hint {
  position: fixed; z-index: 60; left: 50%;
  bottom: calc(var(--nav-h) + 120px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 7px 14px; border-radius: 999px;
  background: rgba(10, 11, 16, .72); border: 1px solid rgba(255, 255, 255, .16);
  color: #e8eaf2; font-size: .7rem; white-space: nowrap;
  pointer-events: none; transition: opacity .4s ease;
}
.short-hint.is-hidden { opacity: 0; }
.short-count {
  position: absolute; z-index: 4; top: 12px; left: 14px;
  font-size: .66rem; color: rgba(255, 255, 255, .78);
  background: rgba(0, 0, 0, .4); border-radius: 999px; padding: 2px 10px;
}
.short-ep {
  position: absolute; z-index: 4; top: 12px; left: 50%; transform: translateX(-50%);
  font-size: .66rem; color: #ffd3de;
  background: rgba(10, 11, 16, .62); border: 1px solid rgba(255, 77, 125, .35);
  border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.short-shuffle {
  position: fixed; z-index: 55; right: 12px;
  top: calc(70px + env(safe-area-inset-top));
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(10, 11, 16, .74); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; font-size: .7rem;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.short-empty {
  margin: 40px auto; max-width: 420px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.short-empty-ico {
  width: 64px; height: 64px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); background: rgba(255, 77, 125, .12); border: 1px solid rgba(255, 77, 125, .3);
}
.short-empty-ico .ico { width: 30px; height: 30px; }
.short-empty h1 { font-size: 1.15rem; }
.short-empty p { color: var(--muted); font-size: .82rem; margin: 0; }

/* ---------- Desktop ---------- */
@media (min-width: 860px) and (max-width: 1060px) {
  .topnav a { padding: 8px 8px; gap: 5px; font-size: .76rem; }
  .topnav a .ico { width: 15px; height: 15px; }
  .app-btn span { max-width: 84px; }
}

@media (min-width: 860px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  .install-banner { left: auto; right: 24px; bottom: 24px; width: 380px; }
  .cat-row { gap: 18px; }
  .cat-tile { width: 96px; }
  .cat-logo { width: 84px; height: 84px; border-radius: 24px; }
  .shell { padding: 26px 28px 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 24px 18px; }
  .rail .card { flex-basis: 172px; }
  .hero { min-height: 520px; }
  .hero-body { padding: 32px; }
  .short-body .shell { padding: 20px; }
  .short-feed {
    height: calc(100dvh - 62px - 40px);
    max-width: 560px; margin: 0 auto;
    border-radius: 20px; border: 1px solid var(--line);
  }
  .short-shuffle { top: 82px; right: 20px; }
  .detail-cover { flex-basis: 190px; }
  .detail-info h1 { font-size: 1.9rem; }
  .ep-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
  .watch-tools { max-width: 900px; margin: 0 auto; width: 100%; }
  .watch-top { padding-left: 20px; padding-right: 20px; }
  .pf-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .pf-grid .pf-card { margin-bottom: 0; }

  /* หน้า watch บนคอม: จำกัดขนาดวิดีโอ ไม่ให้เต็มจอ และเลื่อนหน้าได้ */
  .watch-body { height: auto; min-height: 100dvh; overflow: auto; }
  .watch-top { position: sticky; top: 0; z-index: 10; }
  .watch-stage {
    flex: none;
    height: min(70vh, 720px);
    width: fit-content;
    max-width: 100%;
    margin: 18px auto 0;
    border-radius: 16px;
    overflow: hidden;
    background: transparent;
  }
  .watch-stage .player { width: auto; height: 100%; max-width: 100%; border-radius: 16px; }
  .ep-strip-wrap, .watch-tools { max-width: 980px; margin-left: auto; margin-right: auto; }
  .ep-strip-wrap { margin-top: 14px; border-radius: 14px; }
  .watch-tools { border-top: 0; padding-bottom: 28px; }
}

@media (max-width: 420px) {
  .lang-select { max-width: 96px; font-size: .68rem; padding: 6px 24px 6px 10px; }
  .app-btn { max-width: 140px; padding-right: 8px; }
  .app-btn span { max-width: 64px; font-size: .7rem; }
  .brand span { font-size: .94rem; }
  .hero { min-height: 340px; }
  .detail-cover { flex-basis: 118px; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
  .app-btn span { max-width: 54px; }
  .lang-select { max-width: 84px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   Modern UI pass — glass, depth, motion
   ========================================================= */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .2s ease both; }
::view-transition-new(root) { animation: vtIn .26s ease both; }
@keyframes vtOut { to { opacity: 0; transform: translateY(-4px) scale(.998); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(6px) scale(1.002); } }

html { scroll-behavior: smooth; }

/* top bar: frosted glass */
.topbar {
  background: rgba(10, 11, 16, .72);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: rgba(255, 255, 255, .06);
}
.brand img { box-shadow: 0 6px 20px rgba(255, 130, 40, .35); }

/* bottom nav: glass + active pill */
.bottomnav {
  background: rgba(10, 11, 16, .84);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
  border-top-color: rgba(255, 255, 255, .08);
}
.bottomnav a { border-radius: 14px; transition: color .18s ease, background .18s ease, transform .18s ease; }
.bottomnav a:active { transform: scale(.94); }
.bottomnav a.is-active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 77, 125, .16), rgba(139, 92, 246, .12));
}
.bottomnav a.is-active::before {
  top: 0; width: 24px; height: 3px;
  box-shadow: 0 0 14px rgba(255, 77, 125, .85);
}

/* section headings with accent */
.section-head h2 { display: flex; align-items: center; gap: 9px; letter-spacing: -.01em; }
.section-head h2::before {
  content: ""; width: 3px; height: 1.05em; border-radius: 99px;
  background: linear-gradient(180deg, #ff4d7d, #8b5cf6);
  box-shadow: 0 0 12px rgba(255, 77, 125, .5);
}
.section-head .more { transition: color .18s ease, transform .18s ease; }
.section-head .more:hover { transform: translateX(2px); }

/* cards: static skeleton + softer radius + 2-line title (ไม่ใช้ animation ต่อเนื่อง) */
.card-cover {
  border-radius: 16px;
  background: linear-gradient(100deg, #151824 18%, #1e2233 36%, #151824 54%);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
}
.card-cover:has(img.is-loaded), .card-cover.is-ready { background: #101319; }
.card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.35; max-height: 2.75em;
}
.card:hover .card-cover {
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 77, 125, .18);
}

/* hero */
.hero { border-radius: 26px; box-shadow: 0 18px 44px rgba(0, 0, 0, .42); }
.hero h1 { text-shadow: 0 6px 30px rgba(0, 0, 0, .5); }
.hero-dots { gap: 5px; bottom: 18px; }
.hero-dot { width: 14px; height: 3px; background: rgba(255, 255, 255, .3); }
.hero-dot.is-active {
  width: 30px;
  background: linear-gradient(90deg, #ff4d7d, #8b5cf6);
  box-shadow: 0 0 12px rgba(255, 77, 125, .7);
}

/* buttons & chips */
.btn-primary, .btn-play { box-shadow: 0 12px 30px rgba(255, 77, 125, .3); }
.btn-primary:hover, .btn-play:hover { box-shadow: 0 16px 36px rgba(255, 77, 125, .4); }
.genre-chip { padding: 8px 16px; }
.genre-chip.is-active { box-shadow: 0 8px 22px rgba(255, 77, 125, .3); }

/* page heads / detail / watch */
.page-head h1 { font-size: clamp(1.45rem, 5vw, 1.9rem); }
.detail-cover img { border-radius: 20px; }
.watch-top {
  background: rgba(8, 9, 13, .8);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
}
.searchbar input { border-radius: 999px; }

/* =========================================================
   Mobile performance — ลด blur/animation หนัก ๆ บนมือถือ
   ========================================================= */
@media (max-width: 860px) {
  .topbar, .bottomnav {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: rgba(10, 11, 16, .97);
  }
  .watch-top {
    -webkit-backdrop-filter: none; backdrop-filter: none;
    background: #08090d;
  }
  .card-badge, .card-play, .short-media-note, .short-shuffle {
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .short-rail-btn .ico { filter: none; }
}

/* =========================================================
   Home refresh — intro + progress dots (ไม่เพิ่ม animation หนัก)
   ========================================================= */
.home-body .shell { padding-top: 12px; }
.home-intro {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 16px;
}
.home-intro-txt span { display: block; font-size: .72rem; color: var(--muted); }
.home-intro-txt h1 { font-size: clamp(1.35rem, 5vw, 1.85rem); margin-top: 2px; }
.home-intro-search {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line-strong);
  color: #fff;
  transition: background .18s ease, transform .18s ease;
}
.home-intro-search:hover { background: rgba(255, 255, 255, .1); transform: translateY(-1px); }
.home-intro-search .ico { width: 20px; height: 20px; }
.home-body .rail .card { flex: 0 0 150px; }
.home-body .section-head h2 { font-size: 1.08rem; }
.home-body .hero { min-height: min(62vh, 560px); }
@media (max-width: 420px) {
  .home-body .hero { min-height: 430px; }
}

/* จุดสไลด์แบบมี progress เติม 5 วิ */
.hero-dot { position: relative; overflow: hidden; }
.hero-dot.is-active { background: rgba(255, 255, 255, .22); box-shadow: none; }
.hero-dot.is-active::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #ff4d7d, #8b5cf6);
  transform-origin: left center;
  animation: dotProgress 5s linear forwards;
}
@keyframes dotProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (min-width: 860px) {
  .home-body .rail .card { flex-basis: 178px; }
  .home-intro { margin-top: 6px; }
}

/* =========================================================
   Public landing (SEO) — สำหรับผู้ยังไม่ล็อกอิน
   ========================================================= */
.landing-body { background: #07080c; }
.landing-top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(8, 9, 13, .84);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.landing-top .btn-sm { padding: 8px 16px; font-size: .78rem; }
.landing-hero {
  position: relative; overflow: hidden;
  padding: 64px 20px 54px;
  background:
    linear-gradient(180deg, rgba(10, 11, 16, .3), rgba(7, 8, 12, .96) 80%),
    url('cinema.webp') center / cover no-repeat;
  border-bottom: 1px solid var(--line);
}
.landing-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(800px 400px at 80% 0%, rgba(139, 92, 246, .22), transparent 60%),
    radial-gradient(600px 300px at 10% 20%, rgba(255, 77, 125, .18), transparent 60%);
}
.landing-hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.landing-hero h1 { font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.08; margin: 12px 0; letter-spacing: -.02em; }
.landing-hero p { color: #c9cdda; max-width: 620px; font-size: .95rem; }
.landing-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.landing-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.landing-chips span {
  font-size: .7rem; color: #dfe2ec;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px; padding: 4px 11px;
}
.landing-section { max-width: 1120px; margin: 0 auto; padding: 30px 20px; }
.landing-h2 { font-size: 1.2rem; }
.landing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 16px 12px; }
.landing-card { display: flex; flex-direction: column; gap: 6px; }
.landing-card .lcover {
  display: block; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: #10131c;
  transition: transform .2s ease, border-color .2s ease;
}
.landing-card .lcover img { width: 100%; height: 100%; object-fit: cover; }
.landing-card .ltitle {
  font-size: .76rem; color: #e8eaf2; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.landing-card .lmeta { font-size: .62rem; color: var(--muted); }
.landing-card:hover .lcover { transform: translateY(-2px); border-color: rgba(255, 77, 125, .45); }
.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.landing-features div {
  background: rgba(255, 255, 255, .035); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 4px;
}
.landing-features b { font-size: .9rem; }
.landing-features span { color: var(--muted); font-size: .78rem; }
.landing-buy {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(255, 77, 125, .12), rgba(139, 92, 246, .12));
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 22px;
  margin-top: 10px; margin-bottom: 10px;
}
.landing-buy h2 { font-size: 1.15rem; }
.landing-buy p { color: #cfd3df; font-size: .85rem; margin: 6px 0 0; }
.landing-buy-note { color: var(--muted) !important; font-size: .76rem !important; }
.landing-faq details {
  background: rgba(255, 255, 255, .035); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 8px;
}
.landing-faq summary { cursor: pointer; font-weight: 500; font-size: .86rem; }
.landing-faq p { color: #c3c8d6; font-size: .8rem; margin: 8px 0 0; }
.landing-foot {
  max-width: 1120px; margin: 0 auto;
  padding: 24px 20px calc(28px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-between; gap: 12px;
  color: var(--muted); font-size: .72rem; border-top: 1px solid var(--line);
}
.login-home-link { display: block; text-align: center; margin-top: 14px; color: var(--muted); font-size: .78rem; }
.login-home-link:hover { color: #fff; }
@media (min-width: 860px) {
  .landing-top { padding-left: 32px; padding-right: 32px; }
  .landing-hero { padding: 96px 32px 80px; }
  .landing-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 16px; }
}

/* =========================================================
   Ranked rail (Netflix Top 10)
   ========================================================= */
.ranked-rail { gap: 4px; }
.rank-item { position: relative; flex: 0 0 auto; display: flex; align-items: flex-end; }
.rank-num {
  font-size: 64px; font-weight: 800; line-height: .75; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .35);
  text-shadow: 0 0 20px rgba(0, 0, 0, .4);
  margin-right: -12px; margin-bottom: 28px; z-index: 0;
  font-family: "Prompt", system-ui, sans-serif;
}
.rank-item .card { width: 136px; z-index: 1; }
.home-body .rank-item .card { width: 148px; }
@media (min-width: 860px) {
  .home-body .rank-item .card { width: 176px; }
  .rank-num { font-size: 82px; }
}

/* =========================================================
   Watch v2 — modern control layout + swipe hint
   ========================================================= */
.watch-top {
  background: linear-gradient(180deg, rgba(10, 11, 16, .94), rgba(10, 11, 16, .8));
  border-bottom-color: rgba(255, 255, 255, .08);
}
.watch-swipe-hint {
  position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%);
  z-index: 2; display: flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 999px;
  background: rgba(10, 11, 16, .7); border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; font-size: .68rem; pointer-events: none;
  animation: swipeFloat 2.2s ease-in-out infinite;
}
.watch-swipe-hint span { color: var(--accent); font-weight: 700; }
@keyframes swipeFloat {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -5px); }
}
@media (hover: hover) and (pointer: fine) {
  .watch-swipe-hint { display: none; }
}
.ep-strip .ep-chip { min-width: 46px; height: 40px; border-radius: 12px; }
.ep-strip-more {
  padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}
.source-picker button { padding: 7px 13px; }
.watch-nav .ghost-btn { border-radius: 12px; padding: 11px 14px; }

/* landing: anchor nav + prose + steps + apps */
.landing-anchors { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.landing-anchors a {
  font-size: .7rem; color: #cfd3df;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px; padding: 5px 11px;
}
.landing-anchors a:hover { border-color: rgba(255, 77, 125, .5); color: #fff; }
.landing-prose { max-width: 900px; }
.landing-prose h2 { margin-bottom: 10px; }
.landing-prose p { color: #c6cad8; font-size: .9rem; line-height: 1.75; max-width: 820px; }
.landing-inline-cta { color: var(--accent); font-weight: 600; font-size: .86rem; }
.landing-inline-cta:hover { color: #fff; }
.landing-steps { list-style: none; counter-reset: step; padding: 0; margin: 14px 0; display: grid; gap: 10px; max-width: 760px; }
.landing-steps li {
  counter-increment: step; position: relative;
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(255, 255, 255, .035); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px 12px 46px;
}
.landing-steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--grad); color: #fff; font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.landing-steps b { font-size: .88rem; }
.landing-steps span { color: var(--muted); font-size: .78rem; }
.landing-apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.landing-apps span {
  font-size: .72rem; color: #dfe2ec;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 999px; padding: 5px 12px;
}
.landing-foot-links { display: flex; gap: 12px; flex-wrap: wrap; }
.landing-foot-links a { color: var(--muted); }
.landing-foot-links a:hover { color: #fff; }
.landing-section[id] { scroll-margin-top: 84px; }

/* =========================================================
   Landing free trial + hero player + reveal
   ========================================================= */
.landing-freebar {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(255, 77, 125, .16), rgba(139, 92, 246, .16));
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-size: .78rem; color: #fff;
}
.landing-freebar a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.landing-hero-inner { max-width: 1120px; display: grid; grid-template-columns: 1fr; gap: 26px; align-items: center; }
.landing-hero-copy { max-width: 760px; }
.landing-hero-media { display: flex; justify-content: center; }
.hero-player {
  display: block; width: min(280px, 74vw);
  padding: 10px; border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
  animation: heroFloat 7s ease-in-out infinite;
}
.hero-player:hover { animation-play-state: paused; }
@keyframes heroFloat {
  0%, 100% { transform: rotate(-2deg) translateY(0); }
  50% { transform: rotate(-2deg) translateY(-10px); }
}
.hp-screen { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 2 / 3; background: #0b0d14; }
.hp-screen img { width: 100%; height: 100%; object-fit: cover; }
.hp-screen::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5, 6, 10, .05) 30%, rgba(5, 6, 10, .55) 100%);
}
.hp-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .94); color: #0a0b10;
  font-size: 1.15rem; padding-left: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
  animation: playPulse 2.4s ease-in-out infinite;
  z-index: 1;
}
@keyframes playPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.08); }
}
.hp-badge {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  font-size: .6rem; font-weight: 700; color: #0a0b10;
  background: var(--accent); border-radius: 999px; padding: 3px 9px;
}
.hp-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .22); z-index: 1; }
.hp-progress i {
  display: block; height: 100%; width: 100%;
  background: var(--grad); transform-origin: left center;
  animation: hpProgress 6s ease-in-out infinite;
}
@keyframes hpProgress { 0% { transform: scaleX(.12); } 55% { transform: scaleX(1); } 100% { transform: scaleX(.12); } }
.hp-meta { padding: 10px 6px 4px; display: flex; flex-direction: column; gap: 2px; }
.hp-meta b { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-meta span { font-size: .64rem; color: var(--muted); }
.landing-card .lcover { position: relative; }
.ltrial {
  position: absolute; top: 8px; left: 8px;
  font-size: .56rem; font-weight: 700; color: #0a0b10;
  background: var(--accent); border-radius: 999px; padding: 2px 8px;
}
.js-reveal [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }
@media (min-width: 900px) {
  .landing-hero-inner { grid-template-columns: 1.12fr .88fr; gap: 40px; }
  .landing-hero-media { justify-self: end; }
  .hero-player { width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-player, .hp-play, .hp-progress i { animation: none; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   Watch — free 3 episodes
   ========================================================= */
.watch-free-badge {
  font-style: normal; font-size: .56rem; font-weight: 700; color: #0a0b10;
  background: var(--accent); border-radius: 999px; padding: 1px 7px; white-space: nowrap;
}
.watch-free-note {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px; padding: 10px 12px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 77, 125, .14), rgba(139, 92, 246, .12));
  border: 1px solid rgba(255, 255, 255, .1);
}
.watch-free-note b { display: block; font-size: .8rem; }
.watch-free-note span { display: block; color: var(--muted); font-size: .68rem; }
.watch-free-note .btn-sm { flex: 0 0 auto; }
.promo-btn { color: #fff; border-color: rgba(255, 77, 125, .5); background: rgba(255, 77, 125, .14); }
.watch-free-ico { font-size: 2.2rem; }
