/* MyArena Shop - MyArena design system (docs/DESIGN-SYSTEM.md), light only like id/checkout.
   Header + shop tabs + section chips + product grid.
   Deliberately single-theme light: the MyArena brand has no dark variant, so every color is set explicitly. */
:root {
  --color-dark: #16181D;          --color-dark-rgb: 22 24 29;
  --color-accent: #E30613;        --color-accent-rgb: 227 6 19;
  --color-accent-light: #FF4A54;
  --color-accent-dark: #C10011;
  --color-bg: #EDEFF2;
  --color-surface: #ffffff;
  --color-surface-2: #f1f2f4;
  --color-text: #16181D;
  --color-neutral: #666A72;
  --color-dim-2: #A6AAB2;
  --color-border: rgb(var(--color-dark-rgb) / .12);
  --color-good: #16a34a;
  --ok-bg: #e7f6ec; --ok-fg: #15803d;
  --warn-bg: #fff7e6; --warn-fg: #92600a;
  --grad-btn: linear-gradient(180deg, var(--color-accent-light) 0%, var(--color-accent) 50%, var(--color-accent-dark) 100%);
  --grad-soft: linear-gradient(135deg, rgb(var(--color-accent-rgb) / .10), rgb(var(--color-accent-rgb) / .04));
  --shadow-card: 0 4px 20px -8px rgb(var(--color-accent-rgb) / .14);
  --radius-card: 14px;
  --radius-control: 11px;
  --font: 'Prompt', 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { background: var(--color-bg); color: var(--color-text); }
body { font-family: var(--font); line-height: 1.5; font-size: 15px; min-height: 100%; display: flex; flex-direction: column; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid rgb(var(--color-accent-rgb) / .35); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 16px; }

/* header */
.site-header { background: var(--color-surface); box-shadow: 0 2px 10px rgba(0,0,0,.06); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 22px; letter-spacing: -.01em; color: var(--color-dark); text-decoration: none; }
.brand b { color: var(--color-accent); }
.brand small { font-size: 12px; font-weight: 600; color: var(--color-neutral); letter-spacing: .04em; text-transform: uppercase; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang { display: flex; background: var(--color-surface-2); border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: transparent; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--color-neutral); cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--color-surface); color: var(--color-accent); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.user-pill { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--color-text); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad-btn); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.icon-btn { position: relative; border: 0; background: var(--color-surface-2); width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; color: var(--color-text); cursor: pointer; }
.icon-btn:hover { background: var(--grad-soft); color: var(--color-accent); }
.icon-btn svg { width: 20px; height: 20px; }
.count { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--color-accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.count[hidden] { display: none !important; }

/* game tabs */
.game-tabs { background: var(--color-surface); border-top: 1px solid var(--color-border); }
.game-tabs .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.game-tab { border: 0; background: transparent; padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--color-neutral); cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; }
.game-tab[aria-current="page"] { color: var(--color-accent); border-bottom-color: var(--color-accent); }

main { flex: 1; padding-block: 20px 40px; }

/* banner */
.banner { border-radius: var(--radius-card); overflow: hidden; position: relative; color: #fff; background:
  radial-gradient(120% 140% at 85% 20%, rgb(var(--color-accent-rgb) / .55), transparent 55%),
  linear-gradient(120deg, #101216 0%, #1d2027 60%, #2a0b0e 100%);
  padding: 26px 24px; display: grid; gap: 6px; }
.banner .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #ffb3b8; }
.banner h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); font-weight: 800; line-height: 1.2; text-wrap: balance; max-width: 22ch; }
.banner p { margin: 0; color: #d6d8dd; font-size: 14px; max-width: 52ch; }
.banner .ends { margin-top: 8px; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.1); border-radius: 999px; padding: 5px 12px; width: fit-content; font-variant-numeric: tabular-nums; }

.page-title { font-size: 1.5rem; font-weight: 800; color: var(--color-accent); margin: 26px 0 4px; }
.page-title::after { content: ""; display: block; width: 56px; height: 3px; background: var(--color-accent); border-radius: 3px; margin-top: 6px; }
.page-subtitle { margin: 0 0 14px; color: var(--color-neutral); font-size: 14px; }

