/* =========================================================
   Phoenix Fantasy — bright JX2 fantasy theme
   sky blue + cream, accents crimson red & sky blue
   ========================================================= */
:root {
  --sky: #dff1ff;
  --sky-2: #b9e1ff;
  --cream: #fff8ee;
  --paper: #fffdf9;
  --ink: #1d2b3f;
  --ink-2: #34445c;
  --muted: #4c5c72;
  --red: #d62839;
  --red-2: #ff5468;
  --blue: #1b9be0;
  --blue-2: #49c3ff;
  --blue-d: #0f6fae;
  --gold: #c9962f;
  --gold-2: #e9c46a;
  --green: #1f9d57;
  --purple: #7a4bd6;
  --panel: rgba(255, 255, 255, .88);
  --panel-solid: #ffffff;
  --line: rgba(27, 155, 224, .16);
  --line-2: rgba(27, 155, 224, .32);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(31, 72, 120, .12);
  --shadow-lg: 0 18px 50px rgba(31, 72, 120, .18);
  --grad: linear-gradient(90deg, var(--red), #ff7a59 45%, var(--blue-2) 70%, var(--blue));
  --font: "Kantumruy Pro", "Noto Sans Khmer", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-title: "Cinzel", "Kantumruy Pro", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink);
  font: 15px/1.7 var(--font);
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(800px 500px at 100% 20%, rgba(255, 200, 160, .18), transparent 60%),
    linear-gradient(180deg, #9fc0db 0%, #b3cde2 30%, #c3d3df 70%, #cfcabd 100%);
  background-attachment: fixed;
  min-height: 100vh;
}
body::before { /* drifting clouds */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .28;
  background:
    radial-gradient(120px 26px at 15% 18%, #fff 60%, transparent 62%),
    radial-gradient(80px 22px at 21% 16%, #fff 60%, transparent 62%),
    radial-gradient(150px 28px at 78% 12%, #fff 60%, transparent 62%),
    radial-gradient(90px 22px at 84% 10%, #fff 60%, transparent 62%),
    radial-gradient(130px 24px at 55% 30%, rgba(255,255,255,.8) 60%, transparent 62%);
  animation: drift 60s linear infinite alternate;
}
@keyframes drift { to { transform: translateX(-80px); } }
a { color: var(--blue-d); text-decoration: none; transition: color .2s; }
a:hover { color: var(--red); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; color: var(--ink); }
code { background: rgba(27, 155, 224, .1); color: var(--blue-d); padding: 1px 6px; border-radius: 5px; font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); } .small { font-size: 13px; } .big { font-size: 1.35em; }
.center { text-align: center; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.mt { margin-top: 20px; } .inline { display: inline; } .grow { flex: 1; } .w-sm { width: 90px; }
.text-gold { color: #c27c0e; } .text-red { color: var(--red); } .text-green { color: var(--green); } .text-purple { color: var(--purple); } .text-blue { color: var(--blue-d); }
.empty { color: var(--muted); text-align: center; padding: 18px; }
.hint { color: var(--ink-2); font-size: 13.5px; background: rgba(27, 155, 224, .07); border-left: 3px solid var(--blue); padding: 8px 12px; border-radius: 6px; }
.ua { font-size: 12px; color: var(--muted); max-width: 280px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: 10px; border: 1px solid var(--line-2);
  font: 600 14.5px var(--font); cursor: pointer; color: var(--ink); background: #fff;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s; white-space: nowrap;
}
.btn::after { /* shine sweep */
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg); transition: left .5s;
}
.btn:hover::after { left: 120%; }
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-gold { /* primary: sky blue */
  background: linear-gradient(180deg, #5fd0ff, var(--blue) 60%, var(--blue-d)); color: #fff; border-color: #2aa8ea;
  box-shadow: 0 6px 18px rgba(27, 155, 224, .35), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-gold:hover { color: #fff; box-shadow: 0 10px 26px rgba(27, 155, 224, .45); }
.btn-red {
  background: linear-gradient(180deg, #ff6b7b, var(--red) 60%, #a8162a); color: #fff; border-color: #f04a5c;
  box-shadow: 0 6px 18px rgba(214, 40, 57, .35), inset 0 1px 0 rgba(255,255,255,.45);
}
.btn-red:hover { color: #fff; box-shadow: 0 10px 26px rgba(214, 40, 57, .45); }
.btn-ghost { background: rgba(255,255,255,.75); color: var(--blue-d); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: #fff; color: var(--red); }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn-xs { padding: 3px 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------- Top strip + header ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); box-shadow: 0 4px 20px rgba(31, 72, 120, .08); transition: background .3s, box-shadow .3s; }
.home .topbar { position: fixed; inset: 0 0 auto 0; background: linear-gradient(180deg, rgba(8, 30, 60, .45), transparent); border-color: transparent; box-shadow: none; }
.home .topbar.scrolled, .topbar.scrolled { background: rgba(255, 255, 255, .94); border-color: var(--line); box-shadow: 0 4px 20px rgba(31, 72, 120, .1); }
.topstrip { background: var(--grad); color: #fff; font-size: 13px; }
.topstrip-inner { display: flex; align-items: center; justify-content: space-between; height: 34px; gap: 12px; }
.kh-clock { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.kh-clock small { border: 1px solid rgba(255,255,255,.6); border-radius: 4px; padding: 0 5px; font-size: 11px; }
.kh-clock .clock-text { overflow: hidden; text-overflow: ellipsis; }
.strip-right { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; border: 1px solid rgba(255,255,255,.7); border-radius: 7px; overflow: hidden; background: rgba(255,255,255,.12); }
.lang-switch a { padding: 2px 11px; color: #fff; font-weight: 700; font-size: 12.5px; line-height: 22px; }
.lang-switch a + a { border-left: 1px solid rgba(255,255,255,.5); }
.lang-switch a:hover { background: rgba(255,255,255,.2); color: #fff; }
.lang-switch a.active { background: #fff; color: var(--red); }
.music-btn { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 7px; border: 1px solid rgba(255,255,255,.7); background: rgba(255,255,255,.15); color: #fff; cursor: pointer; font-size: 14px; }
.music-btn:hover { background: rgba(255,255,255,.3); }
.music-bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.music-bars i { width: 3px; height: 3px; background: rgba(255,255,255,.7); border-radius: 1px; }
.music-btn.playing .music-bars i { background: #fff; animation: eq .9s ease-in-out infinite; }
.music-btn.playing .music-bars i:nth-child(2) { animation-delay: .2s; }
.music-btn.playing .music-bars i:nth-child(3) { animation-delay: .4s; }
.music-btn.playing .music-bars i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

.topbar-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; height: 76px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 50px; height: 50px; filter: drop-shadow(0 0 8px rgba(255, 84, 104, .45)) drop-shadow(0 0 14px rgba(73, 195, 255, .45)); animation: logoGlow 3s ease-in-out infinite; }
@keyframes logoGlow { 50% { filter: drop-shadow(0 0 12px rgba(255, 84, 104, .7)) drop-shadow(0 0 20px rgba(73, 195, 255, .7)); } }
.brand-text { font: 900 21px var(--font-title); letter-spacing: .5px; background: linear-gradient(90deg, var(--red) 0%, #ff7a59 40%, var(--blue) 60%, var(--red) 100%); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.home .topbar:not(.scrolled) .brand-text { background: linear-gradient(90deg, #fff, #ffd9de, #d6f2ff, #fff); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
/* desktop: wrapper ចែកកូនទៅក្នុង grid */
.mainnav { display: contents; }
.mainnav form { margin: 0; }
/* ស៊ុមបែបចិន: គែមមាស + ខ្សែក្រហមខាងក្នុង + លំនាំ 回 នៅចុងសងខាង + ពពកមាសនៅខាងលើ/ក្រោម */
.nav-frame { justify-self: center; display: flex; align-items: center; gap: 4px; }
.nav-frame a { position: relative; padding: 8px 14px; color: var(--ink); font-weight: 600; white-space: nowrap; border-radius: 8px; transition: color .2s, background .2s; }
.nav-frame a:hover { color: var(--red); background: rgba(200, 16, 46, .06); }
.nav-frame a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--grad); transform: scaleX(0); transition: transform .25s; }
.nav-frame a:hover::after, .nav-frame a.active::after { transform: scaleX(1); }
.nav-frame a.active { color: var(--red); }
.home .topbar:not(.scrolled) .nav-frame a { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.home .topbar:not(.scrolled) .nav-frame a:hover { background: rgba(255,255,255,.15); }
.nav-actions { display: flex; align-items: center; gap: 6px; justify-self: end; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; justify-self: end; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--blue); margin: 5px 0; }
.home .topbar:not(.scrolled) .nav-toggle span { background: #fff; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
.hero-media { position: absolute; inset: 0; background: #9fd0f5 url("../img/hero-poster.svg") center/cover; }
.hero-media video, .hero-yt { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; pointer-events: none; }
.hero-yt { width: 177.78vh; min-width: 100%; height: 56.25vw; min-height: 100%; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 40, 80, .35) 0%, rgba(10, 40, 80, .12) 45%, rgba(159, 192, 219, .6) 85%, #9fc0db 100%); }
.hero-content { position: relative; z-index: 2; text-align: center; padding: 160px 0 150px; color: #fff; }
.hero-logo { width: 170px; height: 170px; margin: 0 auto 10px; filter: drop-shadow(0 0 18px rgba(255, 84, 104, .65)) drop-shadow(0 0 30px rgba(73, 195, 255, .6)); animation: float 5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }
.hero-kicker { letter-spacing: 6px; font: 700 13px var(--font-title); margin: 0 0 8px; text-shadow: 0 2px 6px rgba(0,0,0,.4); }
.hero-wordmark { font: 900 clamp(38px, 6.5vw, 82px)/1.05 var(--font-title); margin: 0 0 10px; letter-spacing: 2px;
  background: linear-gradient(180deg, #fff 20%, #ffd2d8 55%, #ff5468 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(120, 10, 30, .35)) drop-shadow(0 0 22px rgba(255, 84, 104, .55)); animation: flameText 3s ease-in-out infinite; }
.hero-wordmark span { background: linear-gradient(180deg, #fff 20%, #cdeeff 55%, #2aa8ea 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes flameText { 50% { filter: drop-shadow(0 3px 0 rgba(120, 10, 30, .35)) drop-shadow(0 0 34px rgba(73, 195, 255, .7)); } }
.hero-title { font: 600 clamp(17px, 2.2vw, 24px)/1.4 var(--font); margin: 0 auto 8px; max-width: 860px; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.hero-sub { font-size: clamp(14px, 1.8vw, 17px); text-shadow: 0 2px 8px rgba(0,0,0,.45); margin-bottom: 30px; opacity: .95; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.embers { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.embers i { position: absolute; bottom: -20px; width: 8px; height: 8px; border-radius: 50%; opacity: 0; animation: rise 9s linear infinite; }
.embers i:nth-child(odd) { background: radial-gradient(circle, #fff 0, #ff7a8a 40%, transparent 70%); }
.embers i:nth-child(even) { background: radial-gradient(circle, #fff 0, #7fd6ff 40%, transparent 70%); }
.embers i:nth-child(1) { left: 6%; animation-delay: 0s; } .embers i:nth-child(2) { left: 14%; animation-delay: 2s; width: 6px; height: 6px; }
.embers i:nth-child(3) { left: 23%; animation-delay: 4.5s; } .embers i:nth-child(4) { left: 31%; animation-delay: 1.2s; width: 10px; height: 10px; }
.embers i:nth-child(5) { left: 42%; animation-delay: 6s; } .embers i:nth-child(6) { left: 51%; animation-delay: 3.3s; width: 5px; height: 5px; }
.embers i:nth-child(7) { left: 60%; animation-delay: 7.5s; } .embers i:nth-child(8) { left: 68%; animation-delay: .6s; width: 9px; height: 9px; }
.embers i:nth-child(9) { left: 77%; animation-delay: 5.2s; } .embers i:nth-child(10) { left: 85%; animation-delay: 2.7s; width: 6px; height: 6px; }
.embers i:nth-child(11) { left: 92%; animation-delay: 8s; } .embers i:nth-child(12) { left: 37%; animation-delay: 9s; width: 7px; height: 7px; }
@keyframes rise { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 10% { opacity: .95; } 100% { transform: translate(40px, -95vh) scale(1.1); opacity: 0; } }

.ticker { position: absolute; bottom: 0; left: 0; right: 0; z-index: 3; display: flex; background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px); border-top: 1px solid var(--line-2); overflow: hidden; }
.ticker-label { flex: none; padding: 10px 16px; background: var(--red); color: #fff; font-weight: 700; }
.ticker-track { flex: 1; overflow: hidden; display: flex; align-items: center; color: var(--ink); }
.ticker-track span { white-space: nowrap; padding-left: 100%; animation: ticker 28s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---------- Sections ---------- */
.section { padding: 90px 0; position: relative; }
.section.page-top { padding-top: 60px; }
.section-dark { background: linear-gradient(180deg, rgba(20, 60, 110, .06), rgba(20, 60, 110, .12)); border-block: 1px solid var(--line); }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 6px; }
.section-head h2::after { content: ""; display: block; width: 140px; height: 3px; border-radius: 3px; margin: 14px auto 0; background: var(--grad); }
.section-kicker { font: 700 12px var(--font-title); letter-spacing: 5px; color: var(--red); }

/* ---------- Trailer ---------- */
.trailer-frame { max-width: 980px; margin: 0 auto; border-radius: 20px; padding: 10px; background: linear-gradient(135deg, var(--red-2), #fff 40%, var(--blue-2)); box-shadow: var(--shadow-lg); }
.trailer-frame .video-frame { border-radius: 14px; overflow: hidden; }
.trailer-empty { aspect-ratio: 16/9; display: grid; place-items: center; border-radius: 14px; background: #e9f5ff url("../img/placeholder.svg") center/cover; color: #fff; font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,.4); }

/* ---------- Events ---------- */
.event-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.event-card { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; outline: none; }
.event-card:hover, .event-card:focus-visible { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.event-card.featured { grid-column: span 2; grid-row: span 2; }
.event-card.featured .event-thumb { aspect-ratio: 16/8.4; }
.event-card.featured h3 { font-size: 24px; }
.event-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--sky); }
.event-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.event-card:hover .event-thumb img { transform: scale(1.06); }
.play-badge { position: absolute; inset: 0; margin: auto; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.9); color: var(--red); font-size: 22px; padding-left: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.event-tag { position: absolute; top: 12px; left: 12px; background: var(--red); color: #fff; font: 700 11.5px var(--font); letter-spacing: 1px; padding: 3px 10px; border-radius: 6px; box-shadow: 0 3px 10px rgba(214, 40, 57, .35); }
.event-tag.static { position: static; display: inline-block; margin-bottom: 10px; }
.event-body { padding: 16px 18px 18px; }
.event-body h3 { font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.event-body p { color: var(--ink-2); margin: 0 0 10px; font-size: 14px; }
.event-date { font-size: 12.5px; color: var(--muted); }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20, 45, 80, .55); backdrop-filter: blur(4px); }
.modal-box { position: relative; width: min(960px, 100%); max-height: 92vh; overflow: auto; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .25s ease; }
.modal-box.small { width: min(480px, 100%); }
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.modal-close { position: absolute; top: 8px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; color: var(--red); font-size: 24px; cursor: pointer; box-shadow: var(--shadow); }
.modal-media img { width: 100%; }
.modal-text, .modal-pad { padding: 22px 26px 26px; }
.modal-text h3 { font-size: 24px; }
.prose { color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.video-frame { position: relative; aspect-ratio: 16/9; background: #000; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Factions + sub-factions ---------- */
.faction-tabs { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.faction-tab { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 104px; padding: 10px 6px; border-radius: 16px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; font: 700 13px var(--font); box-shadow: var(--shadow); transition: .25s; }
.faction-tab img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line-2); filter: saturate(.6); transition: .25s; }
.faction-tab:hover { transform: translateY(-4px); }
.faction-tab.active { color: var(--red); border-color: var(--red-2); background: linear-gradient(180deg, #fff, #ffeef0); }
.faction-tab.active img, .faction-tab:hover img { filter: none; box-shadow: 0 0 0 2px var(--red-2), 0 0 18px rgba(255, 84, 104, .45); }
.faction-panel { display: none; animation: fade .35s ease; }
.faction-panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.faction-intro { text-align: center; max-width: 760px; margin: 0 auto 18px; }
.faction-intro h3 { font: 700 30px var(--font-title); margin: 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.route-tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.route-tab { display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 6px; border-radius: 40px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font: 700 14px var(--font); color: var(--ink-2); box-shadow: 0 4px 12px rgba(31,72,120,.08); transition: .2s; }
.route-tab img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.route-tab:hover { border-color: var(--blue); }
.route-tab.active { background: linear-gradient(90deg, var(--blue), var(--blue-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(27, 155, 224, .35); }
.route-panel { display: none; grid-template-columns: 1.35fr 1fr; gap: 30px; align-items: start; animation: fade .3s ease; }
.route-panel.active { display: grid; }
.faction-video { border-radius: 18px; overflow: hidden; background: #000; box-shadow: var(--shadow-lg); border: 4px solid #fff; }
.faction-art { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.video-cover { position: relative; display: block; width: 100%; aspect-ratio: 16/9; padding: 0; border: 0; cursor: pointer; background: #9fd0f5; }
.video-cover img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.video-cover:hover img { transform: scale(1.03); }
.play-big { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: rgba(214, 40, 57, .9); color: #fff; font-size: 32px; padding-left: 6px; box-shadow: 0 0 0 10px rgba(255,255,255,.35); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 18px rgba(255,255,255,.08); } }
.video-cover-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px; background: linear-gradient(transparent, rgba(10, 30, 60, .75)); color: #fff; font: 600 14px var(--font); text-align: left; }
.faction-info h4 { font: 700 26px var(--font-title); color: var(--ink); margin: 0; }
.faction-sub { color: var(--red); font-weight: 700; margin: 0 0 10px; }
.stat-list { margin: 18px 0; display: grid; gap: 9px; }
.stat-row { display: grid; grid-template-columns: 104px 1fr 36px; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.stat-row b { color: var(--blue-d); text-align: right; }
.stat-bar { height: 9px; background: rgba(27, 155, 224, .12); border-radius: 9px; overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: var(--grad); border-radius: 9px; }
.skill-head { color: var(--red); margin-top: 20px; }
.skill-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.skill-list li { padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; box-shadow: 0 3px 10px rgba(31,72,120,.06); }
.skill-list b { color: var(--ink); display: block; }
.skill-list span { color: var(--muted); font-size: 13.5px; }

/* ---------- Ranking ---------- */
.rank-wrap { max-width: 900px; margin: 0 auto; }
.rank-table td:first-child, .rank-table th:first-child { width: 70px; text-align: center; }
.rank-badge { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; color: var(--ink-2); background: rgba(27, 155, 224, .1); }
.rank-1 .rank-badge { background: linear-gradient(180deg, #ffe58a, #e3a51c); color: #fff; box-shadow: 0 3px 10px rgba(227, 165, 28, .5); }
.rank-2 .rank-badge { background: linear-gradient(180deg, #f1f4f8, #a9b4c2); color: #fff; }
.rank-3 .rank-badge { background: linear-gradient(180deg, #ffc69a, #c4733a); color: #fff; }
.rank-1 td { background: rgba(255, 229, 138, .18); }
.rank-level { font-weight: 800; color: var(--red); }
.guild-tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; color: #7a1f1f; background: linear-gradient(180deg, #fff7e6, #ffecc7); border: 1px solid rgba(201, 150, 47, .5); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.card .table-wrap { border: 0; box-shadow: none; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: linear-gradient(180deg, #eef8ff, #dcefff); color: var(--blue-d); font-weight: 700; text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid rgba(27, 155, 224, .09); vertical-align: middle; }
.table tbody tr:nth-child(even) td { background: rgba(240, 248, 255, .5); }
.table tbody tr:hover td { background: rgba(27, 155, 224, .06); }
.table tfoot td { background: #f2f9ff; font-weight: 700; border-top: 1px solid var(--line-2); }
.table.compact th, .table.compact td { padding: 8px 10px; font-size: 13.5px; }
.item-cell { display: flex; align-items: center; gap: 10px; }
.item-cell img { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line-2); object-fit: cover; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid; }
.badge-ok { color: #157a43; border-color: rgba(31, 157, 87, .35); background: rgba(31, 157, 87, .1); }
.badge-warn { color: #a6650a; border-color: rgba(230, 150, 30, .4); background: rgba(255, 190, 70, .15); }
.badge-bad { color: var(--red); border-color: rgba(214, 40, 57, .35); background: rgba(214, 40, 57, .08); }
.badge-mute { color: var(--muted); border-color: rgba(102, 118, 141, .3); background: rgba(102,118,141,.06); }

.pager { display: flex; gap: 6px; justify-content: center; margin: 20px 0; }
.pager a, .pager span { min-width: 36px; padding: 6px 10px; text-align: center; border: 1px solid var(--line-2); border-radius: 8px; color: var(--ink-2); background: #fff; }
.pager .active { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 700; }

/* ---------- Downloads ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.dl-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; display: flex; flex-direction: column; gap: 10px; }
.dl-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.dl-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; border-radius: 18px 18px 0 0; background: var(--grad); }
.dl-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: linear-gradient(135deg, #ffe5e8, #dff2ff); }
.dl-type { display: inline-block; font: 700 11px var(--font); letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue-d); background: rgba(27,155,224,.1); padding: 2px 10px; border-radius: 20px; }
.dl-card h3 { margin: 0; font-size: 19px; }
.dl-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.dl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.dl-steps { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.dl-steps li { counter-increment: s; background: #fff; border-radius: 14px; padding: 16px 16px 16px 56px; position: relative; box-shadow: var(--shadow); border: 1px solid var(--line); }
.dl-steps li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--grad); }

/* ---------- CTA & Footer ---------- */
.cta-band { padding: 60px 0; background: linear-gradient(90deg, rgba(255, 84, 104, .14), rgba(73, 195, 255, .2)); border-top: 1px solid var(--line); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cta-inner h2 { margin: 0 0 4px; }
.cta-inner p { margin: 0; color: var(--ink-2); }
.footer { position: relative; background: linear-gradient(180deg, #1c4f86, #143c69); color: #dbe9f8; padding: 56px 0 20px; }
.footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.footer h4 { color: #fff; }
.footer .brand-text { background: linear-gradient(90deg, #fff, #ffd2d8, #cdeeff); -webkit-background-clip: text; background-clip: text; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.2fr; gap: 30px; }
.footer-grid a:not(.brand):not(.social) { display: block; color: #c6dbf1; padding: 3px 0; }
.footer-grid a:hover { color: #fff; }
.footer .muted { color: #a9c3df; }
.socials { display: flex; flex-direction: column; gap: 10px; }
.social { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); transition: .2s; }
.social:hover { background: rgba(255,255,255,.18); color: #fff; transform: translateX(4px); }
.social svg { width: 22px; height: 22px; flex: none; }
.social.fb { box-shadow: inset 4px 0 0 #4c8dff; } .social.tg { box-shadow: inset 4px 0 0 #49c3ff; }
.social.yt { box-shadow: inset 4px 0 0 #ff5468; } .social.tt { box-shadow: inset 4px 0 0 #e9c46a; }
.copyright { text-align: center; color: #a9c3df; font-size: 13px; margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }

/* ---------- Forms ---------- */
input, select, textarea {
  width: 100%; padding: 10px 13px; font: 15px var(--font); color: var(--ink);
  background: #fff; border: 1px solid rgba(27, 155, 224, .3); border-radius: 10px; outline: none; transition: border .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(27, 155, 224, .15); }
input:disabled { background: #f3f7fb; color: var(--muted); }
input[type=file] { padding: 7px; }
input[type=checkbox] { width: auto; accent-color: var(--blue); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; color: var(--ink-2); }
.field em { color: var(--red); font-style: normal; }
.field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-row input { width: auto; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-form { display: flex; gap: 6px; align-items: center; margin: 2px 0; }
.inline-form input { padding: 4px 8px; font-size: 13px; width: 150px; }
.captcha { color: var(--red); font-family: monospace; font-size: 17px; letter-spacing: 1px; }
.pw-rules { list-style: none; padding: 0; margin: -6px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.pw-rules li { font-size: 12.5px; padding: 2px 10px; border-radius: 20px; border: 1px solid rgba(102,118,141,.35); color: var(--muted); background: #fff; }
.pw-rules li::before { content: "○ "; }
.pw-rules li.ok { color: var(--green); border-color: rgba(31,157,87,.45); background: rgba(31,157,87,.06); }
.pw-rules li.ok::before { content: "✓ "; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; padding: 7px 12px; font-size: 14px; }
.toolbar .grow { flex: 1; }
.toolbar label { display: flex; align-items: center; gap: 6px; color: var(--muted); }

/* Image captcha */
.cap-box { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; background: #f6fbff; }
.cap-q { font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.cap-q b { color: var(--red); }
.cap-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 300px; }
.cap-cell { position: relative; cursor: pointer; border-radius: 12px; overflow: hidden; border: 3px solid transparent; background: #fff; box-shadow: 0 2px 8px rgba(31,72,120,.1); transition: .15s; }
.cap-cell input { position: absolute; opacity: 0; pointer-events: none; }
.cap-cell img { width: 100%; aspect-ratio: 1; }
.cap-cell:hover { transform: scale(1.03); }
.cap-cell:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(27,155,224,.25); }
.cap-cell:has(input:checked)::after { content: "✓"; position: absolute; top: 4px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 13px; display: grid; place-items: center; font-weight: 800; }
.cap-help { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-size: 14.5px; }
.alert ul { margin: 0; padding-left: 18px; }
.alert-success { color: #145f36; background: #e8f8ef; border-color: rgba(31,157,87,.35); }
.alert-error { color: #9b1626; background: #fff0f2; border-color: rgba(214,40,57,.35); }
.alert-info { color: #164c78; background: #ecf7ff; border-color: var(--line-2); }
.alert-warn { color: #7a4a06; background: #fff7e6; border-color: rgba(230,150,30,.4); }

/* ---------- Auth ---------- */
.auth { min-height: calc(100vh - 104px); display: grid; place-items: center; padding: 50px 16px; }
.auth-card { width: min(440px, 100%); padding: 34px 32px; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); position: relative; }
.auth-card.wide { width: min(720px, 100%); }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; border-radius: 22px 22px 0 0; background: var(--grad); }
.auth-card h1 { text-align: center; font-size: 26px; }
.reg-logo { width: 130px; height: 130px; margin: -95px auto 10px; border-radius: 50%; background: #fff; padding: 8px; box-shadow: 0 0 0 4px #fff, 0 0 0 7px rgba(27,155,224,.35), 0 10px 30px rgba(31,72,120,.25); animation: float 5s ease-in-out infinite; }
.reg-logo img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; filter: drop-shadow(0 0 10px rgba(255,84,104,.5)) drop-shadow(0 0 16px rgba(73,195,255,.5)); }
.auth-card.has-logo { margin-top: 70px; }

/* ---------- Panel (dashboard) ---------- */
.panel-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 26px; padding: 30px 0 60px; align-items: start; }
.sidebar { position: sticky; top: 124px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.side-user { display: flex; gap: 12px; align-items: center; padding: 18px; background: linear-gradient(135deg, rgba(255,84,104,.14), rgba(73,195,255,.2)); border-bottom: 1px solid var(--line); }
.side-user small { display: block; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font: 900 20px var(--font-title); box-shadow: 0 4px 12px rgba(214,40,57,.3); }
.side-balance { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.side-balance div { padding: 12px 16px; }
.side-balance div + div { border-left: 1px solid var(--line); }
.side-balance span { display: block; font-size: 12px; color: var(--muted); }
.side-balance b { color: #c27c0e; font-size: 17px; }
.side-balance div + div b { color: var(--purple); }
.side-nav { padding: 8px 0 12px; }
.side-nav a { display: flex; gap: 10px; align-items: center; padding: 9px 18px; color: var(--ink-2); font-size: 14.5px; border-left: 3px solid transparent; }
.side-nav a:hover { background: rgba(27,155,224,.06); color: var(--blue-d); }
.side-nav a.active { background: linear-gradient(90deg, rgba(27,155,224,.14), transparent); border-left-color: var(--blue); color: var(--blue-d); font-weight: 700; }
.side-nav .ico { width: 22px; text-align: center; }
.side-sep { padding: 14px 18px 4px; font: 700 11px var(--font-title); letter-spacing: 2px; color: var(--red); text-transform: uppercase; }
.panel-main { min-width: 0; }
.panel-title { font-size: 26px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid transparent; border-image: var(--grad) 1; }
.card { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card h3 { color: var(--ink); font-size: 17px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2, .grid-3 { margin-bottom: 20px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; position: relative; overflow: hidden; box-shadow: var(--shadow); transition: transform .2s; }
.stat-card:hover { transform: translateY(-3px); }
.stat-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(rgba(73,195,255,.22), transparent 70%); }
.stat-card span { display: block; font-size: 13px; color: var(--muted); }
.stat-card b { display: block; font: 700 25px var(--font-title); color: var(--ink); margin: 4px 0; }
.stat-card small { color: var(--green); }
.stat-card a { font-size: 13px; }
.stat-card.gold b { color: #c27c0e; } .stat-card.gold { border-color: rgba(233,196,106,.6); }
.stat-card.purple b { color: var(--purple); }
.stat-card.red b { color: var(--red); } .stat-card.red::after { background: radial-gradient(rgba(255,84,104,.2), transparent 70%); }
.stat-card.blue b { color: var(--blue-d); }
.info-list { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 0; font-size: 14.5px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; word-break: break-word; }
.ga-list { list-style: none; padding: 0; margin: 0 0 14px; }
.ga-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line-2); }
.balance-line { padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f6fbff; margin-bottom: 16px; }
.balance-line b { font-size: 1.3em; }
.quick-amounts { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.steps { padding-left: 20px; color: var(--ink-2); }
.steps li { margin-bottom: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 18px; color: var(--muted); border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; font-weight: 600; }
.tabs a.active { color: var(--blue-d); border-color: var(--line-2); background: #fff; }
.seg-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.seg-tabs a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 2px solid var(--line); color: var(--ink-2); font-weight: 700; box-shadow: var(--shadow); transition: .2s; }
.seg-tabs a .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: linear-gradient(135deg, #ffe5e8, #dff2ff); }
.seg-tabs a small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.seg-tabs a:hover { border-color: var(--blue-2); transform: translateY(-2px); }
.seg-tabs a.active { border-color: var(--blue); background: linear-gradient(135deg, #fff, #eaf6ff); color: var(--blue-d); }
.narrow { max-width: 560px; }
.thumb { max-width: 220px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 8px; }
.thumb-sm { width: 60px; height: 40px; object-fit: cover; border-radius: 6px; }

/* ---------- Top up + VIP cards (vertical) ---------- */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.pkg-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.pkg-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.pkg-card.hot { border-color: rgba(255, 84, 104, .55); }
.pkg-img { aspect-ratio: 4/3; background: linear-gradient(135deg, #ffeef0, #e3f4ff); display: grid; place-items: center; overflow: hidden; }
.pkg-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.pkg-card:hover .pkg-img img { transform: scale(1.06); }
.pkg-img .pkg-emoji { font-size: 64px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.15)); }
.ribbon { position: absolute; top: 12px; left: -34px; transform: rotate(-45deg); width: 130px; text-align: center; background: var(--red); color: #fff; font: 800 12px var(--font); letter-spacing: 1px; padding: 4px 0; box-shadow: 0 3px 10px rgba(214,40,57,.4); z-index: 2; }
.pkg-body { padding: 14px 16px 18px; text-align: center; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pkg-name { font-weight: 700; color: var(--ink-2); }
.pkg-coin { font: 800 28px var(--font-title); color: #c27c0e; line-height: 1.1; }
.pkg-coin small { font: 600 13px var(--font); color: var(--muted); }
.pkg-bonus { display: inline-block; align-self: center; font-size: 12.5px; font-weight: 700; color: var(--green); background: rgba(31,157,87,.1); padding: 2px 10px; border-radius: 20px; }
.pkg-price { font: 800 22px var(--font); color: var(--red); margin-top: auto; }
.pkg-card form { margin: 0; }
.pkg-card .btn { width: 100%; }
.vip-cost { font: 800 22px var(--font-title); color: var(--purple); }
.vip-stock { font-size: 12.5px; color: var(--muted); }

/* Payment */
.pay-box { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.pay-qr { position: sticky; top: 124px; }
.qr-frame { background: #fff; padding: 16px; border-radius: 16px; border: 3px solid var(--blue); box-shadow: var(--shadow-lg); }
.qr-frame .empty { color: #555; }
.countdown { color: var(--red); font-weight: 700; }
.upload-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.upload-form.receipt-upload { flex-direction: column; align-items: center; text-align: center; }
.upload-form.receipt-upload .field { width: 100%; max-width: 420px; }
.receipt-view { margin: 16px auto; max-width: 420px; text-align: center; }
.receipt-view img { display: block; margin: 0 auto; max-width: 100%; max-height: 520px; object-fit: contain; border-radius: 12px; border: 2px solid var(--line-2); box-shadow: var(--shadow); background: #fff; cursor: zoom-in; }
.receipt-view figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(5, 8, 15, .86); backdrop-filter: blur(3px); animation: pop .2s ease; overflow: auto; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { display: block; margin: 0 auto; max-width: min(92vw, 900px); max-height: 82vh; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.6); background: #fff; cursor: zoom-in; }
.lightbox img.zoom { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox figcaption { margin-top: 12px; color: #fff; font-weight: 600; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.lightbox figcaption a { color: #ffd77a; }
.lightbox-close { position: fixed; top: 14px; right: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: var(--red); }
.upload-form .field { flex: 1; margin: 0; }
.qr-frame.khqr { padding: 0 0 14px; overflow: hidden; text-align: center; border-color: #e1232e; }
.qr-frame.khqr svg { display: block; width: 100%; height: auto; max-width: 300px; margin: 6px auto 0; }
.khqr-head { background: #e1232e; color: #fff; font: 800 20px/44px var(--font); letter-spacing: 3px; }
.khqr-name { color: #222; font-weight: 700; font-size: 15px; }
.pay-live { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #f2f9ff; font-size: 14px; text-align: center; }
.pay-live.paid { color: #145f36; border-color: rgba(31,157,87,.5); background: #e8f8ef; font-weight: 700; }
.pay-live.expired { color: #9b1626; border-color: rgba(214,40,57,.45); background: #fff0f2; }
.spinner { width: 16px; height: 16px; flex: none; border: 2px solid var(--line-2); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
details.fallback { margin-top: 14px; border-top: 1px dashed var(--line-2); padding-top: 10px; }
details.fallback summary { cursor: pointer; color: var(--blue-d); margin-bottom: 10px; }

/* Transfer confirm */
.confirm-box { border: 2px dashed var(--blue-2); background: #f2f9ff; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.confirm-box b { color: var(--red); }

/* 2FA */
.totp-box { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; }
.totp-box .qr { background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--line-2); }
.totp-box .qr svg { width: 100%; height: auto; display: block; }
.code-input { letter-spacing: 8px; font: 700 24px monospace; text-align: center; max-width: 220px; }
.secret { font: 600 15px monospace; letter-spacing: 2px; word-break: break-all; }

/* Admin chart */
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar i { width: 100%; min-height: 2px; background: linear-gradient(180deg, var(--blue-2), var(--blue-d)); border-radius: 6px 6px 0 0; }
.bar span { font-size: 11px; color: var(--muted); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .nav-frame a { padding: 7px 8px; font-size: 14px; } .brand-text { font-size: 18px; } }
@media (max-width: 1024px) {
  .event-grid { grid-template-columns: 1fr 1fr; }
  .route-panel.active { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .panel-wrap { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .side-nav { display: flex; flex-wrap: wrap; padding: 8px; gap: 4px; }
  .side-nav a { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
  .side-sep { display: none; }
  .pay-box { grid-template-columns: 1fr; }
  .pay-qr { position: static; max-width: 340px; margin: auto; }
  .totp-box { grid-template-columns: 1fr; }
}
@media (max-width: 1140px) {
  .topbar-inner { grid-template-columns: 1fr auto; }
  .nav-toggle { display: block; }
  .mainnav { display: flex; position: fixed; top: 110px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateY(-140%); transition: transform .3s; max-height: calc(100vh - 110px); overflow: auto; }
  .mainnav.open { transform: none; }
  .nav-frame { flex-direction: column; align-items: stretch; justify-self: stretch; }
  .nav-frame a, .home .topbar:not(.scrolled) .nav-frame a { text-align: center; padding: 10px; color: var(--ink); text-shadow: none; }
  .nav-actions { justify-content: center; flex-wrap: wrap; justify-self: stretch; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .event-grid, .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .event-card.featured { grid-column: auto; grid-row: auto; }
  .auth-card { padding: 26px 20px; }
  .info-list { grid-template-columns: 110px 1fr; }
  .section { padding: 60px 0; }
  .kh-clock .flag, .kh-clock small { display: none; }
  .topstrip { font-size: 12px; }
  .hero-logo { width: 120px; height: 120px; }
  .faction-tab { width: 84px; }
  .faction-tab img { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Admin permissions ---------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 12px 0; }
.perm-grid fieldset { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px 4px; margin: 0; }
.perm-grid legend { padding: 0 6px; font-weight: 700; color: var(--gold); }
.perm-grid .check { margin-bottom: 8px; font-size: 14px; }
.admin-head { display: flex; gap: 14px; align-items: center; }
.admin-head .badge { margin-right: 6px; }
.admin-actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.admin-actions .confirm-sec { margin: 0; min-width: 260px; }

/* =========================================================
   THEME: Dark Gold (ដូចការរៀបចំ Website ដំបូង)
   បើក/បិទ: Admin → ការកំណត់ → Theme
   ========================================================= */
body.theme-dark {
  --sky: #17120c; --sky-2: #1f1810; --cream: #120e0a; --paper: #17120c;
  --ink: #ecdfc4; --ink-2: #d9c9a6; --muted: #a2947c;
  --red: #d1382c; --red-2: #e04a3a;
  --blue: #d4a24c; --blue-2: #f3cf7a; --blue-d: #f0c36a;
  --gold: #d4a24c; --gold-2: #f3cf7a;
  --green: #5fbf6a; --purple: #b98aff;
  --panel: rgba(23, 18, 12, .92); --panel-solid: #17120c;
  --line: rgba(212, 162, 76, .22); --line-2: rgba(212, 162, 76, .45);
  --shadow: 0 10px 34px rgba(0, 0, 0, .55); --shadow-lg: 0 18px 50px rgba(0, 0, 0, .65);
  --grad: linear-gradient(90deg, #8a6420, #d4a24c 35%, #f3cf7a 55%, #d4a24c 75%, #8a6420);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(184, 40, 31, .18), transparent 60%),
    radial-gradient(800px 500px at 0% 30%, rgba(212, 162, 76, .08), transparent 60%),
    linear-gradient(180deg, #0b0907 0%, #120e0a 50%, #0b0907 100%);
  background-attachment: fixed;
}
body.theme-dark::before { display: none; }
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3, body.theme-dark h4 { color: #f3e6c8; }
body.theme-dark a { color: var(--gold-2); }
body.theme-dark a:hover { color: #fff3d0; }
body.theme-dark code { background: rgba(212, 162, 76, .12); color: var(--gold-2); }
body.theme-dark .hint { background: rgba(212, 162, 76, .08); border-left-color: var(--gold); color: var(--ink-2); }
body.theme-dark .muted { color: var(--muted); }

/* Buttons */
body.theme-dark .btn { background: #1f1810; color: var(--ink); border-color: var(--line-2); }
body.theme-dark .btn-gold { background: linear-gradient(180deg, #f3cf7a, #d4a24c 55%, #a8782a); color: #1a1208; border-color: #f3cf7a; text-shadow: none; }
body.theme-dark .btn-gold:hover { color: #000; box-shadow: 0 10px 26px rgba(212, 162, 76, .45); }
body.theme-dark .btn-red { background: linear-gradient(180deg, #e04a3a, #b8281f 60%, #7d1913); color: #fff; border-color: #e04a3a; }
body.theme-dark .btn-ghost { background: rgba(23, 18, 12, .7); color: var(--gold-2); border-color: var(--line-2); }
body.theme-dark .btn-ghost:hover { background: #2a2015; color: #fff3d0; }

/* Header */
body.theme-dark .topbar, body.theme-dark .home .topbar.scrolled, body.theme-dark .topbar.scrolled { background: rgba(11, 9, 7, .92); border-color: var(--line); box-shadow: 0 4px 20px rgba(0,0,0,.5); }
body.theme-dark.home .topbar:not(.scrolled) { background: linear-gradient(180deg, rgba(0, 0, 0, .75), transparent); }
body.theme-dark .topstrip, body.theme-dark .top-strip { background: #000 !important; color: var(--gold-2); border-bottom: 1px solid var(--line); }
body.theme-dark .lang-switch { border-color: var(--line-2); background: transparent; }
body.theme-dark .lang-switch a { color: var(--ink-2); }
body.theme-dark .lang-switch a.active { background: linear-gradient(180deg, #f3cf7a, #d4a24c); color: #1a1208; }
body.theme-dark .music-btn { border-color: var(--line-2); color: var(--gold-2); background: transparent; }
body.theme-dark .brand-text, body.theme-dark.home .topbar:not(.scrolled) .brand-text { background: linear-gradient(90deg, #f3cf7a, #fff1c9, #d4a24c, #f3cf7a); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; filter: none; }
body.theme-dark .nav-frame a, body.theme-dark.home .topbar:not(.scrolled) .nav-frame a { color: #ecdfc4; text-shadow: none; }
body.theme-dark .nav-frame a:hover, body.theme-dark .nav-frame a.active { color: var(--gold-2); background: rgba(212, 162, 76, .08); }
body.theme-dark .nav-toggle span, body.theme-dark.home .topbar:not(.scrolled) .nav-toggle span { background: var(--gold-2); }

/* Hero */
body.theme-dark .hero-media { background-color: #0b0907; }
body.theme-dark .hero-media::after { content: ""; position: absolute; inset: 0; background: rgba(5, 4, 3, .55); }
body.theme-dark .hero-shade { background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.25) 45%, rgba(11,9,7,.75) 85%, #0b0907 100%); }
body.theme-dark .hero-kicker { color: var(--gold); }
body.theme-dark .hero-wordmark { background: linear-gradient(180deg, #fff6dc 15%, #f3cf7a 50%, #b8822e 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.theme-dark .hero-wordmark span { background: linear-gradient(180deg, #fff6dc 15%, #f3cf7a 50%, #b8822e 100%); -webkit-background-clip: text; background-clip: text; }
body.theme-dark .ticker { background: rgba(11, 9, 7, .85); border-color: var(--line); color: var(--ink); }

/* Sections */
body.theme-dark .section-dark { background: linear-gradient(180deg, rgba(23, 18, 12, .7), rgba(18, 14, 10, .7)); border-color: var(--line); }
body.theme-dark .section-kicker { color: var(--gold); }
body.theme-dark .trailer-frame { background: linear-gradient(135deg, #8a6420, #f3cf7a 45%, #8a6420); }
body.theme-dark .trailer-empty, body.theme-dark .video-cover { background-color: #17120c; }
body.theme-dark .cta-band { background: linear-gradient(90deg, rgba(184, 40, 31, .18), rgba(212, 162, 76, .14)); border-color: var(--line); }

/* Cards / panels */
body.theme-dark .event-card, body.theme-dark .dl-card, body.theme-dark .dl-steps li, body.theme-dark .pkg-card,
body.theme-dark .stat-card, body.theme-dark .card, body.theme-dark .table-wrap, body.theme-dark .skill-list li,
body.theme-dark .faction-tab, body.theme-dark .route-tab, body.theme-dark .seg-tabs a, body.theme-dark .modal-box,
body.theme-dark .auth-card, body.theme-dark .sidebar { background: var(--panel); border-color: var(--line); color: var(--ink); }
body.theme-dark .faction-tab.active { background: linear-gradient(180deg, #2a2015, #17120c); border-color: var(--gold); color: var(--gold-2); }
body.theme-dark .faction-tab img { border-color: #17120c; }
body.theme-dark .route-tab.active { background: linear-gradient(90deg, #a8782a, #d4a24c); color: #1a1208; }
body.theme-dark .faction-video { border-color: #2a2015; }
body.theme-dark .seg-tabs a.active { background: linear-gradient(135deg, #2a2015, #17120c); border-color: var(--gold); color: var(--gold-2); }
body.theme-dark .seg-tabs a .ico, body.theme-dark .dl-icon { background: linear-gradient(135deg, #2a2015, #3a2a14); }
body.theme-dark .pkg-img { background: linear-gradient(135deg, #1f1810, #2a2015); }
body.theme-dark .pkg-coin, body.theme-dark .side-balance b, body.theme-dark .stat-card.gold b { color: var(--gold-2); }
body.theme-dark .stat-card::after { background: radial-gradient(rgba(212, 162, 76, .18), transparent 70%); }
body.theme-dark .side-user { background: linear-gradient(135deg, rgba(184, 40, 31, .18), rgba(212, 162, 76, .12)); border-color: var(--line); }
body.theme-dark .side-nav a { color: var(--ink-2); }
body.theme-dark .side-nav a:hover { background: rgba(212, 162, 76, .08); color: var(--gold-2); }
body.theme-dark .side-nav a.active { background: linear-gradient(90deg, rgba(212, 162, 76, .18), transparent); border-left-color: var(--gold); color: var(--gold-2); }
body.theme-dark .side-sep { color: var(--gold); }
body.theme-dark .modal-close { background: #17120c; color: var(--gold-2); }
body.theme-dark .modal-backdrop { background: rgba(0, 0, 0, .7); }

/* Tables */
body.theme-dark .table th { background: linear-gradient(180deg, #2a2015, #1f1810); color: var(--gold-2); border-color: var(--line-2); }
body.theme-dark .table td { border-color: var(--line); color: var(--ink); }
body.theme-dark .table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
body.theme-dark .table tbody tr:hover td { background: rgba(212, 162, 76, .07); }
body.theme-dark .table tfoot td { background: #1f1810; }
body.theme-dark .rank-1 td { background: rgba(212, 162, 76, .12); }
body.theme-dark .rank-badge { background: rgba(212, 162, 76, .12); color: var(--ink-2); }
body.theme-dark .rank-1 .rank-badge { background: linear-gradient(180deg, #ffe58a, #e3a51c); color: #1a1208; box-shadow: 0 0 12px rgba(227, 165, 28, .55); }
body.theme-dark .rank-2 .rank-badge { background: linear-gradient(180deg, #f1f4f8, #a9b4c2); color: #1a1208; }
body.theme-dark .rank-3 .rank-badge { background: linear-gradient(180deg, #ffc69a, #c4733a); color: #1a1208; }
body.theme-dark .rank-level { color: var(--gold-2); }
body.theme-dark .guild-tag { background: rgba(212, 162, 76, .14); color: var(--gold-2); border-color: var(--line-2); }
body.theme-dark .pager a, body.theme-dark .pager span { background: #17120c; color: var(--ink-2); border-color: var(--line-2); }
body.theme-dark .pager .active { background: var(--gold); color: #1a1208; }

/* Forms */
body.theme-dark input, body.theme-dark select, body.theme-dark textarea { background: #0f0c08; color: var(--ink); border-color: var(--line-2); }
body.theme-dark input:focus, body.theme-dark select:focus, body.theme-dark textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 162, 76, .18); }
body.theme-dark input:disabled { background: #1a150f; color: var(--muted); }
body.theme-dark input::placeholder, body.theme-dark textarea::placeholder { color: #6f6452; }
body.theme-dark .pw-rules li { background: #17120c; }
body.theme-dark .cap-box, body.theme-dark .balance-line, body.theme-dark .confirm-box { background: #120e0a; border-color: var(--line-2); }
body.theme-dark .tabs a.active { background: #17120c; color: var(--gold-2); }
body.theme-dark .reg-logo { background: #17120c; box-shadow: 0 0 0 4px #17120c, 0 0 0 7px rgba(212, 162, 76, .45); }

/* Alerts & badges */
body.theme-dark .alert-success { color: #9fe0a8; background: rgba(95, 191, 106, .1); border-color: rgba(95, 191, 106, .35); }
body.theme-dark .alert-error { color: #ffb4a8; background: rgba(209, 56, 44, .12); border-color: rgba(209, 56, 44, .4); }
body.theme-dark .alert-info { color: #f3dca8; background: rgba(212, 162, 76, .1); border-color: var(--line-2); }
body.theme-dark .alert-warn { color: #ffd38a; background: rgba(230, 150, 30, .12); border-color: rgba(230, 150, 30, .4); }
body.theme-dark .badge-ok { color: #8fdc9a; background: rgba(95, 191, 106, .1); }
body.theme-dark .badge-warn { color: #ffd38a; background: rgba(230, 150, 30, .12); }
body.theme-dark .pay-live { background: #120e0a; }
body.theme-dark .pay-live.paid { color: #9fe0a8; background: rgba(95, 191, 106, .1); }
body.theme-dark .pay-live.expired { color: #ffb4a8; background: rgba(209, 56, 44, .12); }
body.theme-dark .receipt-view img { border-color: var(--line-2); }

/* Footer */
body.theme-dark .footer { background: linear-gradient(180deg, #0d0a07, #000); color: var(--ink-2); border-top: 1px solid var(--line); }
body.theme-dark .footer h4 { color: var(--gold-2); }
body.theme-dark .footer-grid a:not(.brand):not(.social) { color: #c9b993; }
body.theme-dark .footer .muted, body.theme-dark .copyright { color: #8f826b; }
body.theme-dark .social { background: rgba(212, 162, 76, .06); border-color: var(--line); color: var(--ink); }
body.theme-dark .bar i { background: linear-gradient(180deg, #f3cf7a, #8a6420); }
body.theme-dark .stat-bar { background: rgba(212, 162, 76, .1); }

@media (max-width: 1140px) {
  body.theme-dark .mainnav { background: rgba(11, 9, 7, .98); border-color: var(--line); }
  body.theme-dark .nav-frame a, body.theme-dark.home .topbar:not(.scrolled) .nav-frame a { color: var(--ink); }
}

/* ---------- Music disc button (left side, home page) ---------- */
.bgm-yt { position: fixed; left: -10000px; top: 0; width: 200px; height: 200px; border: 0; opacity: 0; pointer-events: none; }
.music-disc { position: fixed; right: 26px; top: 124px; z-index: 45; width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)) drop-shadow(0 0 10px rgba(243, 207, 122, .35)); transition: transform .2s; }
.music-disc:hover { transform: scale(1.08); }
.music-disc:focus-visible { outline: 3px solid #f3cf7a; outline-offset: 3px; }
.music-disc .disc-spin { display: block; width: 64px; height: 64px; border-radius: 50%; }
.music-disc .disc-spin svg { display: block; }
.music-disc.playing .disc-spin { animation: discspin 6s linear infinite; }
@keyframes discspin { to { transform: rotate(360deg); } }
.music-disc::before { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(243, 207, 122, .55); opacity: 0; }
.music-disc.playing::before { animation: discpulse 2s ease-out infinite; }
@keyframes discpulse { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
.music-disc .disc-state { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #fff1c2, #d4a24c 60%, #8a6420); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); color: #2a1606; font-size: 11px; font-weight: 900; }
.music-disc .disc-state::before { content: "▶"; padding-left: 2px; }
.music-disc.playing .disc-state::before { content: "❚❚"; padding-left: 0; font-size: 9px; letter-spacing: -1px; }
@media (max-width: 1140px) { .music-disc { right: 14px; top: 120px; transform: scale(.8); } .music-disc:hover { transform: scale(.86); } }
.music-disc.muted .disc-state::before { content: "🔇"; font-size: 11px; padding: 0; letter-spacing: 0; }
.music-disc.muted .disc-spin { animation-duration: 12s; }
.music-disc.muted[data-tap]::after { content: attr(data-tap); position: absolute; right: 74px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 600 12px var(--font); color: #1a1208; background: linear-gradient(180deg, #fff1c2, #d4a24c); padding: 4px 10px; border-radius: 14px; box-shadow: 0 3px 10px rgba(0,0,0,.4); animation: tapHint 2.4s ease-in-out infinite; }
@keyframes tapHint { 0%, 100% { opacity: .95; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .music-disc.playing .disc-spin, .music-disc.playing::before { animation: none; } }

/* ---------- Trailer: គ្មានរបារបញ្ជា, មានតែប៊ូតុងសំឡេង ---------- */
.trailer-box video { object-fit: cover; pointer-events: none; }
.trailer-box video::-webkit-media-controls { display: none !important; }
.trailer-shield { position: absolute; inset: 0; z-index: 1; }
.trailer-sound { position: absolute; right: 16px; bottom: 16px; z-index: 2; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0;
  color: #ffe9b0; border: 2px solid #e9b955;
  background: radial-gradient(circle at 35% 30%, #ff8a4a 0%, #d63a1c 45%, #7a160b 100%);
  box-shadow: 0 0 0 3px rgba(60, 20, 5, .55), 0 0 16px rgba(255, 120, 40, .55), inset 0 2px 6px rgba(255, 220, 160, .45), inset 0 -4px 8px rgba(60, 0, 0, .5);
  transition: transform .2s, box-shadow .2s; }
.trailer-sound:hover { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(60, 20, 5, .55), 0 0 24px rgba(255, 140, 50, .8), inset 0 2px 6px rgba(255, 220, 160, .45), inset 0 -4px 8px rgba(60, 0, 0, .5); }
.trailer-sound:focus-visible { outline: 3px solid #f3cf7a; outline-offset: 3px; }
.trailer-sound svg { filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.trailer-sound .snd-wave { display: none; }
.trailer-sound.on .snd-wave { display: inline; }
.trailer-sound.on .snd-x { display: none; }
@media (max-width: 640px) { .trailer-sound { width: 44px; height: 44px; right: 10px; bottom: 10px; } }

.rank-updated { margin-top: 6px; font-size: 13px; color: var(--muted); }
.rank-updated b { color: var(--gold); }

/* =========================================================
   WEATHER EFFECTS (ទំព័រដើម) — pointer-events: none
   ========================================================= */
.wx-badge { display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; margin-right: auto; margin-left: 14px; padding: 1px 10px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(243, 207, 122, .3); }
.wx-badge b { color: var(--gold-2, #f3cf7a); }
.wx-badge small { opacity: .75; }
@media (max-width: 560px) { .wx-badge small { display: none; } .wx-badge { margin-left: 6px; } }

.wx-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.wx-layer > * { position: absolute; inset: 0; }
.wx-canvas { width: 100%; height: 100%; }
.wx-sun, .wx-moon, .wx-stars, .wx-clouds, .wx-fog, .wx-flash, .wx-sky { display: none; }

/* Sky tint */
.wx-sky { display: block; }
.wx-rain .wx-sky, .wx-storm .wx-sky { background: linear-gradient(180deg, rgba(20, 30, 45, .28), rgba(10, 15, 25, .12) 60%, transparent); }
.wx-snow .wx-sky { background: linear-gradient(180deg, rgba(200, 225, 255, .10), transparent 55%); }
.wx-fog .wx-sky { background: linear-gradient(180deg, rgba(200, 200, 200, .06), rgba(220, 220, 220, .10)); }

/* Sun (ថ្ងៃ មេឃស្រឡះ) */
.wx-clear:not(.wx-night) .wx-sun { display: block; inset: auto; top: -180px; right: -160px; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 170, .55) 0%, rgba(255, 200, 90, .22) 30%, rgba(255, 180, 60, .06) 55%, transparent 70%); animation: wxSun 8s ease-in-out infinite; }
.wx-clear:not(.wx-night) .wx-sun::after { content: ""; position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, rgba(255, 230, 160, .10) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 62%); mask: radial-gradient(circle, #000 20%, transparent 62%); animation: wxSpin 90s linear infinite; }
@keyframes wxSun { 0%, 100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes wxSpin { to { transform: rotate(360deg); } }

/* Night: moon + stars */
.wx-night.wx-clear .wx-moon, .wx-night.wx-clouds .wx-moon { display: block; inset: auto; top: 120px; right: 9%; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe8, #f1e2b0 60%, #d8c487); box-shadow: 0 0 30px 8px rgba(255, 240, 190, .35), 0 0 90px 30px rgba(255, 240, 190, .12); opacity: .9; }
.wx-night.wx-clear .wx-stars, .wx-night.wx-clouds .wx-stars, .wx-night.wx-snow .wx-stars { display: block; bottom: 45%;
  background-image: radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 25% 40%, #fff, transparent), radial-gradient(1.6px 1.6px at 38% 12%, #fff, transparent),
    radial-gradient(1px 1px at 52% 30%, #fff, transparent), radial-gradient(1.4px 1.4px at 64% 8%, #fff, transparent), radial-gradient(1px 1px at 72% 36%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 85% 22%, #fff, transparent), radial-gradient(1px 1px at 93% 44%, #fff, transparent), radial-gradient(1.2px 1.2px at 6% 48%, #fff, transparent),
    radial-gradient(1px 1px at 46% 52%, #fff, transparent), radial-gradient(1.3px 1.3px at 79% 55%, #fff, transparent), radial-gradient(1px 1px at 31% 62%, #fff, transparent);
  animation: wxTwinkle 4s ease-in-out infinite alternate; }
@keyframes wxTwinkle { from { opacity: .45; } to { opacity: 1; } }

/* Clouds */
.wx-clouds, .wx-rain .wx-clouds, .wx-storm .wx-clouds { }
.wx-layer.wx-clouds .wx-clouds, .wx-rain .wx-clouds, .wx-storm .wx-clouds, .wx-snow .wx-clouds { display: block; }
.wx-clouds i { position: absolute; left: -40%; width: 520px; height: 150px; border-radius: 50%; filter: blur(22px);
  background: radial-gradient(ellipse at center, rgba(235, 240, 250, .20), rgba(235, 240, 250, 0) 70%); animation: wxDrift 70s linear infinite; }
.wx-clouds i:nth-child(1) { top: 6%; animation-duration: 80s; }
.wx-clouds i:nth-child(2) { top: 18%; width: 700px; animation-duration: 110s; animation-delay: -40s; }
.wx-clouds i:nth-child(3) { top: 32%; width: 420px; animation-duration: 95s; animation-delay: -70s; opacity: .7; }
.wx-clouds i:nth-child(4) { top: 2%; width: 600px; animation-duration: 130s; animation-delay: -20s; opacity: .8; }
.wx-rain .wx-clouds i, .wx-storm .wx-clouds i { background: radial-gradient(ellipse at center, rgba(70, 80, 95, .38), rgba(70, 80, 95, 0) 70%); }
@keyframes wxDrift { from { transform: translateX(0); } to { transform: translateX(190vw); } }

/* Fog */
.wx-layer.wx-fog .wx-fog { display: block; }
.wx-fog i { position: absolute; left: -50%; bottom: 0; width: 200%; height: 45%; background: linear-gradient(0deg, rgba(220, 225, 230, .22), transparent); filter: blur(8px); animation: wxFog 40s ease-in-out infinite alternate; }
.wx-fog i:nth-child(2) { height: 30%; opacity: .7; animation-duration: 55s; animation-direction: alternate-reverse; }
@keyframes wxFog { from { transform: translateX(-8%); } to { transform: translateX(8%); } }

/* Lightning */
.wx-layer.wx-storm .wx-flash { display: block; background: rgba(230, 240, 255, .0); }
.wx-flash.on { animation: wxFlash .9s ease-out; }
@keyframes wxFlash { 0% { background: rgba(230, 240, 255, .55); } 10% { background: rgba(230, 240, 255, .05); } 18% { background: rgba(230, 240, 255, .4); } 100% { background: rgba(230, 240, 255, 0); } }

@media (prefers-reduced-motion: reduce) {
  .wx-layer *, .wx-layer *::after { animation: none !important; }
  .wx-canvas { display: none; }
}

/* =========================================================
   SHOP JP — ស៊ុមបែប Imperial (ក្រហមចាស់ + មាស)
   ========================================================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.shop-frame { position: relative; border-radius: 6px; border: 2px solid #b8862f; color: #f3e6c8;
  background: radial-gradient(900px 400px at 85% 100%, rgba(184, 40, 31, .14), transparent 60%), linear-gradient(180deg, #2a0f0a 0%, #1a0b07 30%, #120806 100%);
  box-shadow: 0 0 0 1px #3a1a0c, 0 0 0 5px rgba(184, 134, 47, .18), 0 24px 60px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(243, 207, 122, .12); }
.shop-corner { position: absolute; width: 46px; height: 46px; pointer-events: none; z-index: 2;
  background: linear-gradient(135deg, #f3cf7a, #b8862f) top left / 100% 3px no-repeat, linear-gradient(135deg, #f3cf7a, #b8862f) top left / 3px 100% no-repeat; }
.shop-corner::after { content: "◆"; position: absolute; top: -9px; left: -7px; font-size: 14px; color: #f3cf7a; text-shadow: 0 0 6px rgba(243, 207, 122, .8); }
.shop-corner.tl { top: -2px; left: -2px; }
.shop-corner.tr { top: -2px; right: -2px; transform: scaleX(-1); }
.shop-corner.bl { bottom: -2px; left: -2px; transform: scaleY(-1); }
.shop-corner.br { bottom: -2px; right: -2px; transform: scale(-1, -1); }
.shop-head { padding: 18px 26px 14px; border-bottom: 1px solid rgba(184, 134, 47, .35); background: linear-gradient(180deg, rgba(0, 0, 0, .25), transparent); }
.shop-kicker { font-size: 11px; letter-spacing: .14em; font-weight: 700; color: #d9b36a; }
.shop-head h1 { margin: 2px 0 2px; font-family: var(--font-display, Georgia, serif); font-variant: small-caps; font-size: 40px; letter-spacing: .02em; color: #fbefd2; text-shadow: 0 2px 0 #000, 0 0 18px rgba(243, 207, 122, .25); }
.shop-head p { margin: 0; }
.shop-body { display: grid; grid-template-columns: 220px 1fr; min-height: 460px; }
.shop-cats { display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; border-right: 1px solid rgba(184, 134, 47, .35); }
.shop-cat { position: relative; text-align: left; padding: 10px 14px 10px 22px; cursor: pointer; font: 600 14px var(--font); color: #e9d9b6; border-radius: 4px;
  background: linear-gradient(180deg, #2e130c, #1c0b07); border: 1px solid #a8782a; box-shadow: inset 0 0 0 2px #1a0905, inset 0 0 0 3px rgba(184, 134, 47, .45); transition: filter .2s, transform .15s; }
.shop-cat::before { content: "◆"; position: absolute; left: -6px; top: 50%; transform: translateY(-50%); font-size: 11px; color: #c8102e; text-shadow: 0 0 4px rgba(255, 60, 60, .7); }
.shop-cat:hover { filter: brightness(1.2); transform: translateX(2px); }
.shop-cat.active { color: #fff; background: linear-gradient(180deg, #d6241c, #8f0f0b); border-color: #f3cf7a; box-shadow: inset 0 0 0 2px #5a0805, inset 0 0 0 3px #f3cf7a, 0 0 14px rgba(214, 36, 28, .45); }
.shop-cat span { margin-right: 4px; }
.shop-main { padding: 16px 18px 18px; min-width: 0; }
.shop-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.shop-search { flex: 1; }
.shop-search input { width: 100%; padding: 11px 16px; border-radius: 4px; color: #f3e6c8; border: 1px solid #8a6420; background: linear-gradient(90deg, rgba(60, 40, 25, .85), rgba(30, 18, 12, .85)); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5); }
.shop-search input::placeholder { color: #9a8566; }
.shop-pager { display: flex; gap: 6px; flex-wrap: wrap; }
.shop-pager button { min-width: 34px; height: 30px; padding: 0 8px; border-radius: 3px; cursor: pointer; font: 700 12px var(--font); color: #e9d9b6; background: #1c0b07; border: 1px solid #a8782a; }
.shop-pager button.active { color: #fff; background: linear-gradient(180deg, #d6241c, #8f0f0b); border-color: #f3cf7a; }
.shop-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.shop-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px; text-align: left; cursor: pointer; border-radius: 4px; color: inherit; font: inherit;
  background: linear-gradient(180deg, #2a100a, #170805); border: 1px solid #b8862f; box-shadow: inset 0 0 0 2px #120604, inset 0 0 0 3px rgba(214, 36, 28, .55), 0 3px 10px rgba(0, 0, 0, .4); transition: transform .15s, box-shadow .2s; }
.shop-item::before, .shop-item::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid #f3cf7a; pointer-events: none; }
.shop-item::before { top: 3px; left: 3px; border-right: 0; border-bottom: 0; }
.shop-item::after { bottom: 3px; right: 3px; border-left: 0; border-top: 0; }
.shop-item:hover, .shop-item:focus-visible { transform: translateY(-2px); box-shadow: inset 0 0 0 2px #120604, inset 0 0 0 3px #f3cf7a, 0 8px 22px rgba(214, 36, 28, .35); outline: none; }
.si-icon { flex: 0 0 auto; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 3px; background: radial-gradient(circle, #3a2414, #140905); border: 1px solid #a8782a; box-shadow: inset 0 0 8px rgba(0, 0, 0, .7); }
.si-icon img { width: 44px; height: 44px; object-fit: contain; }
.si-icon.lg { width: 84px; height: 84px; } .si-icon.lg img { width: 72px; height: 72px; }
.si-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.si-name { font-size: 14px; color: #fbefd2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: #c9b48d; }
.si-price { font-weight: 800; color: #f3cf7a; }
.si-old { color: #8f7a5a; }
.si-badge { position: absolute; top: -7px; right: 10px; padding: 1px 7px; border-radius: 3px; font: 800 10px var(--font); letter-spacing: .05em; color: #fff; }
.si-badge.hot { background: linear-gradient(180deg, #ff5a36, #b8160c); box-shadow: 0 0 8px rgba(255, 80, 40, .6); }
.si-badge.new { background: linear-gradient(180deg, #4fc3ff, #1b6fd1); }
.shop-empty { text-align: center; padding: 40px 0; }
.shop-modal { width: min(520px, 100%); padding: 24px; background: linear-gradient(180deg, #2a0f0a, #140806) !important; color: #f3e6c8; border: 2px solid #b8862f; }
.shop-modal .sm-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.shop-modal h3 { margin: 0 0 6px; color: #fbefd2; }
.sm-price b { font-size: 20px; color: #f3cf7a; } .sm-price s { color: #8f7a5a; margin-left: 6px; }
.sm-desc { white-space: pre-line; line-height: 1.6; color: #e1d0ac; }
@media (max-width: 1000px) { .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .shop-body { grid-template-columns: 1fr; }
  .shop-cats { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid rgba(184, 134, 47, .35); padding: 12px; }
  .shop-cat { flex: 0 0 auto; white-space: nowrap; }
  .shop-tools { flex-direction: column; align-items: stretch; }
  .shop-head h1 { font-size: 30px; }
}
@media (max-width: 520px) { .shop-grid { grid-template-columns: 1fr; } }
.shop-modal .kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid rgba(184, 134, 47, .35); border-radius: 4px; background: rgba(0, 0, 0, .25); }
.shop-modal .kv dt { color: #c9b48d; } .shop-modal .kv dd { margin: 0; color: #f3cf7a; font-weight: 700; }
.brand-text { white-space: nowrap; }
@media (max-width: 1440px) { .nav-frame a { padding: 8px 10px; } .nav-frame { gap: 2px; } }
@media (max-width: 1280px) { .nav-frame a { padding: 8px 8px; font-size: 14px; } }

.shop-item[hidden] { display: none !important; }
/* Shop JP: ប្រភេទនៅខាងឆ្វេង (ទំហំស្មើគ្នា), ទំព័រនៅខាងស្តាំលើ */
.shop-cat { width: 100%; }
.shop-pager button.nav { font-size: 15px; }
.shop-pager button:disabled { opacity: .35; cursor: default; }
@media (max-width: 760px) {
  .shop-cat { width: auto; flex: 0 0 auto; }
  .shop-cats { scrollbar-width: thin; scrollbar-color: #a8782a transparent; }
  .shop-cats::-webkit-scrollbar { height: 4px; } .shop-cats::-webkit-scrollbar-thumb { background: #a8782a; border-radius: 4px; }
}

/* ---------- Telegram login ---------- */
.btn-telegram { display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff !important; font-weight: 700;
  background: linear-gradient(180deg, #37aee2, #1e96c8) !important; border: 1px solid #5cc1ec !important; box-shadow: 0 6px 18px rgba(30, 150, 200, .35); text-shadow: none; }
.btn-telegram:hover { filter: brightness(1.08); color: #fff !important; }
.or-sep { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 13px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.tg-linked { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(55, 174, 226, .45); background: rgba(55, 174, 226, .08); }
.tg-linked img, .tg-ava { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-size: 26px; background: rgba(55, 174, 226, .2); }
.tg-linked b { display: block; } .tg-linked small { color: #5cc1ec; }
