:root {
  --bg: #0b0b0d;
  --bg-2: #141418;
  --bg-3: #1e1e24;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #f5b301;
  --accent-2: #ff5a1f;
  --ok: #22c55e;
  --line: rgba(255,255,255,.08);
  --radius: 6px;
  --gutter: 4%;
  font-family: "Anuphan", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
.muted { color: var(--muted); }

/* ---------- NAV ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 68px;
  display: flex; align-items: center; gap: 28px; padding: 0 var(--gutter);
  background: linear-gradient(180deg, rgba(0,0,0,.85), transparent);
  transition: background .3s;
}
.nav.solid { background: rgba(11,11,13,.97); box-shadow: 0 1px 0 var(--line); }
.brand { font-family: "Bebas Neue", sans-serif; font-size: 34px; letter-spacing: 1px; line-height: 1; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.brand span { color: var(--accent); }
.brand small { font-family: "Anuphan"; font-size: 10px; letter-spacing: 3px; color: var(--muted); font-weight: 600; }
.brand.small { font-size: 26px; justify-content: center; }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav-links a, .dd-btn { color: #d4d4d8; transition: color .2s; }
.nav-links a:hover, .dd-btn:hover { color: #fff; }
.nav-links a.active { color: #fff; font-weight: 600; }
.nav-studio { border: 1px solid var(--accent); color: var(--accent) !important; padding: 3px 10px; border-radius: 99px; }
.dropdown { position: relative; }
.dd-menu {
  position: absolute; top: 140%; left: -10px; display: none; grid-template-columns: repeat(2, 140px);
  background: rgba(15,15,18,.98); border: 1px solid var(--line); padding: 12px; border-radius: var(--radius); gap: 4px;
}
.dropdown:hover .dd-menu, .dropdown.open .dd-menu { display: grid; }
.dd-menu a { padding: 6px 8px; border-radius: 4px; }
.dd-menu a:hover { background: var(--bg-3); }
.nav-right { margin-left: auto; }
.search { display: flex; align-items: center; border: 1px solid transparent; transition: .25s; }
.search.open { border-color: #fff; background: rgba(0,0,0,.75); }
.search-btn { font-size: 22px; padding: 4px 8px; }
.search input { width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: #fff; font: inherit; font-size: 14px; transition: width .25s; }
.search.open input { width: 220px; padding: 6px 8px 6px 0; }
.nav-toggle { display: none; font-size: 22px; }

/* ---------- HERO ---------- */
.hero { position: relative; height: 82vh; min-height: 520px; display: flex; align-items: flex-end; padding: 0 var(--gutter) 14vh; overflow: hidden; }
.hero-art { position: absolute; inset: 0; }
.hero-art::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,11,13,.95) 0%, rgba(11,11,13,.4) 45%, transparent 70%),
              linear-gradient(0deg, var(--bg) 0%, transparent 35%); }