/* category chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid transparent; background: transparent; color: var(--color-neutral); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip:hover { color: var(--color-accent); }
.chip[aria-current="true"] { background: var(--color-surface); color: var(--color-accent); border-color: rgb(var(--color-accent-rgb) / .35); font-weight: 600; box-shadow: 0 1px 4px rgba(22,24,29,.06); }

/* product grid - like a web store shelf: 5 small cards per row on desktop, the picture sits
   inside the card with white space around it (not edge to edge), name, small pill, big price. */
.grid { margin-top: 22px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); }
@media (max-width: 600px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; transition: box-shadow .15s ease, border-color .15s ease; }
.card:hover { border-color: rgb(var(--color-accent-rgb) / .35); box-shadow: 0 8px 22px -14px rgb(var(--color-accent-rgb) / .45); }
.thumb { width: 84%; margin: 4px auto 0; aspect-ratio: 1 / 1; position: relative; overflow: hidden; border-radius: 4px; background: var(--color-surface-2); }
.thumb canvas { width: 100%; height: 100%; display: block; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tags { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--color-dark); }
.tag.hot { background: var(--color-accent); color: #fff; }
.tag.internal { background: var(--warn-bg); color: var(--warn-fg); }
.card-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 0 2px; }
.card-body h3 { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stock { font-size: 12px; font-weight: 600; color: var(--warn-fg); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills:empty { display: none; }
.pill { font-size: 12px; font-weight: 500; padding: 1px 7px; border-radius: 4px; white-space: nowrap; border: 1px solid; }
.pill-sale { border-color: rgb(var(--color-accent-rgb) / .55); color: var(--color-accent); background: rgb(var(--color-accent-rgb) / .04); }
.pill-off { border-color: var(--color-border); color: var(--color-neutral); background: var(--color-surface-2); }
.price { margin-top: auto; font-size: 21px; font-weight: 700; color: var(--color-text); font-variant-numeric: tabular-nums; }
.price small { font-size: 11px; font-weight: 700; margin-right: 4px; color: var(--color-text); }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* product page */
.back-link { display: inline-block; margin-top: 22px; font-size: 14px; font-weight: 500; color: var(--color-neutral); text-decoration: none; }
.back-link:hover { color: var(--color-accent); }
.product-detail { margin-top: 16px; display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 820px) { .product-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.detail-picture { border-radius: var(--radius-card); overflow: hidden; aspect-ratio: 1 / 1; background: var(--color-surface); box-shadow: 0 6px 18px -10px rgba(22,24,29,.18); }
.detail-picture img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-panel { background: var(--color-surface); border-radius: var(--radius-card); box-shadow: var(--shadow-card); border: 1px solid var(--color-border); padding: 26px 24px; }
.detail-info { display: grid; gap: 16px; }
.tags-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.tags-inline:empty { display: none; }
.detail-name { margin: 0; font-size: 1.4rem; font-weight: 700; line-height: 1.35; text-wrap: balance; }
.detail-desc { margin: 0; color: var(--color-neutral); font-size: 15px; }
.detail-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.detail-price .price { font-size: 30px; font-weight: 800; }
.detail-price .was { font-size: 14px; color: var(--color-neutral); }
.detail-notes { margin: 4px 0 0; padding-left: 18px; color: var(--color-neutral); font-size: 13px; display: grid; gap: 6px; }
.detail-notes a { color: var(--color-accent); }
.btn { border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: 14px; padding: 8px 16px; cursor: pointer; min-height: 40px; }
.btn-brand { background: var(--grad-btn); color: #fff; box-shadow: 0 6px 16px -6px rgb(var(--color-accent-rgb) / .6); }
.btn-brand:hover { transform: translateY(-1px); }
.btn-brand:disabled { background: #f1b3b8; box-shadow: none; transform: none; cursor: not-allowed; }
.btn-secondary { background: var(--color-surface-2); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--grad-soft); color: var(--color-accent); }
.btn-block { width: 100%; }
@media (prefers-reduced-motion: reduce) { .btn-brand:hover { transform: none; } * { transition: none !important; } }

/* prizepool ranking */
.two-col { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 860px) { .two-col { grid-template-columns: minmax(0, 1fr) 320px; } }
.panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 18px; }
.panel h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.panel .hint { margin: 0 0 12px; font-size: 12px; color: var(--color-neutral); }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.rank .no { width: 28px; height: 28px; border-radius: 8px; background: var(--color-surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.rank li:nth-child(-n+3) .no { background: var(--grad-btn); color: #fff; }
.rank .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.rank .me { color: var(--color-accent); font-weight: 700; }

/* history */
.history { display: grid; gap: 10px; }
.order { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); padding: 14px 16px; display: grid; gap: 4px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.order .title { font-weight: 600; font-size: 15px; }
.order .sub { font-size: 12px; color: var(--color-neutral); font-variant-numeric: tabular-nums; }
.order .right { text-align: right; display: grid; gap: 4px; justify-items: end; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.wait { background: var(--warn-bg); color: var(--warn-fg); }
.badge.off { background: var(--color-surface-2); color: var(--color-neutral); }
.badge.legacy { background: var(--color-surface-2); color: var(--color-neutral); }
.info-note { font-size: 13px; color: var(--color-neutral); background: var(--color-surface); border: 1px dashed var(--color-border); border-radius: 12px; padding: 10px 14px; margin-top: 12px; }

/* cart drawer */
.scrim { position: fixed; inset: 0; background: rgba(15,17,21,.45); z-index: 40; }
.drawer { position: fixed; z-index: 41; background: var(--color-surface); display: flex; flex-direction: column;
  right: 0; top: 0; bottom: 0; width: min(420px, 100%); box-shadow: -10px 0 30px rgba(0,0,0,.18);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
@media (max-width: 600px) { .drawer { top: auto; height: 86%; width: 100%; border-radius: 18px 18px 0 0; } }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--color-border); }
.drawer header h2 { margin: 0; font-size: 18px; font-weight: 700; }
.drawer .lines { flex: 1; overflow-y: auto; padding: 8px 18px; display: grid; align-content: start; gap: 10px; }
.line { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.line canvas { width: 52px; height: 52px; border-radius: 10px; }
.line .name { font-size: 14px; font-weight: 600; line-height: 1.35; }
.line .unit { font-size: 12px; color: var(--color-neutral); font-variant-numeric: tabular-nums; }
.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--color-surface-2); border-radius: 999px; padding: 2px; margin-top: 4px; }
.qty button { border: 0; background: var(--color-surface); width: 26px; height: 26px; border-radius: 50%; font-weight: 700; cursor: pointer; color: var(--color-text); }
.qty span { min-width: 22px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.line .sum { font-weight: 700; font-variant-numeric: tabular-nums; }
.drawer footer { padding: 16px 18px; border-top: 1px solid var(--color-border); display: grid; gap: 12px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.total strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.paynote { font-size: 12px; color: var(--color-neutral); display: flex; gap: 8px; align-items: flex-start; }
.paynote svg { flex: none; width: 16px; height: 16px; color: var(--color-good); margin-top: 2px; }
.empty { text-align: center; color: var(--color-neutral); padding: 40px 10px; font-size: 14px; }

/* handoff screen */
.handoff { display: grid; gap: 14px; padding: 18px; }
.step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14px; }
.step i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: var(--color-surface-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.step.done i { background: var(--ok-bg); color: var(--ok-fg); }
.step.now i { background: var(--grad-btn); color: #fff; }
.step small { display: block; color: var(--color-neutral); font-size: 12px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--color-dark); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.25); }

.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); font-size: 12px; color: var(--color-neutral); }
.site-footer .wrap { padding-block: 16px; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }
.site-footer a { color: var(--color-neutral); }
.mock-flag { font-size: 12px; font-weight: 600; color: var(--warn-fg); background: var(--warn-bg); border-radius: 999px; padding: 3px 10px; }

/* links styled as tabs/chips/buttons */
.game-tab, .chip { text-decoration: none; display: inline-block; }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.site-header form { margin: 0; }
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; font-size: 14px; }
.alert-success { background: var(--ok-bg); color: var(--ok-fg); }
.alert-danger { background: #fdecee; color: #b4121c; }
.empty-state { text-align: center; padding: 36px 18px; margin-top: 14px; }
.price s { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--color-dim-2); }
.card-body h3 { font-size: 13.5px; font-weight: 400; line-height: 1.45; }
.detail-price s.was { font-size: 15px; color: var(--color-dim-2); }
.detail-name { font-size: 1.2rem; font-weight: 600; }

/* 4 per row on desktop (owner: 5 is too many), 3 on tablet, 2 on phones */
.grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* discounted products stand out: red price, visible struck list price, solid red badge on the picture */
.price.is-sale { color: var(--color-accent); }
.price s { font-size: 14px; color: var(--color-neutral); text-decoration-thickness: 1.5px; }
.tag.discount { background: var(--color-accent); color: #fff; font-size: 12px; padding: 3px 9px; }

/* smaller pictures on the shelf (owner: picture too big) */
.thumb { width: 66%; margin-top: 8px; }
.card { padding: 16px 16px 18px; gap: 12px; }

/* ===== Horizontal cards like the legacy shop (owner 2026-10-03: more room + more info) =====
   2 per row on desktop, 1 on phones: picture left, name / รายละเอียด / สถานะ / ราคา right, button. */
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 760px) { .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.card { display: grid; grid-template-columns: 40% minmax(0, 1fr); gap: 20px; padding: 18px; align-items: start; position: relative; }
@media (max-width: 420px) { .card { grid-template-columns: 38% minmax(0, 1fr); gap: 14px; padding: 14px; } }
.thumb { width: 100%; margin: 0; display: block; }
.card-body { gap: 10px; padding: 0; min-width: 0; }
.card-body h3 { font-size: 16px; font-weight: 600; line-height: 1.4; -webkit-line-clamp: 3; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-body h3 a:hover { color: var(--color-accent); }
.ribbons { position: absolute; top: 0; right: 0; display: flex; gap: 0; }
.ribbons:empty { display: none; }
.ribbons .tag { border-radius: 0 10px 0 10px; font-size: 11px; padding: 4px 10px; letter-spacing: .04em; }
.tag.new { background: #16a34a; color: #fff; }
.tag.discount { position: absolute; top: 6px; left: 6px; }
.facts { margin: 0; display: grid; gap: 4px; font-size: 13.5px; }
.facts > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; }
.facts dt { color: var(--color-neutral); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts dd.is-in { color: var(--color-good); font-weight: 500; }
.facts dd.is-out { color: var(--color-neutral); }
.price-line s { color: var(--color-neutral); margin-right: 6px; text-decoration-thickness: 1.5px; }
.price-line strong { font-size: 16px; font-weight: 700; }
.price-line strong.is-sale { color: var(--color-accent); }
.card .btn-block { margin-top: 6px; min-height: 40px; }
.btn-disabled { background: var(--color-surface-2); color: var(--color-neutral); cursor: not-allowed; }

/* ===== Horizontal cards like the legacy shop (owner 2026-10-03: more room + more info) =====
   2 per row on desktop, 1 on phones: picture left, name / รายละเอียด / สถานะ / ราคา right, button. */
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 760px) { .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.card { display: grid; grid-template-columns: 40% minmax(0, 1fr); gap: 20px; padding: 18px; align-items: start; position: relative; }
@media (max-width: 420px) { .card { grid-template-columns: 38% minmax(0, 1fr); gap: 14px; padding: 14px; } }
.thumb { width: 100%; margin: 0; display: block; }
.card-body { gap: 10px; padding: 0; min-width: 0; }
.card-body h3 { font-size: 16px; font-weight: 600; line-height: 1.4; -webkit-line-clamp: 3; padding-right: 44px; }
.card-body h3 a { color: inherit; text-decoration: none; }
.card-body h3 a:hover { color: var(--color-accent); }
.ribbons { position: absolute; top: 0; right: 0; display: flex; }
.ribbons:empty { display: none; }
.ribbons .tag { border-radius: 0 10px 0 10px; font-size: 11px; padding: 4px 10px; letter-spacing: .04em; }
.tag.new { background: #16a34a; color: #fff; }
.tag.discount { position: absolute; top: 6px; left: 6px; }
.facts { margin: 0; display: grid; gap: 4px; font-size: 13.5px; }
.facts > div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; }
.facts dt { color: var(--color-neutral); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts dd.is-in { color: var(--color-good); font-weight: 500; }
.facts dd.is-out { color: var(--color-neutral); }
.price-line s { color: var(--color-neutral); margin-right: 6px; text-decoration-thickness: 1.5px; }
.price-line strong { font-size: 16px; font-weight: 700; }
.price-line strong.is-sale { color: var(--color-accent); }
.card .btn-block { margin-top: 6px; min-height: 40px; }
.btn-disabled { background: var(--color-surface-2); color: var(--color-neutral); cursor: not-allowed; }

/* smaller picture; buy button pinned to the bottom so every card lines up (owner 2026-10-03) */
.card { grid-template-columns: 30% minmax(0, 1fr); align-items: stretch; }
@media (max-width: 420px) { .card { grid-template-columns: 32% minmax(0, 1fr); } }
.thumb { align-self: start; }
.card-body { display: flex; flex-direction: column; height: 100%; }
.card .btn-block { margin-top: auto; }
.card .facts { margin-bottom: 12px; }

/* 3 cards per row on desktop (owner 2026-10-05); tighter card so the info column still fits */
.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid { grid-template-columns: minmax(0, 1fr); gap: 14px; } }
.card { gap: 14px; padding: 14px; }
.card-body h3 { font-size: 15px; padding-right: 40px; }
.facts { font-size: 13px; }
.facts > div { grid-template-columns: 62px minmax(0, 1fr); gap: 6px; }

/* 3 per row: stack the card (picture on top, centred) so it doesn't leave an empty
   column under a small side picture (owner 2026-10-05 "ไม่ balance") */
.card { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px; }
@media (max-width: 420px) { .card { grid-template-columns: minmax(0, 1fr); } }
.thumb { width: 150px; max-width: 70%; margin: 0 auto; align-self: center; }
.card-body h3 { padding-right: 0; text-align: center; min-height: 2.8em; }
.card .facts { margin-bottom: 14px; }

/* orders (2026-10-07) */
.header-link { font-size: 14px; font-weight: 500; color: inherit; text-decoration: none; margin-right: 4px; }
.header-link:hover { color: var(--color-accent); }
.order-list { display: grid; gap: 10px; }
a.order { color: inherit; text-decoration: none; }
a.order:hover { border-color: var(--color-accent); }
.order-name { font-weight: 600; }
.order-meta { font-size: 13px; color: var(--color-neutral); }
.order-side { text-align: right; }
.order-price { font-weight: 700; }
.order-detail { max-width: 560px; margin-inline: auto; display: grid; gap: 14px; }
.order-status { justify-self: start; border-radius: 999px; padding: 4px 14px; font-size: 14px; font-weight: 600; background: var(--color-surface-2); }
.order-status.is-done { background: #dcfce7; color: #166534; }
.order-status.is-paid { background: #fef9c3; color: #854d0e; }
.order-status.is-pending { background: #e0f2fe; color: #075985; }
.order-note { margin: 0; font-size: 14px; line-height: 1.6; }
.order-detail .facts > div { grid-template-columns: 110px minmax(0, 1fr); }

/* ===== Shelf v2 (owner 2026-10-16: "ไม่สวย", "ดูโล่งแล้วไม่เต็ม") =====
   dark SF hero, solid category bar, 4 cards per row with the picture filling the top on a dark stage. */
.shop-hero { margin-top: 4px; border-radius: var(--radius-card); color: #fff; padding: 26px 28px; position: relative; overflow: hidden;
  background: radial-gradient(90% 160% at 100% 0%, rgb(var(--color-accent-rgb) / .6), transparent 60%), linear-gradient(120deg, #101216 0%, #1d2027 60%, #2a0b0e 100%); }
.shop-hero h1 { margin: 0; font-size: clamp(22px, 3.2vw, 30px); font-weight: 800; line-height: 1.25; }
.shop-hero p { margin: 6px 0 0; color: #d6d8dd; font-size: 14px; max-width: 60ch; }

.shelf-bar { position: sticky; top: 64px; z-index: 10; margin-top: 14px; padding: 6px; display: flex; align-items: center; gap: 8px; background: var(--color-surface); border-radius: 999px; box-shadow: 0 4px 16px -8px rgb(var(--color-dark-rgb) / .25); }
.chips { flex: 1 1 auto; min-width: 0; padding: 0; gap: 4px; }
.shelf-search { flex: 0 1 230px; display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 12px; height: 38px; border-radius: 999px; background: var(--color-surface-2); color: var(--color-neutral); }
.shelf-search:focus-within { box-shadow: 0 0 0 2px rgb(var(--color-accent-rgb) / .35); background: var(--color-surface); }
.shelf-search svg { width: 17px; height: 17px; flex: none; }
.shelf-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--color-text); }
.search-head { margin: 16px 2px 0; font-size: 14px; color: var(--color-neutral); }
.search-head a { margin-left: 8px; color: var(--color-accent); font-weight: 600; }
@media (max-width: 760px) { .shelf-bar { flex-wrap: wrap; border-radius: 14px; } .chips { flex-basis: 100%; } .shelf-search { flex-basis: 100%; } }
.chip { padding: 9px 18px; border: 0; color: var(--color-text); font-weight: 500; white-space: nowrap; }
.chip:hover { background: var(--color-surface-2); color: var(--color-accent); }
.chip[aria-current="true"] { background: var(--grad-btn); color: #fff; border: 0; font-weight: 600; box-shadow: 0 6px 14px -6px rgb(var(--color-accent-rgb) / .7); }
@media (max-width: 600px) { .chip { padding: 8px 14px; font-size: 13.5px; } }

.grid { margin-top: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.grid .card { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; border-radius: var(--radius-card); border: 1px solid var(--color-border); }
.grid .card:hover { transform: translateY(-2px); }
.grid .thumb { width: 100%; max-width: none; margin: 0; aspect-ratio: 1 / 1; border-radius: 0; display: grid; place-items: center;
  background: radial-gradient(70% 70% at 50% 45%, #3a3e48 0%, #1b1d23 70%, #121318 100%); }
.grid .thumb img { position: static; width: 78%; height: 78%; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0,0,0,.45)); transition: transform .2s ease; }
.grid .card:hover .thumb img { transform: scale(1.05); }
.grid .tag.discount { position: absolute; top: 10px; left: 10px; }
.grid .ribbons { position: absolute; top: 10px; right: 10px; }
.grid .ribbons .tag { border-radius: 999px; padding: 3px 10px; }
.grid .card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; height: auto; }
.grid .card-body h3 { margin: 0; padding: 0; min-height: 0; text-align: left; font-size: 14.5px; font-weight: 600; line-height: 1.4; -webkit-line-clamp: 2; }
.card-detail { margin: 0; font-size: 12.5px; color: var(--color-neutral); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-stock { font-size: 12px; font-weight: 600; }
.card-stock.is-in { color: var(--color-good); }
.card-stock.is-out { color: var(--color-neutral); }
.card-foot { margin-top: auto; padding-top: 8px; display: grid; gap: 10px; }
.card-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.card-price s { font-size: 13px; color: var(--color-neutral); text-decoration-thickness: 1.5px; }
.card-price strong { font-size: 20px; font-weight: 800; }
.card-price strong.is-sale { color: var(--color-accent); }
.card-price small { font-size: 12px; font-weight: 600; }
.grid .card .btn-block { margin: 0; min-height: 40px; }
@media (prefers-reduced-motion: reduce) { .grid .card:hover, .grid .card:hover .thumb img { transform: none; } }
.card [hidden] { display: none !important; }
/* amount choice on a card that groups the same box / item sold in several amounts (owner 2026-10-16) */
.variants { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.variant { display: grid; justify-items: center; gap: 0; min-width: 64px; padding: 5px 9px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface-2); color: var(--color-text); text-decoration: none; line-height: 1.25; }
.variant b { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.variant small { font-size: 11px; color: var(--color-neutral); white-space: nowrap; }
.variant:hover { border-color: rgb(var(--color-accent-rgb) / .45); }
.variant[aria-current="true"] { border-color: var(--color-accent); background: rgb(var(--color-accent-rgb) / .07); color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.variant[aria-current="true"] small { color: var(--color-accent); }
.btn-locked { background: var(--color-surface-2); color: var(--color-neutral); border: 1px dashed rgb(var(--color-dark-rgb) / .25); cursor: default; font-weight: 500; }

/* MyArena CashShop logo in the header (owner 2026-10-28) */
.brand { align-items: center; }
.brand img { display: block; height: 48px; width: auto; }
@media (max-width: 480px) { .brand img { height: 40px; } }
