/* หน้าตาเว็บเช่า PS5 — โทนมืด ใช้ชุดสีจากโลโก้ร้าน: น้ำเงิน ฟ้า และชมพูเป็นจุดเน้น */
:root {
  color-scheme: dark;
  --bg: #0b0d11;        /* สีพื้นเดียวกับโลโก้ */
  --surface: #131722;
  --surface-2: #1a2030;
  --line: #262d40;
  --text: #eef1f7;
  --muted: #8d97ad;
  --accent: #2563ff;    /* น้ำเงินของโลโก้ (ปรับสว่างขึ้นเล็กน้อยให้ตัวหนังสือขาวอ่านชัด) */
  --accent-2: #1746d9;
  --cyan: #0de0fa;      /* ฟ้าของโลโก้: ลิงก์ ราคา ตัวเลขเด่น */
  --pink: #e9378f;      /* ชมพูของโลโก้: ใช้น้อย ๆ เป็นจุดเน้น */
  --amber: #0de0fa;     /* ชื่อเดิมของสีราคา ตอนนี้ชี้ไปที่สีฟ้า */
  --ok: #3ddc97;
  --bad: #ff6b6b;
  --warn: #ffb347;
  --radius: 16px;
  --font: 'IBM Plex Sans Thai', 'Leelawadee UI', 'Noto Sans Thai', system-ui, sans-serif;
  --display: 'Kanit', 'IBM Plex Sans Thai', 'Leelawadee UI', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font);
  background-image: radial-gradient(900px 420px at 85% -120px, rgba(37, 99, 255, .20), transparent 70%), radial-gradient(700px 380px at -10% 10%, rgba(13, 224, 250, .07), transparent 70%);
  background-repeat: no-repeat; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); line-height: 1.25; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.35rem; margin-top: 2.2em; }
h3 { font-size: 1.05rem; margin-top: 1.4em; }
h1.tight { margin: 0; }
p { margin: 0 0 1em; }
code, .mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .04em; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
main.wrap { flex: 1; padding: 28px 0 56px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.pre { white-space: pre-line; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.2em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--cyan); font-weight: 600; }