.hero-content { position: relative; max-width: 560px; }
.hero-tag { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; letter-spacing: 3px; color: var(--accent); font-weight: 700; }
.hero h1 { font-size: clamp(40px, 6vw, 84px); line-height: 1.05; margin: 10px 0 6px; text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.hero .en { font-family: "Bebas Neue"; font-size: 22px; letter-spacing: 2px; color: #ddd; }
.hero p { font-size: 17px; color: #e4e4e7; margin: 14px 0 22px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: #d4d4d8; }
.meta .match { color: var(--ok); font-weight: 700; }
.badge { border: 1px solid rgba(255,255,255,.4); padding: 0 6px; font-size: 12px; border-radius: 3px; }
.badge.new { background: var(--accent); color: #000; border: 0; font-weight: 700; }
.badge.soon { background: #fff; color: #000; border: 0; font-weight: 700; }
.badge.short { background: var(--accent-2); border: 0; font-weight: 700; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border-radius: var(--radius); font-weight: 600; font-size: 16px; transition: .15s; }
.btn-play { background: #fff; color: #000; }
.btn-play:hover { background: #ffffffcc; }
.btn-ghost { background: rgba(109,109,110,.7); color: #fff; }
.btn-ghost:hover { background: rgba(109,109,110,.5); }
.btn-accent { background: var(--accent); color: #000; }
.btn-sm { padding: 6px 14px; font-size: 14px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); display: inline-grid; place-items: center; font-size: 16px; background: rgba(20,20,20,.6); }
.icon-btn:hover { border-color: #fff; }
.icon-btn.on { border-color: var(--accent); color: var(--accent); }

/* ---------- POSTER ART (generated) ---------- */
.art { position: absolute; inset: 0; background: radial-gradient(120% 90% at 75% 20%, var(--c1) 0%, var(--c2) 55%, #000 100%); overflow: hidden; }
.art::before { content: ""; position: absolute; inset: -20%; opacity: .35;
  background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255,255,255,.06) 22px 23px); }
.art .glyph { position: absolute; right: -4%; bottom: -12%; font-family: "Bebas Neue"; font-size: 260px; line-height: 1; color: rgba(255,255,255,.08); white-space: nowrap; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- ROWS ---------- */
.rows { position: relative; z-index: 2; margin-top: -9vh; padding-bottom: 40px; }
.page { padding: 100px 0 40px; min-height: 80vh; }
.page-head { padding: 0 var(--gutter); margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 34px; }
.row { margin: 0 0 34px; }
.row-head { display: flex; align-items: baseline; gap: 12px; padding: 0 var(--gutter); margin-bottom: 10px; }
.row-head h2 { font-size: 20px; margin: 0; }
.row-head a { font-size: 13px; color: var(--accent); opacity: 0; transition: .2s; }
.row:hover .row-head a { opacity: 1; }
.track-wrap { position: relative; }
.track { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px var(--gutter) 14px; scrollbar-width: none; scroll-padding: 0 var(--gutter); }
.track::-webkit-scrollbar { display: none; }
.arrow { position: absolute; top: 6px; bottom: 14px; width: var(--gutter); z-index: 3; background: rgba(0,0,0,.5); font-size: 30px; opacity: 0; transition: .2s; }
.track-wrap:hover .arrow { opacity: 1; }
.arrow.l { left: 0; } .arrow.r { right: 0; }

.card { position: relative; flex: 0 0 calc((100% - 5 * 8px) / 6.3); aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; scroll-snap-align: start; cursor: pointer; background: var(--bg-3); transition: transform .25s, box-shadow .25s; }
.card:hover { transform: scale(1.06); z-index: 4; box-shadow: 0 12px 30px rgba(0,0,0,.7); }
.card .t { position: absolute; left: 10px; right: 10px; bottom: 8px; font-weight: 700; font-size: 16px; line-height: 1.2; text-shadow: 0 2px 8px #000; }
.card .t small { display: block; font-family: "Bebas Neue"; font-size: 13px; letter-spacing: 1px; color: #ddd; font-weight: 400; }
.card .corner { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.card .logo-d { position: absolute; top: 6px; right: 8px; font-family: "Bebas Neue"; font-size: 18px; color: var(--accent); }
.card.vertical { flex-basis: calc((100% - 6 * 8px) / 7.3); aspect-ratio: 9/16; }
.card.vertical .t { font-size: 14px; }
.card .dur { position: absolute; right: 8px; bottom: 8px; font-size: 11px; background: rgba(0,0,0,.7); padding: 1px 5px; border-radius: 3px; }
.card .date { position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; background: linear-gradient(0deg, rgba(0,0,0,.9), transparent); font-size: 12px; color: var(--accent); font-weight: 600; }

/* Top 10 */
.top10 .card { flex-basis: calc((100% - 4 * 8px) / 5.3); aspect-ratio: auto; height: auto; overflow: visible; background: none; display: flex; align-items: flex-end; }
.top10 .card:hover { transform: none; box-shadow: none; }
.top10 .num { font-family: "Bebas Neue"; font-size: clamp(90px, 11vw, 170px); line-height: .8; color: var(--bg); -webkit-text-stroke: 3px #595959; margin-right: -14px; }
.top10 .poster { position: relative; flex: 1; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; transition: transform .25s; }
.top10 .card:hover .poster { transform: scale(1.05); }

/* ---------- GRID / CHIPS ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 var(--gutter); margin-bottom: 22px; }
.chip { border: 1px solid var(--line); background: var(--bg-2); padding: 6px 14px; border-radius: 99px; font-size: 14px; }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px 8px; padding: 0 var(--gutter); }
.grid .card { flex: none; width: 100%; }
.grid.vertical { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.empty { padding: 40px var(--gutter); color: var(--muted); }

/* ---------- COMING SOON LIST ---------- */
.coming-list { padding: 0 var(--gutter); display: grid; gap: 28px; max-width: 1100px; }
.coming-item { display: grid; grid-template-columns: 90px 1fr; gap: 18px; }
.cal { text-align: center; }
.cal .m { font-size: 14px; color: var(--muted); }
.cal .d { font-family: "Bebas Neue"; font-size: 54px; line-height: 1; }
.cal .cd { font-size: 12px; color: var(--accent); }
.coming-card { background: var(--bg-2); border-radius: var(--radius); overflow: hidden; }
.coming-card .banner { position: relative; aspect-ratio: 21/9; }
.coming-card .banner h3 { position: absolute; left: 20px; bottom: 14px; margin: 0; font-size: 32px; text-shadow: 0 2px 12px #000; }
.coming-card .body { padding: 16px 20px 20px; display: grid; gap: 10px; }
.coming-card .body .top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------- SHORTS FEED ---------- */
.shorts-page { padding: 84px 0 30px; }
.shorts-layout { display: grid; grid-template-columns: 1fr minmax(0, 420px) 1fr; gap: 24px; padding: 0 var(--gutter); }
.feed { height: calc(100vh - 110px); overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; border-radius: 14px; }
.feed::-webkit-scrollbar { display: none; }
.reel { position: relative; height: 100%; aspect-ratio: 9/16; max-width: 100%; margin: 0 auto 12px; border-radius: 14px; overflow: hidden; scroll-snap-align: start; }
.reel .hook { position: absolute; top: 18%; left: 8%; right: 8%; text-align: center; font-size: 26px; font-weight: 700; text-shadow: 0 3px 14px #000; }
.reel .info { position: absolute; left: 14px; right: 70px; bottom: 18px; }
.reel .info h3 { margin: 4px 0; font-size: 18px; }
.reel .info p { margin: 0 0 10px; font-size: 13px; color: #ddd; }
.reel .side { position: absolute; right: 10px; bottom: 24px; display: grid; gap: 14px; justify-items: center; font-size: 11px; }
.reel .side .icon-btn { width: 44px; height: 44px; font-size: 18px; }
.reel .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 60px; opacity: .8; }
.shorts-side h3 { margin: 0 0 10px; font-size: 16px; }
.shorts-side .chips { padding: 0; }

/* ---------- MODAL ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.75); }
.modal-card { position: relative; width: min(880px, 94vw); max-height: 92vh; overflow-y: auto; margin: 4vh auto; background: var(--bg-2); border-radius: 10px; box-shadow: 0 20px 80px #000; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 5; width: 36px; height: 36px; border-radius: 50%; background: #181818; font-size: 16px; }
.m-hero { position: relative; aspect-ratio: 16/9; max-height: 470px; width: 100%; }
.m-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg-2), transparent 55%); pointer-events: none; }
.m-hero .m-title { position: absolute; left: 40px; bottom: 34px; z-index: 2; max-width: 70%; }
.m-hero h2 { font-size: clamp(28px, 4vw, 48px); margin: 0 0 4px; line-height: 1.1; }
.m-hero .en { font-family: "Bebas Neue"; letter-spacing: 2px; font-size: 18px; color: #ddd; margin-bottom: 16px; }
.m-hero iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }
.player-ph { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; text-align: center; background: rgba(0,0,0,.85); padding: 20px; }
.m-body { padding: 4px 40px 36px; }
.m-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; }
.m-cols p { margin: 12px 0; }
.kv { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.kv b { color: var(--text); font-weight: 500; }
.m-section { margin-top: 30px; }
.m-section h3 { font-size: 20px; margin: 0 0 12px; }
.short-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.short-list .card { flex: none; width: 100%; }
.short-list .card .date { color: #fff; font-weight: 500; }
.short-list .card .date b { color: var(--accent); display: block; }

/* Distribution table */
.dist { width: 100%; border-collapse: collapse; font-size: 14px; }
.dist th, .dist td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.dist th { color: var(--muted); font-weight: 500; font-size: 12px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st.live { color: var(--ok); background: rgba(34,197,94,.12); }
.st.plan { color: var(--accent); background: rgba(245,179,1,.12); }
.st.na { color: #71717a; background: rgba(113,113,122,.12); }
.caption-box { background: var(--bg); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px; white-space: pre-wrap; font-size: 14px; margin: 0 0 10px; }
.table-scroll { overflow-x: auto; }

/* Social hub */
.hub-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; padding: 0 var(--gutter); margin-bottom: 26px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.stat .n { font-family: "Bebas Neue"; font-size: 40px; line-height: 1; }
.stat .l { color: var(--muted); font-size: 13px; }
.hub-wrap { padding: 0 var(--gutter); }
.hub-table td:first-child { cursor: pointer; font-weight: 600; }
.hub-table td:first-child:hover { color: var(--accent); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); padding: 0 var(--gutter); margin-bottom: 14px; }

/* ---------- FOOTER / TOAST ---------- */
.footer { text-align: center; padding: 50px var(--gutter) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer-social { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.footer-social a { border: 1px solid var(--line); padding: 6px 12px; border-radius: 99px; color: var(--text); font-size: 13px; }
.footer-social a:hover { border-color: var(--accent); color: var(--accent); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; background: #fff; color: #000; padding: 10px 18px; border-radius: 99px; font-weight: 600; font-size: 14px; transition: .25s; z-index: 200; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1100px) {
  .card { flex-basis: calc((100% - 3 * 8px) / 4.3); }
  .card.vertical { flex-basis: calc((100% - 4 * 8px) / 5.3); }
  .top10 .card { flex-basis: calc((100% - 2 * 8px) / 3.3); }
  .shorts-layout { grid-template-columns: minmax(0, 420px) 1fr; }
  .shorts-layout > .shorts-side:first-child { display: none; }
}
@media (max-width: 860px) {
  .nav { gap: 12px; }
  .nav-toggle { display: block; order: -1; }
  .nav-links { position: fixed; top: 68px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: rgba(11,11,13,.98); padding: 8px 16px 16px; display: none; border-bottom: 1px solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-links > a, .dropdown { padding: 10px 0; width: 100%; }
  .dd-menu { position: static; grid-template-columns: repeat(2, 1fr); margin-top: 8px; }
  .search.open input { width: 140px; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .brand { font-size: 28px; }
  .brand small { display: none; }
  .hero { height: 72vh; padding-bottom: 12vh; }
  .hero p { font-size: 15px; }
  .card { flex-basis: calc((100% - 8px) / 2.3); }
  .card.vertical { flex-basis: calc((100% - 2 * 8px) / 3.3); }
  .top10 .card { flex-basis: calc((100% - 8px) / 2.2); }
  .arrow { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid.vertical { grid-template-columns: repeat(3, 1fr); }
  .shorts-layout { grid-template-columns: 1fr; }
  .shorts-layout > .shorts-side { display: none; }
  .feed { height: calc(100vh - 100px); }
  .modal-card { width: 100%; margin: 0; max-height: 100vh; border-radius: 0; }
  .m-hero .m-title { left: 16px; bottom: 16px; }
  .m-body { padding: 4px 16px 30px; }
  .m-cols { grid-template-columns: 1fr; gap: 0; }
  .coming-item { grid-template-columns: 1fr; gap: 8px; }
  .cal { display: flex; gap: 10px; align-items: baseline; text-align: left; }
  .cal .d { font-size: 34px; }
  .coming-card .banner h3 { font-size: 24px; }
}
