@font-face { font-family: "Fredoka"; src: url("/assets/fonts/fredoka.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Mitr"; src: url("/assets/fonts/mitr.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("/assets/fonts/rubik.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #0D0724;
  --bg-2: #160C38;
  --surface: rgba(255, 255, 255, .055);
  --surface-2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .13);
  --text: #F4F1FF;
  --muted: #B9B0DB;
  --gold: #FFD84D;
  --gold-deep: #E0A100;
  --pink: #FF6FB5;
  --cyan: #5CD6FF;
  --green: #4ADE80;
  --radius: 22px;
  --display: "Fredoka", "Mitr", "Rubik", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", "Noto Sans", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 400 17px/1.6 var(--body); overflow-x: hidden; background: var(--bg); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: radial-gradient(60vmax 45vmax at 85% -5%, rgba(124, 58, 237, .35), transparent 70%), radial-gradient(55vmax 40vmax at -5% 40%, rgba(255, 111, 181, .14), transparent 70%), radial-gradient(60vmax 40vmax at 100% 95%, rgba(92, 214, 255, .12), transparent 70%); }
body { background: transparent; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--cyan); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -.01em; }
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3 { font-weight: 500; line-height: 1.28; letter-spacing: 0; }
html[lang="ru"] h1, html[lang="ru"] h2, html[lang="ru"] h3 { font-weight: 700; }
button { font: inherit; color: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: min(100%, 1160px); margin: 0 auto; padding: 0 16px; }
.section { padding-block: 56px; }
.eyebrow { display: inline-block; margin-bottom: 10px; color: var(--gold); font: 600 14px/1.2 var(--display); letter-spacing: .08em; text-transform: uppercase; }
html[lang="th"] .eyebrow { letter-spacing: 0; font-weight: 500; }
.title { font-size: clamp(30px, 6vw, 52px); }
.lead { max-width: 40em; margin: 10px 0 26px; color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* Top bar */
.bar { position: relative; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(13, 7, 36, .78); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; width: min(100%, 1160px); margin: 0 auto; padding: 8px 16px; }
.brand img { width: 92px; }
.links { order: 3; display: flex; gap: 2px; width: calc(100% + 16px); margin: 0 -8px; overflow-x: auto; scrollbar-width: none; }
.links::-webkit-scrollbar { display: none; }
.links a { flex: none; padding: 8px 12px; border-radius: 999px; color: var(--text); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.links a:hover { background: var(--surface-2); }
.links a[aria-current="page"] { background: var(--surface-2); color: var(--gold); }
.langs { display: flex; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.langs a, .langs button { display: grid; place-items: center; min-width: 40px; min-height: 34px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--text); font-size: 13px; font-weight: 700; text-decoration: none; }
.langs [aria-pressed="true"], .langs [aria-current="true"] { background: var(--gold); color: #1A1033; }

/* Buttons */
.cta, .sticky, .bar-play { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 16px; background: linear-gradient(180deg, #FFE680, var(--gold)); box-shadow: inset 0 -4px 0 var(--gold-deep), 0 10px 30px rgba(255, 216, 77, .28); color: #1A1033; font-family: var(--display); font-weight: 600; text-decoration: none; transition: transform .12s, box-shadow .12s; }
html[lang="th"] .cta, html[lang="th"] .sticky, html[lang="th"] .bar-play { font-weight: 500; }
html[lang="ru"] .cta, html[lang="ru"] .sticky, html[lang="ru"] .bar-play { font-weight: 700; }
.cta { min-height: 62px; width: min(100%, 420px); padding: 10px 18px; font-size: clamp(20px, 5vw, 25px); }
.cta:hover, .sticky:hover, .bar-play:hover { transform: translateY(-2px); box-shadow: inset 0 -4px 0 var(--gold-deep), 0 14px 36px rgba(255, 216, 77, .4); }
.cta:active, .sticky:active, .bar-play:active { transform: translateY(1px); }
.ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; transition: background .12s; }
.ghost:hover { background: var(--surface-2); }
.sticky { position: fixed; z-index: 15; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); min-height: 58px; font-size: 21px; transform: translateY(170%); transition: transform .2s; }
.sticky.show { transform: none; }
.has-sticky { padding-bottom: 80px; }

/* Hero */
.hero { position: relative; overflow: hidden; text-align: center; }
.hero-art { position: absolute; inset: 0 0 auto 0; height: clamp(330px, 88vw, 720px); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.hero-art { -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%); mask-image: linear-gradient(180deg, #000 72%, transparent 100%); }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 7, 36, 0) 42%, rgba(13, 7, 36, .86) 74%, var(--bg) 100%); }
.hero-in { position: relative; display: flex; flex-direction: column; align-items: center; padding: 14px 16px 12px; }
.hero-logo { width: min(62vw, 330px); filter: drop-shadow(0 8px 18px rgba(20, 8, 60, .45)); }
.hero h1 { margin-top: clamp(120px, 37vw, 300px); font-size: clamp(30px, 7.6vw, 62px); background: linear-gradient(180deg, #FFF3B8, var(--gold) 60%, #FFB84D); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 34em; margin: 10px 0 16px; font-size: clamp(16px, 2.3vw, 19px); }
.hero-note { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.live { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.live li { display: flex; align-items: center; gap: 7px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; color: var(--muted); }
.live b { color: var(--text); font: 600 16px/1.2 "Fredoka", var(--display); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: ping 2s infinite; }
@keyframes ping { to { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); } }

.code { display: flex; align-items: center; gap: 8px; width: min(100%, 420px); min-height: 56px; margin-top: 14px; padding: 8px 8px 8px 12px; border: 1.5px dashed rgba(255, 216, 77, .75); border-radius: 16px; background: var(--surface); color: var(--text); text-align: left; }
.code-gift { font-size: 24px; }
.code-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; color: var(--muted); }
.code-text b { display: block; color: var(--gold); font: 600 20px/1.2 "Fredoka", var(--display); letter-spacing: .05em; }
.code-copy { flex: none; padding: 8px 10px; border-radius: 10px; background: var(--text); color: #1A1033; font-size: 13px; font-weight: 700; }

/* Cards */
.card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
a.card { display: block; color: inherit; text-decoration: none; transition: transform .16s, border-color .16s, background .16s; }
a.card:hover { transform: translateY(-3px); border-color: rgba(255, 216, 77, .55); background: var(--surface-2); }
.clip-grid { display: grid; gap: 14px; }
.frame { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.frame video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tag { position: absolute; top: 10px; left: 10px; padding: 3px 11px; border-radius: 999px; background: rgba(13, 7, 36, .78); font-size: 13px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0; padding: 0; list-style: none; text-align: center; }
.stats li { display: flex; flex-direction: column; justify-content: center; padding: 14px 6px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.stats b { color: var(--gold); font: 600 clamp(26px, 5vw, 36px)/1.1 "Fredoka", var(--display); }
.stats span { color: var(--muted); font-size: 14px; }

.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; z-index: 1; top: 10px; left: 10px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(13, 7, 36, .86); color: var(--gold); font: 600 19px/1 "Fredoka", sans-serif; }
.steps img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.steps div { padding: 12px 16px 16px; }
.steps h3 { font-size: 23px; }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
.note { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

.bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile { padding: 16px 14px; }
.tile i { display: block; margin-bottom: 8px; font-size: 30px; font-style: normal; line-height: 1; }
.tile h3 { font-size: 19px; }
.tile p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
figure { margin: 0; }
.grid img { width: 100%; border-radius: 14px; aspect-ratio: 16 / 9; object-fit: cover; }
figcaption { padding: 5px 2px 0; color: var(--muted); font-size: 14px; font-weight: 600; }

.yt { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.yt img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.yt-play { position: absolute; top: 50%; left: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%; background: var(--gold); box-shadow: 0 8px 24px rgba(13, 7, 36, .6); }
.yt-play::after { content: ""; position: absolute; top: 23px; left: 31px; border-style: solid; border-width: 17px 0 17px 28px; border-color: transparent transparent transparent #1A1033; }
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }

.checks { margin: 0; padding: 6px 18px; list-style: none; }
.checks li { position: relative; padding: 11px 0 11px 30px; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks li::before { content: "✓"; position: absolute; left: 3px; top: 11px; color: var(--green); font-weight: 700; }

.final { text-align: center; }
.final .card { padding: 34px 16px; background: linear-gradient(135deg, rgba(124, 58, 237, .4), rgba(255, 111, 181, .2)); }
.final h2 { margin-bottom: 18px; font-size: clamp(30px, 6vw, 48px); color: var(--gold); }

footer { margin-top: 30px; padding: 28px 0 22px; border-top: 1px solid var(--line); color: var(--muted); text-align: center; font-size: 15px; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; margin-bottom: 10px; }
footer a { display: inline-block; padding: 8px 10px; color: var(--text); font-weight: 600; }
footer p { margin: 4px auto; max-width: 660px; }
.small { font-size: 13px; opacity: .8; }

/* Top players */
.rows { margin: 0; padding: 0; list-style: none; }
.rows li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.medal { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); font: 600 15px/1 "Fredoka", sans-serif; }
.rows li:nth-child(1) .medal { background: linear-gradient(180deg, #FFE680, #E0A100); color: #1A1033; }
.rows li:nth-child(2) .medal { background: linear-gradient(180deg, #F1F5F9, #94A3B8); color: #1A1033; }
.rows li:nth-child(3) .medal { background: linear-gradient(180deg, #FDBA74, #B45309); color: #1A1033; }
.face { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); object-fit: cover; }
.who { flex: 1; min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.val { flex: none; color: var(--gold); font: 600 17px/1.2 "Fredoka", var(--display); text-align: right; }

/* Rankings */
.chips { display: flex; gap: 8px; margin: 0 -16px 14px; padding: 2px 16px 8px; overflow-x: auto; scrollbar-width: thin; }
.chip { flex: none; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip[aria-pressed="true"] { border-color: var(--gold); background: var(--gold); color: #1A1033; }
.tabs { display: inline-flex; gap: 2px; margin-bottom: 14px; padding: 3px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tabs button { padding: 8px 16px; border: 0; border-radius: 11px; background: none; font-weight: 600; font-size: 15px; }
.tabs [aria-pressed="true"] { background: var(--surface-2); color: var(--gold); }
.how-card { padding: 14px 16px; margin-bottom: 14px; }
.how-card h3 { font-size: 22px; }
.how-card p { margin: 4px 0 0; color: var(--muted); }
.updated { margin: 10px 2px 0; color: var(--muted); font-size: 13px; }
.more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Shop + badges */
.items { display: grid; gap: 12px; }
.item { display: flex; gap: 12px; padding: 14px; }
.item-icon { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); font-size: 30px; overflow: hidden; }
.item-icon img { width: 100%; height: 100%; object-fit: cover; }
.item h3 { font-size: 20px; }
.item p { margin: 3px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.item .what { color: var(--text); }
.price { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--gold); font-size: 14px; font-weight: 700; }
.soon { opacity: .55; }
.notice { padding: 14px 16px; margin-bottom: 22px; border-color: rgba(255, 216, 77, .4); background: rgba(255, 216, 77, .07); }
.notice p { margin: 0; }
.sub { margin: 34px 0 12px; font-size: 28px; }

/* Guide */
.docs { display: grid; gap: 22px; padding-top: 18px; padding-bottom: 30px; }
.side { align-self: start; }
.side summary { padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 700; cursor: pointer; }
.side h4 { margin: 14px 0 3px; padding: 0 10px; color: var(--gold); font: 600 13px/1.3 var(--display); letter-spacing: .05em; text-transform: uppercase; }
html[lang="th"] .side h4 { font-weight: 500; letter-spacing: 0; }
.side a { display: block; padding: 6px 10px; border-radius: 10px; color: var(--text); font-size: 15px; line-height: 1.35; text-decoration: none; }
.side a:hover { background: var(--surface); }
.side a[aria-current="page"] { background: var(--surface-2); color: var(--gold); font-weight: 700; }
.doc { min-width: 0; max-width: 780px; }
.doc h1 { font-size: clamp(32px, 6vw, 48px); }
.doc-sum { margin: 8px 0 18px; color: var(--muted); font-size: 18px; }
.doc-art { width: 100%; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 4 / 3; object-fit: cover; max-height: 420px; }
.doc h2 { margin: 34px 0 10px; font-size: clamp(24px, 4.4vw, 30px); scroll-margin-top: 80px; }
.doc h3 { margin: 22px 0 6px; font-size: 21px; }
.doc p, .doc li { color: #E4DFF8; }
.doc li { margin: 4px 0; }
.doc ul, .doc ol { padding-left: 22px; }
.doc strong { color: #fff; }
.tablewrap { margin: 14px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc th, .doc td { padding: 8px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc th { background: var(--surface-2); color: var(--gold); white-space: nowrap; }
.doc tr:last-child td { border-bottom: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 34px; }
.pager a { padding: 12px 14px; font-weight: 600; line-height: 1.3; }
.pager small { display: block; color: var(--muted); font-weight: 400; }
.pager .next { grid-column: 2; text-align: right; }
.group-title { margin: 30px 0 12px; font-size: 25px; }
.chapters { display: grid; gap: 10px; }
.chapter { display: flex; gap: 12px; padding: 13px 14px; }
a.card.chapter { display: flex; }
.chapter i { font-size: 28px; font-style: normal; line-height: 1.2; }
.chapter h3 { font-size: 19px; }
.chapter p { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.4; }
.filter { width: 100%; max-width: 520px; min-height: 48px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; }
.filter::placeholder { color: var(--muted); }

/* Scroll reveal: only once the script has marked the page */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s, transform .5s; }
.js .reveal.in { opacity: 1; transform: none; }

.page-home .brand { display: none; }
@media (max-width: 699px) {
  .bar-play { display: none; }
}
@media (min-width: 700px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .bento { grid-template-columns: repeat(4, 1fr); }
  .items, .chapters { grid-template-columns: repeat(2, 1fr); }
  .bar { position: sticky; top: 0; }
  .bar-in { flex-wrap: nowrap; }
  .links { order: 0; width: auto; margin: 0; }
  .bar-play { display: inline-flex; flex: none; min-height: 42px; padding: 6px 16px; border-radius: 13px; font-size: 16px; box-shadow: inset 0 -3px 0 var(--gold-deep); }
  .hero-logo { width: 300px; }
}
@media (min-width: 1000px) {
  .has-sticky { padding-bottom: 0; }
  .sticky { display: none; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .docs { grid-template-columns: 270px minmax(0, 1fr); gap: 34px; }
  .side-in { position: sticky; top: 72px; max-height: calc(100vh - 84px); overflow-y: auto; }
  .side details > summary { display: none; }
  .hero h1 { margin-top: min(290px, 26vh); }
  .clip-grid { grid-template-columns: 2fr 1fr; }
  .clip-grid .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cta, .sticky, .bar-play, a.card { transition: none; }
}
