/* Halaman pembeli: tema gelap, aksen emas. Tanpa font atau skrip luar (CSP). */
:root {
  --bg: #0b1220; --panel: #121c30; --panel2: #162138; --line: #243352;
  --text: #e8eef9; --muted: #9db0cc; --gold: #fbbf24; --green: #34d399; --red: #f87171; --blue: #60a5fa;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1100px 480px at 50% -220px, #1a2c55 0, transparent 70%), var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; }
main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px 18px 40px; flex: 1; }
h1, h2 { line-height: 1.2; margin: 0; }

.top { max-width: 1120px; width: 100%; margin: 0 auto; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; text-decoration: none; }
.gem {
  width: 22px; height: 22px; display: inline-block; background: linear-gradient(135deg, #fde68a, var(--gold));
  clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%);
}
.foot { max-width: 1120px; width: 100%; margin: 0 auto; padding: 22px 18px 34px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.muted { color: var(--muted); }

.hero { padding: 26px 0 10px; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); }
.hero p { color: var(--muted); max-width: 60ch; margin: 10px 0 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 14px 0 22px; }
.filters label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.filters select, .filters button {
  font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; min-width: 130px;
}
.filters button { cursor: pointer; background: var(--gold); color: #1a1405; border-color: var(--gold); font-weight: 600; min-width: 0; }

.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: #3a4f7d; }
.card.horde { border-top: 3px solid #ef4444; }
.card.alliance { border-top: 3px solid var(--blue); }
.cover { position: relative; display: block; aspect-ratio: 16 / 10; background: #0a1020; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { display: grid; place-items: center; height: 100%; min-height: 120px; color: var(--muted); font-size: 14px; background: repeating-linear-gradient(45deg, #0e1729, #0e1729 10px, #101b30 10px, #101b30 20px); }
.noimg.big { aspect-ratio: 16 / 10; border-radius: var(--radius); border: 1px solid var(--line); }
.ribbon { position: absolute; top: 10px; right: 10px; background: #f59e0b; color: #1a1405; font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.info { padding: 14px 16px 16px; display: grid; gap: 6px; }
.code { margin: 0; color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.card h2 { font-size: 20px; }
.card h2 a { text-decoration: none; }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 6px 0 2px; }
.chips li { font-size: 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.chips b { color: var(--green); font-weight: 600; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 8px; }
.gold { color: var(--gold); font-weight: 600; }
.price { font-weight: 700; }

.empty { text-align: center; padding: 60px 10px; color: var(--muted); }
.empty h2 { color: var(--text); margin-bottom: 8px; }

.btn { display: inline-block; text-decoration: none; font-weight: 700; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2); }
.btn.wa { background: #22c55e; border-color: #22c55e; color: #052e14; }
.btn.wa:hover { background: #4ade80; }

/* detail */
.crumb { margin: 6px 0 14px; }
.crumb a { color: var(--muted); text-decoration: none; }
.detail { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
.gallery .main { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #0a1020; }
.gallery .main img { width: 100%; display: block; max-height: 560px; object-fit: contain; background: #0a1020; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { width: 84px; height: 60px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; opacity: .75; }
.thumb.on { border-color: var(--gold); opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; align-self: start; display: grid; gap: 6px; }
.summary h1 { font-size: 28px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: rgba(52, 211, 153, .15); color: var(--green); border: 1px solid rgba(52, 211, 153, .4); }
.badge.dipesan { background: rgba(245, 158, 11, .15); color: #fbbf24; border-color: rgba(245, 158, 11, .4); }
.price.big { font-size: 30px; margin: 8px 0 0; color: var(--gold); }
.summary .btn { margin-top: 12px; text-align: center; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel.wide { grid-column: 1 / -1; }
.panel h2 { font-size: 17px; margin-bottom: 12px; }
dl { margin: 0; display: grid; gap: 0; }
dl > div { display: flex; justify-content: space-between; gap: 18px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
dl > div:last-child { border-bottom: 0; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.profs { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.profs li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.profs meter { grid-column: 1 / -1; width: 100%; height: 10px; appearance: none; border: 0; background: var(--line); border-radius: 6px; }
.profs meter::-webkit-meter-bar { background: var(--line); border: 0; height: 10px; border-radius: 6px; }
.profs meter::-webkit-meter-optimum-value, .profs meter::-webkit-meter-suboptimum-value, .profs meter::-webkit-meter-even-less-good-value { background: linear-gradient(90deg, #34d399, #86efac); border-radius: 6px; }
.profs meter::-moz-meter-bar { background: #34d399; border-radius: 6px; }
.pv { color: var(--muted); font-variant-numeric: tabular-nums; }

body.plain main { display: grid; place-items: center; text-align: center; min-height: 60vh; }
.landing { display: grid; place-items: center; min-height: 100vh; font-family: system-ui, sans-serif; }

/* pemilih bahasa: <details> murni HTML, jadi tetap jalan tanpa JavaScript */
.langs { position: relative; }
.langs summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel2); color: var(--muted); font-size: 14px;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover, .langs details[open] summary { color: var(--text); border-color: #3a4f7d; }
.langs summary:focus-visible, .langs a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.langs ul {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-width: 200px; max-height: 80vh;
  overflow-y: auto; box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}
.langs a { display: block; padding: 7px 12px; border-radius: 8px; text-decoration: none; }
.langs a:hover { background: var(--panel2); }
.langs a[aria-current="true"] { color: var(--gold); font-weight: 600; }

.usd { font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.price.big .usd { font-size: 15px; }
html:lang(th) body { line-height: 1.75; }

@media (max-width: 820px) {
  .detail { grid-template-columns: 1fr; }
  .summary { order: -1; }
}
