/* ฝั่งขายและผู้จัด: โทนกลางคืนน้ำเงินเข้ม-ทอง ใช้ง่ายบนมือถือ */
:root {
  --bg: #0a1428;
  --bg2: #12254a;
  --card: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.16);
  --text: #eef2fb;
  --muted: #b3bfd9;
  --gold: #f6c453;
  --gold-deep: #d99a1c;
  --ink: #14203a;
  --ok: #5fd99a;
  --err: #ff8a8a;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #0e1d3c; }
body {
  margin: 0;
  font-family: 'Sarabun', 'Prompt', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, .brand { font-family: 'Prompt', 'Sarabun', sans-serif; line-height: 1.3; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 7vw, 3rem); }
h2 { font-size: clamp(1.4rem, 5vw, 2rem); color: var(--gold); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--gold); }
img, canvas { max-width: 100%; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }
.site-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; max-width: 1040px; margin: 0 auto; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand b { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
section { padding: 28px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem 'Prompt', 'Sarabun', sans-serif; text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep)); color: #2a1c00;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn.danger { background: #b64a4a; color: #fff; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.hero { padding: 24px 0 8px; }
.hero-grid { display: grid; gap: 24px; align-items: center; }
.hero-card {
  position: relative; min-height: 220px; border-radius: 22px; border: 1px solid var(--line); overflow: hidden;
  background: url('/images/bg/river-night-landscape.jpg') center/cover no-repeat, linear-gradient(160deg, #1a2d57, #0a1428 60%, #3b2a0c);
  display: flex; align-items: flex-end;
}
.hero-card span { padding: 12px 16px; background: linear-gradient(0deg, rgba(0,0,0,.65), transparent); width: 100%; font-size: .95rem; }
.badge { display: inline-block; padding: 4px 14px; border-radius: 999px; background: rgba(246,196,83,.16); border: 1px solid var(--gold); color: var(--gold); font-size: .95rem; margin-bottom: 12px; }
.lead { font-size: 1.1rem; color: var(--muted); }

.grid { display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { color: var(--gold); }
.features { grid-template-columns: 1fr; }
.themes { grid-template-columns: repeat(2, 1fr); }
.theme-tile {
  min-height: 110px; border-radius: 14px; border: 2px solid var(--line); display: flex; align-items: flex-end; overflow: hidden;
  background-size: cover; background-position: center; cursor: pointer; position: relative;
}
.theme-tile span { width: 100%; padding: 6px 10px; font-size: .9rem; background: linear-gradient(0deg, rgba(0,0,0,.7), transparent); }
.theme-tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.theme-tile.sel { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,196,83,.35); }
.t-river-night { background-image: url('/images/bg/river-night-landscape.jpg'), linear-gradient(160deg, #1d3566, #0a1428); }
.t-lantern-sky { background-image: url('/images/bg/lantern-sky-landscape.jpg'), linear-gradient(160deg, #3a2a52, #101030 70%, #7a4a12); }
.t-temple-glow { background-image: url('/images/bg/temple-glow-landscape.jpg'), linear-gradient(160deg, #4a2c14, #1a1008 70%, #8a5a18); }
.t-city-lights { background-image: url('/images/bg/city-lights-landscape.jpg'), linear-gradient(160deg, #123a5a, #0a1830 70%, #5a2a6a); }
.t-custom { background-image: linear-gradient(160deg, #333, #111); }

.price-grid { grid-template-columns: 1fr; }
.price-card { text-align: center; }
.price-card.best { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(246,196,83,.3); }
.price { font: 700 2.4rem 'Prompt', sans-serif; color: var(--gold); }
.price small { font-size: 1rem; color: var(--muted); }
.price-card ul { text-align: left; padding-left: 1.2em; margin: 12px 0; color: var(--muted); }

details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--muted); }

/* ฟอร์ม */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 2px solid transparent; background: #f4f7fd; color: var(--ink);
  font: inherit; min-height: 48px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); }
textarea { min-height: 90px; resize: vertical; }
.hint { font-size: .9rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 16px 0; }
.check input { width: 24px; height: 24px; margin-top: 2px; flex: none; }
.group-row { display: grid; grid-template-columns: 1fr 76px 48px; gap: 8px; margin-bottom: 8px; align-items: center; }
.msg { padding: 10px 14px; border-radius: 12px; margin: 12px 0; }
.msg.err { background: rgba(255,138,138,.15); border: 1px solid var(--err); color: #ffd0d0; }
.msg.ok { background: rgba(95,217,154,.14); border: 1px solid var(--ok); color: #c9f5de; }
.msg.warn { background: rgba(246,196,83,.14); border: 1px solid var(--gold); }

.key-box {
  font: 700 clamp(1.6rem, 8vw, 2.6rem) 'Prompt', monospace; letter-spacing: .08em; text-align: center; padding: 18px 10px;
  background: #fff; color: var(--ink); border-radius: 16px; margin: 14px 0; user-select: all; word-break: break-all;
}

/* จัดการ */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin: 14px 0; -webkit-overflow-scrolling: touch; }
.tab { flex: none; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 600 .95rem 'Prompt', sans-serif; cursor: pointer; min-height: 44px; }
.tab[aria-selected=true] { background: var(--gold); color: #2a1c00; border-color: var(--gold); }
.panel[hidden] { display: none; }
.link-item { display: grid; gap: 10px; }
.link-top { word-break: break-all; }
.link-url { font-size: .9rem; background: rgba(0,0,0,.25); padding: 8px 10px; border-radius: 10px; word-break: break-all; }
.qr-box { background: #fff; padding: 8px; border-radius: 12px; width: 168px; height: 168px; }
.qr-box canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.status-chip { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: .9rem; border: 1px solid var(--ok); color: var(--ok); }
.status-chip.bad { border-color: var(--err); color: var(--err); }
.up-preview { width: 100%; max-width: 360px; border-radius: 12px; border: 1px solid var(--line); display: block; background: #000; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pay-list { list-style: none; padding: 0; margin: 0; }
.pay-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }

/* ผู้ดูแล */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--gold); white-space: nowrap; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 30px); opacity: 0; transition: .25s; background: #fff; color: var(--ink); padding: 12px 20px; border-radius: 999px; font-weight: 600; z-index: 50; max-width: 92vw; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #ffe1e1; }
footer { padding: 30px 16px 40px; text-align: center; color: var(--muted); font-size: .92rem; }
.prose h2 { margin-top: 1.4em; font-size: 1.3rem; }
.prose li { margin-bottom: .4em; }

@media (min-width: 720px) {
  .hero-grid { grid-template-columns: 1.1fr 1fr; }
  .features { grid-template-columns: repeat(3, 1fr); }
  .themes { grid-template-columns: repeat(4, 1fr); }
  .price-grid { grid-template-columns: repeat(3, 1fr); }
  .link-item { grid-template-columns: 1fr auto; align-items: start; }
}
