:root {
  --bg: #12151d; --panel: #1b1f2a; --panel2: #242a38; --text: #eef1f7; --muted: #8d96aa;
  --accent: #ffcb05; --accent2: #3d7dca; --good: #4cc38a; --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: var(--panel); border-bottom: 1px solid #2c3343; }
.top h1 { margin: 0; font-size: 1.25rem; letter-spacing: .3px; }
.game-pill { background: var(--accent); color: #222; font-weight: 700; font-size: .75rem; padding: 4px 10px; border-radius: 99px; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.view { display: none; } .view.active { display: block; }
.muted { color: var(--muted); }
input, select, button { font: inherit; color: var(--text); }
input, select { background: var(--panel2); border: 1px solid #333b4e; border-radius: 10px; padding: 10px 12px; }
button { background: var(--accent2); border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer; }
button.secondary { background: var(--panel2); border: 1px solid #333b4e; }
button:disabled { opacity: .5; }
.search { display: flex; gap: 8px; } .search input { flex: 1; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; } .toolbar input { flex: 1; min-width: 160px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.card { background: var(--panel); border-radius: var(--radius); padding: 8px; cursor: pointer; position: relative;
  border: 1px solid transparent; transition: border-color .15s; }
.card:hover { border-color: #3a4357; }
.card img { width: 100%; aspect-ratio: 63/88; object-fit: cover; border-radius: 8px; background: var(--panel2); display: block; }
.card .name { font-weight: 600; font-size: .9rem; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { font-size: .75rem; color: var(--muted); }
.card .price { font-size: .85rem; color: var(--accent); font-weight: 700; }
.badge { position: absolute; top: 12px; right: 12px; background: var(--good); color: #062; font-weight: 800;
  font-size: .8rem; border-radius: 99px; padding: 2px 8px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--panel); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-size: 1.3rem; } .stat span { font-size: .75rem; color: var(--muted); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--panel); border-top: 1px solid #2c3343;
  padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabs button { flex: 1; background: none; border-radius: 0; padding: 10px 0 8px; font-size: 1.2rem; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabs button span { font-size: .7rem; } .tabs button.active { color: var(--accent); }
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: 760px; width: calc(100% - 24px); }
dialog::backdrop { background: rgba(0,0,0,.65); }
.dlg { background: var(--panel); border-radius: 18px; padding: 16px; position: relative; max-height: 90vh; overflow: auto; }
.close { position: absolute; top: 8px; right: 8px; background: var(--panel2); width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 1.3rem; }
.detail { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 16px; }
.detail img { width: 100%; border-radius: 12px; }
@media (max-width: 560px) { .detail { grid-template-columns: 1fr; } .detail img { max-width: 260px; margin: 0 auto; display: block; } }
.detail h2 { margin: 0 0 4px; }
.prices { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .9rem; }
.prices td { padding: 6px 4px; border-bottom: 1px solid #2c3343; } .prices td:last-child { text-align: right; font-weight: 700; }
.variant-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #2c3343; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 36px; height: 36px; padding: 0; font-size: 1.2rem; }
.stepper output { min-width: 24px; text-align: center; font-weight: 700; }
.filebtn { display: inline-block; background: var(--panel2); border: 1px solid #333b4e; border-radius: 10px; padding: 10px 14px; font-weight: 600; cursor: pointer; margin-top: 8px; }
a { color: var(--accent2); }
h2 { font-size: 1.1rem; }
