/* WarZTH Verify — ระบบดีไซน์
   ใช้ภาษาเดียวกับเว็บ WARZ Limited Edition: พื้นดำ เส้นขอบทองแดง เน้นสีแดง
   ธีมเดียวคือธีมมืดโดยตั้งใจ ให้เข้าชุดกับเว็บหลักของทีม */

:root {
  --bg: #070808;
  --bg-2: #0d1010;
  --surface: rgba(14, 17, 17, .9);
  --surface-2: rgba(20, 23, 22, .88);
  --surface-3: rgba(28, 31, 30, .9);
  --line: rgba(179, 128, 91, .32);
  --line-strong: rgba(241, 78, 49, .68);

  --text: #f1ede4;
  --muted: #aaa49a;
  --dim: #716b63;

  --red: #e13422;
  --red-2: #8f1e17;
  --gold: #d3a85b;
  --green: #6cc46d;
  --amber: #e0a331;

  --radius: 8px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .55);

  --font-th: "Noto Sans Thai", system-ui, sans-serif;
  --font-display: "Chakra Petch", "Noto Sans Thai", system-ui, sans-serif;
  --font-mono: "Chakra Petch", ui-monospace, monospace;

  --header-h: 62px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

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

body {
  margin: 0;
  padding-top: var(--header-h);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-th);
  font-size: 16px;
  line-height: 1.65;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}

a { color: var(--gold); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 4px;
}

.shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- แถบหัวเว็บ ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(4, 5, 5, .96), rgba(4, 5, 5, .78));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand img { height: 30px; width: auto; display: block; }

.brand__text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  line-height: 1.1;
}

.brand__sub {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: .06em;
  line-height: 1.1;
}

/* ---------- แถบแท็บ ---------- */

.tabstrip {
  position: sticky;
  top: var(--header-h);
  z-index: 25;
  background: linear-gradient(180deg, rgba(4, 5, 5, .98), rgba(4, 5, 5, .92));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.tabstrip__inner {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabstrip__inner::-webkit-scrollbar { display: none; }

.tabbtn {
  flex: none;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.tabbtn:hover { color: var(--text); border-color: var(--line-strong); }

.tabbtn[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-2));
  border-color: var(--red);
  font-weight: 600;
}

/* ---------- หน้าในแท็บ ---------- */

.page { padding: 28px 0 52px; }
.page[hidden] { display: none; }

.page__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.page h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  margin: 6px 0 0;
}

.page h2 {
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  margin: 6px 0 0;
}

.page__lead {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0;
  max-width: 58ch;
  text-wrap: pretty;
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 10px 0 0;
}

/* ---------- ฟอร์มค้นหา ---------- */

.search-card { max-width: 560px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field__label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font-family: var(--font-th);
  font-size: 16px;
  color: var(--text);
  background: rgba(7, 8, 8, .8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.input::placeholder { color: var(--dim); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(225, 52, 34, .16);
}

.input--uid {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}

.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }

/* ช่องค้นหาไม่ใช่ช่องกรอกหลัก จึงเตี้ยกว่าและไม่ลากยาวเต็มความกว้างจอ */
.input--search {
  min-height: 46px;
  font-size: 15px;
  max-width: 420px;
}

/* ช่องค้นหากับชิปกรองอยู่แถวเดียวกัน ตกลงมาเรียงกันเองเมื่อจอแคบ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  max-width: 860px;
}

.toolbar .input--search { flex: 1 1 260px; }

.hint { font-size: 13px; color: var(--dim); margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}

.btn:hover:not(:disabled) { border-color: var(--line-strong); background: rgba(225, 52, 34, .1); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary {
  background: linear-gradient(180deg, var(--red), var(--red-2));
  border-color: var(--red);
  color: #fff;
}

.btn--primary:hover:not(:disabled) { background: linear-gradient(180deg, #f04a37, #a02219); border-color: #f04a37; }

.btn--block { width: 100%; }
.btn--sm { min-height: 38px; font-size: 13px; padding: 0 14px; }

.crosshair {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
  flex: none;
}

.crosshair::before,
.crosshair::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.crosshair::before { left: 50%; top: -5px; bottom: -5px; width: 2px; transform: translateX(-50%); }
.crosshair::after { top: 50%; left: -5px; right: -5px; height: 2px; transform: translateY(-50%); }

/* ---------- ป้ายสถานะ ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}

.pill--ok { color: var(--green); background: rgba(108, 196, 109, .12); border-color: rgba(108, 196, 109, .4); }
.pill--wait { color: var(--amber); background: rgba(224, 163, 49, .12); border-color: rgba(224, 163, 49, .4); }
.pill--bad { color: var(--red); background: rgba(225, 52, 34, .14); border-color: rgba(225, 52, 34, .45); }
.pill--none { color: var(--muted); background: rgba(255, 255, 255, .05); border-color: var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  padding: 8px 15px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }

.chip[aria-pressed="true"] {
  color: #fff;
  background: rgba(225, 52, 34, .2);
  border-color: var(--red);
}

.chip--uid { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: .06em; }

/* ---------- แบนเนอร์ประกาศ ---------- */

.banner {
  padding: 12px 15px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  background: rgba(211, 168, 91, .08);
  color: var(--text);
}

.banner--warn { border-left-color: var(--amber); background: rgba(224, 163, 49, .1); }

.banner--demo {
  border-left-color: var(--red);
  background: rgba(225, 52, 34, .1);
  font-family: var(--font-display);
  font-weight: 500;
}

/* ---------- การ์ดผลลัพธ์ ---------- */

.result {
  max-width: 560px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), rgba(7, 8, 8, .95));
  box-shadow: var(--shadow);
  animation: rise .22s ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.result__head {
  padding: 18px 16px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--dim);
}

