/* Card Planet TCG — stylesheet */
:root {
  --bg: #f6f7fb; --surface: #ffffff; --surface-2: #f7f8fc; --text: #141a2e; --muted: #667085; --line: #e6e8f0; --line-strong: #d5d9e5;
  --primary: #4f46e5; --primary-hover: #4338ca; --primary-ink: #ffffff; --primary-soft: #eef0ff; --accent: #f59e0b;
  --ok: #047857; --ok-soft: #e8f7f0; --warn: #b45309; --warn-soft: #fff6e5; --danger: #dc2626; --danger-soft: #fdeeee;
  --info: #2563eb; --info-soft: #eaf1fe; --night: #0f1230; --night-2: #1a1d48;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04); --shadow-md: 0 6px 20px rgba(16,24,40,.08); --shadow-lg: 0 16px 40px rgba(16,24,40,.14);
  --ring: 0 0 0 3px rgba(79,70,229,.25);
  --font: 'IBM Plex Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif; --display: 'Kanit', var(--font);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.005em; }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(1.55rem, 3vw, 2rem); }
h2 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; } h3 { font-size: 1.06rem; }
p { margin: 0 0 1em; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 28px; padding-bottom: 64px; min-height: 70vh; }
.muted { color: var(--muted); } .small, small { font-size: .86em; }
.center { text-align: center; } .r { text-align: right; }
.danger-text { color: var(--danger); font-weight: 600; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- topbar ---------- */
.topbar { background: var(--night); color: #fff; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(255,255,255,.06); }
.bar { display: flex; align-items: center; gap: 12px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; font-family: var(--display); font-size: 1.15rem; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand img.logo { width: auto; height: 52px; border-radius: 10px; }
.sidebar .brand img.logo { height: 40px; }
.mainnav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.mainnav > a, .usermenu summary { color: #c9cdf5; padding: 8px 14px; border-radius: 10px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.mainnav > a:hover, .usermenu summary:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.mainnav > a.active { color: #fff; background: rgba(255,255,255,.12); }
.mainnav .btn.sm { color: var(--night); background: var(--accent); border-color: var(--accent); margin-left: 6px; }
.mainnav .btn.sm:hover { background: #fbbf24; }
.cart-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: #e3e6ff; flex: none; transition: background .15s; }
.cart-btn:hover, .cart-btn.active { background: rgba(255,255,255,.12); color: #fff; }
.cart-btn .pill { position: absolute; top: 2px; right: 0; }
.cart-btn.bump { animation: bump .45s ease; }
@keyframes bump { 30% { transform: scale(1.18); } 60% { transform: scale(.95); } }
.nav-toggle { display: none; background: none; border: 0; color: inherit; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; align-items: center; justify-content: center; flex: none; }
.nav-toggle:hover { background: rgba(255,255,255,.1); }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 8px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary::after { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .7; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--night); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: none; object-fit: cover; }
img.avatar { background: var(--surface-2); }
.avatar.sm { width: 22px; height: 22px; font-size: .68rem; }
.avatar.md { width: 28px; height: 28px; }
.avatar.lg { width: 72px; height: 72px; font-size: 2rem; font-family: var(--display); }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); color: var(--text); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; border: 1px solid var(--line); }
.usermenu .menu a, .usermenu .menu .linkbtn { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); width: 100%; text-align: left; }
.usermenu .menu a:hover, .usermenu .menu .linkbtn:hover { background: var(--surface-2); text-decoration: none; }
.usermenu .menu form { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--night); font-size: .75rem; font-weight: 700; text-align: center; line-height: 20px; }
.pill.danger { background: var(--danger); color: #fff; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: 12px; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; text-decoration: none !important; }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-busy=true] { opacity: .5; cursor: not-allowed; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: .88rem; border-radius: 10px; }
.btn.lg { min-height: 52px; padding: 12px 28px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--primary); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
.btn.danger, .btn.ghost.danger { border-color: #f3c0c0; color: var(--danger); background: var(--surface); }
.btn.ghost.danger:hover, .btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.win { background: var(--ok); border-color: var(--ok); }
.btn.loss { background: var(--danger); border-color: var(--danger); }
.btn.draw { background: #64748b; border-color: #64748b; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.linkbtn.danger { color: var(--danger); }
input, select, textarea { font: inherit; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); width: 100%; max-width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 0; resize: vertical; }
input::placeholder, textarea::placeholder { color: #98a1b3; }
input:hover, select:hover, textarea:hover { border-color: #b9bfd0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); flex: none; }
input[type=color] { padding: 2px; width: 46px; height: 40px; }
input[type=file] { padding: 8px; background: var(--surface-2); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form label, .grid-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .93rem; }
.form h3 { margin: 8px 0 0; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-form .span2 { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 14px; margin: 0; }
legend { font-weight: 600; padding: 0 6px; }
label.check { flex-direction: row !important; align-items: center; gap: 10px !important; font-weight: 500; cursor: pointer; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.inline-form input:not([type=checkbox]), .inline-form select { width: auto; }
.qty { width: 84px !important; }
.w-s { width: 120px !important; } .w-xs { width: 70px !important; }
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio { flex-direction: row !important; align-items: center; gap: 12px !important; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.radio:hover { border-color: #b9bfd0; }
.radio:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.radio.disabled { opacity: .45; pointer-events: none; }
.radio small { margin-left: auto; text-align: right; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.actions.end { justify-content: flex-end; }
.hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 76px; }
.pass-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); font: inherit; font-size: .85rem; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.pass-toggle:hover { background: var(--surface-2); color: var(--text); }
.search { position: relative; flex: 2 1 240px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 42px; width: 100% !important; }

/* qty stepper */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--surface); }
.stepper button { width: 40px; border: 0; background: var(--surface-2); font: inherit; font-size: 1.15rem; color: var(--text); cursor: pointer; }
.stepper button:hover { background: var(--primary-soft); color: var(--primary); }
.stepper input { width: 56px !important; border: 0; border-radius: 0; text-align: center; padding: 8px 4px; -moz-appearance: textfield; }
.stepper input:focus { box-shadow: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper:focus-within { border-color: var(--primary); box-shadow: var(--ring); }

/* ---------- flash / toast / badges ---------- */
.flash { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 12px; margin: 0 0 18px; border: 1px solid transparent; transition: opacity .3s, transform .3s; }
.flash > span, .flash > :first-child { flex: 1; }
.flash ul { margin: 0; padding-left: 18px; }
.flash.ok { background: var(--ok-soft); color: #065f46; border-color: #bfe8d6; }
.flash.error { background: var(--danger-soft); color: #991b1b; border-color: #f6c9c9; }
.flash.warn { background: var(--warn-soft); color: #92400e; border-color: #f6dfb2; }
.flash.info { background: var(--info-soft); color: #1e40af; border-color: #c9dafb; }
.flash.hide { opacity: 0; transform: translateY(-6px); }
.flash-x { background: none; border: 0; color: inherit; opacity: .55; font-size: 1.3rem; line-height: 1; padding: 0 4px; cursor: pointer; border-radius: 6px; }
.flash-x:hover { opacity: 1; }
.toasts { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--night); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; animation: toast-in .25s ease; }
.toast a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.toast.error { background: var(--danger); }
.toast.error a { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; font-size: .76rem; font-weight: 600; white-space: nowrap; vertical-align: middle; line-height: 1.6; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.muted { background: #eef0f4; color: #4b5563; }
.badge.live { background: var(--danger); color: #fff; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .7; } }
.game-tag { display: inline-block; padding: 1px 9px; border-radius: 6px; font-size: .74rem; font-weight: 700; color: #fff; background: var(--g); vertical-align: middle; line-height: 1.7; }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.narrow { max-width: 560px; margin: 40px auto; }
.card.auth { max-width: 440px; margin: 16px auto; padding: 28px; }
.card.auth h1 { text-align: center; margin-bottom: .3em; }
.card.auth > .muted:first-of-type { text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 36px 0 16px; }
.card .section-head { margin-top: 0; }
.section-head h2, .section-head h3 { margin: 0; }
.section-head > a { font-weight: 600; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { color: #b4bbcd; margin-bottom: 4px; }
.empty b { color: var(--text); font-size: 1.05rem; }
.empty p { margin: 0 0 8px; max-width: 420px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 20px 0; font-size: .9rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.social { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.social-btn.google { background: #fff; color: #1f2937; border-color: var(--line-strong); }
.social-btn.google:hover { background: var(--surface-2); border-color: #b9bfd0; }
.social-btn.facebook { background: #1877f2; border-color: #1877f2; }
.social-btn.facebook:hover { background: #166fe0; }
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .88rem; color: var(--muted); margin: 0 0 16px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span[aria-hidden] { opacity: .5; }

/* ---------- hero ---------- */
.hero { background: radial-gradient(120% 140% at 100% 0%, #3b2fd1 0%, #1a1c55 45%, var(--night) 100%); color: #fff; border-radius: 24px; padding: clamp(28px, 5vw, 56px); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; width: 300px; height: 300px; right: -70px; bottom: -150px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fbbf24, #f97316 55%, #7c2d12); opacity: .85; }
.hero > div { position: relative; z-index: 1; max-width: 620px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: .25em; }
.hero p { color: #d7dbff; max-width: 520px; font-size: 1.05rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--accent) !important; font-weight: 600; margin-bottom: .6em; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
.hero .btn.ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.hero .btn:not(.ghost) { background: var(--accent); border-color: var(--accent); color: var(--night); }
.hero .btn:not(.ghost):hover { background: #fbbf24; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 28px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--display); font-size: 1.6rem; line-height: 1.1; }
.hero-stats span { color: #b9bee8; font-size: .85rem; }
.games-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 22px 0 0; scrollbar-width: thin; }
.game-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 500; font-size: .92rem; transition: border-color .15s, box-shadow .15s; }
.game-chip::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--g); }
.game-chip:hover { border-color: var(--g); box-shadow: var(--shadow-md); text-decoration: none; }

/* ---------- events ---------- */
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.ecard { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
.ecard::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--g); }
.ecard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; border-color: var(--line-strong); }
.edate { flex: none; width: 62px; height: 68px; border-radius: 12px; background: color-mix(in srgb, var(--g) 10%, #fff); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.edate b { font-size: 1.6rem; line-height: 1; font-family: var(--display); color: color-mix(in srgb, var(--g) 70%, #141a2e); }
.edate span { font-size: .8rem; color: var(--muted); }
.einfo { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.einfo h3 { margin: 4px 0 2px; overflow-wrap: anywhere; }
.einfo .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .86rem; }
.seats { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; border: 1px solid var(--line); }
.seats i { display: block; height: 100%; background: var(--g); border-radius: 99px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.event-head { display: flex; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--g); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.event-head h1 { margin: 8px 0; }
.event-img { width: 220px; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; flex: none; }
.event-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.action-box { position: sticky; top: 88px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 12px 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }
.dl.inline { grid-template-columns: repeat(auto-fit, minmax(110px, max-content) minmax(140px, 1fr)); }
.round-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.round-nav a { padding: 6px 14px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: .9rem; }
.round-nav a:hover { text-decoration: none; border-color: var(--primary); }
/* ตัวบอกว่าหน้าอัปเดตเอง (อีเว้นท์ที่กำลังแข่ง) */
.live-status { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); padding: 6px 10px; border-radius: 99px; }
.live-status i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: live-pulse 2s infinite; }
.live-status.flash-in { animation: live-flash 1.2s ease-out; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes live-flash { 0% { background: rgba(34,197,94,.28); color: var(--text); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .live-status i, .live-status.flash-in { animation: none; } }
.round-nav a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.round-nav .refresh { margin-left: auto; border: 0; background: none; color: var(--primary); }
.match-box { border: 2px solid var(--primary); border-radius: 14px; padding: 16px; margin: 14px 0; background: var(--primary-soft); }
.match-box.confirmed { border-color: var(--ok); background: var(--ok-soft); }
.match-box.disputed { border-color: var(--danger); background: #fff7f7; }
.vsline { font-size: 1.15rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vsline span { color: var(--muted); font-size: .9rem; }
.report-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.players { columns: 2; padding-left: 22px; margin: 0; }
.players li { padding: 3px 0; }
.desc { white-space: normal; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { padding: 12px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th.r, .table td.r { text-align: right; }
.table thead th { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); border-bottom-color: var(--line); white-space: nowrap; }
.table thead th:first-child { border-top-left-radius: 10px; } .table thead th:last-child { border-top-right-radius: 10px; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: #fafbfe; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 600; border-bottom: 0; }
.table tr.total td { font-size: 1.05rem; border-top: 2px solid var(--line); }
.table tr.me td { background: #fff8e6 !important; }
.table td.win { font-weight: 700; color: var(--ok); }
.table td.vs { color: var(--muted); font-size: .8rem; text-align: center; }
.table tr.disputed td { background: var(--danger-soft); }
.table tr.inactive td { opacity: .55; }
.table.ranking tr.top td { font-weight: 600; }
.card > .table:first-child { margin-top: -6px; }
.card:has(> .table) { overflow-x: auto; }

/* ---------- products ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.pcard.soldout .thumb { filter: grayscale(.7); opacity: .7; }
.pcard .flag { position: absolute; top: 10px; left: 10px; z-index: 1; }
.thumb, .big-thumb, .mini-thumb { aspect-ratio: 1; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumb img, .big-thumb img, .mini-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.pcard:hover .thumb img { transform: scale(1.04); }
.ph { background: linear-gradient(135deg, var(--g), color-mix(in srgb, var(--g) 45%, #0f1230)); color: #fff; font-family: var(--display); font-size: 1.1rem; text-align: center; padding: 10px; }
.ph span { opacity: .92; text-shadow: 0 2px 10px rgba(0,0,0,.25); }
.mini-thumb { width: 56px; border-radius: 10px; flex: none; }
.mini-thumb.ph { font-size: .6rem; padding: 2px; }
.pbody { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pbody h3 { font-size: .98rem; font-weight: 600; margin: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pbody h3 a { color: var(--text); }
.pbody h3 a::after { content: ''; position: absolute; inset: 0; } /* ทั้งการ์ดกดได้ */
.pbody form { position: relative; z-index: 1; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { color: var(--text); font-weight: 700; font-size: 1.12rem; font-family: var(--display); }
.price.big { font-size: 2rem; color: var(--primary); }
.stock-low { color: var(--warn); font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 500; font-size: .9rem; transition: border-color .15s, background .15s; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--g); }
.chip small { color: var(--muted); font-size: .78rem; }
.chip:hover { text-decoration: none; border-color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.active small { color: #dfe1ff; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.chips.scroll .chip { flex: none; }
.sortbar { justify-content: space-between; align-items: center; }
.sortbar select { flex: 0 0 auto !important; width: auto !important; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.filters .btn { flex: none; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; color: var(--muted); }
.result-bar a { font-weight: 600; }
.product-detail { display: grid; grid-template-columns: minmax(260px, 460px) 1fr; gap: 36px; align-items: start; }
.product-detail h1 { margin: 10px 0 6px; }
.buy-box { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); margin: 18px 0; }
.buy-box form { display: flex; gap: 10px; flex-wrap: wrap; }
.buy-box .btn { flex: 1 1 180px; }
.big-thumb { border-radius: 14px; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.pager a, .pager span { min-width: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-align: center; }
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- cart & checkout ---------- */
.cart-item { display: flex; align-items: center; gap: 14px; }
.cart-item a { color: var(--text); font-weight: 500; }
.received-card { grid-column: 1 / -1; order: -1; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; border-color: var(--accent); }
.received-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.received-card p { margin: 0; }
.cart-layout, .checkout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.summary { position: sticky; top: 88px; }
.summary h3 { margin-bottom: 12px; }
.sum-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.sum-line span { color: var(--muted); }
.sum-line.total { font-size: 1.15rem; border: 0; padding-top: 14px; }
.sum-line.total span { color: var(--text); font-weight: 600; }
.sum-line.total b { font-family: var(--display); font-size: 1.35rem; color: var(--primary); }
.step-title { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; }
.step-title::before { counter-increment: step; content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
#checkout-form { counter-reset: step; }
.secure-note { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; margin-top: 10px; }
.qr-box { text-align: center; }
.qr { display: inline-block; padding: 14px; background: #fff; border-radius: 14px; border: 1px solid var(--line); margin: 6px 0 10px; }
.qr img, .qr canvas { margin: 0 auto; }
.slip { max-height: 480px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 12px; }
.preview { max-height: 140px; border-radius: 10px; }
/* ความคืบหน้าคำสั่งซื้อ */
.order-steps { display: flex; list-style: none; padding: 0; margin: 0 0 22px; counter-reset: os; }
.order-steps li { flex: 1; position: relative; text-align: center; font-size: .85rem; color: var(--muted); padding-top: 38px; }
.order-steps li::before { counter-increment: os; content: counter(os); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-weight: 700; z-index: 1; }
.order-steps li::after { content: ''; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.order-steps li:first-child::after { display: none; }
.order-steps li.done { color: var(--text); }
.order-steps li.done::before { border-color: var(--ok); }
.order-steps li.done::after, .order-steps li.current::after { background: var(--ok); }
.order-steps li.current { color: var(--primary); font-weight: 600; }
.order-steps li.current::before { border-color: var(--primary); color: var(--primary); box-shadow: var(--ring); }

/* ---------- footer ---------- */
.footer { background: var(--night); color: #b9bee8; padding: 36px 0; font-size: .9rem; }
.footer .container { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; align-items: flex-start; }
.footer a { color: #fff; }
.foot-brand { display: flex; gap: 14px; align-items: center; }
.foot-brand img { height: 48px; width: auto; border-radius: 10px; }
.foot-brand b { color: #fff; }
.foot-links { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.foot-contact { display: flex; flex-direction: column; gap: 4px; }

/* ---------- admin ---------- */
body.admin { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--night); color: #cfd3ff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.sidebar .brand { color: #fff; padding: 0 8px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: #c3c8f2; padding: 10px 12px; border-radius: 10px; display: flex; justify-content: space-between; align-items: center; font-weight: 500; transition: background .15s, color .15s; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 8px 0; font-size: .9rem; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot a, .side-foot .linkbtn { color: #c3c8f2; text-align: left; }
.admin-main { min-width: 0; }
.admin-top { display: flex; align-items: center; gap: 12px; padding: 22px 32px 0; }
.admin-top h1 { margin: 0; font-size: 1.55rem; }
.admin-top .nav-toggle { color: var(--text); margin-left: 0; }
.admin-top .nav-toggle:hover { background: var(--surface); }
.admin-body { padding: 20px 32px 56px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow); }
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi b { font-size: 1.6rem; font-family: var(--display); font-weight: 600; }
.kpi small { color: var(--muted); }
.kpi.alert { border-left: 4px solid var(--accent); }
.kpi.alert:hover { text-decoration: none; background: var(--surface-2); }
.chart { position: relative; height: 280px; }
.chart.small { height: 220px; }
.plain { list-style: none; padding: 0; margin: 0; } .plain li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.event-admin-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.event-admin-head p { margin: 6px 0 0; }
.event-admin-head .actions { margin: 0; }
.start-box { border: 2px dashed var(--primary); background: var(--primary-soft); }
.points-box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.points-box legend { font-weight: 600; padding: 0 6px; }
.points-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.points-box .btn { align-self: flex-start; }
details summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.game-row input[name=name] { width: 220px !important; }

/* ---------- เด็คลิสต์ ---------- */
.decklists { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.decklist pre, pre.decklist { white-space: pre-wrap; word-break: break-word; font-family: inherit; margin: 0; font-size: 14px; line-height: 1.5; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .event-layout, .checkout, .cart-layout, .grid2, .product-detail { grid-template-columns: 1fr; }
  .product-detail { gap: 20px; }
  .action-box, .summary { position: static; }
  .hero::after { opacity: .35; }
  body.admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .admin-top .nav-toggle { display: inline-flex; }
  .admin-body, .admin-top { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 760px) {
  .bar { height: 62px; gap: 6px; }
  .brand img.logo { height: 44px; }
  .nav-toggle { display: inline-flex; }
  .cart-btn { margin-left: auto; }
  .mainnav { display: none; position: absolute; left: 0; right: 0; top: 62px; background: var(--night); flex-direction: column; align-items: stretch; padding: 8px 16px 18px; gap: 2px; box-shadow: 0 16px 30px rgba(0,0,0,.25); }
  .mainnav.open { display: flex; }
  .mainnav > a, .usermenu summary { padding: 12px 14px; }
  .mainnav .btn.sm { margin: 8px 0 0; min-height: 44px; }
  .usermenu .menu { position: static; box-shadow: none; margin-top: 6px; }
  .grid-form { grid-template-columns: 1fr; }
  .event-head { flex-direction: column; align-items: stretch; padding: 18px; }
  .event-img { width: 100%; }
  .radio { flex-wrap: wrap; }
  .radio small { margin-left: 30px; flex-basis: 100%; text-align: left; }
  .product-detail .big-thumb { aspect-ratio: 4 / 3; }
  .product-detail .price.big { font-size: 1.7rem; margin-bottom: 0; }
  .buy-box { margin: 14px 0; padding: 14px; }
  .buy-box .btn { flex: 1 1 120px; }
  .filters[role=search] .search { flex: 1 1 100%; }
  .filters[role=search] select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .filters[role=search] > .btn { display: none; } /* มือถือกด Enter/ไป บนคีย์บอร์ดได้ และตัวเลือกส่งเองอัตโนมัติ */
  .chips.scroll, .games-strip, .tabs { scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .chips.scroll::-webkit-scrollbar, .games-strip::-webkit-scrollbar { display: none; }
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pbody { padding: 10px 12px 12px; }
  .pbody .btn.sm { min-height: 40px; }
  .egrid { grid-template-columns: 1fr; }
  .players { columns: 1; }
  .table { font-size: .88rem; }
  .table th, .table td { padding: 10px 8px; }
  .card { padding: 16px; }
  .card.auth { padding: 22px 18px; margin-top: 0; }
  .section-head { margin-top: 28px; }
  .hero { border-radius: 18px; }
  .hero .actions .btn { flex: 1 1 100%; }
  .order-steps li { font-size: .74rem; }
  .toasts { left: 16px; right: 16px; max-width: none; }
  .footer .container { flex-direction: column; gap: 18px; }
  /* ตะกร้า: เปลี่ยนตารางเป็นการ์ดในมือถือ */
  .table.cart thead { display: none; }
  .table.cart tbody tr { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .table.cart tbody tr:last-child { border-bottom: 0; }
  .table.cart td { border: 0; padding: 0; background: none !important; }
  .table.cart td:first-child { grid-column: 1 / -1; }
  .table.cart td.price-col { display: none; }
}
@media print {
  .sidebar, .admin-top, .no-print, .flash, .topbar, .footer, .toasts { display: none !important; }
  .admin-main { margin: 0 !important; }
  .decklist { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}

/* ---------- แรงกิ้ง / โปรไฟล์ผู้เล่น ---------- */
.player-link { color: var(--text); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.player-link:hover { color: var(--primary); }
.move-col { width: 56px; padding-left: 0 !important; padding-right: 0 !important; text-align: center; }
.move { display: inline-block; font-size: .78rem; font-weight: 700; min-width: 34px; text-align: center; border-radius: 6px; padding: 1px 4px; }
.move.up { color: var(--ok); background: var(--ok-soft); }
.move.down { color: var(--danger); background: var(--danger-soft); }
.move.same { color: #9aa3b5; }
.move.new { color: var(--info); background: var(--info-soft); font-size: .7rem; }
.profile-head { display: flex; gap: 20px; align-items: center; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 2px 0 10px; }
.profile-head .chips { margin: 0; }

@media (max-width: 760px) {
  .profile-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .profile-head .avatar.lg { width: 56px; height: 56px; font-size: 1.5rem; }
  main .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  main .kpi { padding: 14px; }
  main .kpi b { font-size: 1.3rem; }
  .move-col { width: 44px; }
}

/* ---------- หน้าเนื้อหา (นโยบาย) ---------- */
.prose { max-width: 820px; margin: 0 auto 20px; padding: clamp(20px, 4vw, 40px); line-height: 1.75; }
.prose h2 { font-size: 1.15rem; margin: 1.8em 0 .5em; }
.prose ul { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; }
label.consent { font-size: .9rem; line-height: 1.5; align-items: flex-start !important; }
label.consent input { margin-top: 3px; }

/* ---------- แนะนำรหัสผ่าน ---------- */
.pw-help { font-size: .86rem; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: -6px; }
.pw-meter { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pw-bar { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pw-bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .2s, background .2s; }
.pw-label { font-weight: 600; white-space: nowrap; }
.pw-meter.bad i { background: var(--danger); } .pw-meter.bad .pw-label { color: var(--danger); }
.pw-meter.weak i { background: #f97316; } .pw-meter.weak .pw-label { color: #c2410c; }
.pw-meter.fair i { background: var(--accent); } .pw-meter.fair .pw-label { color: var(--warn); }
.pw-meter.good i, .pw-meter.strong i { background: var(--ok); } .pw-meter.good .pw-label, .pw-meter.strong .pw-label { color: var(--ok); }
.pw-rules { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 3px; }
.pw-rules li { padding-left: 22px; position: relative; }
.pw-rules li::before { position: absolute; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.bad small { color: var(--danger); font-weight: 600; }
.pw-tips summary { padding: 4px 0 0; font-weight: 600; color: var(--primary); font-size: .86rem; }
.pw-tips ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* ---------- รูปโปรไฟล์ ---------- */
.photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.photo-form { flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 10px !important; }
.file-btn { position: relative; overflow: hidden; flex-direction: row !important; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-preview { display: flex; align-items: center; gap: 10px; flex-basis: 100%; }
.photo-preview img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 2px solid var(--primary); }
.photo-card form + form { margin-top: 8px; }
.usermenu summary .avatar { margin-right: 2px; }

/* =====================================================================
   เลย์เอาต์หน้าร้านแบบแถบข้างซ้าย (ตามแบบอ้างอิง)
   ===================================================================== */
svg.i { flex: none; vertical-align: -0.18em; }
body.site { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; background: radial-gradient(120% 80% at 100% 0%, #eef0ff 0%, var(--bg) 55%); }
.m-top { display: none; }
.site-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 22px 16px 18px;
  background: linear-gradient(180deg, #fbfbff 0%, #f3f2ff 100%); border-right: 1px solid var(--line); }
.side-brand { display: flex; align-items: center; gap: 12px; color: var(--text); padding: 2px 6px 6px; }
.side-brand:hover { text-decoration: none; }
.side-brand .logo { height: 46px; width: auto; border-radius: 10px; }
.side-brand span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.side-brand b { font-family: var(--display); font-size: 1.15rem; color: var(--primary); }
.side-brand small { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav, .side-user { display: flex; flex-direction: column; gap: 4px; }
.side-nav a, .side-user a, .side-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: #3b4157; font: inherit; font-weight: 500; background: none; border: 0; width: 100%; cursor: pointer; text-align: left; transition: background .15s, color .15s, box-shadow .15s; }
.side-nav a:hover, .side-user a:hover, .side-link:hover { background: rgba(79, 70, 229, .07); color: var(--primary); text-decoration: none; }
.side-nav a.active, .side-user a.active { background: var(--surface); color: var(--primary); font-weight: 600; box-shadow: 0 2px 10px rgba(79, 70, 229, .12); }
.side-nav a svg, .side-user a svg, .side-link svg { opacity: .85; }
.side-nav .pill { margin-left: auto; }
.side-user { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.side-user .avatar { width: 26px; height: 26px; }
.side-user form { margin: 0; }
.side-user .btn { margin-top: 6px; }
.site-main { min-width: 0; display: flex; flex-direction: column; }
.site-main > main { flex: 1; width: 100%; }
.site-top { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 18px 28px 0; }
.top-search { position: relative; width: min(340px, 100%); }
.top-search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.top-search input { border-radius: 99px; padding-left: 44px; background: var(--surface); border-color: var(--line); box-shadow: 0 2px 10px rgba(16, 24, 40, .05); }
.site-top .cart-btn, .m-top .cart-btn { color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.site-top .cart-btn:hover, .m-top .cart-btn:hover, .site-top .cart-btn.active { color: var(--primary); background: var(--surface); border-color: var(--primary); }
body.site .footer { margin-top: 40px; }
/* ปุ่มช่วยเหลือมุมขวาล่าง */
.help-fab { position: fixed; right: 20px; bottom: 20px; z-index: 80; }
.help-fab > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); cursor: pointer; }
.help-fab > summary::-webkit-details-marker { display: none; }
.help-fab > summary span { display: flex; flex-direction: column; line-height: 1.3; }
.help-fab > summary b { color: var(--primary); font-size: .88rem; }
.help-fab > summary small { color: var(--muted); font-size: .76rem; }
.help-fab > summary i { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; }
.help-pop { position: absolute; right: 0; bottom: calc(100% + 10px); min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; }
.help-pop a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.help-pop a:hover { background: var(--surface-2); text-decoration: none; color: var(--primary); }
.toasts { bottom: 96px; }
/* เหรียญอันดับ */
.medal { vertical-align: middle; }
.medal .disc { fill: var(--md); } .medal .ring { fill: none; stroke: #fff; stroke-opacity: .55; stroke-width: 1; }
.medal .rib { fill: var(--mr); } .medal text { font: 700 8.5px var(--font); fill: #fff; }
.medal.m1 { --md: #f5b301; --mr: #4f46e5; } .medal.m2 { --md: #9aa4b6; --mr: #6366f1; } .medal.m3 { --md: #c47a3d; --mr: #818cf8; }
.titles { display: inline-flex; align-items: center; gap: 4px; color: #b7791f; font-weight: 600; }
.move svg { vertical-align: -0.2em; }
/* เครื่องหมายถูก/ผิด: วาดด้วย SVG แทนสัญลักษณ์ตัวอักษร */
.order-steps li.done::before { content: ''; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat; }
.pw-rules li::before { content: ''; top: .45em; left: 3px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #c3c9d6; }
.pw-rules li.ok::before { content: ''; border: 0; width: 14px; height: 14px; top: .3em; left: 1px; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 10px no-repeat; }
.pw-rules li.bad::before { content: ''; border: 0; width: 14px; height: 14px; top: .3em; left: 1px; background: var(--danger) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 9px no-repeat; }
.toast a::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); vertical-align: 1px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; }
/* หน้าแรก: ข้อความซ้าย ภาพใหญ่ขวา */
.hero2 { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 24px; min-height: calc(100vh - 150px); padding: 12px 0 64px; }
.hero2 .eyebrow { color: var(--muted) !important; letter-spacing: .06em; text-transform: none; font-size: .92rem; font-weight: 500; }
.hero2 h1 { font-size: clamp(2.1rem, 4.4vw, 3.4rem); line-height: 1.12; margin: .2em 0 .45em; color: #1f2340; }
.hero2 h1 em { font-style: normal; color: var(--primary); }
.hero2 .lead { font-size: 1.05rem; color: #4a5068; max-width: 500px; line-height: 1.75; }
.hero2 .actions { margin-top: 26px; }
.hero2 .btn.lg { border-radius: 99px; padding-left: 28px; padding-right: 26px; }
.hero2 .btn.ghost { background: rgba(255, 255, 255, .7); }
.perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 34px; max-width: 540px; }
.perk { display: flex; gap: 10px; align-items: flex-start; }
.perk i { flex: none; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--primary); box-shadow: 0 2px 10px rgba(79, 70, 229, .12); }
.perk b { display: block; font-size: .9rem; color: #1f2340; }
.perk span { font-size: .78rem; color: var(--muted); line-height: 1.45; }
.hero2-art { position: relative; }
.hero2-art img { width: 100%; height: auto; max-width: 640px; margin-left: auto; filter: drop-shadow(0 30px 40px rgba(79, 70, 229, .18)); }
.scroll-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.scroll-hint:hover { text-decoration: none; color: var(--primary); }
@media (max-width: 1100px) {
  .hero2 { grid-template-columns: 1fr; min-height: 0; padding-bottom: 56px; }
  .hero2-art { order: -1; max-width: 520px; margin: 0 auto; }
}
@media (max-width: 960px) {
  body.site { display: block; }
  .m-top { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 70; height: 62px; padding: 0 12px 0 16px; background: rgba(251, 251, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .m-top .brand .logo { height: 42px; border-radius: 9px; }
  .m-top .cart-btn { margin-left: auto; }
  .m-top .nav-toggle { display: inline-flex; color: var(--text); }
  .m-top .nav-toggle:hover { background: var(--surface-2); }
  .site-side { position: fixed; left: 0; top: 0; z-index: 90; width: 280px; transform: translateX(-100%); transition: transform .2s; }
  .site-side.open { transform: none; box-shadow: 0 0 60px rgba(15, 18, 48, .35); }
  .site-top .cart-btn { display: none; }
  .site-top { padding: 14px 16px 0; }
  .top-search { width: 100%; }
  .help-fab > summary span { display: none; }
  .help-fab > summary { padding: 6px; border-radius: 50%; }
  .help-fab { right: 14px; bottom: 14px; }
}
@media (max-width: 640px) {
  .perks { grid-template-columns: 1fr; gap: 12px; }
  .hero2 h1 { font-size: 2rem; }
  .scroll-hint { display: none; }
}
@media print { .site-side, .site-top, .m-top, .help-fab { display: none !important; } body.site { display: block; } }

.report-dots svg { vertical-align: -0.2em; }
.match-box h3 svg, .btn svg.i { vertical-align: -0.15em; }
.side-user a.btn { justify-content: center; background: var(--primary); color: #fff; font-weight: 600; box-shadow: none; }
.side-user a.btn:hover { background: var(--primary-hover); color: #fff; }
.perks { max-width: 580px; }

/* =====================================================================
   พื้นหลังธีมร้าน (เลือกได้ที่หลังบ้าน ตั้งค่าร้าน) — body.bg-<ชื่อ>
   ===================================================================== */
body.site { background-attachment: fixed; }
/* แถบข้างแบบกระจกฝ้า ให้พื้นหลังลอดผ่านได้ */
body.site .site-side { background: rgba(255, 255, 255, .72); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-right-color: rgba(214, 218, 235, .8); }

/* 1) ดาราจักรนวล: แสงม่วง-ฟ้า-ทองนุ่มๆ ตามสีโลโก้ */
body.bg-nebula, .bg-swatch.bg-nebula { background:
  radial-gradient(55% 45% at 88% 6%, rgba(139, 125, 255, .26), transparent 70%),
  radial-gradient(40% 40% at 30% 8%, rgba(165, 243, 252, .18), transparent 70%),
  radial-gradient(45% 40% at 6% 96%, rgba(245, 158, 11, .14), transparent 70%),
  radial-gradient(35% 30% at 70% 85%, rgba(251, 207, 232, .22), transparent 70%),
  #f6f6fd fixed; }

/* 2) วงโคจร: วงแหวนดาวเคราะห์เส้นบางกับดาวจุดเล็ก */
body.bg-orbit, .bg-swatch.bg-orbit { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 1000' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%238b7dff' stroke-opacity='.16' stroke-width='2'%3E%3Cellipse cx='1350' cy='120' rx='520' ry='120' transform='rotate(-14 1350 120)'/%3E%3Cellipse cx='1350' cy='120' rx='420' ry='92' transform='rotate(-14 1350 120)' stroke-opacity='.1'/%3E%3Cellipse cx='150' cy='930' rx='480' ry='110' transform='rotate(-14 150 930)' stroke='%23f59e0b' stroke-opacity='.16'/%3E%3C/g%3E%3Ccircle cx='1350' cy='120' r='70' fill='%238b7dff' fill-opacity='.08'/%3E%3Ccircle cx='150' cy='930' r='56' fill='%23f59e0b' fill-opacity='.08'/%3E%3Cg fill='%234f46e5' fill-opacity='.22'%3E%3Ccircle cx='420' cy='140' r='2'/%3E%3Ccircle cx='760' cy='60' r='1.5'/%3E%3Ccircle cx='980' cy='300' r='2'/%3E%3Ccircle cx='1180' cy='520' r='1.5'/%3E%3Ccircle cx='620' cy='620' r='2'/%3E%3Ccircle cx='300' cy='420' r='1.5'/%3E%3Ccircle cx='1480' cy='760' r='2'/%3E%3Ccircle cx='880' cy='860' r='1.5'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat fixed,
  linear-gradient(160deg, #f7f7fe 0%, #eef0ff 100%) fixed; }

/* 3) ลายหลังการ์ด: ลวดลายการ์ดเรียงจางๆ */
body.bg-cards, .bg-swatch.bg-cards { background:
  radial-gradient(60% 50% at 90% 0%, rgba(139, 125, 255, .16), transparent 70%) fixed,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='140' viewBox='0 0 120 140'%3E%3Cg fill='none' stroke='%234f46e5' stroke-opacity='.075' stroke-width='1.5'%3E%3Crect x='14' y='12' width='40' height='56' rx='5' transform='rotate(-10 34 40)'/%3E%3Crect x='70' y='80' width='40' height='56' rx='5' transform='rotate(12 90 108)'/%3E%3C/g%3E%3Cg fill='%23f59e0b' fill-opacity='.14'%3E%3Cpath d='M92 22l3 6 6 3-6 3-3 6-3-6-6-3 6-3z'/%3E%3Cpath d='M28 98l2 4 4 2-4 2-2 4-2-4-4-2 4-2z'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 120px 140px,
  #f6f6fc; }

/* 4) ฟ้ายามค่ำ: แถบข้างสีกรมท่าแบบโลโก้ หน้าแรกมีท้องฟ้าดาวด้านบน */
body.bg-night, .bg-swatch.bg-night { background:
  radial-gradient(50% 40% at 90% 0%, rgba(139, 125, 255, .28), transparent 70%) fixed,
  radial-gradient(45% 40% at 0% 100%, rgba(245, 158, 11, .1), transparent 70%) fixed,
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600'%3E%3Cg fill='%23fff'%3E%3Ccircle cx='40' cy='60' r='1.3' opacity='.55'/%3E%3Ccircle cx='190' cy='150' r='1' opacity='.35'/%3E%3Ccircle cx='320' cy='40' r='1.5' opacity='.6'/%3E%3Ccircle cx='470' cy='190' r='1' opacity='.4'/%3E%3Ccircle cx='560' cy='70' r='1.3' opacity='.5'/%3E%3Ccircle cx='110' cy='330' r='1' opacity='.3'/%3E%3Ccircle cx='260' cy='420' r='1.4' opacity='.5'/%3E%3Ccircle cx='420' cy='360' r='1' opacity='.35'/%3E%3Ccircle cx='540' cy='500' r='1.3' opacity='.45'/%3E%3Ccircle cx='70' cy='540' r='1.1' opacity='.4'/%3E%3Ccircle cx='350' cy='560' r='1' opacity='.3'/%3E%3C/g%3E%3Cpath d='M480 300c.8 4.5 2 5.8 6.5 6.5-4.5.8-5.8 2-6.5 6.5-.8-4.5-2-5.8-6.5-6.5 4.5-.7 5.8-2 6.5-6.5z' fill='%23fde68a' opacity='.7'/%3E%3Cpath d='M150 470c.6 3.5 1.6 4.5 5 5-3.4.6-4.4 1.6-5 5-.6-3.4-1.6-4.4-5-5 3.4-.5 4.4-1.5 5-5z' fill='%23c7d2fe' opacity='.6'/%3E%3C/svg%3E") 0 0 / 600px 600px fixed,
  linear-gradient(180deg, #0f1236 0%, #0b0d29 100%) fixed; }
body.bg-night .site-side { background: linear-gradient(180deg, #14164a 0%, #0f1230 100%); border-right-color: #23265e; backdrop-filter: none; }
body.bg-night .side-brand b { color: #fbbf24; }
body.bg-night .side-brand small { color: #9aa0d6; }
body.bg-night .side-nav a, body.bg-night .side-user a, body.bg-night .side-link { color: #c9cdf5; }
body.bg-night .side-nav a:hover, body.bg-night .side-user a:hover, body.bg-night .side-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
body.bg-night .side-nav a.active, body.bg-night .side-user a.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 #f59e0b; }
body.bg-night .side-user { border-top-color: rgba(255, 255, 255, .1); }
body.bg-night .side-user a.btn { background: #f59e0b; color: #0f1230; }
body.bg-night .hero2 h1 { color: #fff; }
body.bg-night .hero2 h1 em { color: #fbbf24; }
body.bg-night .hero2 .eyebrow { color: #a5b4fc !important; }
body.bg-night .hero2 .lead { color: #d7dbff; }
body.bg-night .hero2 .btn:not(.ghost) { background: #f59e0b; border-color: #f59e0b; color: #0f1230; }
body.bg-night .hero2 .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
body.bg-night .perk b { color: #fff; } body.bg-night .perk span { color: #b9bee8; }
body.bg-night .perk i { background: rgba(255, 255, 255, .1); color: #fbbf24; box-shadow: none; }
body.bg-night .hero2-art img { filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .35)); }

/* 5) แสงอรุณ: โทนอุ่นทอง-พีชแบบภาพอ้างอิง แต่ใช้ทองของโลโก้ */
body.bg-sunrise, .bg-swatch.bg-sunrise { background:
  radial-gradient(55% 50% at 92% 4%, rgba(251, 191, 36, .28), transparent 70%),
  radial-gradient(45% 40% at 60% 30%, rgba(253, 186, 116, .16), transparent 70%),
  radial-gradient(50% 45% at 4% 100%, rgba(167, 139, 250, .2), transparent 70%),
  #fffaf4 fixed; }
body.bg-sunrise .site-side { background: rgba(255, 252, 247, .78); border-right-color: #f1e4cf; }

/* 6) เพลย์แมท: ตารางเส้นจางแบบแผ่นรองเล่นการ์ด */
body.bg-playmat, .bg-swatch.bg-playmat { background:
  radial-gradient(70% 60% at 75% 20%, rgba(139, 125, 255, .14), transparent 70%) fixed,
  linear-gradient(rgba(79, 70, 229, .055) 1px, transparent 1px) 0 0 / 40px 40px,
  linear-gradient(90deg, rgba(79, 70, 229, .055) 1px, transparent 1px) 0 0 / 40px 40px,
  #f7f7fc; }
@media (max-width: 960px) { body.site .site-side { background: rgba(255, 255, 255, .96); } body.bg-night .m-top { background: rgba(12, 14, 41, .92); border-bottom-color: #23265e; } body.bg-night .site-side { background: #0f1230; } }

/* ตัวเลือกพื้นหลังในหน้าตั้งค่าร้าน */
.bg-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.bg-option { align-items: flex-start !important; }
.bg-option > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.bg-option a { font-size: .85rem; font-weight: 600; }
.bg-swatch { flex: none; width: 64px; height: 48px; border-radius: 10px; border: 1px solid var(--line); background-size: cover !important; background-attachment: scroll !important; }
.bg-swatch.bg-night { background: linear-gradient(90deg, #0f1230 0 32%, #161a45 32%) !important; }

/* ---------- ฟ้ายามค่ำ = โหมดมืดทั้งหน้าร้าน ---------- */
body.bg-night {
  --bg: #0b0d29; --surface: #161a45; --surface-2: #1d2152; --text: #e8eaff; --muted: #a3a9d9; --line: #2a2f6b; --line-strong: #3b4185;
  --primary: #6d5dfc; --primary-hover: #7f71ff; --primary-soft: rgba(139, 125, 255, .16);
  --ok: #34d399; --ok-soft: rgba(52, 211, 153, .13); --warn: #fbbf24; --warn-soft: rgba(251, 191, 36, .13);
  --danger: #f87171; --danger-soft: rgba(248, 113, 113, .13); --info: #7cb3ff; --info-soft: rgba(96, 165, 250, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-md: 0 8px 24px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 44px rgba(0, 0, 0, .5);
  --ring: 0 0 0 3px rgba(139, 125, 255, .4);
  color: var(--text); color-scheme: dark;
}
body.bg-night a:not(.btn) { color: #b4bcff; }
body.bg-night a.player-link, body.bg-night .pbody h3 a, body.bg-night .cart-item a, body.bg-night .help-pop a { color: var(--text); }
body.bg-night .player-link:hover, body.bg-night .pbody h3 a:hover { color: #b4bcff; }
body.bg-night .btn.ghost { color: #c7cbff; background: rgba(255, 255, 255, .04); border-color: var(--line-strong); }
body.bg-night .btn.ghost:hover { background: var(--primary-soft); border-color: #8b7dff; }
body.bg-night .btn.danger, body.bg-night .btn.ghost.danger { color: var(--danger); border-color: rgba(248, 113, 113, .45); background: transparent; }
body.bg-night .card, body.bg-night .pcard, body.bg-night .ecard, body.bg-night .kpi, body.bg-night .event-head { border-color: var(--line); }
body.bg-night input, body.bg-night select, body.bg-night textarea { background: #11143a; border-color: var(--line-strong); color: var(--text); }
body.bg-night input::placeholder, body.bg-night textarea::placeholder { color: #7a80b8; }
body.bg-night input[type=file] { background: #11143a; }
body.bg-night .flash.ok { color: #a7f3d0; border-color: rgba(52, 211, 153, .35); }
body.bg-night .flash.error { color: #fecaca; border-color: rgba(248, 113, 113, .35); }
body.bg-night .flash.warn { color: #fde68a; border-color: rgba(251, 191, 36, .35); }
body.bg-night .flash.info { color: #c7dbff; border-color: rgba(96, 165, 250, .35); }
body.bg-night .badge.muted { background: rgba(255, 255, 255, .08); color: #c3c8ee; }
body.bg-night .table tbody tr:hover td { background: rgba(255, 255, 255, .03); }
body.bg-night .table tr.me td { background: rgba(251, 191, 36, .1) !important; }
body.bg-night .table thead th { background: var(--surface-2); }
body.bg-night .edate { background: color-mix(in srgb, var(--g) 22%, #161a45); }
body.bg-night .edate b { color: #fff; }
body.bg-night .match-box.disputed { background: rgba(248, 113, 113, .08); }
body.bg-night .scroll-hint { background: rgba(22, 26, 69, .85); color: #c3c8ee; }
body.bg-night .chip.active small { color: #dfe1ff; }
body.bg-night .social-btn.google { background: #fff; color: #1f2937; }
body.bg-night .toast { background: #23286a; border: 1px solid #3b4185; }
body.bg-night .help-fab > summary b { color: #c7cbff; }
body.bg-night .footer { background: #080a22; border-top: 1px solid #1d2152; }
body.bg-night .top-search input { background: rgba(22, 26, 69, .9); }
body.bg-night .stepper input { background: transparent; }
body.bg-night .pw-meter.weak .pw-label { color: #fdba74; }
body.bg-night .price.big, body.bg-night .sum-line.total b { color: #b4bcff; }
body.bg-night h1, body.bg-night h2, body.bg-night h3 { color: #f1f2ff; }
body.bg-night .pw-tips summary, body.bg-night .linkbtn:not(.danger), body.bg-night .back-link { color: #b4bcff; }
body.bg-night .tabs a.active, body.bg-night .side-nav a.active { color: #fff; }
body.bg-night .tabs a.active { border-color: #8b7dff; }

/* ---------- เกี่ยวกับเรา (/about) ---------- */
.about-hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; margin: 8px 0 24px; }
.about-hero h1 { font-family: var(--display); font-size: clamp(1.7rem, 3.6vw, 2.6rem); line-height: 1.2; margin: 0 0 6px; }
.about-hero .lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 14px; }
.about-hero img { width: min(240px, 38vw); height: auto; filter: drop-shadow(0 10px 30px rgba(0,0,0,.35)); }
.about-values { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.about-values li { padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line-strong); font-weight: 600; font-size: .9rem; }
.about-grid { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.about-grid .card { margin-bottom: 0; }
.about-text p, .about-story p { line-height: 1.85; }
.founder { margin: 0; text-align: center; }
.founder img { width: 200px; height: 200px; object-fit: cover; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); display: block; margin: 0 auto 14px; }
.founder figcaption { display: flex; flex-direction: column; gap: 2px; }
.founder figcaption b { font-size: 1.15rem; }
.founder figcaption span { color: var(--muted); }
.about-grid + .card, .about-story { margin-top: 20px; }
.about-story { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: center; }
.about-photos { display: grid; gap: 12px; }
.about-photos img { width: 100%; height: auto; border-radius: var(--radius-sm); display: block; }
.card h2 small { font-size: .9rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.card h2 .i, .about-next h3 .i { vertical-align: -4px; color: var(--accent); }
.about-mission { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.about-mission li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.7; }
.about-mission li > .i { color: var(--accent); flex: none; margin-top: 4px; }
.journey { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.journey li { position: relative; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.journey li i { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 10px; }
.journey li b { display: block; margin-bottom: 4px; }
.journey li p { margin: 0; color: var(--muted); line-height: 1.7; font-size: .95rem; }
.about-next { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.about-next h2 em { font-style: normal; color: #f87171; }
.about-next h3 { margin: 4px 0 6px; }
.about-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.about-chips li { padding: 8px 14px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.about-quote { margin: 24px 0; padding: 28px 32px; border-radius: var(--radius); background: linear-gradient(135deg, #312e81, #1e1b4b); color: #eef0ff; display: flex; gap: 16px; align-items: flex-start; }
.about-quote .i { color: var(--accent); flex: none; }
.about-quote p { margin: 0; font-size: 1.15rem; line-height: 1.8; font-weight: 500; }
.about-contact { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.about-links, .about-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.about-teaser { display: flex; gap: 22px; align-items: center; margin-top: 36px; }
.about-teaser img { width: 150px; height: 150px; flex: none; }
.about-teaser h2 { margin: 0 0 6px; }
.about-teaser p:not(.eyebrow) { color: var(--muted); line-height: 1.75; margin: 0 0 12px; }
body.bg-night .journey li { background: rgba(255,255,255,.03); }
body.bg-night .journey li i, body.bg-night .about-chips li { background: rgba(139,125,255,.16); color: #c7c2ff; }
@media (max-width: 900px) {
  .about-grid, .about-story, .about-next { grid-template-columns: 1fr; }
  .journey { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .about-hero { grid-template-columns: 1fr; text-align: center; }
  .about-hero img { order: -1; margin: 0 auto; width: 170px; }
  .about-values { justify-content: center; }
  .journey { grid-template-columns: 1fr; }
  .about-teaser { flex-direction: column; text-align: center; }
  .about-quote { padding: 22px; }
}

/* ---------- แกลเลอรีรูปสินค้า + ตัวเลือกสินค้า ---------- */
.gallery { display: grid; gap: 10px; align-content: start; }
.gallery-main { display: block; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs a { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2); }
.gallery-thumbs a.active { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.buy-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.variant-pick { border: 0; padding: 0; margin: 0 0 4px; width: 100%; min-width: 0; }
.variant-list { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-pick legend { font-weight: 600; margin-bottom: 8px; }
.variant-pick .variant { position: relative; cursor: pointer; display: block; flex: 0 0 auto; width: auto; margin: 0; }
.variant input { position: absolute; opacity: 0; pointer-events: none; }
.variant span { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; min-width: 84px; }
.variant small { color: var(--muted); font-size: .8rem; }
.variant input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.variant input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.variant.out { cursor: not-allowed; opacity: .45; }
.variant.out b { text-decoration: line-through; }
.img-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.img-tile { margin: 0; width: 140px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px; }
.img-tile img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: block; }
.img-tile figcaption { font-size: .8rem; display: grid; gap: 2px; margin-top: 6px; }
.img-tile { position: relative; background: var(--surface); }
.img-tile[draggable="true"] { cursor: grab; }
.img-tile.dragging { opacity: .4; }
.img-badge { display: none; position: absolute; top: 10px; left: 10px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--night); font-size: .75rem; font-weight: 700; }
.img-tile.is-cover, .img-grid:not(:has(.img-tools)) .img-tile:first-child { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.img-tile.is-cover .img-badge, .img-grid:not(:has(.img-tools)) .img-tile:first-child .img-badge { display: block; }
.img-tile.removed img { opacity: .3; }
.img-tools { display: flex; justify-content: space-between; gap: 4px; margin-top: 6px; }
.img-tools .icon-btn { width: 30px; height: 30px; }
.img-tools .icon-btn:disabled { opacity: .3; cursor: default; }
.variants-table input { width: 100%; min-width: 70px; }
.variants-table td:last-child, .variants-table th:last-child { width: 1%; white-space: nowrap; }
.variants-table label.check { gap: 6px !important; }
.variants-table tr.removed td { opacity: .45; }
.variants-table tr.removed input[name^="v_name_"] { text-decoration: line-through; }
.v-tools { display: flex; gap: 4px; align-items: center; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn[data-v-del]:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.v-quick { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 4px; }
.v-quick-names { flex: 1 1 260px; }
.v-quick-num { flex: 0 0 110px; }
.v-quick .btn { min-height: 44px; }
.v-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-top: 8px; }
.v-empty { margin: 8px 0; }
@media (max-width: 640px) {
  .variants-table, .variants-table tbody { display: block; width: 100%; }
  .variants-table thead { display: none; }
  .variants-table tr[data-v-row] { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .variants-table tr[data-v-row] td { display: block; padding: 0; border: 0; width: auto !important; }
  .variants-table tr[data-v-row] td:first-child { grid-column: 1 / -1; }
  .variants-table input { min-width: 0; }
  .v-tools { gap: 2px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) { .img-tile { width: calc(50% - 6px); } }
