/* PROJECT X3D · เว็บลูกค้า — ธีมดำ-น้ำเงินรอยัล มุมโค้ง (ปรับตามแบบ 11 พ.ย.) */
:root {
  --bg: #05070c;
  --bg-deep: #030408;
  --surface: #0b0f18;
  --surface-2: #111726;
  --surface-hover: #172036;
  --border: #1d2538;
  --accent: #3b74ff;
  --accent-2: #1f4fe6;
  --text: #eef2f9;
  --muted: #98a2b6;
  --radius: 16px;
  --radius-sm: 10px;
  --head: "Kanit", "IBM Plex Sans Thai", sans-serif;
  --danger: #d9364f;
  --success: #1fa971;
  --warning: #f0b030;
  --glow: 0 0 14px rgba(59, 116, 255, .4);
  --cut: 14px;
  --font: "IBM Plex Sans Thai", "Leelawadee UI", "Segoe UI", system-ui, sans-serif;
  --brand: "Orbitron", "IBM Plex Sans Thai", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg-deep); }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 17px; line-height: 1.65; color: var(--text);
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(59, 116, 255, .22), transparent 70%),
    radial-gradient(600px 400px at 100% 40%, rgba(59, 116, 255, .06), transparent 70%),
    linear-gradient(180deg, var(--bg-deep) 0%, #081634 100%);
  background-attachment: fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(59, 116, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(59, 116, 255, .07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 80%);
}
header, main, footer { position: relative; z-index: 1; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
img { max-width: 100%; }
.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }
.accent { color: var(--accent); }
.glow-text { text-shadow: 0 0 14px rgba(59, 116, 255, .6); }
.ok-text { color: #6ee7b7; } .bad-text { color: #fca5a5; } .warn-text { color: #fcd34d; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- nav ---------- */
/* ปัก sticky ไว้ที่ #nav (header ตัวนอก ลูกตรงของ body) ไม่ใช่ .nav (ตัวใน) — เพราะ .nav ถูกครอบอยู่ใน
   <header id="nav"> ที่สูงเท่า .nav เป๊ะ ๆ (ไม่มีเนื้อหาอื่น) ทำให้ "กรอบที่ sticky เกาะได้" ของ .nav
   แคบแค่ความสูงตัวเอง เลื่อนผ่านไปก็หลุดตามไปด้วยทันที ต้องปักที่ header ซึ่งมีพื้นที่เกาะได้ยาวเท่าเนื้อหาทั้งหน้า */
#nav { position: sticky; top: 0; z-index: 10; }
.nav { background: rgba(2, 4, 10, .85); backdrop-filter: blur(12px); }
.nav::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2) 20%, var(--accent) 50%, var(--accent-2) 80%, transparent); box-shadow: 0 0 12px rgba(59, 116, 255, .6); }
.nav-in { display: flex; align-items: center; gap: 18px; min-height: 68px; flex-wrap: wrap; padding: 8px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 44px; height: 44px; filter: drop-shadow(0 0 8px rgba(59, 116, 255, .5)); }
.brand b { font-family: var(--brand); font-weight: 800; letter-spacing: .06em; display: block; line-height: 1.1; }
.brand b span { color: var(--accent); text-shadow: 0 0 12px rgba(59, 116, 255, .7); }
.brand small { font-size: .66rem; letter-spacing: .22em; color: var(--muted); }
.links { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.links a { color: var(--muted); text-decoration: none; padding: 8px 12px; font-weight: 500; position: relative; }
.links a:hover { color: var(--text); }
.links a[aria-current] { color: var(--accent); }
.links a[aria-current]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--accent); box-shadow: var(--glow); }
.nav-right { display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
  .nav-in { gap: 6px 10px; }
  .brand { flex: 1; min-width: 0; white-space: nowrap; }
  .brand img { width: 36px; height: 36px; }
  .brand small { display: none; }
  .links { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -8px; }
  .links a { white-space: nowrap; padding: 6px 10px; }
  .nav-right .muted { display: none; }
}
.credit-chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 14px; font-weight: 600; text-decoration: none; color: var(--accent);
  background: rgba(59, 116, 255, .08); border: 1px solid rgba(59, 116, 255, .45);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.credit-chip .coin-ic { width: 16px; height: 16px; flex: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font-weight: 600; text-decoration: none;
  padding: 10px 18px; min-height: 44px; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); transition: filter .15s, transform .15s; }
.btn-x { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--bg-deep); }
.btn-x:hover { filter: brightness(1.15) drop-shadow(0 0 10px rgba(59, 116, 255, .6)); transform: translateY(-1px); }
.btn-ghost { background: rgba(17, 29, 53, .7); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--accent); }
.btn-danger { background: rgba(70, 18, 30, .85); color: #ffaab4; border: 1px solid var(--danger); }
.btn:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; filter: none; transform: none; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .92rem; }
.btn-lg { min-height: 54px; padding: 12px 26px; font-size: 1.08rem; }
.btn-block { width: 100%; }

/* ---------- panels ---------- */
.panel { position: relative; padding: 22px; --edge: var(--border);
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--edge) 50%, transparent calc(50% + 1px)) top left / var(--cut) var(--cut) no-repeat,
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--edge) 50%, transparent calc(50% + 1px)) bottom right / var(--cut) var(--cut) no-repeat,
    linear-gradient(180deg, rgba(11, 19, 36, .92), rgba(6, 12, 26, .92));
  border: 1px solid var(--edge);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.panel::before { content: ""; position: absolute; top: 0; left: var(--cut); right: 30%; height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }
