/* ธีม Novice: Sunset Isles กลางคืน ตัวหนังสือ pixel + Thai */

:root {
  --mono: "IBM Plex Mono", "IBM Plex Sans Thai", ui-monospace, monospace;
  --thai: "Chakra Petch", "IBM Plex Sans Thai", sans-serif;
  --pixel: "Press Start 2P", "Chakra Petch", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--mono);
  font-size: 15px;
  background: var(--dusk-1);
  color: var(--cream);
  line-height: 1.75;
  overflow-x: hidden;
}
img, svg { image-rendering: pixelated; }
a { color: var(--amber); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; position: relative; }

/* ---------- nav ---------- */
nav.site { background: var(--dusk-1, #24123f); border-bottom: 4px solid #3b1640; position: sticky; top: 0; z-index: 20; }
nav.site .wrap { display: flex; align-items: center; gap: 22px; height: 60px; overflow-x: auto; }
.logo {
  font-family: var(--pixel); font-size: 12px; white-space: nowrap; color: #ffe9b8; text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.logo-mark { width: 24px; height: 24px; flex: none; image-rendering: pixelated; }
.logo b { font-weight: 400; color: var(--amber); }
nav.site a.link { color: #e6c9b8; text-decoration: none; white-space: nowrap; font-size: 14px; font-family: var(--thai); }
nav.site a.link:hover { color: #ffb23f; }
nav.site .spacer { flex: 1; }
nav.site form { margin: 0; }

/* ---------- hero: Sunset Isles ---------- */
:root {
  --dusk-1: #24123f;
  --dusk-2: #3b1640;
  --dusk-3: #5a1e4a;
  --cream: #fff4e0;
  --gold: #ffe9b8;
  --amber: #ffb23f;
  --amber-dark: #d27a1f;
  --amber-light: #ffe08a;
  --peach: #ffb26b;
  --notch: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
}
header#hero {
  position: relative; overflow: hidden; background: var(--dusk-1);
  height: clamp(560px, calc(100vh - 60px), 820px); border-bottom: 4px solid var(--dusk-2);
}
#scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 62% 50%; image-rendering: pixelated;
}
.hero-ui { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; }
.hero-copy { max-width: 560px; color: var(--cream); }
.hero-title {
  font-family: var(--pixel); font-weight: 400; font-size: clamp(38px, 6.4vw, 88px); line-height: 1.1;
  color: var(--gold);
  text-shadow: 4px 0 var(--dusk-3), -4px 0 var(--dusk-3), 0 4px var(--dusk-3), 0 -4px var(--dusk-3),
               4px 4px var(--dusk-3), -4px -4px var(--dusk-3), 4px -4px var(--dusk-3), -4px 4px var(--dusk-3),
               10px 10px 0 #2b0f2e;
}
.hero-title small {
  display: block; font-size: .36em; margin-top: 18px; letter-spacing: 6px; color: var(--peach);
  text-shadow: 3px 3px 0 #2b0f2e;
}
.hero-lead {
  margin: 22px 0 26px; max-width: 470px; font-family: var(--thai); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.75;
  text-shadow: 2px 2px 0 var(--dusk-2);
}
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.pbtn {
  font-family: var(--thai); font-weight: 700; font-size: 16px; padding: 13px 24px; cursor: pointer;
  border: 0; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  clip-path: var(--notch); transition: transform .08s, filter .15s;
}
.pbtn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.pbtn:active { transform: translateY(1px); }
.pbtn:focus-visible { outline: 3px dashed var(--amber-light); outline-offset: 4px; }
.pbtn.amber { background: var(--amber); color: var(--dusk-2); box-shadow: inset -4px -4px 0 var(--amber-dark), inset 4px 4px 0 var(--amber-light); }
.pbtn.ghost { background: rgba(43, 15, 46, .78); color: var(--gold); box-shadow: inset 0 0 0 3px var(--peach); }
.hero-status { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; }
.hero-status > span { background: rgba(43, 15, 46, .78); color: var(--cream); padding: 5px 11px; clip-path: var(--notch); display: inline-flex; align-items: center; gap: 7px; }
.hero-status .ip { font-family: var(--mono); color: var(--gold); }
.dot { width: 8px; height: 8px; display: inline-block; background: #b9a7c4; }
.dot.on { background: #5dff8a; animation: blink 1.2s steps(2) infinite; }
.dot.off { background: #ff5a5a; }
@keyframes blink { 50% { opacity: .3; } }
.heads { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 14px; min-height: 24px; }
.heads img { width: 24px; height: 24px; outline: 2px solid var(--dusk-2); }
.heads .more { font-size: 12px; align-self: center; margin-left: 4px; color: var(--cream); }

/* ---------- พื้นฐานหน้า (ธีมกลางคืนทั้งเว็บ) ---------- */
section { padding: 72px 0; }
code { font-family: var(--mono); font-size: 13px; font-weight: 600; background: #1a0820; color: var(--gold); padding: 1px 6px; word-break: break-all; }
.note { margin-top: 28px; color: #c8a8b8; font-size: 13px; font-family: var(--thai); }

footer { padding: 28px 0 40px; font-size: 13px; color: #c8a8b8; background: #1a0820; border-top: 4px solid var(--dusk-2); font-family: var(--thai); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
footer .foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
footer .foot-links a { color: #e6c9b8; text-decoration: none; }
footer .foot-links a:hover { color: var(--amber); }

/* ---------- กฎ: ป้ายไม้ ---------- */
.signs { list-style: none; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.sign {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px 18px 18px 16px; color: #3b1f14;
  background:
    repeating-linear-gradient(0deg, transparent 0 11px, rgba(107, 68, 38, .16) 11px 12px),
    #d9a066;
  clip-path: var(--notch); box-shadow: inset 0 0 0 4px #8b5a33, inset -4px -4px 0 4px #6b4426;
}
.sign-icon {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-size: 28px;
  background: #fff4e0; box-shadow: inset 0 0 0 3px #8b5a33; clip-path: var(--notch);
}
.sign h3 { font-family: var(--thai); font-size: 18px; font-weight: 700; line-height: 1.3; display: flex; gap: 10px; align-items: baseline; }
.sign-num { font-family: var(--pixel); font-size: 11px; color: #8b3a2a; }
.sign p { font-family: var(--thai); font-size: 15px; color: #4a2a18; margin-top: 4px; line-height: 1.6; }

/* ---------- อันดับ: โพเดียม + scoreboard ---------- */
.board { display: grid; gap: 28px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: end; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.pod { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pod-who { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 12px; min-width: 0; max-width: 100%; text-align: center; }
.pod-who img, .pod-empty { width: 64px; height: 64px; outline: 4px solid #1a0820; }
.pod-1 .pod-who img, .pod-1 .pod-empty { width: 80px; height: 80px; }
.pod-empty { display: grid; place-items: center; background: #3b1640; color: #c8a8b8; font-family: var(--pixel); font-size: 22px; }
.pod-who b, .pod-who .pod-name { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--cream); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-who .pod-name, a.sb-name { text-decoration: none; color: inherit; }
.pod-who .pod-name:hover, a.sb-name:hover { color: var(--amber); text-decoration: underline; }
.pod-who > span:last-child { font-family: var(--pixel); font-size: 10px; color: var(--amber); }
.crown { font-size: 34px; margin-bottom: -2px; }
.pod-block {
  width: 100%; display: grid; place-items: start center; padding-top: 14px;
  font-family: var(--pixel); font-size: 22px; color: rgba(0, 0, 0, .45);
  box-shadow: inset 4px 4px 0 rgba(255, 255, 255, .35), inset -4px -4px 0 rgba(0, 0, 0, .25);
}
.pod-block span { text-shadow: 2px 2px 0 rgba(255, 255, 255, .3); }
.pod-1 .pod-block { height: 170px; background: #ffd84a repeating-linear-gradient(90deg, transparent 0 16px, rgba(201, 154, 28, .35) 16px 20px); }
.pod-2 .pod-block { height: 120px; background: #d8dde4 repeating-linear-gradient(90deg, transparent 0 16px, rgba(140, 150, 165, .35) 16px 20px); }
.pod-3 .pod-block { height: 86px; background: #e07a4a repeating-linear-gradient(90deg, transparent 0 16px, rgba(160, 80, 40, .35) 16px 20px); }

.scoreboard { background: rgba(0, 0, 0, .55); padding: 6px 0 0; font-family: var(--mono); }
.sb-title { text-align: center; font-family: var(--pixel); font-size: 11px; color: #ffff55; padding: 10px 12px 12px; text-shadow: 2px 2px 0 #3f3f3f; }
.sb-row { display: grid; grid-template-columns: 28px 20px minmax(0, 1fr) auto 56px; gap: 10px; align-items: center; padding: 7px 14px; color: #fff; font-size: 14px; }
.sb-row:nth-child(even) { background: rgba(255, 255, 255, .04); }
.sb-row img { width: 20px; height: 20px; }
.sb-rank { font-family: var(--pixel); font-size: 10px; color: #aaaaaa; }
.sb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-money { color: #aaaaaa; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sb-lv { color: #ff5555; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-empty { padding: 28px 16px; text-align: center; font-family: var(--thai); color: #e6c9b8; }
.sb-foot { display: flex; justify-content: space-between; padding: 8px 14px; margin-top: 4px; background: rgba(0, 0, 0, .35); font-family: var(--thai); font-size: 12px; color: #aaaaaa; }

/* ---------- Donate: tooltip ไอเทม ---------- */
.promise { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.promise li {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; clip-path: var(--notch);
  background: #3b1640; color: var(--cream); font-family: var(--thai); font-weight: 600; font-size: 14px;
}
.promise .px-icon { font-size: 18px; }
.shop { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.item {
  display: flex; flex-direction: column; padding: 20px; background: #100010; clip-path: var(--notch);
  box-shadow: inset 0 0 0 2px #100010, inset 0 0 0 4px #2d0a63, inset 0 0 0 5px #5000ff;
  transition: transform .12s;
}
.item:hover { transform: translateY(-4px); }
.item-slot {
  width: 72px; height: 72px; display: grid; place-items: center; font-size: 40px; margin-bottom: 16px;
  background: #8b8b8b; box-shadow: inset 3px 3px 0 #373737, inset -3px -3px 0 #ffffff;
}
.item-name { font-family: var(--thai); font-size: 20px; font-weight: 700; color: #ffaa00; }
.item-lore { list-style: none; margin: 6px 0 18px; flex: 1; }
.item-lore li { font-family: var(--thai); color: #aaaaaa; font-size: 15px; padding-left: 16px; position: relative; }
.item-lore li::before { content: "+"; position: absolute; left: 0; color: #5555ff; font-weight: 700; }
.item-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 2px dashed #2d0a63; }
.item-price { display: inline-flex; align-items: center; gap: 8px; font-family: var(--pixel); font-size: 15px; color: #55ff55; }
.item-price small { font-family: var(--thai); font-size: 13px; color: #aaaaaa; }
.item-price .px-icon { font-size: 20px; }
.soon { font-family: var(--thai); font-size: 12px; font-weight: 700; color: var(--dusk-2); background: #ffb26b; padding: 3px 10px; clip-path: var(--notch); white-space: nowrap; }
.shop-empty { font-family: var(--thai); color: #e6c9b8; padding: 30px 0; }

@media (max-width: 820px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .pod-who img, .pod-empty { width: 52px; height: 52px; }
  .pod-1 .pod-who img, .pod-1 .pod-empty { width: 64px; height: 64px; }
  .pod-1 .pod-block { height: 130px; } .pod-2 .pod-block { height: 92px; } .pod-3 .pod-block { height: 66px; }
  .sb-money { display: none; }
  .sb-row { grid-template-columns: 28px 20px minmax(0, 1fr) 56px; }
}

/* ---------- ฟอร์ม / บัญชี ---------- */
.page { min-height: calc(100vh - 60px - 92px); padding: 64px 0 80px; }
.narrow { max-width: 460px; margin: 0 auto; }
.form-win { padding: 6px 6px 24px; }
.form-win .win-bar { margin-bottom: 20px; }
.form-body { padding: 0 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--thai); font-weight: 600; font-size: 14px; color: #e6c9b8; margin-bottom: 6px; }
.field input[type=email], .field input[type=password], .field input[type=text] {
  width: 100%; font: inherit; font-size: 16px; background: #1a0820; color: var(--cream);
  border: 0; box-shadow: inset 0 0 0 2px #5a1e4a; padding: 11px 12px;
}
.field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--amber); }
.check { display: flex; gap: 8px; align-items: center; color: #e6c9b8; font-family: var(--thai); }
.check input { accent-color: var(--amber); width: 16px; height: 16px; }
.err { color: #ff8a7a; font-size: 13px; margin-top: 4px; font-family: var(--thai); }
.pbtn.block { display: flex; width: 100%; justify-content: center; }
.pbtn.cream { background: var(--cream); color: var(--dusk-2); box-shadow: inset -4px -4px 0 #d9b878; }
.pbtn.cream img { width: 18px; height: 18px; image-rendering: auto; }
.pbtn.small { font-size: 14px; padding: 8px 16px; }
.or { display: flex; align-items: center; gap: 12px; color: #c8a8b8; margin: 18px 0; font-size: 13px; font-family: var(--thai); }
.or::before, .or::after { content: ""; flex: 1; border-top: 2px dashed #5a1e4a; }
.alt { text-align: center; margin-top: 18px; color: #c8a8b8; font-family: var(--thai); }
.alt a { color: var(--amber); font-weight: 700; }
.flash { font-family: var(--thai); color: var(--cream); padding: 12px 16px 12px 22px; margin-bottom: 20px; background: #1a0820; box-shadow: inset 6px 0 0 #5dff8a; clip-path: var(--notch); }
.flash.error { box-shadow: inset 6px 0 0 #ff5a5a; }

/* หน้าบัญชี: แถบบัญชี + ช่องตัวละคร 3 ช่อง */
.acc-bar { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; padding: 18px 22px; }
.acc-who { display: flex; gap: 14px; align-items: center; flex: 1 1 280px; min-width: 0; }
.acc-icon { flex: none; width: 48px; height: 48px; display: grid; place-items: center; font-size: 28px; background: #1a0820; clip-path: var(--notch); }
.acc-text { min-width: 0; }
.acc-email { font-family: var(--mono); font-weight: 600; color: var(--gold); overflow-wrap: anywhere; line-height: 1.4; }
.acc-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { font-family: var(--thai); font-size: 12px; font-weight: 700; padding: 2px 9px; background: #3b1640; color: #e6c9b8; clip-path: var(--notch); }
.chip.ok { background: #1f4a2a; color: #9dffb5; }
.chip.warn { background: #5a1e1e; color: #ffb0a0; }
.acc-stats { display: flex; gap: 10px; }
.acc-stat { display: flex; gap: 10px; align-items: center; padding: 8px 14px; background: #1a0820; clip-path: var(--notch); }
.acc-stat .px-icon { font-size: 24px; }
.acc-stat b { display: block; font-family: var(--pixel); font-size: 13px; color: var(--cream); line-height: 1.4; }
.acc-stat small { font-family: var(--thai); font-size: 12px; color: #c8a8b8; }

.verify-box {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding: 14px 18px;
  background: #5a1e1e; clip-path: var(--notch); font-family: var(--thai); color: var(--cream);
}
.verify-box > .px-icon { font-size: 28px; flex: none; }
.verify-box p { flex: 1 1 240px; }

.chars-head { margin: 44px 0 24px; }
.chars-head .sec-title { margin-top: 0; }

.char-slots { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.char-card {
  display: flex; flex-direction: column; gap: 16px; padding: 20px; min-width: 0;
  background: #2b0f2e; clip-path: var(--notch); box-shadow: inset 0 0 0 3px #ffb26b, inset 0 0 0 6px #5a1e4a;
}
.char-top { display: flex; gap: 14px; align-items: center; min-width: 0; }
.char-head { width: 72px; height: 72px; flex: none; outline: 4px solid #1a0820; }
.char-id { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.char-slot-no { font-family: var(--pixel); font-size: 9px; color: var(--amber); }
.char-name { font-family: var(--pixel); font-weight: 400; font-size: 14px; line-height: 1.6; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-edition { font-family: var(--thai); font-size: 13px; color: #c8a8b8; }
.char-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.char-stats > div { background: #1a0820; padding: 8px 10px; clip-path: var(--notch); min-width: 0; }
.char-stats dt { display: flex; gap: 6px; align-items: center; font-family: var(--thai); font-size: 12px; color: #c8a8b8; }
.char-stats dt .px-icon { font-size: 14px; }
.char-stats dd { font-family: var(--pixel); font-size: 12px; color: var(--cream); margin-top: 4px; overflow-wrap: anywhere; }
.char-stats dd.small { font-family: var(--thai); font-size: 13px; font-weight: 600; }
.char-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 2px dashed #5a1e4a; font-family: var(--thai); font-size: 13px; color: #c8a8b8; }

.empty-slot {
  align-items: center; justify-content: center; text-align: center; min-height: 300px;
  background: rgba(26, 8, 32, .6); box-shadow: inset 0 0 0 3px #5a1e4a;
  background-image: repeating-linear-gradient(45deg, transparent 0 10px, rgba(255, 178, 107, .04) 10px 20px);
}
.empty-slot.has-code { box-shadow: inset 0 0 0 3px var(--amber); justify-content: flex-start; }
.empty-slot.locked { opacity: .55; }
.slot-text { font-family: var(--thai); color: #e6c9b8; font-size: 15px; }
.slot-text.small { font-size: 13px; color: #c8a8b8; }
.add-form { display: contents; }
.add-btn {
  display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer; border: 0; background: none;
  font-family: var(--thai); font-weight: 700; font-size: 17px; color: var(--gold);
}
.add-plus {
  width: 72px; height: 72px; display: grid; place-items: center; font-family: var(--pixel); font-size: 30px; color: var(--dusk-2);
  background: var(--amber); clip-path: var(--notch); box-shadow: inset -4px -4px 0 var(--amber-dark), inset 4px 4px 0 var(--amber-light);
  transition: transform .08s;
}
.empty-slot:not(.has-code) .add-plus { margin: 0 auto; }
.add-btn:hover .add-plus { transform: translateY(-3px); }
.add-btn:focus-visible { outline: 3px dashed var(--amber-light); outline-offset: 6px; }
.code-box {
  width: 100%; font-family: var(--pixel); font-size: clamp(16px, 2vw, 22px); letter-spacing: 2px; color: #3b1f14;
  text-align: center; padding: 16px 10px; background: #ffe9b8; box-shadow: inset 0 0 0 3px #8b5a33; clip-path: var(--notch);
}

@media (max-width: 960px) {
  .char-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .char-slots { grid-template-columns: minmax(0, 1fr); }
  .empty-slot { min-height: 200px; }
  .empty-slot.locked { min-height: 0; padding: 14px; flex-direction: row; gap: 12px; }
  .acc-bar { padding: 16px; }
  .acc-stats { width: 100%; }
  .acc-stat { flex: 1; }
  .code-box { font-size: 20px; }
}


/* ---------- section โทนยามเย็น (ใช้ร่วมทุก section ที่ทำใหม่) ---------- */
section.dusk {
  position: relative; border-bottom: 0; color: var(--cream);
  background:
    repeating-conic-gradient(rgba(255,255,255,.025) 0 25%, transparent 0 50%) 0 0 / 8px 8px,
    linear-gradient(180deg, #3b1640 0%, #2b0f2e 55%, #24123f 100%);
  padding: 88px 0 96px;
}
section.dusk.night {
  background:
    radial-gradient(2px 2px at 12% 18%, #fff4e0 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 9%, #ffe08a 50%, transparent 51%),
    radial-gradient(2px 2px at 43% 72%, #fff4e0 50%, transparent 51%),
    radial-gradient(2px 2px at 91% 64%, #ffb26b 50%, transparent 51%),
    radial-gradient(2px 2px at 26% 90%, #ffe08a 50%, transparent 51%),
    repeating-conic-gradient(rgba(255,255,255,.02) 0 25%, transparent 0 50%) 0 0 / 8px 8px,
    linear-gradient(180deg, #24123f 0%, #1a0d33 100%);
}
section.dusk + section.dusk { border-top: 4px solid #1a0820; }
.sec-head { margin-bottom: 40px; }
.kicker {
  display: inline-block; font-family: var(--pixel); font-size: 11px; color: var(--dusk-2);
  background: var(--amber); padding: 6px 10px; clip-path: var(--notch);
}
.sec-title {
  font-family: var(--thai); font-weight: 700; font-size: clamp(30px, 4.4vw, 48px); line-height: 1.2;
  margin: 16px 0 8px; color: var(--gold); text-shadow: 4px 4px 0 #1a0820;
}
.sec-sub { color: #e6c9b8; font-family: var(--thai); font-size: 17px; }
.px-icon { display: inline-block; width: 1em; height: 1em; vertical-align: -0.15em; }
.px-icon svg { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

.join-grid {
  display: grid; gap: 22px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas: "quest connect" "quest chat" "hotbar hotbar";
}

/* สมุดเควส: กระดาษครีมขอบไม้ */
.quest-log {
  grid-area: quest; color: #3b1f14; padding: 26px 26px 18px;
  background:
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(139, 90, 51, .12) 31px 32px),
    #fff4e0;
  clip-path: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px));
  box-shadow: inset 0 0 0 6px #8b5a33, inset 0 0 0 10px #c99a5b;
}
.quest-title { font-family: var(--thai); font-weight: 700; font-size: 20px; display: flex; gap: 10px; align-items: center; padding: 6px 4px 14px; border-bottom: 3px dashed #c99a5b; }
.quest-title .px-icon { font-size: 26px; }
.quest-steps { list-style: none; position: relative; margin-top: 8px; }
.quest-steps::before { content: ""; position: absolute; left: 27px; top: 30px; bottom: 40px; border-left: 4px dotted #c99a5b; }
.quest-steps li { display: flex; gap: 16px; padding: 16px 4px; position: relative; }
.q-icon {
  flex: none; width: 50px; height: 50px; display: grid; place-items: center; font-size: 30px; z-index: 1;
  background: #ffe9b8; box-shadow: inset 0 0 0 3px #8b5a33; clip-path: var(--notch);
}
.quest-steps li.done .q-icon { background: #c8f08a; box-shadow: inset 0 0 0 3px #3f8a26; }
.quest-steps h3 { font-family: var(--thai); font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-num { font-family: var(--pixel); font-size: 11px; color: #8b5a33; }
.q-check { font-size: 12px; font-weight: 700; background: #3f8a26; color: #fff; padding: 1px 8px; clip-path: var(--notch); }
.quest-steps p { font-family: var(--thai); color: #6a4a3a; font-size: 15px; margin-top: 2px; }
.q-link { display: inline-block; margin-top: 6px; font-family: var(--thai); font-weight: 700; font-size: 14px; color: #c0443a; text-decoration: none; }
.q-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* หน้าต่างเกม (เข้าเซิร์ฟ) */
.win {
  background: #2b0f2e; clip-path: var(--notch);
  box-shadow: inset 0 0 0 3px #ffb26b, inset 0 0 0 6px #5a1e4a;
}
.connect { grid-area: connect; padding: 6px 6px 20px; }
.win-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 14px;
  background: #5a1e4a; font-family: var(--thai); font-weight: 700; color: var(--gold);
}
.win-bar .px-icon { font-size: 20px; }
.tabs { display: flex; gap: 6px; padding: 0 18px; }
.tab {
  font: inherit; font-family: var(--thai); font-weight: 700; font-size: 14px; cursor: pointer;
  border: 0; padding: 9px 14px; color: #e6c9b8; background: #3b1640; clip-path: var(--notch);
}
.tab.on { background: var(--amber); color: var(--dusk-2); box-shadow: inset -3px -3px 0 var(--amber-dark); }
.tab-body { padding: 16px 18px 0; }
.addr { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.addr > span { width: 74px; color: #c8a8b8; font-size: 13px; font-family: var(--thai); }
.addr code { font-family: var(--pixel); font-size: 13px; color: var(--gold); background: #1a0820; padding: 9px 12px; }
.mini-copy {
  font: inherit; font-family: var(--thai); font-weight: 700; font-size: 13px; cursor: pointer; border: 0;
  background: #ffb26b; color: var(--dusk-2); padding: 8px 12px; clip-path: var(--notch);
}
.mini-copy:hover { filter: brightness(1.1); }
.steps-line { font-family: var(--thai); color: #e6c9b8; font-size: 14px; margin-top: 4px; }
.steps-line b { color: var(--amber); margin: 0 4px; }

/* แชท Minecraft */
.mc-chat {
  grid-area: chat; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 190px; padding: 14px; background: rgba(0, 0, 0, .55);
  background-image: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.55)), linear-gradient(135deg, #8a2d6a, #f2765a);
  clip-path: var(--notch); font-family: var(--pixel); font-size: 11px; line-height: 2;
}
.chat-lines { display: flex; flex-direction: column; gap: 2px; }
.chat-lines div { text-shadow: 2px 2px 0 #3f3f3f; color: #fff; animation: chat-in .25s ease-out; }
.chat-lines .sys { color: #ffd23f; }
.chat-lines .ok { color: #5dff8a; }
.chat-lines .th { font-family: var(--thai); font-size: 15px; font-weight: 600; }
@keyframes chat-in { from { opacity: 0; transform: translateY(6px); } }
.chat-input { margin-top: 10px; background: rgba(0, 0, 0, .55); padding: 6px 10px; color: #fff; min-height: 32px; }
.chat-input .caret { display: inline-block; width: 9px; height: 3px; background: #fff; margin-left: 2px; animation: blink 1s steps(2) infinite; }

/* hotbar */
.hotbar-wrap { grid-area: hotbar; display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 10px; }
.hotbar { display: flex; padding: 4px; background: #1a0820; box-shadow: 0 0 0 4px #3b1640, 0 8px 0 4px rgba(0,0,0,.35); max-width: 100%; overflow-x: auto; }
.slot {
  width: 64px; height: 64px; flex: none; display: grid; place-items: center; font-size: 38px; cursor: pointer;
  background: #8b8b8b; border: 0; padding: 0;
  box-shadow: inset 3px 3px 0 #373737, inset -3px -3px 0 #ffffff;
  margin: 2px; position: relative;
}
.slot.empty { cursor: default; }
.slot:not(.empty):hover { background: #a5a5a5; }
.slot.on::after { content: ""; position: absolute; inset: -6px; border: 4px solid #fff; box-shadow: 0 0 0 2px #1a0820; pointer-events: none; }
.slot:focus-visible { outline: 3px dashed var(--amber); outline-offset: 6px; }
.mc-tooltip {
  min-width: 300px; max-width: 520px; padding: 12px 16px; background: #100010;
  box-shadow: inset 0 0 0 2px #100010, inset 0 0 0 4px #2d0a63, inset 0 0 0 5px #5000ff;
  clip-path: var(--notch);
}
.tt-name { font-family: var(--thai); font-weight: 700; font-size: 17px; color: #55ffff; }
.tt-lore { font-family: var(--thai); color: #aaaaaa; font-size: 14px; margin: 2px 0 10px; }
.tt-cmd { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tt-cmd code { font-family: var(--pixel); font-size: 12px; color: #ffff55; background: none; padding: 0; }

@media (max-width: 820px) {
  .join-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "quest" "connect" "chat" "hotbar"; }
  .hotbar-wrap { min-width: 0; }
  .slot { width: 44px; height: 44px; font-size: 26px; }
  .slot.empty { display: none; }
  .mc-tooltip { min-width: 0; width: 100%; }
  .quest-log { padding: 22px 18px 12px; }
}

@media (max-width: 820px) {
  header#hero { height: auto; }
  #scene { top: auto; bottom: 0; height: 360px; object-position: 60% 100%; }
  .hero-ui { align-items: flex-start; padding-top: 36px; padding-bottom: 330px; }
  nav.site a.link { display: none; }
  nav.site .wrap { gap: 12px; }
  nav.site .nav-menu { display: block; }
}
@media (max-width: 520px) {
  nav.site .wrap a.link.keep { display: none; }
  nav.site .pbtn.small { white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; padding-inline: 12px; }
}

/* เมนูมือถือ (แฮมเบอร์เกอร์) */
nav.site .wrap { position: static; }           /* ให้แผงเมนูอิง nav ไม่โดน overflow ของ .wrap ตัด */
.nav-menu { display: none; flex: none; }
.nav-menu summary { list-style: none; cursor: pointer; padding: 8px; background: #3b1640; clip-path: var(--notch); }
.nav-menu summary::-webkit-details-marker { display: none; }
.burger { display: grid; gap: 4px; width: 20px; }
.burger i { display: block; height: 3px; background: var(--gold); }
.nav-menu[open] summary { background: var(--amber); }
.nav-menu[open] .burger i { background: var(--dusk-2); }
.nav-menu-panel {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30; display: grid; padding: 8px 16px 16px;
  background: var(--dusk-1); border-bottom: 4px solid #3b1640; box-shadow: 0 12px 0 rgba(26, 8, 32, .5);
}
.nav-menu-panel a, .nav-menu-panel button {
  display: block; width: 100%; padding: 12px 4px; text-align: left; font: 700 16px var(--thai); color: #e6c9b8;
  text-decoration: none; background: none; border: 0; border-bottom: 2px dashed #3b1640; cursor: pointer;
}
.nav-menu-panel a:hover, .nav-menu-panel button:hover { color: var(--amber); }
.nav-menu-panel hr { border: 0; height: 4px; background: #3b1640; margin: 6px 0; }
.nav-menu-panel form { margin: 0; }

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

/* กฎข้อสุดท้ายที่เหลือเดี่ยว ๆ ให้เต็มแถว */
@media (min-width: 680px) {
  .signs:not(.rules-list) .sign:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.char-stats dd small { font-family: var(--thai); font-size: 12px; font-weight: 600; color: #c8a8b8; }
.slot-wait { font-family: var(--thai); font-size: 13px; font-weight: 700; }
@media (max-width: 960px) {
  .empty-slot.locked { min-height: 0; padding: 16px; flex-direction: row; gap: 12px; }
}

/* กระเป๋าพอยต์ */
a.acc-stat { text-decoration: none; }
.acc-stat.coin { box-shadow: inset 0 0 0 2px #c99a1c; }
.acc-stat.coin b { color: #ffd84a; }
.wallet { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
.wallet-balance { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 24px; }
.wallet-coin { font-size: 56px; flex: none; }
.wallet-num { font-family: var(--pixel); font-size: clamp(22px, 3vw, 30px); color: #ffd84a; line-height: 1.3; text-shadow: 3px 3px 0 #1a0820; overflow-wrap: anywhere; }
.wallet-unit { font-family: var(--thai); color: #c8a8b8; font-size: 14px; }
.wallet-balance .soon, .wallet-topup { margin-left: auto; }
.wallet-log { background: rgba(0, 0, 0, .55); padding: 6px 0; }
.wl-title { font-family: var(--thai); font-weight: 700; color: var(--gold); padding: 8px 16px 10px; }
.wl-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 16px; font-family: var(--thai); font-size: 14px; }
.wl-row:nth-child(even) { background: rgba(255, 255, 255, .04); }
.wl-amount { font-family: var(--pixel); font-size: 11px; }
.wl-amount.plus { color: #55ff55; }
.wl-amount.minus { color: #ff5555; }
.wl-reason { color: var(--cream); overflow-wrap: anywhere; }
.wl-date { color: #aaaaaa; font-size: 12px; white-space: nowrap; }
.wl-empty { padding: 16px; font-family: var(--thai); color: #c8a8b8; }
@media (max-width: 820px) {
  .wallet { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .acc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .acc-stat { padding: 8px 10px; gap: 8px; }
  .acc-stat .px-icon { font-size: 20px; }
  .wl-row { grid-template-columns: 76px minmax(0, 1fr); }
  .wl-date { grid-column: 2; }
  .wallet-balance .soon { margin-left: 0; }
}

/* ---------- ตลาดกลาง + คลังไอเทม ---------- */
nav.site a.link.on { color: var(--amber); }
@media (max-width: 820px) { nav.site a.link.keep { display: inline; } }

.license { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; background: #1a0820; clip-path: var(--notch); box-shadow: inset 0 0 0 2px #5a1e4a; }
.license.on { box-shadow: inset 0 0 0 2px #3f8a26; }
.license > .px-icon { font-size: 28px; flex: none; }
.license-text { flex: 1 1 260px; font-family: var(--thai); }
.license-text b { display: block; color: var(--cream); }
.license-text small { color: #c8a8b8; font-size: 13px; }
.license form { margin-left: auto; }

.market-me { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; margin-bottom: 18px; }
.market-me .acc-stat { flex: none; }
.market-me .license { flex: 1 1 420px; }
.my-listings { background: rgba(0, 0, 0, .45); padding: 6px 0; margin-bottom: 26px; }
.ml-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 16px; font-family: var(--thai); }
.ml-row:nth-child(even) { background: rgba(255, 255, 255, .04); }
.ml-icon { font-size: 22px; }
.ml-name { color: var(--cream); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-name small { color: #aaaaaa; }
.ml-price { display: inline-flex; align-items: center; gap: 6px; font-family: var(--pixel); font-size: 12px; color: #ffd84a; }

.market-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.market-filter input, .market-filter select {
  font: inherit; font-family: var(--thai); font-size: 15px; color: var(--cream); background: #1a0820;
  border: 0; box-shadow: inset 0 0 0 2px #5a1e4a; padding: 9px 12px; min-width: 0;
}
.market-filter input { flex: 1 1 220px; }
.market-filter select { flex: 0 1 160px; }
.market-filter input:focus, .market-filter select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--amber); }

/* สีตามความหายาก (ตามสีชื่อไอเทมใน Minecraft) */
.item.rarity-common { --rar: #ffffff; --rar-b: #555555; }
.item.rarity-rare { --rar: #55ffff; --rar-b: #1a6a8a; }
.item.rarity-epic { --rar: #ff55ff; --rar-b: #6a1a8a; }
.item.rarity-legendary { --rar: #ffaa00; --rar-b: #8a5a00; }
.item[class*=rarity-] { box-shadow: inset 0 0 0 2px #100010, inset 0 0 0 4px var(--rar-b), inset 0 0 0 5px var(--rar); }
.item[class*=rarity-] .item-name { color: var(--rar); }
.rarity-tag { align-self: flex-start; font-family: var(--thai); font-size: 12px; font-weight: 700; color: var(--rar, #fff); }
.item-slot { position: relative; }
.item-slot .qty { position: absolute; right: 4px; bottom: 0; font-family: var(--pixel); font-size: 12px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.item-desc { font-family: var(--thai); color: #aaaaaa; font-size: 14px; margin: 8px 0 4px; line-height: 1.6; }
.seller { display: flex; align-items: center; gap: 8px; margin: 12px 0 14px; font-family: var(--thai); font-size: 13px; color: #c8a8b8; min-width: 0; }
.seller img { width: 20px; height: 20px; flex: none; }
.seller span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-grid .item-foot { margin-top: auto; }
.item-price { color: #ffd84a; }
.pager { display: flex; justify-content: center; gap: 18px; margin-top: 30px; font-family: var(--thai); color: #c8a8b8; }
.pager a { color: var(--amber); font-weight: 700; }
.shop-empty a, .sec-sub a { color: var(--amber); }

.inv-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); margin-top: 18px; }
.inv-card { gap: 0; }
.inv-top { display: flex; gap: 14px; align-items: center; min-width: 0; }
.inv-top .item-slot { margin: 0; width: 60px; height: 60px; font-size: 32px; flex: none; }
.inv-id { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.inv-id .item-name { font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.inv-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 6px; }
.inv-form label { display: flex; flex-direction: column; gap: 4px; font-family: var(--thai); font-size: 12px; color: #c8a8b8; }
.inv-form input { width: 110px; font: inherit; font-size: 15px; color: var(--cream); background: #1a0820; border: 0; box-shadow: inset 0 0 0 2px #5a1e4a; padding: 7px 10px; }
.inv-form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--amber); }
#inventory + .license { margin-bottom: 4px; }

@media (max-width: 620px) {
  .ml-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .ml-row form { grid-column: 2 / -1; justify-self: end; }
  .license form, .license form .pbtn { width: 100%; justify-content: center; }
  .market-filter select { flex: 1 1 40%; }
  .inv-form input { width: 100%; }
  .inv-form label { flex: 1 1 40%; }
}

/* ---------- ปุ่มแอ็กชันแบบบล็อก (ส่งเข้าเกม / ลงขาย / ซื้อ / ถอด) ---------- */
.act-btn {
  --bg: var(--amber); --fg: var(--dusk-2); --lo: var(--amber-dark); --hi: var(--amber-light);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  font: inherit; font-family: var(--thai); font-weight: 700; font-size: 15px; line-height: 1.2;
  padding: 10px 18px; min-height: 42px; border: 0; cursor: pointer; text-decoration: none;
  color: var(--fg); background: var(--bg); clip-path: var(--notch);
  box-shadow: inset -4px -4px 0 var(--lo), inset 4px 4px 0 var(--hi);
  transition: transform .08s, filter .15s;
}
.act-btn:hover { filter: brightness(1.08); transform: translateY(-2px); }
.act-btn:active { transform: translateY(1px); box-shadow: inset 4px 4px 0 var(--lo); }
.act-btn:focus-visible { outline: 3px dashed var(--amber-light); outline-offset: 3px; }
.act-btn:disabled { filter: grayscale(.6) brightness(.8); cursor: wait; transform: none; }
.act-btn.green { --bg: #3f9a2a; --fg: #fff; --lo: #2a6a1a; --hi: #7ed65a; }
.act-btn.danger { --bg: #c0443a; --fg: #fff4e0; --lo: #8e2c2a; --hi: #ff8a7a; }
.act-btn.danger-soft { --bg: #3b1630; --fg: #ff9a8a; --lo: #2a0f22; --hi: #5a2240; }
.act-btn.danger-soft:hover { --bg: #c0443a; --fg: #fff4e0; --lo: #8e2c2a; --hi: #ff8a7a; filter: none; }
.act-btn.ghost { --bg: #2b0f2e; --fg: var(--gold); --lo: #1a0820; --hi: #5a1e4a; }
.act-btn.small { font-size: 13px; padding: 7px 12px; min-height: 34px; }

/* แถวเปิด/ปิดฟอร์มในคลัง */
.inv-act { margin-top: 10px; border-top: 0; padding-top: 0; }
.inv-act summary {
  list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: #1a0820; color: var(--gold); clip-path: var(--notch); user-select: none;
}
.inv-act summary::-webkit-details-marker { display: none; }
.inv-act summary::after { content: "▸"; margin-left: auto; color: var(--amber); transition: transform .12s; }
.inv-act[open] summary::after { transform: rotate(90deg); }
.inv-act summary:hover { background: #2b0f2e; }
.inv-act summary .px-icon { font-size: 18px; }
.inv-act[open] summary { margin-bottom: 0; background: #2b0f2e; }
.inv-act[open] > :not(summary) { padding: 12px 12px 0; }
.inv-act[open] { background: rgba(43, 15, 46, .55); padding-bottom: 10px; }
.inv-form .act-btn { min-height: 40px; }
.inv-form input { min-height: 40px; }

/* ---------- กล่องยืนยัน ---------- */
.px-dialog {
  border: 0; padding: 6px 6px 20px; width: min(440px, calc(100vw - 32px)); margin: auto;
  color: var(--cream); background: #2b0f2e; clip-path: var(--notch);
  box-shadow: inset 0 0 0 3px #ffb26b, inset 0 0 0 6px #5a1e4a;
}
.px-dialog::backdrop { background: rgba(16, 4, 24, .78); backdrop-filter: blur(2px); }
.px-dialog[open] { animation: pop .14s steps(3); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.px-dialog .win-bar { margin-bottom: 0; }
.px-dialog p { font-family: var(--thai); font-size: 16px; line-height: 1.7; padding: 20px 18px 22px; }
.pc-btns { display: flex; gap: 10px; justify-content: flex-end; padding: 0 18px; flex-wrap: wrap; }
@media (max-width: 480px) {
  .pc-btns .act-btn { flex: 1 1 0; }
}

/* ---------- แบนเนอร์ฉาก pixel ของหน้าย่อย (ตลาด) ---------- */
header.page-hero {
  position: relative; overflow: hidden; background: var(--dusk-1);
  height: clamp(340px, 46vh, 460px); border-bottom: 4px solid var(--dusk-2);
}
header.page-hero #scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 62% 62%; image-rendering: pixelated;
}
/* ไล่เงาให้อ่านตัวหนังสือออก และกลืนลงไปกับ section ข้างล่าง */
header.page-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(36, 18, 63, .72) 0%, rgba(36, 18, 63, .35) 45%, transparent 70%),
    linear-gradient(180deg, transparent 55%, rgba(59, 22, 64, .9) 100%);
}
.page-hero-ui { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; color: var(--cream); }
.page-hero-title {
  font-family: var(--thai); font-weight: 700; font-size: clamp(40px, 6vw, 68px); line-height: 1.15; margin-top: 10px;
  color: var(--gold); text-shadow: 4px 4px 0 #1a0820, -2px -2px 0 var(--dusk-3);
}
.page-hero-lead { max-width: 460px; font-family: var(--thai); font-size: clamp(15px, 1.4vw, 18px); text-shadow: 2px 2px 0 var(--dusk-2); }
.page-hero-ui .hero-status { margin-top: 12px; }
.hero-status .px-icon { font-size: 16px; }
section.market-body { padding-top: 40px; }

@media (max-width: 620px) {
  header.page-hero { height: auto; }
  header.page-hero #scene { top: auto; bottom: 0; height: 250px; object-position: 60% 85%; }
  header.page-hero::after { background: linear-gradient(180deg, transparent 70%, rgba(59, 22, 64, .9) 100%); }
  .page-hero-ui { padding-top: 36px; padding-bottom: 210px; }
}
@media (min-width: 621px) and (max-width: 960px) {
  .page-hero-lead { max-width: 360px; }
  header.page-hero #scene { object-position: 70% 62%; }
}

/* ---------- แถบแยกร้าน: เซิร์ฟเวอร์ / ผู้เล่น ---------- */
.market-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.mtab {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; text-decoration: none; color: var(--cream);
  background: #1a0820; clip-path: var(--notch); box-shadow: inset 0 0 0 2px #3b1640; transition: transform .08s, background .15s;
}
.mtab:hover { background: #2b0f2e; transform: translateY(-2px); }
.mtab > .px-icon { font-size: 34px; flex: none; }
.mtab-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mtab-text b { font-family: var(--thai); font-size: 18px; line-height: 1.3; }
.mtab-text small { font-family: var(--thai); font-size: 13px; color: #c8a8b8; }
.mtab-count { font-family: var(--pixel); font-size: 12px; padding: 6px 10px; background: #3b1640; color: var(--cream); clip-path: var(--notch); }
.mtab.server.on { background: linear-gradient(180deg, #4a2a10, #2b150a); box-shadow: inset 0 0 0 3px #ffd84a, inset 0 0 0 6px #8a5a00; }
.mtab.server.on b { color: #ffd84a; }
.mtab.server.on .mtab-count { background: #ffd84a; color: #3b1f14; }
.mtab.players.on { background: linear-gradient(180deg, #1f3a1a, #10200c); box-shadow: inset 0 0 0 3px #7ed65a, inset 0 0 0 6px #2a6a1a; }
.mtab.players.on b { color: #9dffb5; }
.mtab.players.on .mtab-count { background: #7ed65a; color: #10200c; }

.market-hint { flex: 1 1 300px; align-self: center; font-family: var(--thai); color: #e6c9b8; font-size: 14px; padding: 12px 16px; background: #1a0820; clip-path: var(--notch); }

/* การ์ดของร้านเซิร์ฟ: ขอบทอง + ป้าย OFFICIAL */
.item.official { position: relative; background: linear-gradient(180deg, #24120a 0%, #100010 55%); }
.official-badge {
  position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--pixel); font-size: 9px; color: #3b1f14; background: #ffd84a; padding: 5px 8px; clip-path: var(--notch);
  box-shadow: inset -2px -2px 0 #c99a1c;
}
.official-badge .px-icon { font-size: 12px; }
.offer-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.offer-meta li { font-family: var(--thai); font-size: 12px; font-weight: 700; color: #ffe9b8; background: #3b2410; padding: 2px 9px; clip-path: var(--notch); }
.item.sold-out { filter: grayscale(.7) brightness(.75); }

@media (max-width: 620px) {
  .market-tabs { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mtab { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
  .mtab > .px-icon { font-size: 24px; }
  .mtab-text b { font-size: 15px; }
  .mtab-text small { display: none; }
  .mtab-count { position: absolute; right: 10px; top: 10px; }
  .mtab { position: relative; }
}

/* ลืมรหัสผ่าน */
.field-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.forgot { font-family: var(--thai); font-size: 14px; font-weight: 700; color: var(--amber); }
.form-lead { font-family: var(--thai); color: #e6c9b8; font-size: 15px; margin-bottom: 18px; line-height: 1.7; }
.err a { color: var(--amber); font-weight: 700; }
.field input[readonly] { opacity: .75; }

/* ---------- คลังไอเทมแบบหน้าต่างในเกม ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inv-window { padding: 6px 6px 20px; margin-top: 18px; }
.inv-window .win-bar { margin-bottom: 18px; }
.inv-count { margin-left: auto; font-size: 13px; color: #e6c9b8; font-weight: 600; }
.inv-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; padding: 0 16px; align-items: start; }
.inv-slots {
  display: grid; grid-template-columns: repeat(9, 52px); gap: 4px; padding: 6px;
  background: #c6c6c6; box-shadow: inset 3px 3px 0 #555, inset -3px -3px 0 #fff;
}
.inv-slot {
  position: relative; width: 52px; height: 52px; display: grid; place-items: center; padding: 0; border: 0;
  font-size: 28px; line-height: 1; background: #8b8b8b; box-shadow: inset 3px 3px 0 #373737, inset -3px -3px 0 #ffffff; cursor: pointer;
}
.inv-slot.empty { cursor: default; }
.inv-slot:not(.empty):hover { background: #a5a5a5; }
.inv-slot .qty { position: absolute; right: 3px; bottom: 1px; font-family: var(--pixel); font-size: 9px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
/* แถบสีความหายากใต้ช่อง */
.inv-slot.rarity-rare::before, .inv-slot.rarity-epic::before, .inv-slot.rarity-legendary::before {
  content: ""; position: absolute; left: 3px; right: 3px; top: 3px; height: 3px; background: var(--rar);
}
.inv-slot.rarity-rare { --rar: #55ffff; } .inv-slot.rarity-epic { --rar: #ff55ff; } .inv-slot.rarity-legendary { --rar: #ffaa00; }
.inv-slot.on { outline: 3px solid #fff; outline-offset: -1px; z-index: 1; box-shadow: 0 0 0 5px #1a0820; }
.inv-slot:focus-visible { outline: 3px dashed var(--amber); outline-offset: 2px; }
.inv-details { min-width: 0; }
.inv-details .inv-card { margin: 0; }
.inv-pager { margin-top: 14px; justify-content: flex-start; }

/* ประวัติพอยต์ */
.wl-more { display: block; padding: 12px 16px; font-family: var(--thai); font-weight: 700; color: var(--amber); text-decoration: none; border-top: 1px solid rgba(255,255,255,.06); }
.wl-more:hover { background: rgba(255,255,255,.04); }
.back-link { display: inline-block; margin-bottom: 18px; font-family: var(--thai); font-weight: 700; color: var(--amber); text-decoration: none; }
.gold { color: #ffd84a; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chips a { font-family: var(--thai); font-weight: 700; font-size: 14px; padding: 7px 14px; color: #e6c9b8; background: #1a0820; text-decoration: none; clip-path: var(--notch); }
.filter-chips a.on { background: var(--amber); color: var(--dusk-2); }
.points-log .wl-row { grid-template-columns: 110px minmax(0, 1fr) 130px 110px; }
.wl-head { font-family: var(--thai); font-size: 12px; color: #aaaaaa; border-bottom: 1px solid rgba(255,255,255,.08); }
.wl-balance { color: #c8a8b8; font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; }
.wl-head span:nth-child(3) { text-align: right; }

/* ตลาด: กล่องของที่ลงขาย เลื่อนในตัว + เลขหน้า */
.ml-rows { max-height: 330px; overflow-y: auto; scrollbar-color: #5a1e4a #1a0820; }
.pager { align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.pager .pg { min-width: 34px; text-align: center; padding: 4px 8px; background: #1a0820; clip-path: var(--notch); text-decoration: none; }
.pager .pg.on { background: var(--amber); color: var(--dusk-2); font-weight: 700; }

@media (max-width: 960px) {
  .inv-layout { grid-template-columns: minmax(0, 1fr); }
  .inv-slots { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .inv-slot { width: auto; height: auto; aspect-ratio: 1; font-size: clamp(16px, 4.6vw, 28px); }
}
@media (max-width: 620px) {
  .inv-layout { padding: 0 10px; gap: 16px; }
  .inv-slots { gap: 2px; padding: 4px; }
  .inv-slot { box-shadow: inset 2px 2px 0 #373737, inset -2px -2px 0 #ffffff; }
  .inv-slot .qty { font-size: 7px; right: 2px; }
  .points-log .wl-row { grid-template-columns: 90px minmax(0, 1fr); }
  .points-log .wl-balance { grid-column: 2; text-align: left; }
  .points-log .wl-balance::before { content: "คงเหลือ "; }
  .points-log .wl-date { grid-column: 2; }
  .wl-head { display: none; }

  /* ตลาดบนมือถือ: 2 คอลัมน์ การ์ดย่อ */
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .market-grid .item { padding: 12px; }
  .market-grid .item-slot { width: 52px; height: 52px; font-size: 28px; margin-bottom: 10px; }
  .market-grid .item-name { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
  .market-grid .item-desc, .market-grid .offer-meta li:nth-child(n+2) { display: none; }
  .market-grid .offer-meta { margin: 8px 0; }
  .market-grid .seller { margin: 8px 0 10px; font-size: 12px; }
  .market-grid .item-foot { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 10px; }
  .market-grid .item-price { font-size: 13px; }
  .market-grid .item-foot .act-btn, .market-grid .item-foot form { width: 100%; }
  .market-grid .item-foot .soon { text-align: center; }
  .market-grid .official-badge { top: 10px; right: 10px; font-size: 0; padding: 5px; }
  .market-grid .official-badge .px-icon { font-size: 14px; }
}

/* มือถือ: ตัวเลขยาว ๆ ไม่ล้น / ไม่ชนกัน */
.acc-stat b { overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .acc-stat b { font-size: 11px; }
  .acc-stats .acc-stat.coin { grid-column: 1 / -1; }   /* พอยต์เต็มแถว */
  .acc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallet-num { font-size: 22px; }
  /* แถวประวัติ: บรรทัดแรก จำนวน + เวลา, บรรทัดสองเป็นรายการ */
  .wl-row, .points-log .wl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .wl-row .wl-amount { grid-column: 1; grid-row: 1; }
  .wl-row .wl-date { grid-column: 2; grid-row: 1; text-align: right; }
  .wl-row .wl-reason { grid-column: 1 / -1; grid-row: 2; }
  .points-log .wl-row .wl-balance { grid-column: 1 / -1; grid-row: 3; text-align: left; font-size: 12px; }
}

/* แถบคลัง */
.inv-count.full { color: #ff8a7a; }
.inv-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; }
.inv-tab-lock { display: contents; }
.inv-tab {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-family: var(--thai); font-weight: 700; font-size: 14px;
  padding: 8px 14px; border: 0; cursor: pointer; color: #e6c9b8; background: #1a0820; clip-path: var(--notch);
  box-shadow: inset 0 0 0 2px #3b1640;
}
.inv-tab small { font-family: var(--pixel); font-size: 9px; color: #aaaaaa; }
.inv-tab:hover { background: #2b0f2e; }
.inv-tab.on { background: #c6c6c6; color: #3b1f14; box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #555; }
.inv-tab.on small { color: #555; }
.inv-tab.overflow { color: #ff8a7a; box-shadow: inset 0 0 0 2px #8e2c2a; }
.inv-tab.overflow.on { background: #5a1e1e; color: #ffd0c8; box-shadow: inset 0 0 0 3px #ff5a5a; }
.inv-tab.locked { color: #ffd84a; background: repeating-linear-gradient(45deg, #1a0820 0 8px, #24102a 8px 16px); box-shadow: inset 0 0 0 2px #8a5a00; }
.inv-tab.locked small { font-family: var(--thai); font-size: 12px; color: #ffe9b8; }
.inv-tab.locked .px-icon { font-size: 16px; }
.inv-tab.locked:hover { box-shadow: inset 0 0 0 2px #ffd84a; }
.inv-tab:disabled { opacity: .5; cursor: not-allowed; }
.inv-warn { margin: 0 16px 12px; padding: 10px 14px; font-family: var(--thai); font-size: 13px; color: #ffd0c8; background: #3b1616; clip-path: var(--notch); }
.inv-slots.over { background: #d8b0b0; }
.inv-empty-hint { font-family: var(--thai); color: #e6c9b8; padding: 12px 0; }
.inv-empty-hint a { color: var(--amber); }
@media (max-width: 620px) {
  .inv-tabs { padding: 0 10px 10px; }
  .inv-tab { padding: 7px 10px; font-size: 13px; }
  .inv-tab.locked small { display: block; }
}

/* ปุ่มแสดง/ซ่อนรหัสผ่าน */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px !important; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font: inherit; font-family: var(--thai); font-size: 12px; font-weight: 700; cursor: pointer; border: 0;
  padding: 5px 10px; color: var(--dusk-2); background: #ffb26b; clip-path: var(--notch);
}

/* ปุ่มตั้งค่าบัญชี + ออกจากระบบ */
.acc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* หน้า error (404/419/429/500/503) */
.err-page .wrap { text-align: center; }
.err-code { font-family: var(--pixel); font-size: clamp(44px, 12vw, 72px); color: var(--amber); text-shadow: 6px 6px 0 #1a0820; margin: 8px 0 18px; }
.err-title { font-family: var(--thai); font-weight: 700; font-size: 26px; color: var(--gold); margin-bottom: 10px; }
.err-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.pbtn.icon-btn { padding: 8px 10px; line-height: 0; }
.pbtn.icon-btn .px-icon { font-size: 22px; vertical-align: 0; }
@media (max-width: 620px) {
  .acc-actions { width: 100%; justify-content: flex-end; }
}

/* หน้าแรก: ปุ่มไปร้านค้า */
.shop-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

/* ปุ่มเข้าด้วย Google / Discord + หน้าตั้งค่าบัญชี */
.social-btns { display: grid; gap: 10px; }
.pbtn.discord { background: #5865f2; color: #fff; box-shadow: inset -4px -4px 0 #3c45a5; }
.discord-logo {
  width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: url(https://cdn.jsdelivr.net/npm/simple-icons@13.0.0/icons/discord.svg) center / contain no-repeat;
  mask: url(https://cdn.jsdelivr.net/npm/simple-icons@13.0.0/icons/discord.svg) center / contain no-repeat;
}
.field label small { font-weight: 400; color: #c8a8b8; }
.hint { font-family: var(--thai); font-size: 13px; color: #c8a8b8; margin-top: 6px; line-height: 1.6; }
.form-win + .form-win { margin-top: 22px; }

/* หน้าตั้งค่า: การ์ดเชื่อมบัญชี + ฟอร์มแก้ไข 3 ช่อง */
.chars-head.first { margin-top: 8px; }
.set-forms { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.set-forms .form-win + .form-win { margin-top: 0; }
.link-score { font-family: var(--pixel); font-size: 13px; color: var(--amber); }
.link-grid { display: grid; gap: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.link-grid > .link-card { grid-column: span 2; }
.link-grid > .link-card.social { grid-column: span 3; }
.link-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; min-width: 0;
  background: #2b0f2e; clip-path: var(--notch); box-shadow: inset 0 0 0 3px #5a1e4a;
}
.link-card.done { box-shadow: inset 0 0 0 3px #3f9a2a, inset 0 0 0 6px #1f4a2a; }
.link-card.todo { box-shadow: inset 0 0 0 3px var(--amber), inset 0 0 0 6px #5a1e4a; }
.link-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.link-icon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px; background: #1a0820; clip-path: var(--notch); }
.link-icon img { width: 22px; height: 22px; }
.link-icon.brand-google { background: var(--cream); }
.link-icon.brand-discord { background: #5865f2; color: #fff; }
.link-icon .discord-logo { width: 24px; height: 24px; }
.link-id { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.link-id h3 { font-family: var(--thai); font-size: 16px; font-weight: 700; color: var(--gold); line-height: 1.2; }
.link-value { font-family: var(--thai); font-size: 14px; color: var(--cream); overflow-wrap: anywhere; line-height: 1.5; padding: 8px 10px; background: #1a0820; clip-path: var(--notch); }
.link-value.mono { font-family: var(--mono); }
.link-value.muted { color: #c8a8b8; font-size: 13px; }
.link-foot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.link-foot form { display: contents; }
.link-note { font-family: var(--thai); font-size: 12px; color: #c8a8b8; }
.act-btn.cream { --bg: var(--cream); --fg: var(--dusk-2); --lo: #d9b878; --hi: #fff8e8; }
.act-btn.discord { --bg: #5865f2; --fg: #fff; --lo: #3c45a5; --hi: #8891ff; }
@media (max-width: 960px) {
  .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .link-grid > .link-card, .link-grid > .link-card.social { grid-column: span 1; }
}
@media (max-width: 620px) {
  .link-grid { grid-template-columns: minmax(0, 1fr); }
}

/* เติมพอยต์ */
.topup-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
.topup-open { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; padding: 10px 12px; background: #3b1616; clip-path: var(--notch); font-family: var(--thai); color: var(--cream); }
.topup-quick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.topup-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; cursor: pointer; border: 0;
  background: #1a0820; color: var(--gold); clip-path: var(--notch); box-shadow: inset 0 0 0 3px #5a1e4a; transition: transform .08s;
}
.topup-chip b { font-family: var(--pixel); font-size: 13px; font-weight: 400; color: #ffd84a; }
.topup-chip small { font-family: var(--thai); font-size: 12px; color: #c8a8b8; }
.topup-chip:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 3px var(--amber); }
.topup-chip:focus-visible { outline: 3px dashed var(--amber-light); outline-offset: 3px; }
.field input[type=number], .field input[type=file] {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--cream); background: #1a0820; border: 0; box-shadow: inset 0 0 0 2px #5a1e4a;
}
.field input[type=file] { font-family: var(--thai); font-size: 14px; }
.field input[type=file]::file-selector-button { font: inherit; font-weight: 700; margin-right: 12px; padding: 6px 12px; border: 0; cursor: pointer; background: var(--cream); color: var(--dusk-2); clip-path: var(--notch); }
.tl-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; font-family: var(--thai); font-size: 14px; }
.tl-row:nth-child(even) { background: rgba(255, 255, 255, .04); }
.tl-amount { font-family: var(--pixel); font-size: 11px; color: var(--cream); }
.tl-info { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; color: var(--cream); }
.tl-info small { flex-basis: 100%; color: #c8a8b8; font-size: 12px; }
.tl-plus { color: #55ff55; font-weight: 700; }

.pay-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); align-items: start; }
.pay-card { padding: 20px; text-align: center; background: #fff; color: #1a1a2e; clip-path: var(--notch); box-shadow: inset 0 0 0 4px #113566; }
.pay-head { margin: -20px -20px 16px; padding: 12px; background: #113566; color: #fff; font-family: var(--thai); font-weight: 700; letter-spacing: .5px; }
.pay-qr svg { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto; }
.pay-amount { font-family: var(--pixel); font-size: 22px; margin-top: 12px; color: #113566; }
.pay-to, .pay-ref { font-family: var(--thai); font-size: 14px; margin-top: 6px; color: #444; }
.pay-ref { font-size: 12px; color: #777; }
.pay-satang { font-family: var(--thai); font-size: 12px; margin-top: 4px; color: #a0521d; }
.pay-steps { padding-left: 20px; margin-bottom: 18px; font-family: var(--thai); color: #e6c9b8; line-height: 1.8; }
.pay-cancel { margin-top: 16px; text-align: center; }
@media (max-width: 860px) {
  .topup-grid, .pay-grid { grid-template-columns: minmax(0, 1fr); }
  .pay-card { max-width: 360px; width: 100%; margin: 0 auto; }
}

/* หน้ากฎฉบับเต็ม */
.rules-head { margin-bottom: 24px; }
.rules-toc { margin-bottom: 8px; }
.rules-toc a { display: inline-flex; align-items: center; gap: 6px; }
.rules-toc .px-icon { font-size: 16px; }
.rules-sec { margin-top: 48px; scroll-margin-top: 80px; }
.rules-sec-title { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; font-family: var(--thai); font-size: 26px; font-weight: 700; color: var(--gold); text-shadow: 3px 3px 0 #1a0820; }
.rules-sec-title .px-icon { font-size: 30px; }
.rule { scroll-margin-top: 80px; }
.rule:target { box-shadow: inset 0 0 0 4px var(--amber), inset -4px -4px 0 4px #6b4426; }
.rule-code {
  flex: none; min-width: 46px; padding: 12px 6px; text-align: center; font-family: var(--pixel); font-size: 12px; color: #8b3a2a;
  background: #fff4e0; box-shadow: inset 0 0 0 3px #8b5a33; clip-path: var(--notch);
}
.rule-body { min-width: 0; }
.rule-penalty { display: inline-block; margin-top: 10px; padding: 3px 10px; font-family: var(--thai); font-size: 13px; font-weight: 700; color: #fff4e0; background: #8b3a2a; clip-path: var(--notch); }
.penalty-steps { list-style: none; display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; }
.penalty-steps li {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; text-align: center;
  background: #2b0f2e; clip-path: var(--notch); box-shadow: inset 0 0 0 3px #5a1e4a; font-family: var(--thai);
}
.penalty-steps li:last-child { box-shadow: inset 0 0 0 3px #c0443a; }
.penalty-steps .px-icon { font-size: 32px; }
.penalty-steps b { color: var(--gold); font-size: 17px; }
.penalty-steps small { color: #c8a8b8; font-size: 13px; }
.rules-note { margin-top: 16px; font-family: var(--thai); color: #e6c9b8; line-height: 1.7; }
.rules-help { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 48px; }
.rules-box { padding: 6px 6px 18px; }
.rules-box p { padding: 0 16px; font-family: var(--thai); color: #e6c9b8; line-height: 1.7; }
.rules-cta { margin-top: 28px; display: flex; justify-content: center; }

/* โปรไฟล์ผู้เล่น /player/{name} */
.player-card { display: flex; gap: 32px; align-items: center; padding: 28px 32px; max-width: 820px; }
.player-skin { flex: none; width: 110px; display: grid; place-items: center; filter: drop-shadow(6px 6px 0 #1a0820); }
.player-skin img { width: 110px; height: auto; image-rendering: pixelated; }
.player-info { flex: 1; min-width: 0; }
.player-name-row { display: flex; align-items: center; gap: 12px; }
.player-name { font-family: var(--mono); font-weight: 700; font-size: clamp(26px, 5vw, 38px); color: var(--gold); text-shadow: 3px 3px 0 #1a0820; overflow-wrap: anywhere; }
.player-crown { font-size: 30px; flex: none; }
.player-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 20px; font-family: var(--thai); font-size: 14px; color: #c8a8b8; }
.player-status.on { color: #5dff8a; }
.player-status.on .dot { background: #5dff8a; animation: blink 1.2s steps(2) infinite; }
.player-tag { padding: 2px 8px; font-size: 12px; font-weight: 700; color: var(--dusk-2); background: #7ec8ff; clip-path: var(--notch); }
.player-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.player-search { max-width: 820px; margin-top: 28px; font-family: var(--thai); }
.player-search label { display: block; margin-bottom: 8px; font-weight: 700; color: var(--gold); }
.player-search-row { display: flex; gap: 8px; margin-bottom: 12px; }
.player-search-row input { flex: 1; min-width: 0; padding: 10px 12px; font: 600 15px var(--mono); color: var(--cream); background: #1a0820; border: 0; box-shadow: inset 0 0 0 3px #5a1e4a; outline: none; }
.player-search-row input:focus { box-shadow: inset 0 0 0 3px var(--amber); }
@media (max-width: 620px) {
  .player-card { flex-direction: column; align-items: stretch; text-align: center; padding: 24px 18px; gap: 18px; }
  .player-skin { margin: 0 auto; }
  .player-name-row, .player-status { justify-content: center; }
  .player-stats .acc-stat { text-align: left; }
}

/* ข่าว/ประกาศ */
.news-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-top: 20px; }
.news-card {
  display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; text-decoration: none; color: var(--cream);
  background: #2b0f2e; clip-path: var(--notch); box-shadow: inset 0 0 0 3px #5a1e4a; transition: transform .12s;
}
.news-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 3px var(--amber); }
.news-card.pinned { box-shadow: inset 0 0 0 3px var(--peach); }
.news-card h3 { font-family: var(--thai); font-weight: 700; font-size: 19px; color: var(--gold); line-height: 1.4; }
.news-card p { font-family: var(--thai); font-size: 14px; color: #e6c9b8; line-height: 1.7; flex: 1; }
.news-more { font-family: var(--thai); font-weight: 700; font-size: 14px; color: var(--amber); }
.news-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-family: var(--thai); font-size: 13px; color: #c8a8b8; }
.news-cat { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-weight: 700; color: var(--dusk-2); background: var(--amber); clip-path: var(--notch); }
.news-cat .px-icon { font-size: 14px; }
.news-cat.cat-update { background: #7ec8ff; }
.news-cat.cat-event { background: #ffe08a; }
.news-cat.cat-maintenance { background: #ff8a7a; }
.news-pin { color: var(--peach); font-weight: 700; }
.news-empty { margin-top: 24px; font-family: var(--thai); color: #e6c9b8; }
.news-article { max-width: 760px; }
.news-article .sec-title { margin: 14px 0 22px; }
.news-body { font-family: var(--thai); font-size: 16px; line-height: 1.85; color: #f3e3d3; }
.news-body > * + * { margin-top: 14px; }
.news-body h1, .news-body h2, .news-body h3 { font-weight: 700; color: var(--gold); line-height: 1.4; margin-top: 26px; }
.news-body h1 { font-size: 26px; } .news-body h2 { font-size: 22px; } .news-body h3 { font-size: 19px; }
.news-body ul, .news-body ol { padding-left: 24px; }
.news-body li + li { margin-top: 6px; }
.news-body a { color: var(--amber); }
.news-body code { font-family: var(--mono); background: #1a0820; padding: 2px 6px; color: var(--amber-light); }
.news-body blockquote { padding: 10px 16px; border-left: 4px solid var(--amber); background: #2b0f2e; color: #e6c9b8; }
.news-body img { max-width: 100%; height: auto; image-rendering: auto; }
.news-more-title { margin-top: 56px; }
.home-news .news-grid { margin-top: 0; }
.home-news .news-all { margin-top: 18px; display: flex; justify-content: flex-end; }

/* นโยบายความเป็นส่วนตัว / เงื่อนไขการใช้งาน */
.legal-intro { max-width: 760px; margin-bottom: 24px; font-family: var(--thai); font-size: 16px; color: #e6c9b8; line-height: 1.8; }
.legal-list { list-style: none; display: grid; gap: 10px; max-width: 860px; }
.legal-list li {
  position: relative; padding: 12px 16px 12px 34px; background: #2b0f2e; clip-path: var(--notch);
  font-family: var(--thai); color: #e6c9b8; line-height: 1.75;
}
.legal-list li::before { content: ""; position: absolute; left: 14px; top: 21px; width: 8px; height: 8px; background: var(--amber); }
.legal-list b { color: var(--gold); }
@media (max-width: 760px) {
  .penalty-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules-help { grid-template-columns: minmax(0, 1fr); }
}
