/*! © 2026 OIC GROUP INTERNATIONAL (THAILAND) CO., LTD. (Meana Mooljan). All rights reserved. */
:root {
  --paper: #f6f2f3;
  --stub: #ffffff;
  --brand: #bd003b;
  --on-brand: #ffffff;
  --ink: #22181c;
  --muted: #5d697b;
  --line: #e4d9dc;
  --amber: #e5a00d;
  --amber-ink: #5b3d00;
  --amber-soft: #fcf1d6;
  --go: #1d8556;
  --go-soft: #dcf1e6;
  --danger: #b4372f;
  --display: "Bai Jamjuree", "IBM Plex Sans Thai", system-ui, sans-serif;
  --body: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1215; --stub: #261a1f; --ink: #f3eaed; --muted: #b3a2a8; --line: #3d2b32; --brand: #ff4d7e; --on-brand: #1a1215;
    --amber-soft: #3a2d0c; --amber-ink: #ffd98a; --go-soft: #123a29; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1a1215; --stub: #261a1f; --ink: #f3eaed; --muted: #b3a2a8; --line: #3d2b32; --brand: #ff4d7e; --on-brand: #1a1215;
  --amber-soft: #3a2d0c; --amber-ink: #ffd98a; --go-soft: #123a29; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.6 var(--body);
  min-height: 100dvh;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 440px; margin: 0 auto; padding: 20px 16px 48px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.shop { display: flex; align-items: center; gap: 10px; font: 700 1.35rem/1 var(--display); letter-spacing: .04em; color: var(--brand); margin: 0; }
.shop img { height: 36px; width: auto; display: block; }
.top-r { display: flex; align-items: center; gap: 10px; }
.lang { font: 500 .85rem var(--body); color: var(--ink); background: var(--stub); border: 1.5px solid var(--line); border-radius: 8px; padding: 5px 6px; cursor: pointer; }
:root:lang(zh) { --body: "IBM Plex Sans Thai", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif; }
:root:lang(ja) { --body: "IBM Plex Sans Thai", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.on i { background: var(--go); box-shadow: 0 0 0 0 var(--go); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(29,133,86,.5); } 70% { box-shadow: 0 0 0 7px rgba(29,133,86,0); } 100% { box-shadow: 0 0 0 0 rgba(29,133,86,0); } }

.notice { background: var(--stub); border-left: 4px solid var(--amber); padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: .95rem; }

/* ---------- join ---------- */
.lead { color: var(--brand); font: 600 2rem/1.15 var(--display); margin: 8px 0 6px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 24px; }
.stats { display: flex; gap: 24px; margin-bottom: 28px; }
.stats div { display: flex; flex-direction: column; }
.stats b { color: var(--brand); font: 600 1.75rem/1 var(--display); font-variant-numeric: tabular-nums; }
.stats span { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.autoline { margin: -16px 0 24px; padding: 8px 12px; border-radius: 8px; background: var(--go-soft); font-size: .92rem; font-variant-numeric: tabular-nums; }
.autoline b, #tNext { color: var(--go); }
.autoline.paused { background: var(--amber-soft); color: var(--amber-ink); }

fieldset.party { border: 0; padding: 0; margin: 0; min-width: 0; }
.party legend { font-weight: 500; font-size: .95rem; padding: 0; margin-bottom: 6px; }
.party-pick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.party-pick button { padding: 10px 0; border: 1.5px solid var(--line); border-radius: 10px; background: var(--stub); font: 600 1.05rem var(--display); cursor: pointer; font-variant-numeric: tabular-nums; }
.party-pick button[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.fine a { color: inherit; margin-left: 4px; }

/* รหัสตรวจหน้าประตู — มีส่วนที่ขยับตลอด เพื่อให้พนักงานแยกจากภาพแคปหน้าจอได้ */
.verify { position: relative; overflow: hidden; margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--go-soft); display: grid; justify-items: center; gap: 2px; text-align: center; }
.verify-run { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); background-size: 250% 100%; animation: sweep 2.4s linear infinite; pointer-events: none; }
@keyframes sweep { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.verify-k { font-size: .85rem; color: var(--muted); position: relative; }
.verify-code { position: relative; font: 700 3.4rem/1 var(--display); letter-spacing: .12em; color: var(--go); font-variant-numeric: tabular-nums; }
.verify-clock { position: relative; font: 600 1.3rem var(--display); font-variant-numeric: tabular-nums; }
.verify-exp { margin-top: 12px !important; color: var(--danger) !important; font-weight: 500; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
input {
  width: 100%; padding: 14px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--stub); font-size: 1.05rem;
}
input:focus { border-color: var(--brand); outline: none; }
.field { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
.phone-row { display: flex; gap: 8px; }
.phone-row input { flex: 1; min-width: 0; font-weight: 400; }
.cc { flex: none; max-width: 42%; padding: 0 8px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--stub); color: var(--ink); font: 500 1rem var(--body); cursor: pointer; }
.cc:focus { border-color: var(--brand); outline: none; }
.btn {
  appearance: none; border: 0; border-radius: 10px; padding: 15px 18px; cursor: pointer;
  background: var(--brand); color: var(--on-brand); font-weight: 600; font-size: 1.05rem; width: 100%;
  transition: transform .08s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); font-weight: 500; }
.btn.danger { background: transparent; color: var(--muted); text-decoration: underline; border: 0; font-weight: 500; padding: 10px; }
.fine { font-size: .82rem; color: var(--muted); margin: 0; line-height: 1.55; }
.err { color: var(--danger); font-size: .92rem; margin: 0; min-height: 1.4em; }

/* ---------- ticket (the one bold element) ---------- */
.ticket {
  position: relative; background: var(--stub); border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(189,0,59,.35);
}
.band { height: 10px; background: var(--brand); transition: background .4s; }
.ticket.near .band { background: var(--amber); }
.ticket.turn .band { background: var(--go); }
.head { padding: 20px 22px 18px; }
.head small { color: var(--muted); font-size: .9rem; }
.no {
  font: 700 clamp(5.5rem, 30vw, 8.5rem)/.9 var(--display); letter-spacing: -.045em;
  font-variant-numeric: tabular-nums; margin: 6px 0 10px; color: var(--brand);
}
.who { color: var(--muted); font-size: .95rem; }
.perf { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 18px; }
.perf::before, .perf::after {
  content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper);
}
.perf::before { left: -31px; } .perf::after { right: -31px; }
.body { padding: 18px 22px 22px; }
.ahead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ahead b { color: var(--brand); font: 600 2.6rem/1 var(--display); font-variant-numeric: tabular-nums; }
.ahead span { color: var(--muted); }
.track { height: 8px; background: var(--paper); border-radius: 99px; margin: 14px 0 12px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--brand); border-radius: 99px; width: 0; transition: width .6s ease, background .4s; }
.ticket.near .track i { background: var(--amber); }
.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: .9rem; }
.meta dt { color: var(--muted); font-size: .8rem; }
.meta dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.alert { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-weight: 500; }
.alert.recall { animation: blink 1s ease-in-out infinite alternate; }
@keyframes blink { from { box-shadow: 0 0 0 0 var(--amber); } to { box-shadow: 0 0 0 4px var(--amber); } }
.turnbox { text-align: left; }
.turnbox h2 { font: 700 2rem/1.15 var(--display); margin: 2px 0 6px; color: var(--go); }
.turnbox p { margin: 0; color: var(--muted); }
.ticket.ended .no { color: var(--muted); }