.result__icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #0a0b0b;
}

.result__title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.result__msg { font-size: 14px; color: var(--muted); margin-top: 2px; }

.result--verified .result__head { border-left-color: var(--green); background: rgba(108, 196, 109, .07); }
.result--verified .result__icon { background: var(--green); }
.result--verified .result__title { color: var(--green); }

.result--pending .result__head { border-left-color: var(--amber); background: rgba(224, 163, 49, .07); }
.result--pending .result__icon { background: var(--amber); }
.result--pending .result__title { color: var(--amber); }

.result--rejected .result__head { border-left-color: var(--red); background: rgba(225, 52, 34, .08); }
.result--rejected .result__icon { background: var(--red); color: #fff; }
.result--rejected .result__title { color: var(--red); }

.result--notfound .result__head { border-left-color: var(--dim); background: rgba(255, 255, 255, .03); }
.result--notfound .result__icon { background: transparent; border: 2px solid var(--dim); color: var(--muted); }

.result__body { padding: 4px 16px 14px; }
.result__foot { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }

.datarow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(179, 128, 91, .16);
  font-size: 14px;
}

.datarow:last-child { border-bottom: 0; }
.datarow__key { color: var(--dim); flex: none; }
.datarow__val { text-align: right; word-break: break-word; }

.datarow__val--mono {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}

.copy-btn {
  font: inherit;
  color: var(--text);
  background: none;
  border: 0;
  padding: 2px 4px;
  margin: -2px -4px;
  cursor: pointer;
  border-bottom: 1px dashed var(--line);
}

.copy-btn:hover { border-bottom-color: var(--red); }

/* ---------- รายชื่อผู้ยืนยัน ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 620px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ปุ่มท้ายการ์ดกว้างเท่ากันทุกใบ ขอบขวาจึงเรียงตรงกันทั้งตาราง */
.item__action {
  flex: none;
  width: 84px;
  display: flex;
  justify-content: flex-end;
}

.item__action > * { width: 100%; }

.btn--ghost {
  color: var(--dim);
  border-style: dashed;
  cursor: default;
}

.btn--ghost:hover { border-color: var(--line); background: rgba(255, 255, 255, .04); }

.item__avatar {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(225, 52, 34, .12);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
}

.item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item__body { flex: 1; min-width: 0; }
.item__name {
  font-weight: 600;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.item__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.item__note {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
  overflow-wrap: anywhere;
}

/* ---------- ตารางประกาศรายชื่อ ---------- */

.board-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  max-width: 860px;
  font-size: 13px;
  color: var(--dim);
}

.board-summary b {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.board-summary .n-wait b { color: var(--amber); }
.board-summary .n-ok b { color: var(--green); }

/* ตารางกว้างกว่าจอมือถือ จึงให้เลื่อนในกรอบของตัวเอง หน้าเว็บไม่เลื่อนตาม
   บนจอกว้างจำกัดความกว้างไว้ ไม่ปล่อยให้ยืดเต็ม 1100px
   เพราะข้อมูลในแต่ละช่องสั้น ยืดแล้วช่องว่างระหว่างคอลัมน์จะไกลจนอ่านข้ามแถวไม่ทัน */
.table-wrap {
  overflow-x: auto;
  max-width: 860px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.board-table {
  width: 100%;
  min-width: 660px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 14px;
}

/* กำหนดสัดส่วนเป็นเปอร์เซ็นต์ ทุกคอลัมน์จึงขยายพร้อมกัน
   ไม่ใช่ปล่อยให้คอลัมน์เดียวกินที่ว่างที่เหลือทั้งหมดจนตารางดูโหว่ */
.col-uid { width: 19%; }
.col-ign { width: 17%; }
.col-status { width: 26%; }
.col-by { width: 22%; }
.col-date { width: 16%; }

.board-table th,
.board-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(179, 128, 91, .14);
  white-space: nowrap;
  vertical-align: middle;
}

/* หัวตารางลอยค้างไว้ตอนเลื่อนดูรายชื่อยาวๆ จะได้ไม่ลืมว่าคอลัมน์ไหนคืออะไร */
.board-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  background: #131717;
  border-bottom: 1px solid var(--line);
}