.panel.glow { --edge: rgba(59, 116, 255, .55); box-shadow: inset 0 0 40px rgba(59, 116, 255, .12); }
.label { font-size: .85rem; font-weight: 600; letter-spacing: .04em; color: var(--accent); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.label::before { content: ""; width: 8px; height: 8px; background: var(--accent); box-shadow: var(--glow); transform: rotate(45deg); }
.page-title { display: flex; align-items: center; gap: 12px; margin: 28px 0 22px; }
.page-title h1 { margin: 0; font-size: 1.9rem; }
.page-title .bar { width: 4px; height: 1.9rem; background: var(--accent); box-shadow: var(--glow); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.side-main { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.main-side { display: grid; gap: 22px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .side-main, .main-side { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 18px; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; color: #c9d7ee; font-size: .95rem; font-weight: 600; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.input { width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 11px 14px; min-height: 48px; font-size: 1.05rem; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(59, 116, 255, .25); }
.form-error { border: 1px solid var(--danger); border-left-width: 4px; padding: 10px 14px; color: #ffb0bb; background: rgba(60, 16, 26, .6); margin-bottom: 14px; white-space: pre-line; }

.form-ok { border: 1px solid var(--success); border-left-width: 4px; padding: 10px 14px; color: #8ff5c9; background: rgba(12, 52, 36, .6); margin-bottom: 14px; }

/* ---------- หน้าหลัก 2 คอลัมน์ + ตารางอันดับ ---------- */
/* หน้าหลัก: แบนเนอร์เต็มความกว้าง → ตัวเลขสรุป → โปรโมชั่น + ตารางจัดอันดับ แถวเดียวกัน */
.banner { --ms: 5000ms; position: relative; margin: 24px 0 22px; aspect-ratio: 3 / 1; background: var(--bg-deep);
  border: 1px solid var(--edge); overflow: hidden; box-shadow: 0 0 40px rgba(59, 116, 255, .18);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.banner::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(59, 116, 255, .25); }
.banner-track { position: absolute; inset: 0; touch-action: pan-y; }
.banner-slide { position: absolute; inset: 0; display: block; opacity: 0; visibility: hidden; transform: scale(1.04);
  transition: opacity .7s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1), visibility 0s .7s; }
.banner-slide.on { opacity: 1; visibility: visible; transform: none; transition: opacity .7s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1), visibility 0s; z-index: 1; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
a.banner-slide:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.banner-arrow { position: absolute; top: 50%; z-index: 3; width: 46px; height: 46px; margin-top: -23px; display: grid; place-items: center; padding: 0 0 4px;
  font-size: 2rem; line-height: 1; color: var(--accent); background: rgba(3, 8, 20, .72); border: 1px solid rgba(59, 116, 255, .6); cursor: pointer;
  opacity: 0; transition: opacity .2s, background .15s; }
.banner-arrow.prev { left: 14px; } .banner-arrow.next { right: 14px; }
.banner:hover .banner-arrow, .banner-arrow:focus-visible { opacity: 1; }
.banner-arrow:hover { background: rgba(0, 60, 110, .92); }
.banner-dots { position: absolute; z-index: 3; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px;
  padding: 6px 10px; background: rgba(3, 8, 20, .55); backdrop-filter: blur(4px); }
.banner-dot { width: 26px; height: 6px; padding: 0; border: 0; cursor: pointer; background: rgba(255, 255, 255, .28); position: relative; overflow: hidden; }
.banner-dot span { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 8px var(--accent); }
.banner-dot.on span { transform: scaleX(1); }
.banner.run .banner-dot.on span { animation: banner-fill var(--ms) linear both; }
.banner.paused .banner-dot.on span { animation: none; transform: scaleX(1); }
@keyframes banner-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (hover: none) { .banner-arrow { display: none; } }
@media (max-width: 640px) { .banner { margin-top: 14px; --cut: 8px; } .banner-dots { bottom: 6px; padding: 4px 8px; gap: 6px; } .banner-dot { width: 16px; height: 4px; } }
@media (prefers-reduced-motion: reduce) { .banner-slide { transform: none; } }

.promo-row { display: grid; gap: 26px; grid-template-columns: minmax(0, 1fr) 320px; align-items: stretch; margin-bottom: 6px; }
.promo-main { min-width: 0; }
.promo-main .promo-carousel { --pv: 2; }
.promo-side { display: flex; }
.promo-side .board { margin-top: 0; flex: 1; margin-bottom: 40px; }
@media (max-width: 980px) { .promo-row { grid-template-columns: 1fr; gap: 0; } .promo-side .board { margin-bottom: 34px; } }
@media (max-width: 640px) { .promo-main .promo-carousel { --pv: 1; } }
.board { margin-top: 28px; }
.banner-thumb { width: 150px; aspect-ratio: 12 / 5; object-fit: cover; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 1.4rem; }
.banner-preview { display: block; width: 100%; aspect-ratio: 12 / 5; object-fit: cover; margin-top: 10px; border: 1px solid var(--border); }
.board h2 { margin: 2px 0 2px; font-size: 1.25rem; }
.board-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.board-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); }
.board-list .rk { text-align: center; font-weight: 700; color: var(--muted); font-size: 1.05rem; }
.board-list .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .nm small { color: var(--accent); }
.board-list .hr { color: var(--accent); font-weight: 700; white-space: nowrap; }
.board-list li:nth-child(1) { border-color: #d4a72c; background: linear-gradient(90deg, rgba(212, 167, 44, .18), var(--surface-2)); }
.board-list li:nth-child(2) { border-color: #9aa7ba; }
.board-list li:nth-child(3) { border-color: #b5773a; }
.board-list li.me { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.board-me { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.board-me .board-list { margin-top: 6px; }

/* ---------- โปรโมชั่นหน้าหลัก ---------- */
.promos { margin-bottom: 40px; }
/* แถบโปรโมชั่นเลื่อนซ้าย-ขวา: โชว์ 3 ใบ (จอกลาง 2 · มือถือ 1) */
.promo-carousel { --pg: 22px; --pv: 3; position: relative; margin-bottom: 40px; }
@media (max-width: 1000px) { .promo-carousel { --pv: 2; } }
@media (max-width: 640px) { .promo-carousel { --pv: 1; --pg: 14px; } }
.promo-track { display: flex; gap: var(--pg); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 26px 8px 30px; margin: -26px -8px -30px; scroll-padding-inline: 8px; overscroll-behavior-x: contain; position: relative; }
.promo-track::-webkit-scrollbar { display: none; }
.promo-track.drag { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.promo-track.drag .promo { pointer-events: none; }
.promo-track .promo { flex: 0 0 calc((100% - (var(--pv) - 1) * var(--pg)) / var(--pv)); scroll-snap-align: start; }
.promo-arrow { position: absolute; top: 28%; z-index: 5; width: 54px; height: 54px; display: grid; place-items: center; padding: 0 0 4px; font-size: 2.4rem; line-height: 1; color: var(--accent); background: rgba(3, 8, 20, .88); border: 2px solid var(--accent); cursor: pointer; box-shadow: 0 0 22px rgba(59, 116, 255, .45); transition: opacity .15s, background .15s; }
.promo-arrow:hover { background: rgba(0, 60, 110, .95); }
.promo-arrow.prev { left: -10px; } .promo-arrow.next { right: -10px; }
.promo-arrow.off { opacity: 0; pointer-events: none; }
.promo-carousel.single .promo-arrow, .promo-carousel.single .promo-count { display: none; }
.promo-count { display: block; text-align: center; color: var(--muted); font-size: .95rem; margin-top: 14px; }
@media (max-width: 640px) { .promo-arrow { width: 42px; height: 42px; font-size: 1.9rem; top: 22%; } .promo-arrow.prev { left: -4px; } .promo-arrow.next { right: -4px; } }
.promo { position: relative; display: flex; flex-direction: column; padding: 0; text-align: left; cursor: pointer; background: var(--surface); border: 2px solid rgba(59, 116, 255, .75); overflow: hidden; animation: promo-glow 2.8s ease-in-out infinite; transition: transform .18s; }
.promo::before { content: "🔥 โปรโมชั่น"; position: absolute; top: 14px; left: 0; z-index: 2; padding: 6px 16px 6px 14px; font-weight: 700; font-size: .95rem; color: #02040a; background: linear-gradient(90deg, #3b74ff, #1f4fe6); clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); box-shadow: 0 0 14px rgba(59, 116, 255, .6); }
.promo:hover, .promo:focus-visible { transform: translateY(-4px) scale(1.01); outline: none; }
@keyframes promo-glow { 0%, 100% { box-shadow: 0 0 20px rgba(59, 116, 255, .35); } 50% { box-shadow: 0 0 36px rgba(59, 116, 255, .7); } }
@media (prefers-reduced-motion: reduce) { .promo { animation: none; box-shadow: 0 0 40px rgba(59, 116, 255, .5); } }
.promo-pic { display: block; aspect-ratio: 4 / 3; background: #02040a; overflow: hidden; line-height: 0; }
.promo-pic img { width: 100%; height: 100%; display: block; object-fit: contain; }
.promo-pic:not(:has(img)), .promo-pic.noimg { display: grid; place-items: center; background: linear-gradient(135deg, rgba(59, 116, 255, .35), rgba(2, 4, 10, .9)); }
.promo-pic:not(:has(img))::after, .promo-pic.noimg::after { content: "🎁"; font-size: 4rem; line-height: 1; }
.promo-pic.noimg img { display: none; }
.promo-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px 22px; background: linear-gradient(180deg, rgba(59, 116, 255, .14), transparent); }
.promo-body b { font-size: 1.4rem; line-height: 1.3; }
.promo-more { color: var(--accent); font-size: 1.05rem; font-weight: 600; }
.promo-text { white-space: pre-line; margin: 14px 0 0; line-height: 1.65; }

/* ---------- แอดมิน: จัดการโปรโมชั่น ---------- */
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch .slider { position: absolute; inset: 0; background: #1a2740; border: 1px solid var(--border); border-radius: 28px; transition: background .2s, border-color .2s; }
.switch .slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #8b9bb8; transition: transform .2s, background .2s; }
.switch input:checked + .slider { background: rgba(31, 169, 113, .35); border-color: var(--success); }
.switch input:checked + .slider::before { transform: translateX(22px); background: #6ee7b7; }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 2px var(--accent); }
.switch input:disabled { cursor: wait; }
.promo-preview { display: block; max-width: 100%; max-height: 220px; margin-top: 10px; border: 1px solid var(--border); }
.promo-none { display: grid; place-items: center; font-size: 1.6rem; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #c9d7ee; cursor: pointer; }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.5; }

/* ---------- ป๊อปอัพกฎ ---------- */
/* ป๊อปอัพกฎของร้าน */
.modal-bg .panel.rules-modal { width: min(660px, 100%); padding-top: 18px; }
.rules-modal > .row.between:first-child { position: absolute; top: 12px; right: 12px; z-index: 2; }
.rules-modal > .row.between:first-child h2:empty { display: none; }
.rules-modal > .row.between + div { margin-top: 0 !important; }
.rules { display: grid; gap: 14px; }
.rules > * { animation: rule-in .42s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d, 0ms); }
@keyframes rule-in { from { opacity: 0; transform: translateY(10px); } }
.rules-hero { display: flex; align-items: center; gap: 14px; padding: 4px 40px 12px 0; border-bottom: 1px solid var(--border); }
.rules-shield { flex: none; width: 54px; height: 54px; display: grid; place-items: center; color: var(--accent);
  background: radial-gradient(circle, rgba(59, 116, 255, .22), transparent 70%); filter: drop-shadow(0 0 8px rgba(59, 116, 255, .55)); }
.rules-shield svg { width: 42px; height: 42px; animation: shield-pulse 2.6s ease-in-out infinite; }
@keyframes shield-pulse { 50% { filter: drop-shadow(0 0 10px rgba(59, 116, 255, .9)); } }
.rules-kicker { color: var(--accent); font-size: .85rem; font-weight: 600; }
.rules-hero h3 { margin: 2px 0 0; font-size: 1.3rem; line-height: 1.35;
  background: linear-gradient(90deg, #fff, #b9cdff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rules-list { display: grid; gap: 10px; }
.rule { --tc: var(--accent); display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; position: relative;
  background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 12%, transparent), transparent 60%), var(--surface-2);
  border: 1px solid var(--border); border-left: 3px solid var(--tc);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); transition: transform .15s, border-color .15s; }
.rule:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--tc) 55%, var(--border)); border-left-color: var(--tc); }
.rule.tone-ban { --tc: var(--danger); }
.rule.tone-info { --tc: var(--warning); }
.rule-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.3rem;
  background: color-mix(in srgb, var(--tc) 18%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 45%, transparent);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.rule-tag { display: inline-block; color: var(--tc); font-size: .95rem; margin-bottom: 2px; }
.rule p { margin: 0; font-size: .9rem; line-height: 1.6; color: var(--text); opacity: .9; }
.rules-notes { padding: 12px 14px; border: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent); background: rgba(59, 116, 255, .04); }
.rules-notes h4 { margin: 0 0 8px; font-size: 1rem; }
.rules-notes ol { list-style: none; counter-reset: n; margin: 0; padding: 0; display: grid; gap: 8px; }
.rules-notes li { counter-increment: n; display: flex; gap: 10px; font-size: .9rem; line-height: 1.6; }
.rules-notes li::before { content: counter(n); flex: none; width: 24px; height: 24px; margin-top: 1px; display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; color: #02040a; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-radius: 50%;
  box-shadow: 0 0 8px rgba(59, 116, 255, .5); }
.rules-accept { display: flex; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); font-size: .92rem; }
.rules-accept:has(input:checked) { border-color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface-2)); }
.rules-accept.nudge { animation: rule-nudge .5s ease; border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger), 0 0 14px rgba(217, 54, 79, .45); }
@keyframes rule-nudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.rules-accept input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
@media (prefers-reduced-motion: reduce) { .rules > *, .rules-shield svg, .rules-accept.nudge { animation: none; } .rule:hover { transform: none; } }
@media (max-width: 520px) { .rules-hero h3 { font-size: 1.1rem; } .rule-ic { width: 34px; height: 34px; font-size: 1.1rem; } }

/* ---------- status pills ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: .86rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.st-free { color: #6ee7b7; background: rgba(10, 38, 32, .9); }
.st-use { color: #7dd3fc; background: rgba(10, 33, 66, .9); }
.st-res { color: #c4b5fd; background: rgba(32, 24, 66, .9); }
.st-busy { color: #fcd34d; background: rgba(48, 38, 10, .9); }
.st-muted { color: #8a96ab; background: rgba(22, 27, 38, .9); }
.st-bad { color: #fca5a5; background: rgba(60, 16, 26, .9); }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 56px 0 36px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding-top: 28px; } }
.kicker { font-size: .85rem; letter-spacing: .2em; color: var(--accent); font-weight: 600; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); line-height: 1.15; margin: 12px 0 14px; }
.grad { background: linear-gradient(90deg, #fff 0%, var(--accent) 45%, var(--accent-2) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.12rem; max-width: 34rem; }
.hero-logo { position: relative; display: grid; place-items: center; }
.hero-logo::before { content: ""; position: absolute; width: 88%; aspect-ratio: 1; border-radius: 50%; border: 1px dashed rgba(59, 116, 255, .35); animation: spin 40s linear infinite; }
.hero-logo::after { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(59, 116, 255, .35), transparent 65%); filter: blur(20px); }
.hero-logo img { position: relative; z-index: 1; width: min(420px, 90%); animation: float 6s ease-in-out infinite; filter: drop-shadow(0 0 30px rgba(59, 116, 255, .45)); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-12px); } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); margin-bottom: 34px; }
.stats > div { background: rgba(6, 10, 20, .92); padding: 16px 18px; }
.stats b { font-size: 2rem; line-height: 1; display: block; }
.stats span { color: var(--muted); font-size: .85rem; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 30px; }
.steps .n { font-family: var(--brand); font-size: 1.8rem; font-weight: 800; color: transparent; -webkit-text-stroke: 1px var(--accent); }
.steps h3 { margin: 4px 0; font-size: 1.05rem; }

/* ---------- host cards ---------- */
.host { position: relative; display: flex; flex-direction: column; padding: 18px; --edge: var(--border);
  background:
    linear-gradient(to bottom left, transparent calc(50% - 1px), var(--edge) 50%, transparent calc(50% + 1px)) top right / 22px 22px no-repeat,
    linear-gradient(160deg, rgba(17, 29, 53, .95), rgba(6, 12, 26, .95));
  border: 1px solid var(--edge); clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%); transition: transform .2s, box-shadow .2s; }
.host.free:hover { --edge: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 40px -10px rgba(59, 116, 255, .45); }
.host.off { opacity: .62; }
.host-img { position: relative; margin: -18px -18px 12px; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-deep); border-bottom: 1px solid var(--border); }
.host-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.host.free:hover .host-img img { transform: scale(1.04); }
.host.off .host-img img { filter: grayscale(.7) brightness(.7); }
.host-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(2, 4, 10, .85)); }
.host-img .st { position: absolute; top: 12px; right: 12px; z-index: 1; }
.host-code { font-family: var(--brand); font-weight: 800; font-size: 1.3rem; letter-spacing: .05em; }
.host-img .host-code { position: absolute; left: 16px; bottom: 8px; z-index: 1; text-shadow: 0 2px 10px #000; }
.specs { list-style: none; padding: 0; margin: 4px 0 12px; display: grid; gap: 4px; font-size: .95rem; color: #b9c9e4; }
.specs li::before { content: "▸ "; color: var(--accent); }
.rate { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.rate small { font-size: .85rem; color: var(--muted); font-weight: 400; }
.pkg { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin: 12px 0; }
.pkg button { padding: 8px 2px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-weight: 500; }
.pkg button:hover { border-color: var(--accent); color: var(--text); }
.pkg button[aria-pressed="true"] { background: rgba(59, 116, 255, .14); border-color: var(--accent); color: var(--accent); }

/* ---------- wallet ---------- */
.balance { font-size: clamp(2.2rem, 6vw, 3.2rem); font-weight: 700; line-height: 1; }
.step-head { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.08rem; margin: 6px 0 12px; }
.step-head .no { width: 32px; height: 32px; display: grid; place-items: center; color: var(--bg-deep); background: var(--accent); font-weight: 700;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
@media (max-width: 560px) { .amounts { grid-template-columns: repeat(3, 1fr); } }
.amounts button, .methods button { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; padding: 12px 6px; }
.amounts button { font-family: var(--mono); font-weight: 700; }
.amounts button[aria-pressed="true"], .methods button[aria-pressed="true"] { background: rgba(59, 116, 255, .13); border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.methods button { display: flex; flex-direction: column; gap: 2px; align-items: center; font-weight: 600; font-size: 1.05rem; padding: 14px; }
.methods small { color: var(--muted); font-weight: 400; font-size: .82rem; }
.paybox { border: 1px dashed rgba(59, 116, 255, .45); background: rgba(2, 4, 10, .6); padding: 18px; margin-bottom: 20px; display: grid; gap: 18px; grid-template-columns: auto 1fr; align-items: center; }
@media (max-width: 640px) { .paybox { grid-template-columns: 1fr; text-align: center; } }
.qr { background: #fff; padding: 10px; width: 240px; max-width: 100%; margin: 0 auto; box-shadow: 0 0 0 1px var(--accent), 0 0 40px rgba(59, 116, 255, .35); }
.qr img { display: block; width: 100%; }
.pay-amount { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1.1; margin-bottom: 8px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed rgba(30, 58, 98, .8); }
.kv-row:last-child { border-bottom: 0; }
.kv-row span:first-child { color: var(--muted); }
.slip-drop { display: grid; place-items: center; text-align: center; cursor: pointer; min-height: 170px; padding: 16px; border: 2px dashed rgba(59, 116, 255, .45); background: rgba(2, 4, 10, .6); }
.slip-drop:hover { border-color: var(--accent); background: rgba(59, 116, 255, .06); }
.slip-drop.has { border-style: solid; border-color: var(--accent); }
.slip-drop img { max-height: 260px; object-fit: contain; }

/* ---------- tables ---------- */
.list { width: 100%; border-collapse: collapse; font-size: .94rem; }
.list th { text-align: left; color: var(--accent); font-weight: 600; font-size: .82rem; background: var(--bg-deep); padding: 9px 10px; border-bottom: 1px solid var(--border); }
.list td { padding: 9px 10px; border-bottom: 1px solid rgba(30, 58, 98, .5); vertical-align: top; }
.plus { color: #6ee7b7; } .minus { color: #fca5a5; }
.right { text-align: right; }

/* ---------- keys ---------- */
.keybox { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--bg-deep); border: 1px dashed rgba(59, 116, 255, .55); padding: 12px 14px; margin: 14px 0; }
.keytext { font-family: var(--mono); font-size: clamp(1.05rem, 2.6vw, 1.45rem); font-weight: 700; letter-spacing: .12em; color: var(--accent); text-shadow: 0 0 12px rgba(59, 116, 255, .5); }
.keytext.masked { filter: blur(7px); user-select: none; }
.countdown { font-size: 1.9rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; text-shadow: 0 0 14px rgba(59, 116, 255, .55); }
.countdown.warn { color: var(--warning); text-shadow: 0 0 14px rgba(240, 176, 48, .5); }
.howto { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.howto li { counter-increment: s; position: relative; padding-left: 36px; margin-bottom: 10px; color: #b9c9e4; }
.howto li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 24px; height: 24px; display: grid; place-items: center; font-weight: 700; font-size: .8rem; color: var(--bg-deep); background: var(--accent); }
.order.highlight { --edge: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 40px rgba(59, 116, 255, .25); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }

/* ---------- auth ---------- */
.auth { max-width: 520px; margin: 34px auto; }
.auth .logo { display: block; width: 120px; margin: 0 auto 14px; filter: drop-shadow(0 0 18px rgba(59, 116, 255, .5)); }

/* ---------- toasts / footer ---------- */
/* ปุ่มลอย "ติดต่อแอดมิน" — อยู่ใต้ modal (50) และ toast (100) */
.contact-fab { position: fixed; left: 16px; bottom: 16px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 1px solid var(--border); background: rgba(11, 19, 36, .96); color: inherit; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.contact-fab:hover:not(:disabled) { border-color: var(--accent); }
.contact-fab:disabled { opacity: .7; cursor: progress; }
@media (max-width: 640px) { .contact-fab { padding: 12px; } .contact-fab .cf-t { display: none; } }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(420px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border: 1px solid; border-left-width: 4px; background: rgba(11, 19, 36, .97); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: up .25s ease both; }
.toast.ok { border-color: var(--success); color: #8ff5c9; }
.toast.bad { border-color: var(--danger); color: #ffb0bb; }
.toast.warn { border-color: #f0b030; color: #ffd98a; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .82rem; border-top: 1px solid var(--border); padding: 20px 0 30px; margin-top: 40px; }
.foot-brand { display: flex; align-items: center; gap: 8px; }
.foot-brand img { width: 26px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- หลังบ้านเว็บ (แอดมิน) ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; background: var(--danger); color: #fff; font-size: .78rem; text-align: center; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 20px; }
.kpis .panel b { display: block; font-size: 1.7rem; font-family: var(--mono); color: var(--accent); line-height: 1.2; }
.table-wrap { overflow-x: auto; }
.list .input { min-height: 38px; padding: 6px 10px; font-size: .95rem; }
.thumb { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--border); background: #0b1324; cursor: zoom-in; }
.host-thumb { width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); background: #0b1324; }
.qr-admin { width: 200px; background: #fff; padding: 8px; }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(2, 4, 10, .78); display: grid; place-items: center; padding: 16px; }
.modal-bg .panel { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: var(--surface); }
.modal-bg .panel > .row.between:first-child { flex-wrap: nowrap; align-items: flex-start; }
.modal-bg img.full { max-width: 100%; max-height: 80vh; display: block; margin: 0 auto; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form .input { width: auto; min-width: 0; }

/* ---- หน้าโปรไฟล์ของฉัน */
.acc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.acc-stat { padding: 12px; border: 1px solid var(--border); background: var(--surface); min-width: 0; }
.acc-stat-v { font-size: 1.05rem; font-weight: 700; margin-top: 4px; overflow-wrap: anywhere; }
.input:disabled { opacity: .6; cursor: not-allowed; }

/* ---- จองเครื่องล่วงหน้า (#/book) + การจองของฉัน */
.bk-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.bk-side { position: sticky; top: 84px; }
@media (max-width: 980px) { .bk-layout { grid-template-columns: 1fr; } .bk-side { position: static; } }
.bk-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
.bk-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; min-height: 44px; cursor: pointer; font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.bk-day b { font-size: 1.3rem; line-height: 1.1; }
.bk-day span, .bk-day small { font-size: .78rem; color: var(--muted); }
.bk-day:hover { background: var(--surface-hover); }
.bk-day[aria-pressed="true"] { background: linear-gradient(135deg, var(--accent), #5b8cff); border-color: #8fb0ff; }
.bk-day[aria-pressed="true"] span, .bk-day[aria-pressed="true"] small, .bk-day[aria-pressed="true"] b { color: var(--bg-deep); }
.bk-grid { min-width: 780px; display: flex; flex-direction: column; gap: 6px; }
.bk-row { display: grid; gap: 4px; align-items: center; }
.bk-head { align-items: end; font-size: .78rem; color: var(--muted); }
.bk-slot { height: 40px; padding: 0; border: 1px solid #2b5599; background: #0f2447; cursor: pointer; }
.bk-slot:hover:not(:disabled) { background: #173a70; border-color: var(--accent); }
.bk-slot.sel { background: linear-gradient(90deg, var(--accent), #5b8cff); border-color: #8fb0ff; }
.bk-slot { font: inherit; font-size: .68rem; font-weight: 600; line-height: 1; overflow: hidden; white-space: nowrap; color: var(--text); }
.bk-slot.booked, .bk-slot.busy { background: #1b2336; border-color: #2a3552; color: #8b97b3; cursor: not-allowed; }
.bk-slot.mine { color: #d9fff0; }
.bk-slot.sel { color: var(--bg-deep); }
.bk-slot.mine { background: rgba(31, 169, 113, .35); border-color: var(--success); cursor: not-allowed; }
.busy-text { color: #fbbf77; font-weight: 600; }
.bk-off { height: 40px; display: flex; align-items: center; justify-content: center; gap: 10px; background: #2a1717; border: 1px solid #5a2b2b; color: #fca5a5; cursor: not-allowed; }
.bk-off b { font-size: 1.25rem; letter-spacing: .04em; } .bk-off span { font-size: .9rem; opacity: .85; }
.bk-row.dim { opacity: .3; transition: opacity .15s; }
.bk-row.dim.blocked { opacity: .8; }
.bk-row.dim:hover, .bk-row.dim:focus-within { opacity: 1; }
.bk-row.focus { position: relative; }
.bk-row.focus > div:first-child { border-left: 3px solid var(--accent); padding-left: 8px; margin-left: -11px; }
.bk-slot.past { background: #070c17; border-color: #0d1426; cursor: not-allowed; }
.bk-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--muted); }
.bk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bk-legend i { width: 14px; height: 14px; display: inline-block; border: 1px solid #2b5599; background: #0f2447; }
.bk-legend i.booked { background: #1b2336; border-color: #2a3552; }
.bk-legend i.mine { background: rgba(31, 169, 113, .35); border-color: var(--success); }
.bk-legend i.sel { background: linear-gradient(90deg, var(--accent), #5b8cff); border-color: #8fb0ff; }
.bk-durs { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-durs button { min-width: 84px; min-height: 44px; padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.bk-durs button:hover { background: var(--surface-hover); }
.bk-durs button[aria-pressed="true"] { color: var(--bg-deep); background: linear-gradient(135deg, var(--accent), #5b8cff); border-color: #8fb0ff; }
.bk-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--border); margin: 14px 0 8px; padding-top: 14px; }
.bk-total b { font-size: 1.9rem; }
.bk-rules { margin: 16px 0 0; padding: 0 0 0 18px; color: #b8c9e6; font-size: .9rem; display: grid; gap: 6px; }
.bk-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.bk-card-t { font-size: 1.05rem; }
.bk-card-t b { font-size: 1.15rem; }
.bk-card-s { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.bk-layout > *, .bk-layout .stack > * { min-width: 0; }
.bk-rules .bk-warn { color: #fcd34d; font-weight: 600; }

/* ช่องติ๊กในฟอร์ม (เช่น บันทึกรหัสผ่าน) */
.check-row { display: flex; align-items: center; gap: 10px; margin: -4px 0 16px; color: var(--text); font-size: 14px; cursor: pointer; user-select: none; }
.check-row input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }

/* =====================================================================
   ธีมใหม่ (มุมโค้ง · ปุ่มแคปซูล · น้ำเงินรอยัล) — เขียนทับสไตล์เดิมด้านบน
   ===================================================================== */
body { background: radial-gradient(1100px 520px at 50% -12%, rgba(40, 80, 200, .22), transparent 70%), var(--bg); background-attachment: fixed; }
body::before { display: none; }
h1, h2, h3, .page-title h1 { font-family: var(--head); font-weight: 600; letter-spacing: 0; }

/* มุมตัดเฉียงเดิม → มุมโค้ง */
.credit-chip, .btn, .panel, .banner, .rule, .rule-ic, .host, .step-head .no { clip-path: none; }
.panel::before { display: none; }

/* nav */
.nav { background: rgba(5, 7, 12, .82); border-bottom: 1px solid rgba(255, 255, 255, .05); }
.nav::after { display: none; }
.nav-in { min-height: 76px; }
.brand b { font-style: italic; letter-spacing: .02em; }
.brand b span { text-shadow: none; }
.brand img { filter: none; }
.links { justify-content: center; gap: 12px; }
.links a { color: #d7dcea; font-family: var(--head); font-weight: 500; }
.links a:hover { color: #fff; }
.links a[aria-current] { color: #fff; }
.links a[aria-current]::after { left: 50%; right: auto; width: 18px; margin-left: -9px; bottom: -2px; height: 3px; border-radius: 3px; background: var(--accent); box-shadow: none; }
.nav-login { display: inline-flex; align-items: center; gap: 8px; color: #d7dcea; text-decoration: none; padding: 8px 10px; font-family: var(--head); font-weight: 500; }
.nav-login:hover { color: #fff; }
.ic { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; flex: none; }
.ic svg { width: 100%; height: 100%; }
.credit-chip { border-radius: 999px; color: #c9d8ff; background: rgba(59, 116, 255, .1); border-color: rgba(59, 116, 255, .4); }
@media (max-width: 760px) { .links { justify-content: flex-start; } .nav-in { min-height: 64px; } }

/* ปุ่ม */
.btn { border-radius: 999px; padding: 10px 22px; font-family: var(--head); font-weight: 500; }
.btn-x { background: linear-gradient(180deg, #3d78ff, #1f50f0); color: #fff; box-shadow: 0 6px 20px -8px rgba(59, 116, 255, .8); }
.btn-x:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-ghost { background: rgba(255, 255, 255, .04); border: 1px solid #263046; }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); border-color: #3a4766; }
.btn:disabled { background: #161c2a; }

/* กล่อง */
.panel { border-radius: var(--radius); background: linear-gradient(180deg, #0d1220, #0a0e17); border: 1px solid var(--edge); }
.panel.glow { --edge: rgba(59, 116, 255, .4); box-shadow: 0 20px 60px -30px rgba(59, 116, 255, .45); }
.label::before { width: 7px; height: 7px; border-radius: 50%; transform: none; }
.page-title .bar { border-radius: 4px; box-shadow: none; }
.input, .form-error, .form-ok, .paybox, .slip-drop, .keybox, .qr, .acc-stat, .bk-card, .rules-accept, .rules-notes, .toast { border-radius: var(--radius-sm); }
.input { background: #0f1422; border-color: #232c42; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 116, 255, .22); }
.rule { border-radius: 12px; }
.rule-ic, .step-head .no { border-radius: 10px; }
.st { border-radius: 999px; }
.amounts button, .methods button, .pkg button, .bk-day, .bk-durs button, .bk-slot, .bk-off { border-radius: 10px; }
.bk-slot { border-radius: 6px; }
.tabs .badge { border-radius: 999px; }
.thumb, .host-thumb, .banner-thumb, .promo-preview, .banner-preview { border-radius: 8px; }
.list th { background: transparent; color: var(--muted); }
.modal-bg { background: rgba(3, 4, 8, .78); backdrop-filter: blur(4px); }
.modal-bg .panel { border-radius: 18px; }
.howto li::before { border-radius: 50%; }

/* การ์ดเครื่อง */
.host { border-radius: var(--radius); overflow: hidden; background: linear-gradient(180deg, #0f1525, #0a0e17); }
.host.free:hover { box-shadow: 0 18px 50px -24px rgba(59, 116, 255, .7); }
.host-code { font-family: var(--head); font-weight: 600; letter-spacing: .02em; }
.specs li::before { content: "• "; }

/* ---------- หน้าแรก ---------- */
.banner { aspect-ratio: 12 / 5; border-radius: 20px; border: 1px solid #222b40; margin: 26px 0 26px; box-shadow: 0 30px 80px -40px rgba(40, 90, 255, .5); }
.banner::after { box-shadow: none; }
.banner-arrow { width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; color: #fff; background: rgba(10, 14, 24, .55); border: 1px solid rgba(255, 255, 255, .28); font-size: 1.7rem; opacity: 1; backdrop-filter: blur(6px); }
.banner-arrow:hover { background: rgba(30, 50, 110, .75); border-color: rgba(255, 255, 255, .5); }
.banner-dots { background: none; backdrop-filter: none; bottom: 16px; gap: 10px; }
.banner-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .35); transition: background .2s, transform .2s; }
.banner-dot span { display: none; }
.banner-dot.on { background: var(--accent); transform: scale(1.15); box-shadow: 0 0 10px rgba(59, 116, 255, .8); }
@media (max-width: 640px) { .banner { border-radius: 14px; margin-top: 16px; } .banner-dot { width: 7px; height: 7px; } }

.hero-banner { aspect-ratio: auto; min-height: 340px; display: grid; grid-template-columns: 1.05fr 1fr; align-items: center;
  background: radial-gradient(70% 90% at 75% 60%, rgba(40, 90, 255, .28), transparent 70%), linear-gradient(180deg, #0a1022, #060912); }
.hero-copy { padding: 40px 0 40px clamp(24px, 9%, 110px); position: relative; z-index: 1; }
.hero-copy h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.9rem); line-height: 1.12; font-weight: 600; }
.hero-price { margin: 14px 0 0; font-family: var(--head); font-size: clamp(1.15rem, 2vw, 1.6rem); color: #d9e0ee; }
.hero-price b { font-size: 1.9em; font-weight: 600; color: #fff; margin: 0 4px; vertical-align: -0.08em; }
.hero-pc { align-self: end; justify-self: end; width: 100%; max-height: 100%; object-fit: contain; object-position: right bottom;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%); mask-image: linear-gradient(90deg, transparent 0, #000 22%); }
@media (max-width: 760px) {
  .hero-banner { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 28px 22px 0; }
  .hero-pc { justify-self: center; width: 80%; margin-top: -10px; }
}

.qtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-bottom: 52px; }
.qtile { display: flex; align-items: center; gap: 14px; padding: 14px 22px 14px 14px; min-height: 150px; border-radius: var(--radius); text-decoration: none; color: #fff;
  background: radial-gradient(80% 120% at 20% 50%, rgba(40, 80, 200, .18), transparent 70%), linear-gradient(180deg, #111624, #0b0f18);
  border: 1px solid #1f283b; transition: transform .2s, border-color .2s, box-shadow .2s; }
.qtile img { width: 46%; max-height: 140px; object-fit: contain; flex: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent); mask-image: radial-gradient(closest-side, #000 72%, transparent); }
.qtile b { font-family: var(--head); font-weight: 600; font-size: clamp(1.05rem, 1.8vw, 1.4rem); line-height: 1.3; }
.qtile:hover { transform: translateY(-3px); border-color: rgba(59, 116, 255, .55); box-shadow: 0 18px 40px -24px rgba(59, 116, 255, .8); }
@media (max-width: 760px) {
  .qtiles { grid-template-columns: 1fr; gap: 10px; margin-bottom: 38px; }
  .qtile { min-height: 96px; } .qtile img { width: 30%; max-height: 90px; }
}

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sec-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.sec-head .muted { font-size: 1.05rem; }
.home-hosts { margin-bottom: 44px; }
.empty-hosts { display: grid; justify-items: center; gap: 10px; padding: 44px 16px; color: var(--text); }
.empty-hosts b { font-family: var(--head); font-weight: 500; font-size: 1.35rem; }
.empty-hosts p { margin: 0; }
.ic.big { width: 92px; height: 92px; color: #7c869c; }
.ic.big svg { stroke-width: 1.1; }

.steps-band { position: relative; overflow: hidden; border-radius: 20px; padding: 30px clamp(20px, 5vw, 50px) 32px; margin-bottom: 40px;
  background: linear-gradient(100deg, #0d1a3d 0%, #0b1530 55%, #0a1022 100%); border: 1px solid #22305a; }
.steps-band::after { content: ""; position: absolute; right: -16%; top: -40%; width: 40%; height: 200%; pointer-events: none;
  background: linear-gradient(115deg, transparent 46%, rgba(59, 116, 255, .55) 50%, rgba(30, 70, 200, .18) 56%, transparent 75%); }
.steps-band h2 { position: relative; margin: 0 0 18px; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.steps-band ol { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 0; }
.steps-band li { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; font-family: var(--head); font-size: 1.12rem; }
.steps-band li > .ic:first-child { width: 36px; height: 36px; color: var(--accent); }
.steps-band .sep { width: 18px; height: 18px; color: #8d97ad; margin-left: auto; margin-right: 14px; }
@media (max-width: 760px) { .steps-band ol { flex-direction: column; align-items: stretch; } .steps-band .sep { display: none; } }

.home-tabs { margin-bottom: 48px; }
.home-tabs .promo-carousel { margin-bottom: 0; }
.htabs { display: flex; justify-content: center; margin-bottom: 26px; }
.htab { display: inline-flex; align-items: center; gap: 10px; padding: 10px 26px; background: none; border: 0; cursor: pointer; color: var(--muted);
  font-family: var(--head); font-size: 1.15rem; position: relative; }
.htab + .htab::before { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 1px; background: #3a4358; }
.htab .ic { width: 26px; height: 26px; color: var(--accent); }
.htab:hover { color: #fff; }
.htab[aria-selected="true"] { color: #fff; }
.htab[aria-selected="true"]::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 28px; margin-left: -14px; height: 3px; border-radius: 3px; background: var(--accent); }
@media (max-width: 520px) { .htab { padding: 8px 12px; font-size: 1rem; } }
.board-wrap { max-width: 640px; margin: 0 auto; }
.board-list li { border-radius: 10px; }

/* โปรโมชั่น */
.promo { border-radius: var(--radius); border: 1px solid #263252; animation: none; box-shadow: 0 16px 40px -26px rgba(59, 116, 255, .7); }
.promo:hover, .promo:focus-visible { transform: translateY(-3px); border-color: rgba(59, 116, 255, .6); }
.promo::before { clip-path: none; border-radius: 0 999px 999px 0; color: #fff; box-shadow: none; background: linear-gradient(90deg, #3d78ff, #1f50f0); }
.promo-arrow { border-radius: 50%; width: 46px; height: 46px; font-size: 1.7rem; color: #fff; border: 1px solid rgba(255, 255, 255, .28); background: rgba(10, 14, 24, .7); box-shadow: none; }
.promo-body { background: none; }
.promo-body b { font-family: var(--head); font-weight: 600; }
.promo-carousel { --pv: 3; }
@media (max-width: 1000px) { .promo-carousel { --pv: 2; } }
@media (max-width: 640px) { .promo-carousel { --pv: 1; } }
@media (max-width: 520px) {
  .nl-t { display: none; } .nav-login .ic { width: 1.6em; height: 1.6em; }
  .brand b { font-size: .95rem; }
  .hero-pc { width: 66%; -webkit-mask-image: radial-gradient(closest-side, #000 65%, transparent); mask-image: radial-gradient(closest-side, #000 65%, transparent); }
  .qtile { min-height: 84px; padding: 10px 16px 10px 10px; } .qtile img { max-height: 72px; }
}

/* แบนเนอร์: กรอบขนาดคงที่ (ตามสัดส่วนรูปแรก) · รูปย่อ/ขยายให้พอดีกรอบ เห็นเต็มรูป · ช่องว่างเติมด้วยรูปเดียวกันแบบเบลอ */
.banner-fill { position: absolute; inset: 0; overflow: hidden; display: block; }
.banner-slide img.bg { position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover; filter: blur(28px) brightness(.55) saturate(1.2); }
.banner-slide img.fg { position: relative; width: 100%; height: 100%; object-fit: contain; }
.banner-thumb, .banner-preview { object-fit: contain; background: #05070c; }

/* แบนเนอร์ที่กดได้ (มีลิงก์ = a.banner-slide) — เอาเมาส์วาง/โฟกัสแล้วรูปหดนิดๆ + สว่างขึ้น ให้รู้สึกว่ากดได้ */
a.banner-slide { cursor: pointer; }
a.banner-slide img.fg { border-radius: 20px; transition: transform .35s cubic-bezier(.2, .8, .2, 1), filter .35s ease; }
a.banner-slide:hover img.fg, a.banner-slide:focus-visible img.fg { transform: scale(.97); filter: brightness(1.06); }
a.banner-slide:active img.fg { transform: scale(.945); filter: brightness(.96); transition-duration: .12s; }
@media (max-width: 640px) { a.banner-slide img.fg { border-radius: 14px; } }
@media (hover: none) { a.banner-slide:hover img.fg { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { a.banner-slide img.fg, a.banner-slide:hover img.fg, a.banner-slide:active img.fg { transition: none; transform: none; filter: none; } }

/* ขนาดกรอบแบนเนอร์ = 1920:700 พอดีกับรูปขนาดแนะนำ (รูป 1920×700 จะเต็มกรอบทุกขนาดจอ)
   อยากให้เตี้ยลง/สูงขึ้น เปลี่ยนสัดส่วนนี้ และทำรูปตามสัดส่วนใหม่ด้วย */
.banner:not(.hero-banner) { aspect-ratio: 1920 / 700; width: 100%; }
.banner-thumb, .banner-preview { aspect-ratio: 1920 / 700; }

/* เติมเครดิต: ขั้นต่ำ/สูงสุด */
.min-chip { margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 500; color: #c9d8ff; background: rgba(59, 116, 255, .14); border: 1px solid rgba(59, 116, 255, .4); }
.amt-note { margin: 0 0 18px; font-size: .85rem; color: var(--muted); }
.amt-note.bad { color: #fca5a5; font-weight: 600; }
.input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(217, 54, 79, .2); }

/* รูปเครื่องค่าเริ่มต้น (ยังไม่ได้อัปโหลดรูป) — รูป 16:9 ตามธีม เต็มกรอบ */
.host-img.def { background: #060a16; }
.host-img.def img { object-fit: cover; }
.host.off .host-img.def img { filter: grayscale(.35) brightness(.72); }
.host-thumb.def { object-fit: cover; }

/* ปุ่ม "ขอลิงก์ Parsec" ในการ์ดคีย์ */
.parsec-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: rgba(59, 116, 255, .08); border: 1px solid rgba(59, 116, 255, .3); }
.parsec-req:disabled { background: #18213a; color: #9fb6ec; box-shadow: none; opacity: 1; }

/* ปุ่ม "เริ่มใช้งานที่เครื่อง" ในการ์ดคีย์ */
.start-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.start-box .small { flex: 1 1 18rem; }
