/* site-v2 (1 พ.ย. 2569): หน้าตาแพงแต่ไม่ทางการ — ใช้ร่วมทั้งธีมมืด/สว่าง */
:root{--gold:#d8b48a;--gold-soft:rgba(216,180,138,.18)}
body,input,select,textarea,button{font-family:-apple-system,BlinkMacSystemFont,'Sukhumvit Set','Noto Sans Thai','Anuphan',system-ui,sans-serif!important;letter-spacing:.1px}
h1,h2,h3,.brand,.btn,.shelf-title h2{font-family:'Prompt','Noto Sans Thai',sans-serif!important;font-weight:500!important;letter-spacing:.2px}
.brand{font-weight:600!important}
.shelf-title h2{font-size:1.08em!important}
.btn{border-radius:14px!important;font-weight:500!important;letter-spacing:.3px}
.btn:not(.btn-soft):not(.btn-book){background:linear-gradient(135deg,#ff5a8c,#e23d72)!important;box-shadow:0 8px 22px rgba(226,61,114,.28)!important;border-bottom:0!important}
.btn-book{background:linear-gradient(135deg,#f3d7a8,#d8b48a)!important;color:#2a1a08!important;box-shadow:0 8px 22px rgba(216,180,138,.22)!important}
.poster img,.poster-img img{border-radius:12px}
.poster h3{font-weight:500!important}
.tabbar{backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.tabbar a.on,.tabbar a.active{background:transparent!important;color:var(--pink)!important;position:relative}
.tabbar a.on::after,.tabbar a.active::after{content:"";position:absolute;top:3px;left:50%;width:18px;height:2px;margin-left:-9px;border-radius:2px;background:var(--pink)}
/* กล่องโปรโมหน้าแรก: ไม่ซ้อน ปุ่มเว้นระยะ */
.promo{box-shadow:0 10px 28px rgba(0,0,0,.25)!important;border:1px solid var(--line)!important;border-radius:20px!important}
.promo .btn{display:flex!important;align-items:center;justify-content:center;width:100%!important;max-width:340px;box-sizing:border-box;margin:0!important}
.promo .btn + .btn{margin-top:10px!important}
.promo .btn-soft{box-shadow:none!important}
/* หน้าเรื่อง */
.series-hero{display:grid!important;grid-template-columns:40% 1fr;grid-template-rows:auto auto auto 1fr;column-gap:14px;row-gap:0;align-items:start;position:relative;margin:-4px -18px 0!important;padding:22px 18px 0!important;isolation:isolate;overflow:hidden}
.series-hero::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--bg) center 30%/cover;filter:blur(28px) saturate(1.2);opacity:.55;transform:scale(1.2)}
.series-hero::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,transparent 0,var(--blush) 95%)}
.series-hero>div:not(.poster-img){display:contents}
.series-hero .poster-img{grid-column:1;grid-row:1 / span 4;margin:0!important;width:auto!important;max-width:none!important;border-radius:14px;overflow:hidden;box-shadow:0 12px 30px rgba(0,0,0,.35)}
.series-hero .poster-img img{width:100%;display:block;aspect-ratio:2/3;object-fit:cover}
.series-hero h1{grid-column:2;grid-row:1;font-size:1.35em!important;line-height:1.35!important;margin:2px 0 6px!important}
.series-hero .pen{grid-column:2;grid-row:2;margin:0 0 10px!important;font-size:.85em!important;gap:6px!important}
.series-hero .smeta{grid-column:2;grid-row:3;align-self:start;display:flex!important;flex-wrap:wrap;gap:6px!important;margin:0!important;font-size:.78em!important}
.series-hero .smeta>span{background:rgba(127,127,127,.12);border:1px solid var(--line);border-radius:999px;padding:3px 10px;white-space:nowrap;margin:0!important;backdrop-filter:blur(6px)}
.series-hero .smeta>span:empty{display:none}
.series-hero .smeta .ok{color:var(--gold)!important;border-color:var(--gold-soft)!important;background:var(--gold-soft)!important}
.series-hero .hook{grid-column:1 / -1;grid-row:5;margin:16px 0 8px!important;font-size:1em!important;line-height:1.6!important;padding:4px 0 4px 14px!important;border-left:3px solid var(--gold);background:transparent!important;font-weight:400!important;font-style:normal}
.series-hero .stags{grid-column:1 / -1;grid-row:6;display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;gap:6px!important;margin:0 0 4px!important;scrollbar-width:none;font-size:.8em}
.series-hero .stags::-webkit-scrollbar{display:none}
.series-hero .stags>span{flex:0 0 auto;border:1px solid var(--line);border-radius:999px;padding:3px 11px;margin:0!important;opacity:.8}
.hero-acts{display:grid!important;grid-template-columns:1.6fr 1fr;gap:10px;margin:18px 0 10px!important}
.hero-acts .btn{margin:0!important;min-height:50px;width:100%!important;box-sizing:border-box;justify-content:center}
.save-row{float:left;width:calc(50% - 5px);margin:0 0 12px!important}
.save-row .heart-btn{width:100%!important;min-height:46px;margin:0!important;font-size:.9em!important;padding:0 10px!important;box-sizing:border-box;white-space:nowrap;gap:6px!important}
.share-btn{float:right;width:calc(50% - 5px)!important;min-height:46px;margin:0 0 12px!important;font-size:.9em!important;padding:0 10px!important;box-sizing:border-box;white-space:nowrap;display:flex!important;align-items:center;justify-content:center;gap:6px}
.share-btn>span{display:none}
.share-btn::after{content:"แชร์ให้เพื่อน"}
.secret-card,.series-swipe{clear:both}
.secret-card{padding:12px 14px!important;gap:12px!important;margin-top:6px!important}
.secret-card b{font-size:.95em!important}
.secret-card small{font-size:.8em!important;line-height:1.45!important}
/* ปุ่มสลับธีม */
.theme-tg svg{width:20px;height:20px}
html.light .series-hero .smeta .ok{color:#9a6a2c!important;background:rgba(216,180,138,.25)!important}

/* ลายน้ำบนเว็บ (แทนการฝังในคลิป) */
.wm-brand{position:absolute;inset:0;pointer-events:none;z-index:6;color:#fff;transition:opacity .35s}
.wm-brand .wb-top{position:absolute;top:14px;left:0;right:0;display:flex;align-items:center;justify-content:center;gap:12px;opacity:.92}
body.watching .wm-brand .wb-top{top:calc(env(safe-area-inset-top) + 64px)}
.wm-brand .wb-logo{width:38px;height:38px;border-radius:50%;background:linear-gradient(135deg,#ff5a8c,#e23d72);display:grid;place-items:center;box-shadow:0 2px 10px rgba(0,0,0,.35);flex:0 0 auto}
.wm-brand .wb-logo svg{width:22px;height:22px}
.wm-brand .wb-bar{width:1.5px;height:32px;background:rgba(255,255,255,.85);flex:0 0 auto}
.wm-brand .wb-series{font:500 16px/1.25 'Prompt',sans-serif;max-width:62%;text-shadow:0 1px 6px rgba(0,0,0,.6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wm-brand .wb-bottom{position:absolute;left:12px;right:12px;bottom:56px;text-align:center;opacity:.9}
body.watching .wm-brand .wb-bottom{bottom:calc(env(safe-area-inset-bottom) + 118px)}
.wm-brand .wb-title{font-family:'Playpen Sans Thai',sans-serif;font-weight:200;font-size:clamp(22px,8vw,40px);line-height:1.35;text-shadow:0 2px 10px rgba(0,0,0,.55);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.wm-brand .wb-where{margin-top:4px;font:600 12.5px/1.4 'Prompt',sans-serif;letter-spacing:.2px;text-shadow:0 1px 6px rgba(0,0,0,.7)}
body.ui-idle .wm-brand{opacity:.55}

/* ตัวหนังสือเบาลง เล็กลง บรรทัดเดียว (1 พ.ย. 22:35) */
.series-hero h1{font-size:1.12em!important;font-weight:500!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.series-hero>div:not(.poster-img)>*{min-width:0}
.poster h3,.poster h3 a{font-size:.86em!important;font-weight:500!important;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;display:block!important;-webkit-line-clamp:unset!important}
.shelf-title h2{font-size:1em!important;font-weight:500!important}
html.light body{color:#5a3f4c}
html.light h1,html.light h2,html.light h3,html.light .poster h3,html.light .poster h3 a{color:#4a2e3b!important}
html.light .series-hero .hook{color:#c2477a!important}

/* Top 10 ตัวเลขทอง */
.hit-row .hit-rank{position:absolute!important;left:6px!important;bottom:2px!important;top:auto!important;background:none!important;box-shadow:none!important;border:0!important;padding:0!important;width:auto!important;height:auto!important;font:600 46px/1 'Prompt',sans-serif!important;color:transparent!important;-webkit-text-stroke:1.5px rgba(216,180,138,.95);text-shadow:0 2px 10px rgba(0,0,0,.45)}
.hit-row .hit-rank.top{-webkit-text-stroke:0;color:#e9c99c!important}
/* ท้ายเว็บ 2 บรรทัด */
footer.legal{text-align:center;padding:18px 0 8px!important;font-size:.78em!important;opacity:.85}
footer.legal p{margin:4px 0!important}
footer.legal .lg-links a{color:inherit!important;text-decoration:none;margin:0 2px}
footer.legal .lg-copy{opacity:.7}
.tabbar{grid-template-columns:repeat(6,1fr)!important;display:grid!important}
.tabbar a{min-width:0!important;padding-left:2px!important;padding-right:2px!important}

/* ป้าย "ฟรี X ตอน" บนโปสเตอร์ อ่านชัดทุกธีม */
.poster-img .sticker{background:rgba(20,8,16,.72)!important;color:#ffd98a!important;border:1px solid rgba(255,217,138,.45)!important;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);font-weight:600!important;text-shadow:none!important;box-shadow:0 2px 8px rgba(0,0,0,.25)!important}

/* ปุ่มดูต่อ/อ่านฟรี อยู่ข้างโปสเตอร์ */
.series-hero .hero-acts{grid-column:2;grid-row:4;align-self:end;display:flex!important;flex-direction:column;gap:8px!important;margin:12px 0 0!important}
.series-hero .hero-acts .btn{min-height:44px!important;font-size:.92em!important;padding:0 10px!important;white-space:nowrap}
.series-hero .hook{margin-top:18px!important}
.btn-soon{opacity:.75;cursor:default;pointer-events:none}
.series-hero .sbadges{grid-column:2;grid-row:4;align-self:start;margin:8px 0 0!important;font-size:.85em}

/* หน้าบัญชีแบบเรียบ */
.acc-prof{display:flex;align-items:center;gap:12px;padding:14px;border:1px solid var(--line);border-radius:18px;background:var(--card);margin:0 0 14px}
.acc-prof .ap-av{width:46px;height:46px;border-radius:50%;background:linear-gradient(135deg,#ff5a8c,#e23d72);color:#fff;display:grid;place-items:center;font:600 18px 'Prompt',sans-serif;flex:0 0 auto}
.acc-prof .ap-txt{flex:1;min-width:0;display:flex;flex-direction:column}
.acc-prof .ap-txt b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acc-prof .ap-txt small{opacity:.7;font-size:.82em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acc-prof .ap-copy{border:1px solid var(--line);background:transparent;color:var(--pink);border-radius:999px;padding:6px 12px;font-size:.8em;white-space:nowrap;cursor:pointer}
.acc-menu{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:18px;background:var(--card);overflow:hidden;margin:0 0 14px}
.acc-menu>a,.acc-menu>button{display:flex;align-items:center;gap:12px;padding:15px 16px;color:inherit!important;text-decoration:none;background:none;border:0;border-bottom:1px solid var(--line);font:inherit;text-align:left;width:100%;cursor:pointer}
.acc-menu>:last-child{border-bottom:0}
.acc-menu svg{opacity:.75;flex:0 0 auto}
.acc-menu span{flex:1}
.acc-menu .am-note{opacity:.55;font-size:.8em}
.acc-menu .am-chev{flex:0 0 auto;opacity:.45;font-size:1.3em;line-height:1}
.acc-menu .am-out{color:#e5486f!important}
.am-sw{width:42px;height:24px;border-radius:999px;background:rgba(127,127,127,.35);position:relative;flex:0 0 auto;transition:background .2s}
.am-sw::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .2s}
.am-sw.on{background:var(--pink)}.am-sw.on::after{transform:translateX(18px)}
.acc-more{border:1px solid var(--line);border-radius:18px;padding:4px 16px;background:var(--card);margin:0 0 14px}
.acc-more>summary{padding:12px 0;cursor:pointer;opacity:.8;font-size:.92em}
.acc-more[open]>summary{border-bottom:1px solid var(--line);margin-bottom:12px}

.hist{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:18px;background:var(--card);overflow:hidden}
.hist-row{display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid var(--line);color:inherit!important;text-decoration:none}
.hist-row:last-child{border-bottom:0}
.hist-row img{width:42px;height:60px;object-fit:cover;border-radius:8px;flex:0 0 auto}
.hist-row .dev-ic{width:42px;height:42px;border-radius:12px;background:rgba(127,127,127,.12);display:grid;place-items:center;flex:0 0 auto}
.hist-row .h-txt{flex:1;min-width:0;display:flex;flex-direction:column}
.hist-row .h-txt b{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hist-row .h-txt small{opacity:.65;font-size:.8em}
.h-st{font-size:.75em;padding:3px 10px;border-radius:999px;white-space:nowrap;background:rgba(127,127,127,.15)}
.h-st.st-approved{background:rgba(60,207,142,.15);color:#2fae76}
.h-st.st-pending{background:rgba(216,180,138,.2);color:#c39a62}
.h-st.st-rejected{background:rgba(229,72,111,.15);color:#e5486f}
.h-rm{border:1px solid rgba(229,72,111,.5);color:#e5486f;background:none;border-radius:999px;padding:5px 12px;font-size:.8em;cursor:pointer}

/* ป้ายฟรี/ลด: พื้นทอง ตัวขาว (ทุกที่) */
.sticker,.poster-img .sticker,.spot .sticker{background:linear-gradient(135deg,#f0b84a,#d9952a)!important;color:#fff!important;border:0!important;text-shadow:0 1px 2px rgba(120,60,0,.35)!important;font-weight:600!important;box-shadow:0 3px 10px rgba(217,149,42,.35)!important}
.ptag.is-promo:not(.big),.ptag.is-promo:not(.big) *{color:#fff!important}
.ptag.is-promo:not(.big){background:linear-gradient(135deg,#f0b84a,#d9952a)!important;border:0!important}
.wm-brand .wb-title{font-size:clamp(20px,6.4vw,32px)!important;white-space:normal}
body.watching .wm-brand .wb-bottom{right:76px;left:14px}
.wm-brand .wb-title{font-size:clamp(16px,4.8vw,22px)!important;line-height:1.3!important}
.wm-brand .wb-series{font-size:13px!important}
.wm-brand .wb-logo{width:30px!important;height:30px!important}.wm-brand .wb-logo svg{width:17px!important;height:17px!important}
.wm-brand .wb-bar{height:24px!important}
.wm-brand .wb-where{font-size:10.5px!important}
body.watching .wm-brand .wb-bottom{left:16px!important;right:16px!important;text-align:center}
#wm,.stage .wm{opacity:.16!important;font-size:10px!important;transition:opacity 1.5s ease!important;text-shadow:none!important}
#wm.fade{opacity:0!important}
.wm-brand .wb-app{font:600 13px/1 'Prompt',sans-serif;letter-spacing:.3px;text-shadow:0 1px 6px rgba(0,0,0,.6);margin-left:-4px}
.wm-brand .wb-top{gap:9px!important}
.wm-brand .wb-series{font-weight:400!important;opacity:.9;max-width:52%!important}
.wm-brand .wb-bottom{opacity:.5!important}
body.ui-idle .wm-brand .wb-bottom{opacity:.35!important}

/* แก้ป้ายเรื่องฮิตทับปุ่ม */
.series-hero{grid-template-rows:auto auto auto auto 1fr!important}
.series-hero .poster-img{grid-row:1 / span 5!important}
.series-hero .sbadges{grid-column:2!important;grid-row:4!important;align-self:start;margin:8px 0 0!important}
.series-hero .hero-acts{grid-column:2!important;grid-row:5!important;align-self:end}
.series-hero .hook{grid-row:6!important}
.series-hero .stags{grid-row:7!important}

.series-hero+.share-btn{float:none;width:100%!important;margin:12px 0 0!important}

/* ---- +18 ---- */
.b18{display:inline-flex;align-items:center;justify-content:center;padding:2px 7px;border-radius:7px;background:#c2185b;color:#fff;font:700 .72rem/1.2 var(--font-head,inherit);letter-spacing:.02em;white-space:nowrap}
.b18-big{font-size:1rem;padding:6px 12px;border-radius:10px}
.b18-p{position:absolute;top:6px;left:6px;z-index:2;font-size:.62rem;padding:2px 6px;box-shadow:0 2px 6px rgba(0,0,0,.25)}
.x18{margin:18px 0 6px;padding:14px;border-radius:18px;background:linear-gradient(160deg,rgba(194,24,91,.10),rgba(194,24,91,.03));border:1px solid rgba(194,24,91,.25)}
.x18-head{display:flex;align-items:center;gap:8px}.x18-head h2{margin:0;font-size:1.05rem}
.x18-note{margin:4px 0 10px;font-size:.8rem;opacity:.75}
.x18-list{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.x18-item{display:block;text-decoration:none;color:inherit}
.x18-thumb{position:relative;display:block;aspect-ratio:9/16;border-radius:12px;overflow:hidden;background:#2a1020}
.x18-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.x18-item.lock img{filter:blur(10px) brightness(.7);transform:scale(1.15)}
.x18-thumb i{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff}
.x18-t{display:block;margin-top:4px;font-size:.74rem;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.x18-gift{display:flex;align-items:center;justify-content:center;gap:6px;margin:6px 0 10px;font-size:.86rem;font-weight:600;color:#c2185b}
.x18-gate{max-width:440px;margin:16px auto}.x18-gate h2{margin:12px 0 6px}
.x18-warn{display:flex;gap:12px;align-items:center;padding:12px;border-radius:14px;background:rgba(194,24,91,.08);margin-bottom:14px}
.x18-warn b{display:block;color:#c2185b}.x18-warn small{display:block;opacity:.75;margin-top:2px}
.x18-age input{width:100%;box-sizing:border-box;font-size:1.2rem;text-align:center;padding:12px;border-radius:12px;margin:6px 0 10px}
.x18-err{color:#c2185b;margin:0 0 8px}
.x18-player{position:relative;max-width:440px;margin:0 auto;border-radius:16px;overflow:hidden;background:#000}
.x18-player video{display:block;width:100%;max-height:78vh;background:#000}
.x18-wm{position:absolute;top:10px;right:12px;font-size:10px;color:#fff;opacity:.18;pointer-events:none}
.x18-cap{display:flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:440px;margin:10px auto 0}.x18-cap small{opacity:.7;width:100%}

.x18-player.stage{position:relative;max-width:440px;margin:0 auto;border-radius:16px;overflow:hidden;background:#000;aspect-ratio:auto;height:auto}
.x18-player .wm-brand{bottom:46px}
.x18-player .wb-bottom{bottom:46px}

.x18-pop{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(20,6,14,.72);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.x18-pop[hidden]{display:none}
.x18-pop-box{width:100%;max-width:360px;padding:22px 18px 16px;border-radius:20px;background:var(--card,#fff);color:inherit;text-align:center;box-shadow:0 20px 50px rgba(0,0,0,.35)}
.x18-pop-box h2{margin:12px 0 8px;font-size:1.1rem}
.x18-pop-box p{margin:0 0 8px;font-size:.9rem;line-height:1.55}
.x18-pop-sub{opacity:.7;font-size:.82rem!important;margin-bottom:14px!important}

.x18-player.stage{aspect-ratio:9/16;width:min(100%,440px,calc(78vh*9/16));height:auto!important;max-height:none}
.x18-player.stage video{position:absolute;inset:0;width:100%;height:100%;max-height:none;object-fit:contain}

.x18-player.stage{aspect-ratio:9/16;width:min(100%,440px,calc(78vh*9/16));height:auto!important;max-height:none}
.x18-player.stage video{position:absolute;inset:0;width:100%;height:100%;max-height:none;object-fit:contain}

.x18-show{display:flex;align-items:center;gap:8px;width:100%;margin:18px 0 6px;padding:12px 14px;border-radius:16px;border:1px dashed rgba(194,24,91,.4);background:rgba(194,24,91,.05);color:inherit;font:inherit;font-size:.86rem;text-align:left;cursor:pointer}
.x18-show[hidden],.x18[hidden],.x18-gift[hidden]{display:none!important}