.board-table tbody tr:last-child td { border-bottom: 0; }

/* สลับสีแถวเว้นแถว ช่วยให้สายตาไล่ตามบรรทัดได้ไม่หลุด */
.board-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .022); }
.board-table tbody tr:hover td { background: rgba(225, 52, 34, .07); }

/* คอลัมน์ UID ตรึงไว้ซ้ายมือ เลื่อนดูคอลัมน์อื่นแล้วยังรู้ว่าบรรทัดไหน */
/* คอลัมน์ UID ตรึงไว้ซ้ายมือ เลื่อนดูคอลัมน์อื่นแล้วยังรู้ว่าบรรทัดไหน */
.board-table th:first-child,
.board-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 1px solid var(--line);
}

.board-table thead th:first-child { z-index: 3; }
.board-table tbody td:first-child { background: #0e1211; }
.board-table tbody tr:nth-child(even) td:first-child { background: #121615; }
.board-table tbody tr:hover td:first-child { background: #191d1c; }

.cell--uid {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .05em;
  font-variant-numeric: tabular-nums;
}

.cell--ign { color: var(--muted); font-family: var(--font-mono); letter-spacing: .03em; }
.cell--by { color: var(--text); white-space: normal; }
.cell--date { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ป้ายสถานะกับเวลาที่รออยู่บรรทัดเดียวกัน ทุกแถวจึงสูงเท่ากันหมด
   จอแคบค่อยตกลงมาเรียงกันเอง */
.cell--status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.cell__sub {
  font-size: 12px;
  color: var(--dim);
  white-space: nowrap;
}

/* ช่องที่ยังไม่มีข้อมูลให้จางลง สายตาจะได้ข้ามไปหาช่องที่มีค่าจริง */
.cell--empty { color: var(--line-strong); opacity: .5; }

/* แถบสีบอกสถานะที่ขอบซ้าย วาดด้วยเงาด้านในเพื่อไม่ให้ดันความกว้างของคอลัมน์ที่ตรึงไว้ */
.board-row--pending td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.board-row--verified td:first-child { box-shadow: inset 3px 0 0 var(--green); }

/* ---------- ขั้นตอน ---------- */

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }

.step {
  display: flex;
  gap: 13px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--red), var(--red-2));
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.step__title { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.step__text { font-size: 14px; color: var(--muted); }

/* ---------- ข้อความสำเร็จรูป ---------- */

.template {
  font-family: var(--font-th);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  background: rgba(7, 8, 8, .8);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 13px 15px;
  color: var(--muted);
  margin: 0;
  overflow-x: auto;
}

/* ---------- คำถามที่พบบ่อย ---------- */

details.faq {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2px 16px;
}

details.faq + details.faq { margin-top: 8px; }

.faq summary {
  cursor: pointer;
  padding: 13px 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--red); font-weight: 700; }
.faq[open] summary::after { content: "−"; }
.faq p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }

/* ---------- สถานะว่าง โหลด ผิดพลาด ---------- */

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px 16px;
  color: var(--dim);
  font-size: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.error {
  padding: 14px 15px;
  border-radius: var(--radius);
  background: rgba(225, 52, 34, .1);
  border: 1px solid rgba(225, 52, 34, .4);
  border-left: 3px solid var(--red);
  color: #f5b8b0;
  font-size: 14px;
}

.skeleton {
  height: 92px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 50%, var(--surface) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite;
}

@keyframes shimmer {
  to { background-position: -300% 0; }
}

.meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--dim);
}

/* ---------- ท้ายเว็บ ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  font-size: 13px;
  color: var(--dim);
  text-align: center;
  background: rgba(4, 5, 5, .6);
}

.site-foot p { margin: 6px 0; }

/* ---------- แจ้งเตือนสั้น ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(8px);
  z-index: 40;
  max-width: calc(100% - 32px);
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