.actions { display: grid; gap: 10px; margin-top: 18px; }
.notif { display: flex; gap: 12px; align-items: center; background: var(--stub); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.notif p { margin: 0; font-size: .9rem; flex: 1; }
.notif .btn { width: auto; padding: 10px 14px; font-size: .92rem; white-space: nowrap; }
.notif.ok { border-color: var(--go); }

.hist { margin-top: 36px; }
.hist h3 { font: 600 1rem/1.3 var(--display); margin: 0 0 8px; }
.hist ul { list-style: none; margin: 0; padding: 0; }
.hist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.hist li b { font-family: var(--display); font-variant-numeric: tabular-nums; }
.hist li span { color: var(--muted); text-align: right; }

.policy h2 { font: 600 1.05rem/1.3 var(--display); margin: 26px 0 6px; }
.policy p, .policy li { font-size: .95rem; }
.policy ul { padding-left: 20px; margin: 6px 0; }
.back { color: var(--muted); font-size: .9rem; }

.offline { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 99px; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.credit {
  max-width: 1100px; margin: 0 auto; padding: 8px 16px 28px;
  text-align: center; font-size: .72rem; line-height: 1.5; color: var(--muted); opacity: .75;
}
.field { position: relative; }
button.cc { min-width: 92px; text-align: left; white-space: nowrap; }
button.cc::after { content: '▾'; margin-left: 6px; color: var(--muted); }
.cc-panel { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 6px; padding: 8px; border: 1.5px solid var(--brand); border-radius: 12px; background: var(--stub); box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.cc-panel input { width: 100%; box-sizing: border-box; font-weight: 400; }
.cc-list { list-style: none; margin: 6px 0 0; padding: 0; max-height: min(320px, 50vh); overflow-y: auto; overscroll-behavior: contain; }
.cc-opt { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 8px; cursor: pointer; }
.cc-opt.on, .cc-opt:hover { background: var(--paper); }
.cc-opt[aria-selected="true"] .cc-name { font-weight: 600; color: var(--brand); }
.cc-flag { flex: none; font-size: 1.2rem; }
.cc-name { flex: 1; min-width: 0; }
.cc-code { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-sep { height: 1px; margin: 6px 0; background: var(--line); }
.cc-none { padding: 12px 8px; color: var(--muted); }
.choice { display: grid; gap: 10px; padding: 14px; border: 1.5px solid var(--brand); border-radius: 14px; background: var(--stub); }
.choice p { margin: 0; }
.choice-t { font-weight: 600; }
.choice-d { color: var(--muted); }
.back-prev { margin-bottom: 12px; }
.party .stepper { display: flex; align-items: center; gap: 8px; }
.party .stepper button { flex: none; width: 52px; height: 52px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--stub); color: var(--ink); font: 600 1.5rem/1 var(--display); cursor: pointer; }
.party .stepper button:disabled { opacity: .4; cursor: default; }
.party .stepper input { width: 84px; height: 52px; box-sizing: border-box; text-align: center; font: 700 1.4rem var(--display); font-variant-numeric: tabular-nums; }
.party .stepper-u { color: var(--muted); min-width: 2.5em; }
.join-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.join-btns[hidden] { display: none; }
.join-btns .btn { margin: 0; }