/* แถบบน */
.top { position: sticky; top: 0; z-index: 20; background: rgba(10, 12, 18, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; padding: 8px 0; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--text); display: flex; align-items: center; gap: 10px; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.logo { height: 28px; width: auto; display: block; }
.card-logo { width: 104px; height: auto; display: block; margin: 0 auto 14px; }
.main { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.main a, .subnav a, .tabs a { color: var(--muted); padding: 6px 12px; border-radius: 999px; font-weight: 500; }
.main a:hover, .subnav a:hover, .tabs a:hover { color: var(--text); text-decoration: none; }
.main a.on, .subnav a.on, .tabs a.on { color: var(--text); background: var(--surface-2); }
.acct { display: flex; align-items: center; gap: 8px; }
.acct form { margin: 0; }
.who { color: var(--muted); max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subnav { border-bottom: 1px solid var(--line); background: var(--surface); }
.subnav .wrap { display: flex; gap: 4px; padding: 8px 0; overflow-x: auto; }
.tabs { display: flex; gap: 4px; margin: 20px 0 12px; overflow-x: auto; }
.tabs a, .subnav a { white-space: nowrap; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }
.foot .wrap { display: flex; justify-content: space-between; gap: 12px; padding: 18px 0; flex-wrap: wrap; }

/* ปุ่ม */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: 600 .95rem var(--font); color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); padding: 10px 18px; border-radius: 12px; transition: transform .12s, filter .12s; white-space: nowrap; }
.btn:hover { filter: brightness(1.1); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.btn.lg { padding: 13px 22px; font-size: 1rem; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; text-decoration: underline; padding: 8px; }
.link.danger { color: var(--bad); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* โครง */
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; gap: 12px; }
.row.end { align-items: flex-end; }
.row.gap { gap: 12px; flex-wrap: wrap; }
.row.gap-s { gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.pkgs-show { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card.pad { padding: 20px; }
.card-b { padding: 16px 18px 18px; }
a.card { color: inherit; display: block; transition: border-color .15s, transform .15s; }
a.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 4px 0; font-size: 1.2rem; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.narrow { max-width: 520px; margin-inline: auto; }
.narrow.wide { max-width: 760px; }
.narrow.sm { max-width: 420px; }
.split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 28px; align-items: start; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); }
.center-card { text-align: center; padding: 60px 0; }

/* ป้ายสถานะ */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge.ok { color: var(--ok); background: rgba(61, 220, 151, .12); }
.badge.warn { color: var(--warn); background: rgba(255, 179, 71, .12); }
.badge.bad { color: var(--bad); background: rgba(255, 107, 107, .12); }
.badge.info { color: var(--cyan); background: rgba(13, 224, 250, .12); }
.badge.live { color: #ff6fb1; background: rgba(233, 55, 143, .16); }
.badge.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { border-color: rgba(61, 220, 151, .4); color: var(--ok); }
.flash.bad { border-color: rgba(255, 107, 107, .4); color: var(--bad); }
.flash.warn { border-color: rgba(255, 179, 71, .4); color: var(--warn); }
.err { color: var(--bad); margin: 8px 0; }
.state { border-radius: 12px; padding: 14px 16px; margin: 16px 0; background: var(--surface-2); border-left: 4px solid var(--muted); }
.state p { margin: 4px 0 0; color: var(--muted); }
.state.ok { border-color: var(--ok); } .state.info { border-color: var(--accent); } .state.bad { border-color: var(--bad); }

/* หน้าแรก */
.hero { display: grid; grid-template-columns: 1.35fr 1fr; gap: 28px 32px; align-items: center; padding: 36px 0 20px; position: relative; }
/* เส้นเฉียงชมพู-ฟ้าหลังโลโก้ ล้อกับรอยตัดในโลโก้ */
.hero::before { content: ''; position: absolute; inset: -20px 0 auto auto; width: 46%; height: 78%; pointer-events: none; opacity: .55;
  background:
    linear-gradient(118deg, transparent calc(50% - 1.5px), var(--pink) calc(50% - 1.5px), var(--pink) calc(50% + 1.5px), transparent calc(50% + 1.5px)) 30% 0 / 70% 100% no-repeat,
    linear-gradient(118deg, transparent calc(50% - 1px), var(--cyan) calc(50% - 1px), var(--cyan) calc(50% + 1px), transparent calc(50% + 1px)) 95% 40% / 45% 70% no-repeat; }
.hero > * { position: relative; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.3rem); line-height: 1.12; margin: 10px 0 14px; }
.hero em { font-style: normal; background: linear-gradient(90deg, var(--cyan), #4d8dff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-logo { width: min(100%, 360px); height: auto; justify-self: center; filter: drop-shadow(0 18px 40px rgba(37, 99, 255, .35)); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 46ch; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
.facts li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; }
.facts b { font-family: var(--display); font-size: 1.5rem; color: var(--amber); }
.facts span { color: var(--muted); font-size: .9rem; }
.price { font-family: var(--display); font-weight: 600; font-size: 1.45rem; color: var(--amber); font-variant-numeric: tabular-nums; }
.price small { font: 500 .85rem var(--font); color: var(--muted); margin-left: 2px; }
.price.big { font-size: 2rem; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 62px; position: relative; display: grid; gap: 4px; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 1.05rem var(--display); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.steps li > span { color: var(--muted); font-size: .93rem; }
.steps.v { grid-template-columns: 1fr; margin-top: 16px; }
.steps.v li { background: var(--surface-2); }

/* รูปเครื่อง */
.art { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.ph { display: grid; place-items: center; color: rgba(255, 255, 255, .85); background: linear-gradient(135deg, #0f1f52, #1b3fae 55%, #0c1530); }
.art.ph svg { width: 42%; }
.art.big { border-radius: var(--radius); margin-bottom: 18px; border: 1px solid var(--line); }
.machine-img { max-width: 360px; width: 100%; border-radius: 12px; display: block; margin-bottom: 12px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.info { margin: 12px 0; display: grid; gap: 0; }
.info > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.info dt { color: var(--muted); } .info dd { margin: 0; text-align: right; }
.rules { color: var(--muted); padding-left: 1.2em; }

/* ตัวจองเวลา */
.booker { position: sticky; top: 84px; }
.booker label { display: block; color: var(--muted); font-size: .85rem; margin: 16px 0 8px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.days button, .pkgs button, .slots button { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.days button { padding: 6px 4px; display: grid; line-height: 1.25; }
.days button small { color: var(--muted); font-size: .72rem; }
.days button b { font: 600 1.1rem var(--display); }
.days button.on, .pkgs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.days button.on small { color: rgba(255, 255, 255, .85); }
.pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; }
.pkgs button { padding: 8px 4px; display: grid; line-height: 1.3; }
.pkgs button small { font-size: .72rem; color: var(--ok); }
.pkgs button.on small { color: #fff; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; min-height: 120px; }
.slots button { padding: 9px 0; font-variant-numeric: tabular-nums; }
.slots button:hover:not(:disabled) { border-color: var(--accent); }
.slots button:disabled { cursor: not-allowed; }
.slots .s-past, .slots .s-closed { opacity: .28; }
.slots .s-busy { color: var(--bad); background: rgba(255, 107, 107, .08); border-color: rgba(255, 107, 107, .25); text-decoration: line-through; }
.slots .nofit { opacity: .5; }
.slots .in { background: rgba(79, 140, 255, .22); border-color: var(--accent); opacity: 1; text-decoration: none; }
.slots .sel { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: .78rem; color: var(--muted); margin-top: 10px; }
.legend .k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: var(--surface-2); border: 1px solid var(--line); }
.legend .k.busy { background: rgba(255, 107, 107, .3); border-color: transparent; }
.legend .k.sel { background: var(--accent); border-color: transparent; }
.summary { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.summary .line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: var(--text); }
.summary s { color: var(--muted); font-size: .9rem; margin-right: 8px; }

/* จ่ายเงิน / เข้าเล่น */
.qr { background: #fff; border-radius: 16px; padding: 10px; width: min(280px, 100%); margin: 18px auto 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.timer { font-variant-numeric: tabular-nums; color: var(--amber); }
.timer.xl { font: 700 2.6rem var(--display); display: block; line-height: 1.1; }
.timebox { text-align: center; padding: 16px; margin: 16px 0 4px; background: var(--surface-2); border-radius: 14px; }
.uploader .preview { display: block; max-width: 100%; max-height: 320px; margin: 14px auto 0; border-radius: 12px; }
.copy { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.copy code { background: var(--bg); border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; font-size: 1.05rem; overflow-wrap: anywhere; }
.pin { display: flex; gap: 8px; margin-top: 8px; }
.pin input { width: 7.5ch; text-align: center; font: 700 1.5rem ui-monospace, Consolas, monospace; letter-spacing: .25em; padding: 6px 4px 6px 12px; }
.pin-msg { margin: 8px 0 0; font-weight: 500; }
.pin-msg.ok { color: var(--ok); } .pin-msg.bad { color: var(--bad); }
.pin-big { font-size: 1.4rem; color: var(--amber); }

/* ฟอร์ม */
.form { display: grid; gap: 14px; margin-top: 14px; }
.form label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; }
.form label.check { display: flex; align-items: center; gap: 10px; color: var(--text); }
.form h3 { margin: 10px 0 0; }
.form.inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; }
details summary { cursor: pointer; }

/* หลังบ้าน */
.num { display: block; font: 700 1.9rem var(--display); font-variant-numeric: tabular-nums; }
.table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .82rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.acts { white-space: nowrap; text-align: right; }
td.acts form { display: inline-block; margin: 0 0 0 4px; }
.slip-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.slip-thumb { width: 84px; height: 112px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; background: var(--bg); }
.slip-row form { margin: 0; }
kbd { display: inline-block; font: 600 .82rem ui-monospace, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; color: var(--text); white-space: nowrap; }
.hash { font-size: .72rem; overflow-wrap: anywhere; }
.prose ul, .prose ol { padding-left: 1.3em; color: var(--muted); }
.prose li { margin-bottom: 6px; }

.only-mobile { display: none !important; }
#booker { scroll-margin-top: 120px; }

@media (max-width: 860px) {
  .only-mobile { display: flex !important; margin-bottom: 8px; }
  .hero { grid-template-columns: 1fr; padding-top: 16px; }
  .hero::before { width: 100%; height: 40%; opacity: .3; }
  .hero-logo { order: -1; width: min(72%, 280px); }
  .facts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .booker { position: static; }
  .wrap-sm { flex-wrap: wrap; }
  .who { display: none; }
  .bar { gap: 10px; }
  .main { order: 3; flex-basis: 100%; }
  .acct { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
