/* Goldberry store — ธีมเว็บเกม: ฉากบล็อกเต็มจอ การ์ดครีมขอบหนา เงาแข็ง */
:root {
  --ink: #0d1016;        /* พื้นหลังหลัก */
  --panel: #161b24;
  --panel-2: #1f2633;
  --line: #2a3242;
  --gold: #ffc531;
  --gold-deep: #d99a12;
  --cream: #fff2d6;
  --cream-2: #f6e3b8;
  --black: #000;
  --berry: #ff4d5e;
  --online: #39d353;
  --text: #f4f1ea;
  --muted: #9aa3b2;
  --font: "Kanit", "Noto Sans Thai", system-ui, sans-serif;
  --r: 10px;
  --hard: 0 5px 0 var(--black);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--ink); color: var(--text); font: 400 17px/1.6 var(--font); }
a { color: var(--gold); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.ic { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border: 3px solid var(--black); border-radius: var(--r);
  background: var(--gold); color: #1d1300; font-weight: 700; text-decoration: none; cursor: pointer;
  box-shadow: var(--hard); transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--black); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--black); }
.btn:disabled { background: #3a4150; color: var(--muted); cursor: not-allowed; transform: none; }
.btn.dark { background: var(--black); color: #fff; border-color: var(--black); box-shadow: none; }
.btn.dark:hover { background: #222; }
.btn.glass { background: rgba(10, 14, 20, .55); color: #fff; border: 2px solid rgba(255,255,255,.18); box-shadow: none; backdrop-filter: blur(6px); }
.btn.glass:hover { background: rgba(10, 14, 20, .75); }
.btn.ghost { background: transparent; color: var(--text); border: 2px solid var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--panel-2); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; font-size: .9rem; border-width: 2px; box-shadow: 0 3px 0 var(--black); }

/* ---------- แถบประกาศ + เมนู ---------- */
.announce { background: var(--gold); color: #1d1300; text-align: center; font-weight: 600; padding: 7px 16px; font-size: .95rem; border-bottom: 3px solid var(--black); }
.top { position: absolute; left: 0; right: 0; z-index: 20; padding: 16px 0; }
.top.solid { position: sticky; top: 0; background: rgba(13, 16, 22, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 10px 0; }
.top .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.25rem; text-shadow: 0 2px 0 rgba(0,0,0,.5); }
.brand .px, .brand img { width: 40px; height: 40px; object-fit: contain; }
.brand span[hidden] + span { margin-left: 0; }
.nav { display: flex; gap: 4px; padding: 6px; border-radius: 16px; background: rgba(13, 16, 22, .6); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(10px); }
.nav a { display: flex; align-items: center; gap: 8px; color: #dfe3ea; text-decoration: none; padding: 8px 14px; border-radius: 11px; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a[aria-current="page"] { background: var(--gold); color: #1d1300; }
.top-right { justify-self: end; display: flex; gap: 10px; align-items: center; }
.login-btn { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: rgba(13, 16, 22, .6); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(10px); color: #fff; font-weight: 600; cursor: pointer; }
.login-btn img { width: 26px; height: 26px; border-radius: 5px; image-rendering: pixelated; }
.menu-btn { display: none; }
@media (max-width: 900px) {
  .top .wrap { grid-template-columns: 1fr auto; }
  .nav { display: none; position: absolute; top: 66px; left: 16px; right: 16px; flex-direction: column; background: rgba(13,16,22,.97); }
  .nav.open { display: flex; }
  .menu-btn { display: flex; }
  .login-btn .label { display: none; }
}

/* ---------- ปุ่มลอยด้านขวา ---------- */
.rail { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 30; display: flex; flex-direction: column; gap: 12px; }
.rail button { width: 60px; height: 60px; border: 3px solid var(--black); border-radius: 12px; box-shadow: 0 4px 0 var(--black); cursor: pointer; display: grid; place-items: center; font-weight: 800; position: relative; padding: 0; }
.rail button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--black); }
.rail .me { background: var(--gold); }
.rail .me { color: #1d1300; }
.rail .me .ic { position: absolute; width: 28px; height: 28px; }
.rail .me img { position: relative; width: 38px; height: 38px; image-rendering: pixelated; border-radius: 4px; background: var(--gold); }
.rail .cart { background: var(--berry); color: #fff; display: flex; gap: 4px; align-items: center; justify-content: center; font-size: 1.05rem; }
.rail .cart .ic { width: 22px; height: 22px; }
@media (max-width: 900px) { .rail { top: auto; bottom: 16px; transform: none; flex-direction: row; } .rail button { width: 56px; height: 56px; } }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 560px; display: grid; place-items: center; text-align: center; overflow: hidden; background: linear-gradient(180deg, #1a2130 0%, var(--ink) 100%); border-bottom: 1px solid var(--line); }
.hero.has-image { min-height: 640px; border-bottom: 4px solid var(--black); }
.hero-bg { position: absolute; inset: 0; }
.hero-bg svg, .hero-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,16,22,.55) 0%, rgba(13,16,22,.25) 40%, rgba(13,16,22,.85) 100%); }
.hero-inner { position: relative; z-index: 1; padding: 120px 20px 80px; display: flex; flex-direction: column; align-items: center; }
.logo-img { max-width: min(520px, 86vw); max-height: 220px; filter: drop-shadow(0 8px 0 rgba(0,0,0,.45)); }
.logo-text {
  font-size: clamp(3.4rem, 10vw, 7.5rem); font-weight: 800; line-height: .95; letter-spacing: .01em; color: var(--gold);
  -webkit-text-stroke: 3px var(--black); paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--gold-deep), 0 8px 0 #a86f0c, 0 12px 0 var(--black), 0 20px 24px rgba(0,0,0,.45);
}
.hero .tag { font-size: 1.2rem; max-width: 34ch; margin: 26px 0 30px; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.ip-btn { font-size: 1.15rem; padding: 14px 22px; }
.ip-btn .dot { width: 10px; height: 10px; border-radius: 50%; background: #888; }
.ip-btn .dot.on { background: var(--online); box-shadow: 0 0 0 4px rgba(57,211,83,.25); }
.ip-btn .count { font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: rgba(13,16,22,.6); border: 1px solid rgba(255,255,255,.15); color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; backdrop-filter: blur(6px); }
.chip:hover { background: rgba(13,16,22,.85); }
@media (max-width: 600px) { .hero { min-height: 480px; } .hero-inner { padding-top: 100px; } }

/* ---------- section ---------- */
.section { padding: 56px 0 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.section-head h2 { display: flex; align-items: center; gap: 12px; font-size: 1.6rem; }
.section-head h2 .px { width: 34px; height: 34px; }
.section-head a { color: var(--muted); text-decoration: none; font-weight: 600; }
.section-head a:hover { color: #fff; }

/* โปรโมชั่น */
.promo { position: relative; display: block; border: 4px solid var(--black); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 0 var(--black); text-decoration: none; color: #fff; min-height: 220px; background: linear-gradient(120deg, #1f2633 0%, #2b2412 100%); }
.promo .promo-img { position: absolute; right: 3%; top: 50%; transform: translateY(-50%); width: 52%; max-height: 92%; object-fit: contain; object-position: right center; z-index: 1; filter: drop-shadow(0 10px 0 rgba(0,0,0,.35)); }
.promo .promo-bg svg { width: 100%; height: 100%; }
/* ไม่ใช้เงาทับรูป */ .promo-unused::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,16,22,.88) 0%, rgba(13,16,22,.35) 60%, transparent 100%); }
.promo-body { position: relative; z-index: 1; padding: 34px 36px; max-width: 560px; }
.promo-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.promo-body .pill-sale { display: inline-block; background: var(--berry); color: #fff; font-weight: 800; padding: 4px 12px; border-radius: 8px; border: 2px solid var(--black); }
.pill-time { display: inline-flex; align-items: center; gap: 6px; background: rgba(0,0,0,.45); color: var(--gold); font-weight: 700; padding: 4px 12px; border-radius: 8px; border: 2px solid rgba(255,197,49,.5); }
.promo-desc { color: #d9dee6; margin: 0 0 10px; max-width: 46ch; white-space: pre-line; }
.promo-end { color: var(--muted); font-size: .92rem; margin: 0 0 18px; }
.promo-body h3 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin-bottom: 10px; }
.promo-body h3:last-of-type + .btn { margin-top: 8px; }
.promo-art { position: absolute; right: 6%; top: 50%; transform: translateY(-50%) rotate(-8deg); z-index: 1; width: 190px; height: 190px; filter: drop-shadow(0 10px 0 rgba(0,0,0,.4)); }
@media (max-width: 700px) { .promo .promo-img { position: relative; right: auto; top: auto; transform: none; display: block; width: 100%; max-height: 160px; margin: 0 auto; padding: 18px 18px 0; object-position: center; } .promo-art { width: 110px; height: 110px; right: 4%; top: 22%; opacity: .9; } .promo-body { padding: 26px 22px; padding-right: 120px; } }

/* ---------- การ์ดสินค้า ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px; }
.card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--cream); color: #1b1305; border: 4px solid var(--black); border-radius: 14px; padding: 22px 20px 20px;
  box-shadow: 0 8px 0 var(--black); cursor: pointer; transition: transform .12s;
}
.card:hover { transform: translateY(-4px); }
.card .art { width: 150px; height: 150px; display: grid; place-items: center; margin: 4px 0 10px; position: relative; }
.card .art::before { content: ""; position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle, rgba(255,197,49,.55), transparent 70%); }
.card .art .px, .card .art img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.card .art .px { image-rendering: pixelated; filter: drop-shadow(0 6px 0 rgba(0,0,0,.18)); }
/* รูปจริง (ภาพวาดความละเอียดสูง): ย่อแบบนุ่ม เงานุ่ม */
.card .art img, .thumb img, .modal .art-box img, .promo .promo-img { image-rendering: auto; }
.card .art img { filter: drop-shadow(0 8px 10px rgba(80, 40, 0, .22)); }
.card .art .emoji { position: relative; font-size: 5rem; }
.badge { display: inline-block; background: var(--berry); color: #fff; font-weight: 700; font-size: .85rem; padding: 2px 10px; border-radius: 7px; margin-bottom: 8px; }
.badge.hot { background: #ff8a1f; }
.card .name { font-size: 1.55rem; font-weight: 800; line-height: 1.15; }
.card .desc { color: #6b5a3a; font-size: .95rem; line-height: 1.45; margin: 6px 0 16px; flex: 1; }
.card .buy { width: 100%; justify-content: center; font-size: 1.05rem; padding: 13px 16px; border-radius: 10px; background: var(--black); color: #fff; border: 0; box-shadow: none; }
.card .buy:hover { background: #262626; transform: none; }
.card .buy .was { color: #9aa3b2; text-decoration: line-through; font-weight: 400; font-size: .9rem; }
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .card { padding: 14px 10px 12px; border-width: 3px; box-shadow: 0 5px 0 var(--black); }
  .card .art { width: 96px; height: 96px; }
  .card .name { font-size: 1.1rem; }
  .card .desc { font-size: .82rem; }
  .card .buy { font-size: .92rem; padding: 10px 8px; gap: 6px; }
  .card .buy .was { display: none; }
}

/* ---------- แถบชุมชน (เป้าหมาย / อันดับ / ล่าสุด) ---------- */
.community { display: grid; grid-template-columns: 1.1fr .9fr 1.2fr; gap: 20px; }
@media (max-width: 900px) { .community { grid-template-columns: 1fr; } }
.box { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 22px; }
.box h3 { font-size: 1.15rem; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.box h3 .px { width: 26px; height: 26px; }
.goal-num { font-size: 2rem; font-weight: 800; color: var(--gold); line-height: 1.1; }
.bar { height: 18px; border-radius: 9px; background: #0a0d12; border: 2px solid var(--black); overflow: hidden; margin: 12px 0 8px; }
.bar > span { display: block; height: 100%; background: repeating-linear-gradient(45deg, var(--gold) 0 12px, #ffd45e 12px 24px); }
.donor { display: flex; align-items: center; gap: 16px; }
.donor img { width: 72px; height: 72px; border-radius: 10px; border: 3px solid var(--black); background: #0a0d12; image-rendering: pixelated; }
.donor b { font-size: 1.4rem; display: block; }
.recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.recent li { display: flex; gap: 12px; align-items: center; line-height: 1.35; font-size: .95rem; }
.head { width: 36px; height: 36px; border-radius: 7px; background: #0a0d12; image-rendering: pixelated; flex: none; }

/* ---------- ข่าว ---------- */
.news { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.news article { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.news time { color: var(--gold); font-weight: 600; font-size: .9rem; }
.news h3 { font-size: 1.2rem; margin: 6px 0 8px; }
.news p { margin: 0; white-space: pre-line; color: #cdd3dc; }

/* ---------- ร้านค้า ---------- */
.page-head { padding: 120px 0 34px; background: linear-gradient(180deg, #1a2130, var(--ink)); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
.page-head p { color: var(--muted); margin: 8px 0 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 30px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; border: 3px solid var(--black); background: var(--panel-2); color: #fff; text-decoration: none; font-weight: 700; box-shadow: 0 4px 0 var(--black); }
.tabs a .px, .tabs a img { width: 26px; height: 26px; object-fit: contain; }
.tabs a:hover { background: #2a3344; }
.tabs a[aria-current="page"] { background: var(--gold); color: #1d1300; }
.empty { text-align: center; padding: 56px 12px; color: var(--muted); }
.empty .px { width: 80px; height: 80px; }

/* ---------- ฟอร์ม ---------- */
label.field { display: block; font-weight: 600; margin-bottom: 14px; }
label.field > span { display: block; margin-bottom: 6px; }
.input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 2px solid var(--line); background: #0a0d12; outline: none; }
.input:focus { border-color: var(--gold); }
.hint { font-size: .9rem; color: var(--muted); font-weight: 400; margin-top: 6px; }
.err { color: #ff8f8f; }
.ok { color: var(--online); }
.row { display: flex; gap: 8px; align-items: center; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 6px 0 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--gold); }

/* ---------- drawer / modal ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); z-index: 40; display: none; }
.scrim.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--ink); border-left: 4px solid var(--black); z-index: 50; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .22s ease; }
.drawer.open { transform: none; }
.drawer header, .modal header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer header h2, .modal header h2 { font-size: 1.4rem; }
.drawer .body { flex: 1; overflow: auto; padding: 16px 20px; }
.drawer footer { padding: 18px 20px; border-top: 1px solid var(--line); }
.x { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.line-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.thumb { width: 58px; height: 58px; border-radius: 10px; background: var(--cream); border: 3px solid var(--black); display: grid; place-items: center; font-size: 1.8rem; }
.thumb .px, .thumb img { width: 80%; height: 80%; }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 8px; margin-top: 4px; }
.qty button { background: none; border: 0; width: 30px; height: 30px; cursor: pointer; font-size: 1.1rem; }
.qty span { min-width: 28px; text-align: center; font-weight: 700; }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: .9rem; padding: 0; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-bottom: 14px; }
.totals .grand { font-size: 1.5rem; font-weight: 800; color: var(--gold); }

.modal { position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto; background: var(--ink); border: 4px solid var(--black); border-radius: 16px; box-shadow: 0 10px 0 var(--black); display: none; }
.modal.open { display: block; }
.modal .body { padding: 22px; display: grid; grid-template-columns: 200px 1fr; gap: 22px; }
.modal .art-box { background: var(--cream); border: 4px solid var(--black); border-radius: 14px; display: grid; place-items: center; aspect-ratio: 1; font-size: 5rem; }
.modal .art-box .px, .modal .art-box img { width: 78%; height: 78%; }
.perks { margin: 12px 0; padding-left: 20px; }
.perks li { margin: 4px 0; }
.price-big { font-size: 1.9rem; font-weight: 800; color: var(--gold); }
.price-big s { color: var(--muted); font-size: 1.1rem; font-weight: 400; margin-left: 8px; }
@media (max-width: 560px) { .modal .body { grid-template-columns: 1fr; } .modal .art-box { max-width: 160px; } }

/* ---------- จ่ายเงิน ---------- */
.narrow { max-width: 680px; margin: 0 auto; padding: 120px 20px 72px; }
.sheet { background: var(--cream); color: #1b1305; border: 4px solid var(--black); border-radius: 16px; box-shadow: 0 8px 0 var(--black); padding: 26px; }
.sheet + .sheet { margin-top: 22px; }
.sheet .muted, .sheet .hint { color: #6b5a3a; }
.sheet a { color: #a3650a; }
.pay { text-align: center; }
.pay h2 { font-size: 1.6rem; }
.pay .qr { width: 260px; height: 260px; background: #fff; border-radius: 12px; border: 3px solid var(--black); padding: 8px; margin: 16px auto 8px; display: block; image-rendering: pixelated; }
.pay .amount { font-size: 2.6rem; font-weight: 800; margin: 2px 0 12px; }
.pay .actions { display: flex; flex-direction: column; gap: 12px; max-width: 380px; margin: 0 auto; }
.pay .btn.ghost { color: #1b1305; border-color: #1b1305; }
.pay .btn.ghost:hover { background: var(--cream-2); }
.steps { margin: 0 auto 18px; padding-left: 22px; text-align: left; max-width: 380px; color: #4a3d22; }
.status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 99px; background: #1b1305; color: #fff; margin-top: 18px; font-weight: 600; }
.status-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: blink 1.2s infinite; }
.status-pill.done .dot { background: var(--online); animation: none; }
.status-pill.bad .dot { background: var(--berry); animation: none; }
@keyframes blink { 50% { opacity: .3; } }
.receipt { width: 100%; border-collapse: collapse; }
.receipt td { padding: 6px 0; }
.receipt td:last-child { text-align: right; }
.receipt tr.sum td { border-top: 2px solid #1b1305; padding-top: 10px; font-weight: 800; }
.big-art { width: 120px; height: 120px; margin: 0 auto; }

.rules { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: r; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: center; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.rules li::before { content: counter(r); width: 46px; height: 46px; display: grid; place-items: center; border-radius: 10px; background: var(--gold); color: #1d1300; border: 3px solid var(--black); font-weight: 800; font-size: 1.2rem; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--gold); color: #1d1300; border: 3px solid var(--black); padding: 10px 18px; border-radius: 10px; font-weight: 700; z-index: 60; display: none; box-shadow: 0 4px 0 var(--black); }
.toast.show { display: block; }

/* ---------- footer ---------- */
.site-foot { padding: 64px 0 40px; }
.foot-card { background: var(--gold); color: #1d1300; border: 4px solid var(--black); border-radius: 18px; box-shadow: 0 8px 0 var(--black); padding: 30px 34px; display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; }
.foot-card .px, .foot-card .flogo { width: 96px; height: 96px; object-fit: contain; }
.ip-plate { display: inline-flex; align-items: center; gap: 12px; background: #fff; border: 3px solid var(--black); border-radius: 10px; box-shadow: 0 4px 0 var(--black); padding: 10px 16px; font-weight: 800; cursor: pointer; font-size: 1.05rem; }
.ip-plate .n { background: #f1ede2; border-radius: 6px; padding: 0 8px; font-size: .9rem; }
.foot-card p { margin: 12px 0 0; font-size: .95rem; }
.follow { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.follow-title { font-weight: 800; font-size: .9rem; letter-spacing: .02em; opacity: .8; }
.socials { display: flex; gap: 12px; }
/* ปุ่มโซเชียลสี่เหลี่ยม: ชี้แล้วลอยขึ้นและส่ายซ้ายขวา ไอคอนเปลี่ยนเป็นสีแบรนด์ */
.soc { --brand: #000; position: relative; width: 56px; height: 56px; display: grid; place-items: center; background: #fff; color: #111; border: 3px solid var(--black); border-radius: 12px; box-shadow: 0 5px 0 var(--black); text-decoration: none; transition: transform .2s cubic-bezier(.3, .8, .3, 1.4), box-shadow .2s, color .2s, background-color .2s; }
.soc .ic { width: 26px; height: 26px; transition: transform .25s cubic-bezier(.3, .8, .3, 1.4); }
.soc-discord { --brand: #5865f2; } .soc-facebook { --brand: #1877f2; } .soc-youtube { --brand: #ff0033; } .soc-tiktok { --brand: #000; }
.soc:hover, .soc:focus-visible { transform: translateY(-4px); box-shadow: 0 9px 0 var(--black); color: var(--brand); animation: socWiggle .55s ease-in-out; }
.soc:hover .ic, .soc:focus-visible .ic { transform: scale(1.15); }
.soc:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--black); animation: none; }
@keyframes socWiggle {
  0% { rotate: 0deg; } 20% { rotate: -9deg; } 40% { rotate: 7deg; } 60% { rotate: -4deg; } 80% { rotate: 2deg; } 100% { rotate: 0deg; }
}
/* ป้ายชื่อเล็ก ๆ เด้งขึ้นเหนือปุ่ม */
.soc::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 10px); left: 50%; translate: -50% 4px; background: var(--black); color: #fff; font-size: .75rem; font-weight: 700; padding: 4px 9px; border-radius: 7px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .18s, translate .18s; }
.soc:hover::after, .soc:focus-visible::after { opacity: 1; translate: -50% 0; }
@media (prefers-reduced-motion: reduce) { .soc:hover, .soc:focus-visible { animation: none; } }
@media (max-width: 760px) { .foot-card { grid-template-columns: 1fr; text-align: center; justify-items: center; } .follow { align-items: center; } }
@media (max-width: 700px) { .promo:has(.promo-img) .promo-body { padding-right: 22px; } }

/* ---------- ข่าวสาร ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.news-card { display: flex; flex-direction: column; background: var(--panel); border: 3px solid var(--black); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--text); box-shadow: 0 6px 0 var(--black); transition: transform .12s; }
.news-card:hover { transform: translateY(-3px); }
.news-card .cover { aspect-ratio: 16 / 9; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; border-bottom: 3px solid var(--black); }
.news-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.news-card .cover .px { width: 64px; height: 64px; }
.news-card .info { padding: 14px 18px 18px; }
.news-card time { color: var(--gold); font-weight: 600; font-size: .88rem; }
.news-card h3 { font-size: 1.15rem; margin: 4px 0 6px; }
.news-card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article { max-width: 760px; margin: 0 auto; padding: 110px 20px 64px; }
.article .back { color: var(--muted); text-decoration: none; font-weight: 600; }
.article .back:hover { color: #fff; }
.article time { display: block; color: var(--gold); font-weight: 600; margin-top: 18px; }
.article h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 800; margin: 6px 0 22px; }
.article-cover { width: 100%; border-radius: 14px; border: 3px solid var(--black); margin-bottom: 24px; display: block; }
.article p { white-space: pre-line; color: #dfe3ea; font-size: 1.05rem; line-height: 1.8; margin: 0 0 20px; }
.article figure { margin: 8px 0 26px; }
.article figure img { max-width: 100%; max-height: 560px; margin: 0 auto; border-radius: 12px; border: 3px solid var(--black); display: block; }
.article figcaption { color: var(--muted); font-size: .93rem; text-align: center; margin-top: 8px; }

/* ---------- หัวหน้าร้านค้าแบบกระชับ: ชื่อ + คำอธิบายบรรทัดเดียว + แถบหมวดอยู่ในแถบเดียวกัน ---------- */
.store-top { padding: 92px 0 16px; background: linear-gradient(180deg, #1a2130 0%, var(--ink) 100%); border-bottom: 1px solid var(--line); }
.store-title { display: flex; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; }
.store-title h1 { font-size: 1.75rem; font-weight: 800; }
.store-title p { margin: 0; color: var(--muted); font-size: .95rem; }
.store-top .tabs { margin: 14px 0 0; gap: 8px; }
.store-top .tabs a { padding: 8px 14px; font-size: .95rem; box-shadow: 0 3px 0 var(--black); }
.store-body { padding-top: 28px; }
.page-head { padding: 100px 0 24px; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); }
@media (max-width: 600px) {
  .store-top { padding-top: 84px; }
  .store-title h1 { font-size: 1.45rem; }
  .store-title p { font-size: .85rem; }
  .store-top .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
  .store-top .tabs::-webkit-scrollbar { display: none; }
  .store-top .tabs a { flex: none; }
  .store-body { padding-top: 18px; }
}

/* ป้ายบนการ์ด: ห้อยจากขอบบนซ้าย สี่เหลี่ยมมุมมน ไม่มีกรอบ */
.card .tags { position: absolute; top: -4px; left: 18px; z-index: 1; display: flex; gap: 6px; }
.tag { display: inline-block; font-weight: 700; font-size: .82rem; line-height: 1.3; padding: 6px 11px 5px; border-radius: 0 0 7px 7px; }
.card .name { margin-top: 2px; }
@media (max-width: 600px) { .card .tags { left: 10px; gap: 4px; } .tag { font-size: .7rem; padding: 4px 7px 3px; border-radius: 0 0 5px 5px; } }

.login-btn.active { background: var(--gold); color: #1d1300; border-color: var(--gold); }

/* ---------- สไลด์โปรโมชั่น ---------- */
.promo-carousel { position: relative; overflow: hidden; padding-bottom: 10px; margin-bottom: -10px; }
.promo-track { display: flex; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.promo-track > .promo { flex: 0 0 100%; }
.promo-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.promo-dots .dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 99px; background: #4a5263; cursor: pointer; transition: width .25s, background .25s; }
.promo-dots .dot:hover { background: #7a8394; }
.promo-dots .dot[aria-selected="true"] { width: 22px; background: var(--gold); }
.promo-body .pill-sale { border: 0; padding: 6px 12px; }

/* ป้ายนับถอยหลังของสินค้า */
.tag.tag-time { display: inline-flex; align-items: center; gap: 4px; background: #14161c; color: var(--gold); font-variant-numeric: tabular-nums; }
.tag.tag-time .ic { width: 13px; height: 13px; }

/* สวิตช์เปิด/ปิด (หลังร้าน) */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #3a4150; transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--online); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- รับรางวัลเติมสะสม ---------- */
.rewards-page { padding-top: 28px; padding-bottom: 20px; }
.reward-who { display: flex; gap: 10px; align-items: center; max-width: 520px; margin: 0 auto 18px; }
.reward-who .head { width: 46px; height: 46px; border-radius: 8px; }
.reward-total { text-align: center; font-size: 1.1rem; margin-bottom: 26px; }
.reward-total .num { font-size: 2rem; font-weight: 800; color: var(--gold); margin: 0 4px; }
.reward-track { position: relative; height: 14px; border-radius: 99px; background: #0a0d12; border: 2px solid var(--line); margin: 0 4% 54px; }
.reward-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .6s ease; }
.reward-mark { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.reward-mark i { display: block; width: 22px; height: 22px; border-radius: 50%; background: #2a3242; border: 3px solid var(--ink); }
.reward-mark.on i { background: var(--gold); box-shadow: 0 0 0 4px rgba(255,197,49,.25); }
.reward-mark em { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); font-style: normal; font-weight: 700; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.reward-mark.on em { color: var(--gold); }
.reward-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1000px) { .reward-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .reward-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .reward-track { margin-bottom: 46px; } .reward-mark em { font-size: .7rem; } }
.rcard { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; background: var(--cream); color: #1b1305; border: 4px solid var(--black); border-radius: 14px; padding: 34px 14px 14px; box-shadow: 0 8px 0 var(--black); }
.rcard .rneed { position: absolute; top: -4px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: #14161c; color: var(--gold); font-weight: 700; font-size: .82rem; padding: 6px 12px 5px; border-radius: 0 0 8px 8px; }
.rcard .art { width: 110px; height: 110px; display: grid; place-items: center; margin-bottom: 8px; }
.rcard .art .px, .rcard .art img { width: 100%; height: 100%; object-fit: contain; }
.rcard .art .px { image-rendering: pixelated; }
.rcard .art .emoji { font-size: 4rem; }
.rcard .name { font-size: 1.15rem; font-weight: 800; line-height: 1.2; }
.rcard .desc { color: #6b5a3a; font-size: .88rem; line-height: 1.4; margin: 4px 0 14px; flex: 1; }
.rcard .btn { font-size: .95rem; padding: 10px 8px; }
.rcard.ready { box-shadow: 0 8px 0 var(--black), 0 0 0 4px rgba(255,197,49,.55); }
.rcard.ready .rneed { background: var(--gold); color: #1d1300; }
.rcard.locked .art { filter: grayscale(.85) opacity(.55); }
.rcard.claimed .art { opacity: .75; }
.rcard .btn.dark:disabled { background: #2a2f3a; color: #aab2c0; }
@media (max-width: 600px) { .rcard { padding-top: 30px; border-width: 3px; box-shadow: 0 5px 0 var(--black); } .rcard .rneed { font-size: .7rem; padding: 4px 8px; } .rcard .art { width: 80px; height: 80px; } .rcard .name { font-size: .98rem; } .rcard .btn { font-size: .82rem; } }
.reward-who .btn { white-space: nowrap; flex: none; }

/* ---------- เข้าสู่ระบบ (AuthMe) ---------- */
.login-form { padding: 22px; max-width: 420px; margin: 0 auto; }
.login-form .muted { margin-top: 4px; }
.login-form code, .redeem-box code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.login-head { display: grid; place-items: center; }
.login-head .head, .login-head img { width: 72px; height: 72px; border-radius: 10px; border: 3px solid var(--black); box-shadow: 0 4px 0 var(--black); image-rendering: pixelated; }
.login-cta { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; max-width: 620px; margin: 0 auto 22px; padding: 14px 18px; border: 2px dashed var(--line); border-radius: 12px; color: var(--muted); }
.login-cta .ic { width: 22px; height: 22px; color: var(--gold); flex: none; }
.login-cta.in-cart { justify-content: flex-start; margin: 0 0 14px; font-size: .95rem; }
.buyer-row { padding: 8px 10px; border-radius: 10px; background: #0a0d12; border: 2px solid var(--line); }
.buyer-row .head { width: 36px; height: 36px; border-radius: 6px; }
.buyer-row b { flex: 1; }
.reward-total .head { width: 34px; height: 34px; border-radius: 6px; vertical-align: middle; margin-right: 10px; }

/* ช่องใส่โค้ดไอเทม ล่างสุดของหน้ารับรางวัล */
.redeem-box { display: flex; gap: 22px; align-items: center; margin: 46px auto 10px; max-width: 820px; padding: 22px 26px; background: var(--panel); border: 4px solid var(--black); border-radius: 16px; box-shadow: 0 8px 0 var(--black); scroll-margin-top: 90px; }
.redeem-ic { width: 84px; height: 84px; flex: none; display: grid; place-items: center; background: var(--panel-2); border-radius: 12px; }
.redeem-ic .px { width: 60px; height: 60px; image-rendering: pixelated; }
.redeem-main { flex: 1; min-width: 0; }
.redeem-main h2 { font-size: 1.35rem; }
.redeem-main .muted { margin: 4px 0 12px; font-size: .95rem; }
.redeem-form { display: flex; gap: 10px; }
.redeem-form .btn { flex: none; white-space: nowrap; }
.redeem-main .hint { margin: 8px 0 0; min-height: 1em; }
@media (max-width: 600px) {
  .redeem-box { flex-direction: column; text-align: center; padding: 20px 16px; }
  .redeem-form { flex-direction: column; }
}

/* ---------- สารบัญ (ข่าวสาร + กฎ) ---------- */
.wiki-jump { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.wiki-jump a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 99px; background: var(--panel); border: 2px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.wiki-jump a:hover { border-color: var(--gold); color: var(--gold); }
.wiki-jump .ic { width: 17px; height: 17px; }
.wiki-jump em { font-style: normal; font-size: .75rem; background: var(--gold); color: #1d1300; border-radius: 99px; padding: 0 7px; }
.wiki-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0 34px; align-items: start; padding-top: 28px; padding-bottom: 20px; }
/* หัวข้อข่าวอยู่แถวบน ข่าวกับกฎอยู่แถวเดียวกัน ขอบบนของกฎเลยตรงกับการ์ดข่าว */
.wiki-head { grid-column: 1; grid-row: 1; }
.wiki-news { grid-column: 1; grid-row: 2; }
.wiki-rules { grid-column: 2; grid-row: 2; }
.wiki-head, .wiki-rules { scroll-margin-top: 84px; }
.wiki-head { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 16px; }
.wiki-head h2, .wiki-rules-card h2 { display: flex; align-items: center; gap: 10px; font-size: 1.45rem; }
.wiki-head h2 .px, .wiki-rules-card h2 .px { width: 30px; height: 30px; image-rendering: pixelated; }
.wiki-head .muted { font-size: .92rem; }

/* ข่าวเด่น: การ์ดใหญ่แนวนอน */
.news-feature { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--panel); border: 3px solid var(--black); border-radius: 16px; overflow: hidden; text-decoration: none; color: var(--text); box-shadow: 0 7px 0 var(--black); transition: transform .12s; }
.news-feature:hover { transform: translateY(-3px); }
.news-feature .tags { position: absolute; top: 0; left: 18px; z-index: 1; display: flex; gap: 6px; }
.news-feature .cover { position: relative; min-height: 260px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; border-right: 3px solid var(--black); }
.news-feature .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.news-feature .cover .px { width: 80px; height: 80px; }
.news-feature .info { padding: 22px 24px; display: flex; flex-direction: column; }
.news-feature time { color: var(--gold); font-weight: 600; font-size: .9rem; }
.news-feature h3 { font-size: 1.5rem; line-height: 1.25; margin: 6px 0 10px; }
.news-feature p { margin: 0; color: var(--muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.news-feature .more { margin-top: auto; padding-top: 14px; color: var(--gold); font-weight: 700; }
.wiki-grid { margin-top: 24px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

/* กฎ: การ์ดครีมด้านขวา ติดจอตอนเลื่อน */
.wiki-rules { position: sticky; top: 84px; }
.wiki-rules-card { background: var(--cream); color: #1b1305; border: 4px solid var(--black); border-radius: 16px; box-shadow: 0 8px 0 var(--black); padding: 22px 22px 18px; }
.wiki-rules-card .sub { color: #6b5a3a; font-size: .9rem; margin: 6px 0 14px; }
.wiki-rules-card ol { list-style: none; counter-reset: r; margin: 0; padding: 0; }
.wiki-rules-card li { counter-increment: r; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px dashed rgba(27,19,5,.18); font-size: .95rem; line-height: 1.5; }
.wiki-rules-card li::before { content: counter(r); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--gold); border: 2px solid var(--black); font-weight: 800; font-size: .9rem; }

@media (max-width: 960px) {
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-head, .wiki-news, .wiki-rules { grid-column: 1; grid-row: auto; }
  .wiki-rules { position: static; margin-top: 30px; }
}
@media (max-width: 640px) {
  .news-feature { grid-template-columns: 1fr; }
  .news-feature .cover { min-height: 0; aspect-ratio: 16 / 9; border-right: 0; border-bottom: 3px solid var(--black); }
  .news-feature h3 { font-size: 1.25rem; }
  .news-feature .info { padding: 16px 18px 18px; }
}

/* ป้ายบนการ์ดข่าว ห้อยจากขอบบนซ้ายแบบเดียวกับสินค้า */
.news-card { position: relative; }
.news-card .tags { position: absolute; top: 0; left: 16px; z-index: 1; display: flex; gap: 6px; }

/* ตารางโอกาสดรอป (กล่องสุ่ม) ในหน้ารายละเอียดสินค้า */
.drops { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: .93rem; }
.drops th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 0 8px 6px; border-bottom: 2px solid var(--line); }
.drops th:last-child, .drops td:last-child { text-align: right; width: 150px; }
.drops td { padding: 8px; border-bottom: 1px solid var(--line); }
.drops tr:last-child td { border-bottom: 0; }
.drops td:last-child { white-space: nowrap; }
.drops .chance { display: inline-block; vertical-align: middle; width: 64px; height: 6px; border-radius: 99px; background: #0a0d12; margin-right: 10px; overflow: hidden; }
.drops .chance i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.drops b { display: inline-block; min-width: 54px; color: var(--gold); font-variant-numeric: tabular-nums; }
/* ตารางกรอกของดรอปในหลังร้าน */
.drops-edit { width: 100%; border-collapse: collapse; }
.drops-edit th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: 0 4px 4px; }
.drops-edit td { padding: 3px 4px; }
.drops-edit .input { padding: 9px 11px; }

/* สินค้าโชว์อย่างเดียว ซื้อไม่ได้ */
.card .btn.buy:disabled, .modal .btn.dark:disabled { background: #6b6f78; color: #f1f1f1; border-color: #000; cursor: not-allowed; transform: none; }

/* ปุ่มโซเชียลหน้าแรก: สีไอคอนตามแบรนด์ */
.chip-discord .ic { color: #8c9eff; }
.chip-youtube .ic { color: #ff4e45; }
.chip-facebook .ic { color: #5b9bff; }

/* ไอคอนหัวข้อที่อัปโหลดเอง: รูปจริง ไม่ทำให้แตกเป็นพิกเซล */
img.sec-ic { object-fit: contain; image-rendering: auto; }

/* กันกดค้างเพื่อบันทึกรูปบนมือถือ และกันลากรูปออกไป */
#app img, .modal img, .drawer img, .site-head img, footer img { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

/* ---------- animation เปลี่ยนหน้า ---------- */
/* แถบสีทองในเมนูเลื่อนตามหน้า (เฉพาะจอใหญ่ จอมือถือเมนูเป็นรายการแนวตั้งใช้แบบเดิม) */
.nav-pill { display: none; }
@media (min-width: 901px) {
  .nav.has-pill { position: relative; }
  .nav.has-pill a { position: relative; z-index: 1; transition: color .25s ease, background-color .2s ease; }
  .nav.has-pill a[aria-current="page"] { background: transparent; color: #1d1300; }
  .nav-pill { display: block; position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; width: 0; border-radius: 11px; background: var(--gold); box-shadow: 0 2px 10px rgba(255, 197, 49, .35); transition: transform .38s cubic-bezier(.3, .8, .25, 1), width .38s cubic-bezier(.3, .8, .25, 1), opacity .2s; pointer-events: none; }
  .nav.pill-instant .nav-pill { transition: none; }
}
/* เนื้อหาหน้าใหม่ค่อย ๆ จางเข้าและลอยขึ้น */
#app.page-in { animation: pageIn .34s cubic-bezier(.25, .8, .3, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #app.page-in { animation: none; }
  .nav-pill { transition: none; }
}

/* ---------- animation เปลี่ยนหมวดในร้านค้า ---------- */
/* ปุ่มหมวด: สีเปลี่ยนนุ่ม ๆ และปุ่มที่เลือกยุบลงเหมือนถูกกด */
.tabs a { transition: background-color .22s ease, color .22s ease, transform .16s ease, box-shadow .16s ease; }
.tabs a:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--black); }
.tabs a[aria-current="page"] { transform: translateY(2px); box-shadow: 0 2px 0 var(--black); }
/* สินค้าชุดเก่าจางออก แล้วชุดใหม่ลอยขึ้นทีละใบ */
.store-body .cards-out { opacity: 0; transform: translateY(6px); transition: opacity .13s ease, transform .13s ease; }
.card-in { animation: cardIn .42s cubic-bezier(.25, .8, .3, 1) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.store-title p { transition: opacity .2s; }
@media (prefers-reduced-motion: reduce) {
  .card-in { animation: none; }
  .store-body .cards-out { transition: none; }
}

/* ---------- รางวัลประจำ (รายวัน / สัปดาห์ / เดือน) ---------- */
.rsec-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 1.4rem; margin: 6px 0 26px; }
.rsec-title .px, .rsec-title img { width: 30px; height: 30px; object-fit: contain; }
.rsec-title .muted { font-size: .9rem; font-weight: 500; }
.period-sec { margin-bottom: 52px; }
.period-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; max-width: 900px; }
.pcard .rneed { color: #fff; background: #ff8a1f; }
.pcard:nth-child(2) .rneed { background: #7c3aed; }
.pcard:nth-child(3) .rneed { background: #e11d48; }
.pcard .pnext { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; font-size: .82rem; color: #6b5a3a; }
.pcard .pnext .ic { width: 15px; height: 15px; }
.pcard .pnext b { color: #1b1305; font-variant-numeric: tabular-nums; }
.pcard.ready { animation: pReady 2.4s ease-in-out infinite; }
@keyframes pReady { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@media (max-width: 760px) { .period-grid { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; } }
@media (prefers-reduced-motion: reduce) { .pcard.ready { animation: none; } }

/* ---------- โหมดปิดปรับปรุง ---------- */
body.maint-mode .top, body.maint-mode .site-foot, body.maint-mode .rail, body.maint-mode #announce { display: none !important; }
.maint { position: relative; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; text-align: center; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #2a2112 0%, #12151c 60%, #0b0d12 100%); }
.maint-bg { position: absolute; inset: 0; }
.maint-bg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.maint::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,12,17,.55), rgba(10,12,17,.75) 60%, rgba(10,12,17,.92)); }
.maint-inner { position: relative; z-index: 1; padding: 60px 22px; display: flex; flex-direction: column; align-items: center; max-width: 760px; }
.maint-logo { width: min(440px, 80vw); height: auto; filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); animation: maintFloat 4s ease-in-out infinite; }
.maint-logo-text { display: flex; align-items: center; gap: 14px; font-size: 2.6rem; font-weight: 800; color: var(--gold); text-shadow: 0 4px 0 #000; }
.maint-logo-text .px, .maint-logo-text img { width: 72px; height: 72px; }
.maint-badge { margin-top: 26px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 99px; background: #ff8a1f; color: #1d1300; border: 3px solid var(--black); box-shadow: 0 4px 0 var(--black); font-weight: 800; letter-spacing: .08em; font-size: .9rem; }
.maint-badge .gear { display: inline-block; animation: maintSpin 3s linear infinite; }
.maint h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.15; margin: 22px 0 0; color: #fff; text-shadow: 0 4px 0 #000, 0 8px 24px rgba(0,0,0,.6); }
.maint-msg { font-size: 1.15rem; line-height: 1.7; color: #e9e3d6; margin: 16px 0 0; max-width: 46ch; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
.maint-eta { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; padding: 12px 20px; border-radius: 14px; background: rgba(13,16,22,.75); border: 2px solid var(--line); font-size: 1.05rem; }
.maint-eta .ic { width: 20px; height: 20px; color: var(--gold); }
.maint-eta b { color: var(--gold); font-variant-numeric: tabular-nums; font-size: 1.2rem; }
.maint-eta span { width: 100%; color: var(--muted); font-size: .85rem; }
.maint .chips { margin-top: 28px; }
@keyframes maintFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes maintSpin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .maint-logo, .maint-badge .gear { animation: none; } }
.maint-bar { position: sticky; top: 0; z-index: 60; background: #ff8a1f; color: #1d1300; text-align: center; font-weight: 700; padding: 8px 16px; font-size: .9rem; border-bottom: 3px solid var(--black); }
.maint-bar a { color: #1d1300; margin-left: 8px; }
.maint-panel.on { border-color: #ff8a1f; box-shadow: 0 0 0 2px rgba(255, 138, 31, .35); }
.maint-exit { position: fixed; right: 18px; bottom: 18px; z-index: 70; }

/* ปุ่มตะกร้ามุมขวาบน ข้างชื่อผู้เล่น */
.top-cart { position: relative; }
.top-cart .ic { width: 20px; height: 20px; }
.top-cart .badge { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 99px; background: var(--berry); color: #fff; font-size: .78rem; font-weight: 800; border: 2px solid var(--black); line-height: 1; }
.top-cart .badge.pop { animation: badgePop .35s cubic-bezier(.3, .8, .3, 1.6); }
@keyframes badgePop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
@media (max-width: 640px) { .top-cart .label { display: none; } }

/* ---------- ของลอยลงตะกร้า ---------- */
.fly-ghost { position: fixed; z-index: 200; pointer-events: none; object-fit: contain; margin: 0; filter: drop-shadow(0 8px 10px rgba(0,0,0,.4)); will-change: transform, opacity; }
svg.fly-ghost { image-rendering: pixelated; }
.cart-bump { animation: cartBump .5s cubic-bezier(.3, .8, .3, 1.5); }
@keyframes cartBump { 0% { transform: scale(1); } 30% { transform: scale(1.22) rotate(-6deg); } 60% { transform: scale(.94) rotate(4deg); } 100% { transform: scale(1); } }
