@import url("https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800&display=swap");
:root {
  --bg: #f5f5f4;
  --card: #ffffff;
  --ink: #18181b;
  --muted: #5b5b66;
  --line: #e4e4e7;
  --brand: #111111;
  --accent: #d92d20;
  --accent-ink: #ffffff;
  --ok: #067647;
  --warn-bg: #fffaeb;
  --warn-line: #fedf89;
  --warn-ink: #93370d;
  --err-bg: #fef3f2;
  --err-ink: #b42318;
  --info-bg: #eff8ff;
  --info-ink: #175cd3;
  --radius: 14px;
  --tap: 48px;
  font-family: "Kanit", "Noto Sans Thai", "Sukhumvit Set", "Leelawadee UI", "Thonburi", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.55; }
a { color: var(--info-ink); }
[hidden] { display: none !important; }

.topbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 10; }
.topbar .in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.logo { font-weight: 800; letter-spacing: .04em; color: #fff; text-decoration: none; font-size: 18px; }
.logo b { background: var(--accent); padding: 1px 6px; border-radius: 6px; margin-left: 2px; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a { color: #e4e4e7; text-decoration: none; font-size: 14px; padding: 6px 8px; border-radius: 8px; }
.topbar nav a.on, .topbar nav a:hover { background: #2a2a2e; color: #fff; }

main { max-width: 720px; margin: 0 auto; padding: 16px 16px 64px; }
h1 { font-size: 22px; line-height: 1.3; margin: 8px 0 4px; }
h2 { font-size: 18px; margin: 20px 0 8px; }
h3 { font-size: 16px; margin: 14px 0 6px; }
.sub { color: var(--muted); margin: 0 0 14px; }
.small { font-size: 14px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 10px 18px; border-radius: 12px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn.block { width: 100%; }
.btn.accent { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #e7e5e4; border-radius: 12px; padding: 4px; margin: 14px 0 8px; }
.tabs button { min-height: 44px; border: 0; background: transparent; font: inherit; font-weight: 600; border-radius: 9px; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

.seg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.seg label { flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; cursor: pointer; }
.seg input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--info-ink); }

.field { margin: 10px 0; }
.field > label, .lbl { display: block; font-weight: 600; margin-bottom: 4px; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=search], input[type=tel], input[type=url], input[type=email], input[type=date], input[type=password], input[type=number], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 12px; border: 1px solid #c8c8ce; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--err-ink); background: var(--err-bg); }
.field .err { color: var(--err-ink); font-size: 14px; margin-top: 4px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }

.alert { border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 15px; }
.alert.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.alert.err { background: var(--err-bg); border: 1px solid #fecdca; color: var(--err-ink); }
.alert.info { background: var(--info-bg); border: 1px solid #b2ddff; color: var(--info-ink); }
.alert.ok { background: #ecfdf3; border: 1px solid #abefc6; color: var(--ok); }

.queried { background: #18181b; color: #fff; border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.queried .k { color: #a1a1aa; font-size: 13px; }
.queried .v { font-size: 20px; font-weight: 700; letter-spacing: .03em; word-break: break-all; }

.result { border-left: 5px solid var(--accent); }
.result .type { font-weight: 700; font-size: 16px; }
.badge { display: inline-block; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: #f4f4f5; border: 1px solid var(--line); margin: 2px 4px 2px 0; }
.badge.red { background: var(--err-bg); color: var(--err-ink); border-color: #fecdca; }
.badge.green { background: #ecfdf3; color: var(--ok); border-color: #abefc6; }
.badge.amber { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; font-size: 15px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #eee; }

.steps { display: flex; gap: 6px; margin: 12px 0; }
.steps div { flex: 1; text-align: center; font-size: 13px; padding: 8px 4px; border-radius: 10px; background: #e7e5e4; color: var(--muted); }
.steps div.on { background: var(--ink); color: #fff; font-weight: 600; }
.steps div.done { background: #d6d3d1; color: var(--ink); }
.choice { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 8px 0; background: #fff; cursor: pointer; }
.choice input { margin-right: 8px; transform: scale(1.3); }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.att { display: grid; grid-template-columns: 88px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; background: #fff; }
.att img { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; }
.att .status { font-size: 13px; font-weight: 600; }
.att .status.failed { color: var(--err-ink); }
.att .status.done { color: var(--ok); }
.slotbtns { display: grid; gap: 8px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 16px 0 calc(8px + env(safe-area-inset-bottom)); display: flex; gap: 8px; z-index: 5; }
.sticky-actions .btn { flex: 1; }

footer.site { max-width: 720px; margin: 0 auto; padding: 16px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
footer.site a { margin-right: 12px; }

.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid #d4d4d8; border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* admin */
.admin main { max-width: 1100px; }
.admin .topbar .in { max-width: 1100px; }
table.list { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover { background: #fafafa; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.ident { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; background: #fff; }
.ident.approved { border-color: #abefc6; background: #f6fef9; }
.ident.revoked, .ident.rejected { opacity: .65; }
.redactor { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 50; display: flex; flex-direction: column; padding: 12px; gap: 8px; }
.redactor canvas { max-width: 100%; max-height: calc(100vh - 120px); margin: auto; touch-action: none; cursor: crosshair; background: #fff; }
.redactor .row { justify-content: center; }
.preview-box { border: 2px dashed #a1a1aa; border-radius: 14px; padding: 8px 12px; background: #fafafa; }
pre.audit { white-space: pre-wrap; font-size: 12px; background: #fafafa; border: 1px solid var(--line); border-radius: 10px; padding: 8px; max-height: 260px; overflow: auto; }

/* header: โลโก้ + ปุ่มบัญชีแถวบน, เมนูหลักแถวล่างบนจอแคบ (ไม่เลื่อนแนวนอน ไม่ถูกตัด) */
.logo { white-space: nowrap; }
.topbar nav .sm { display: none; }
.topbar .navlogin { order: 3; white-space: nowrap; flex: none; text-decoration: none; font-size: 14px; padding: 7px 14px; border-radius: 999px; }
.topbar nav { order: 2; }
@media (max-width: 640px) {
  .topbar .in { flex-wrap: wrap; row-gap: 2px; padding: 8px 12px 6px; }
  .topbar .navlogin { order: 2; margin-left: auto; padding: 6px 12px; font-size: 13.5px; }
  .topbar nav { order: 3; margin-left: 0; width: 100%; display: flex; justify-content: space-between; gap: 2px; }
  .topbar nav a { white-space: nowrap; font-size: 13.5px; padding: 8px 6px; min-height: 36px; display: inline-flex; align-items: center; }
  .topbar nav .lg { display: none; }
  .topbar nav .sm { display: inline; }
}
@media (max-width: 340px) {
  .topbar nav a { font-size: 12.5px; padding: 8px 3px; }
  .logo { font-size: 18px; }
}
.admin .topbar nav { flex-wrap: wrap; overflow: visible; }


/* ================= ธีม: ตัวหนาแบบ Kanit, ฮีโร่ไล่สี, แถบล่าสุด, การ์ดเกม ================= */
h1, h2, h3, .btn, .tabs button, .logo { font-weight: 700; letter-spacing: 0; }
.btn { border-radius: 999px; }
.btn.small { border-radius: 999px; }

.hero {
  margin: -16px -16px 0; padding: 22px 16px 20px; color: #fff;
  background: radial-gradient(120% 90% at 100% 100%, #e5484d 0%, transparent 55%), linear-gradient(160deg, #18181b 0%, #3b0d0f 70%, #7a1219 100%);
}
.hero .pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); font-weight: 600; font-size: 14px; }
.hero .pill i { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--accent); display: grid; place-items: center; font-style: normal; font-weight: 800; }
.hero h1 { font-size: clamp(30px, 8.5vw, 44px); line-height: 1.12; font-weight: 800; margin: 14px 0 8px; }
.hero h1 em { font-style: normal; color: #ffb4b4; }
.hero .sub { color: #e4e4e7; font-size: 16px; }
.hero .cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.hero .cta .btn { min-height: 52px; font-size: 17px; }
.hero .cta .btn.white { background: #fff; color: #7a1219; border-color: #fff; }
.hero .cta .btn.glass { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 10px 6px; text-align: center; }
.stats b { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; }
.stats span { font-size: 12px; color: #d4d4d8; }

.ticker { margin: 0 -16px 8px; background: #0b0b0c; color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 16px; overflow: hidden; text-decoration: none; min-height: 46px; }
.ticker .live { display: inline-flex; align-items: center; gap: 6px; color: #ff8a8a; font-weight: 700; flex: none; }
.ticker .live::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #ff4d4f; box-shadow: 0 0 0 0 rgba(255,77,79,.7); animation: pulse 1.6s infinite; }
.ticker .msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; animation: tickin .45s ease; }
.ticker .go { flex: none; font-size: 13px; color: #a1a1aa; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255,77,79,0); } 100% { box-shadow: 0 0 0 0 rgba(255,77,79,0); } }
@keyframes tickin { from { transform: translateY(60%); opacity: 0; } to { transform: none; opacity: 1; } }

.sechead { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.sechead h2 { margin: 0; font-size: 21px; }
.sechead::before { content: ""; width: 5px; height: 24px; border-radius: 4px; background: var(--accent); }
.sechead a { margin-left: auto; font-size: 15px; color: var(--accent); text-decoration: none; font-weight: 600; }

.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 10px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.latest { flex: 0 0 86%; max-width: 420px; scroll-snap-align: start; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: inherit; text-decoration: none; display: flex; flex-direction: column; box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.latest .top { position: relative; height: 92px; background: linear-gradient(135deg, #27272a, #7a1219); background-size: cover; background-position: center; }
.latest .top .tag { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.latest .top .gname { position: absolute; left: 12px; bottom: 8px; color: #fff; font-weight: 800; font-size: 20px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.latest .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.latest .t { font-weight: 700; font-size: 16px; line-height: 1.35; }
.latest .s { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.latest .meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; color: var(--muted); }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 2px; }
.dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: #d4d4d8; cursor: pointer; transition: width .2s; background-clip: content-box; box-sizing: content-box; padding: 10px 4px; }
.dots button.on { width: 22px; background: var(--accent); }

.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 620px) { .games { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gcard { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s; }
.gcard:active { transform: scale(.98); }
.gcard .cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #18181b, #b42318); background-size: cover; background-position: center; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 26px; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.gcard .cover.has { color: transparent; text-shadow: none; }
.gcard .info { padding: 10px 12px 12px; }
.gcard .info b { display: block; font-size: 17px; }
.gcard .info span { font-size: 14px; color: var(--muted); }

.ghero { margin: -16px -16px 0; position: relative; min-height: 190px; display: flex; align-items: flex-end; color: #fff; background: linear-gradient(135deg, #18181b, #b42318); background-size: cover; background-position: center; }
.ghero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 20%, rgba(0,0,0,.8)); }
.ghero .in { position: relative; z-index: 1; padding: 16px; width: 100%; }
.ghero h1 { margin: 0; font-size: 34px; font-weight: 800; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .ticker .msg, .ticker .live::before { animation: none; } }
.cta-row { margin: 14px 0 0; }
.covercell img { width: 140px; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 6px; }
td.click { cursor: pointer; }
.nw { white-space: nowrap; display: inline-block; }
.hero .cta { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.hero .cta .btn { font-size: 16px; padding: 8px 12px; line-height: 1.25; }
.gcard .cover { font-size: clamp(18px, 5vw, 24px); padding: 0 10px; text-align: center; line-height: 1.15; }

/* แบนเนอร์ผู้สนับสนุน SATTA (แถบเล็กด้านบน) */
.sponsor { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; padding: 5px 14px; text-decoration: none; color: #fff; background: linear-gradient(90deg, #053d1e, #08642e 60%, #0a7a37); font-size: 14px; }
.sponsor img { border-radius: 8px; flex: none; }
.sponsor b { letter-spacing: .06em; font-weight: 800; }
.sponsor span { color: #fff; opacity: .92; white-space: nowrap; }
@media (max-width: 380px) { .sponsor span { display: none; } }

/* ห้องสนทนาผ่านระบบ */
.thread { display: grid; gap: 8px; margin: 12px 0; }
.bubble { max-width: 85%; padding: 10px 12px; border-radius: 16px; background: #fff; border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { justify-self: end; background: var(--ink); color: #fff; border-color: var(--ink); border-bottom-right-radius: 4px; }
.bubble.other { justify-self: start; border-bottom-left-radius: 4px; }
.bubble.system { justify-self: center; background: #f4f4f5; color: var(--muted); font-size: 14px; text-align: center; }
.bubble .meta { display: block; font-size: 12px; opacity: .7; margin-top: 4px; }
.bubble .flag { background: none; border: 0; color: inherit; text-decoration: underline; font: inherit; font-size: 12px; cursor: pointer; padding: 0; margin-left: 8px; }
.threadlink { display: block; text-decoration: none; color: inherit; }
.withdraw-box { border-color: #fecdca; }

/* Facebook (ไม่บังคับ) */
.fbcard .fbic { width: 40px; height: 40px; border-radius: 12px; background: #1877f2; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 24px; flex: none; }
.fbcard.on { border-color: #b2ccff; background: #f5f9ff; }
.fbbtn { background: #1877f2; border-color: #1877f2; margin-top: 10px; }
.badge.fb { background: #e7f0ff; color: #1859c9; border-color: #b2ccff; }
a.card { display: block; text-decoration: none; color: inherit; }

.seg4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 520px) { .seg4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.small-alert { font-size: 14px; padding: 10px 12px; }

/* ไอคอนสายสืบ/โจร ในช่องค้นหา */
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ill { width: 100%; height: 100%; display: block; }
i[data-icon], .seg span i, .btn i { display: inline-flex; font-style: normal; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn i { margin-right: 6px; }
.sleuth { display: flex; align-items: center; gap: 12px; margin: -4px 0 14px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, #fafafa, #fdecec); border: 1px dashed #f3b4b0; }
.sleuth b { display: block; font-size: 17px; }
.sleuth span:not(.avatar) { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; }
.sleuth > div { flex: 1; }
.avatar { width: 52px; height: 52px; flex: none; border-radius: 50%; background: #fff; border: 2px solid #18181b; padding: 3px; overflow: hidden; }
.avatar.suspect { width: 40px; height: 40px; border-color: var(--accent); transform: rotate(8deg); animation: peek 3.2s ease-in-out infinite; }
@keyframes peek { 0%, 70%, 100% { transform: rotate(8deg) translateX(0); } 80% { transform: rotate(-6deg) translateX(-4px); } 90% { transform: rotate(10deg) translateX(2px); } }
.rhead { display: flex; align-items: center; gap: 10px; }
.mini { width: 36px; height: 36px; flex: none; border-radius: 50%; background: #fff; border: 2px solid var(--accent); padding: 2px; overflow: hidden; }
.found-head { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; }
.found-head h2 { margin: 0; }
.found-head .avatar { border-color: var(--accent); }
.sleuth-msg { display: flex; align-items: center; gap: 12px; }
.sleuth-msg .avatar { border-color: #b2ddff; }
@media (prefers-reduced-motion: reduce) { .avatar.suspect { animation: none; } }

/* สมาชิก / เข้าสู่ระบบ */
.gate .sleuth { margin-top: 0; }
.consent { background: #fffaf0; border: 1px solid var(--warn-line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.consent p { margin: 6px 0; }
.consent ul { margin: 4px 0 8px; padding-left: 20px; }
.logins { display: grid; gap: 8px; margin: 12px 0 6px; }
.pvbtn { justify-content: center; gap: 10px; }
.pv { display: inline-grid; place-items: center; border-radius: 6px; font-weight: 800; }
.pv.fb { width: 24px; height: 24px; background: #fff; color: #1877f2; font-size: 18px; }
.pv.line { padding: 1px 6px; background: #fff; color: #06c755; font-size: 11px; }
.linebtn { background: #06c755; border-color: #06c755; }
.navlogin { margin-left: 4px; background: var(--accent); color: #fff !important; }
.navlogin.on { box-shadow: 0 0 0 2px #fff inset; }

/* ช่องเลือกเกมแบบค้นหาได้ */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.gp { position: relative; }
input.gp-in { padding-left: 40px !important; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 18px; }
.gp-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: min(300px, 45vh); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #c8c8ce; border-radius: 12px; box-shadow: 0 12px 28px rgba(0,0,0,.14); }
.gp-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gp-list li small { color: var(--muted); font-size: 13px; }
.gp-list li.on, .gp-list li:hover { background: #f4f4f5; }
.gp-list li[aria-selected="true"] { font-weight: 700; }
.gp-list .gp-none { color: var(--muted); cursor: default; font-size: 14px; }
.games-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.games-tools input { flex: 1; }

/* ไอคอนเกม */
.gicon { display: inline-block; flex: none; border-radius: 10px; object-fit: cover; vertical-align: middle; }
.gicon.sm { width: 28px; height: 28px; border-radius: 8px; }
.gicon.md { width: 56px; height: 56px; border-radius: 14px; }
.gicon.lg { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.gp-name { display: inline-flex; align-items: center; gap: 10px; }
.gp-sel { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; display: flex; }
.gp.has-sel input.gp-in { background-image: none; padding-left: 46px !important; }
.gcard .cover:not(.has) { background: linear-gradient(135deg, #f4f4f5, #e4e4e7); }
.gcard .cover .gicon.md { width: 64px; height: 64px; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.gname-row { display: flex !important; align-items: center; gap: 8px; }
.gname-row .gicon { display: none; }
.ghead { display: flex; align-items: center; gap: 14px; }
.qgame { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
input[type=search]::-webkit-search-decoration { -webkit-appearance: none; }
.iconcell { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 84px; }
.iconcell .btn { white-space: nowrap; }
.opt { font-weight: 400; color: var(--muted, #71717a); font-size: .9em; }
.uname { display: inline-flex; align-items: center; gap: 6px; background: #f4f4f5; border-radius: 8px; padding: 2px 8px; font-size: 14px; }


/* ================= แก้จากการทดสอบบนมือถือ ================= */
/* หัวเว็บแบบ sticky ไม่บังหัวข้อเวลากดลิงก์ # หรือเลื่อนไปช่องที่ผิด, ปุ่มล่างไม่บังช่องกรอก */
html { scroll-padding-top: 110px; scroll-padding-bottom: 96px; -webkit-text-size-adjust: 100%; }
/* ข้อความยาว (ลิงก์ UID ชื่อ คำอธิบาย) ตัดบรรทัดได้ ไม่ดันหน้ากว้างเกินจอ */
main p, main li, main dd, main td, .card, .ident code, .uname, .caption, .bubble { overflow-wrap: anywhere; }
dl.kv { grid-template-columns: max-content minmax(0, 1fr); }
dl.kv dd { min-width: 0; }
/* ตารางหลังบ้านเลื่อนในกรอบของตัวเอง */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tablewrap table.list { min-width: 560px; }
/* หน้าเกม: ป้ายบนพื้นเข้มอ่านออก */
.ghero .small { color: #f4f4f5; opacity: .9; }
/* ปุ่มเล็ก/ชิปกดง่ายบนมือถือ */
.chips button { min-height: 44px; }
@media (max-width: 640px) { .btn.small { min-height: 40px; } }
/* ตัวหนังสือใหญ่ 200%: ไม่ห้ามตัดบรรทัด */
@media (max-width: 420px) { .hero .nw { white-space: normal; } }
.sponsor span { white-space: normal; }
/* รายการวิธีเข้าสู่ระบบในหน้าบัญชี */
.idrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; }
/* คำขั้นตอนในฟอร์มแจ้งเคสไม่ตัดกลางคำ */
.steps div { word-break: keep-all; }
.opt-hint { color: var(--muted); font-weight: 400; }
/* จอแคบมาก: ซ่อนอวตารตัวที่สอง ให้หัวข้อสายสืบไม่ตัดกลางคำ */
@media (max-width: 360px) { .sleuth .avatar.suspect { display: none; } .sleuth b { word-break: keep-all; } }

/* ป๊อปอัปประกาศ */
.sitepop { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); animation: popfade .18s ease-out; }
.sitepop-card { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; background: #fff; border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.sitepop-img { display: block; width: 100%; max-height: 50vh; object-fit: cover; border-radius: 18px 18px 0 0; }
.sitepop-body { padding: 18px 18px 16px; }
.sitepop-body h2 { margin: 0 32px 8px 0; font-size: 20px; }
.sitepop-msg { margin: 0 0 14px; white-space: pre-line; overflow-wrap: anywhere; color: #3f3f46; }
.sitepop-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 12px; }
.sitepop-actions .btn { min-height: 44px; flex: 1; }
.sitepop-x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; z-index: 1; }
@keyframes popfade { from { opacity: 0 } to { opacity: 1 } }
.popprev { border: 1px dashed #c8c8ce; border-radius: 14px; padding: 12px; background: #f4f4f5; }
.popprev .sitepop-card { box-shadow: none; margin: 0 auto; }
.popprev .sitepop-img { max-height: 220px; }
