:root {
  --bg: #16171b;
  --bg2: #1f2127;
  --panel: #23262d;
  --line: #34373f;
  --text: #e9e9ec;
  --muted: #9a9ca6;
  --accent: #ff8a1f;
  --accent2: #ffc23d;
  --pump: #3ddc84;
  --skip: #ff4d5e;
  --radius: 6px;
  --shadow: 0 2px 0 #000, 0 8px 24px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  background-image: radial-gradient(circle at 20% -10%, #2a2016 0, transparent 45%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.012) 3px 4px);
  min-height: 100vh;
}
a { color: var(--accent2); }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }

/* ticker */
.ticker { background: #000; color: var(--accent2); overflow: hidden; white-space: nowrap; font: 12px Bungee, sans-serif; letter-spacing: .05em; border-bottom: 2px solid var(--accent); }
.ticker-track { display: inline-block; padding: 6px 0; animation: tick 40s linear infinite; }
.ticker-track span { margin: 0 2rem; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem;
  padding: 10px 16px; background: linear-gradient(#2b2e36, #1d1f25); border-bottom: 3px solid #000;
}
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.logo-mark { background: var(--accent); color: #000; font: 16px Bungee; padding: 4px 8px; border-radius: 4px; box-shadow: 2px 2px 0 #000; transform: rotate(-4deg); }
.logo-text { font: 20px Bungee; letter-spacing: .02em; }
.logo-text b { color: var(--accent); font-weight: 400; }
.nav { display: flex; gap: 1rem; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }
.nav a:hover { color: var(--accent2); }
.cart-btn { display: flex; gap: .4rem; align-items: center; background: var(--accent); color: #000; border: 0; border-radius: var(--radius); padding: 8px 12px; font: 14px Bungee; box-shadow: 2px 2px 0 #000; }
.badge { background: #000; color: var(--accent2); border-radius: 99px; padding: 0 7px; font: 12px Inter; font-weight: 800; }

main { max-width: 1240px; margin: 0 auto; padding: 16px; }
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; margin-top: 16px; }
.side { display: flex; flex-direction: column; gap: 16px; }

/* panels */
.panel { background: var(--panel); border: 2px solid #000; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head {
  margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font: 15px Bungee; letter-spacing: .04em; padding: 8px 12px; color: #000;
  background: linear-gradient(var(--accent2), var(--accent)); border-bottom: 2px solid #000;
}
.panel-head .hint { font: 600 11px Inter; text-transform: uppercase; opacity: .7; }
.pad { padding: 12px 14px; }
.small { font-size: 12px; color: var(--muted); }
.center { text-align: center; }

/* featured */
.featured-body { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; padding: 16px; align-items: center; }
.featured-body img { border-radius: var(--radius); background: #fff; aspect-ratio: 1; object-fit: cover; width: 100%; border: 2px solid #000; }
.featured-body h3 { font: 26px/1.15 Bungee; margin: 0 0 .5rem; }
.featured-body p { color: var(--muted); }
.price { font: 22px Bungee; color: var(--accent2); }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.chip[aria-selected="true"] { background: var(--accent); color: #000; border-color: #000; }
.sort { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.sort select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }

/* grid cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 12px; }
.card { background: var(--bg2); border: 2px solid #000; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 0 var(--accent); }
.card-img { position: relative; background: #fff; aspect-ratio: 1; border: 0; padding: 0; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.tag { position: absolute; top: 6px; left: 6px; background: #000; color: var(--accent2); font: 10px Bungee; padding: 2px 6px; border-radius: 3px; }
.card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 800; font-size: 14px; line-height: 1.25; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.card .price { font-size: 16px; }
.votes { display: flex; gap: 4px; }
.vote { border: 2px solid #000; border-radius: 4px; padding: 2px 7px; font: 11px Bungee; color: #000; }
.vote.pump { background: var(--pump); }
.vote.skip { background: var(--skip); }
.vote:disabled { opacity: .5; cursor: default; }
.meter { height: 6px; background: var(--skip); border-radius: 3px; overflow: hidden; border: 1px solid #000; }
.meter i { display: block; height: 100%; background: var(--pump); }

/* top list */
.toplist { list-style: none; margin: 0; padding: 6px 0; counter-reset: n; }
.toplist li { counter-increment: n; display: flex; gap: 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.toplist li::before { content: counter(n); font: 18px Bungee; color: var(--accent); width: 1.2em; }
.toplist img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; background: #fff; border: 1px solid #000; }
.toplist .t { font-size: 13px; font-weight: 600; line-height: 1.2; }

/* buttons */
.btn { background: var(--accent); color: #000; border: 2px solid #000; border-radius: var(--radius); padding: 10px 16px; font: 14px Bungee; box-shadow: 3px 3px 0 #000; transition: transform .08s; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.btn.ghost { background: var(--panel); color: var(--text); }
.btn.big { width: 100%; font-size: 18px; padding: 14px; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

/* modal */
.modal { border: 2px solid #000; border-radius: var(--radius); background: var(--panel); color: var(--text); padding: 0; width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0,0,0,.7); }
.x { background: none; border: 0; color: inherit; font-size: 18px; padding: 4px 8px; }
.modal > form { position: absolute; right: 6px; top: 6px; z-index: 2; }
.modal > form .x { background: #000; color: #fff; border-radius: 99px; }
.pm { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; padding: 20px; }
.pm-main { background: #fff; border-radius: var(--radius); border: 2px solid #000; aspect-ratio: 1; object-fit: contain; width: 100%; }
.thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.thumbs button { border: 2px solid transparent; padding: 0; background: #fff; border-radius: 4px; flex: 0 0 56px; }
.thumbs button[aria-current="true"] { border-color: var(--accent); }
.thumbs img { width: 56px; height: 56px; object-fit: cover; }
.pm h3 { font: 22px/1.2 Bungee; margin: 0 0 6px; }
.opt { margin: 12px 0; }
.opt-name { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.opt-vals { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-vals button { background: var(--bg2); color: var(--text); border: 2px solid var(--line); border-radius: 4px; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.opt-vals button[aria-pressed="true"] { border-color: var(--accent); background: #3a2a18; }
.opt-vals button:disabled { opacity: .3; text-decoration: line-through; }
.swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; vertical-align: -2px; margin-right: 6px; border: 1px solid #000; }
.desc { color: var(--muted); font-size: 14px; max-height: 160px; overflow: auto; }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s; }
.drawer-panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(420px, 100vw); background: var(--panel); border-left: 3px solid #000; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; }
.drawer.open { pointer-events: auto; }
.drawer.open .drawer-scrim { opacity: 1; }
.drawer.open .drawer-panel { transform: none; }
.drawer-items { flex: 1; overflow: auto; padding: 8px 12px; }
.ci { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.ci img { width: 64px; height: 64px; object-fit: cover; background: #fff; border-radius: 4px; border: 1px solid #000; }
.ci .t { font-size: 13px; font-weight: 700; line-height: 1.2; }
.qty { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.qty button { width: 26px; height: 26px; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.drawer-foot { padding: 12px; border-top: 2px solid #000; background: var(--bg2); display: flex; flex-direction: column; gap: 8px; }
.total { display: flex; justify-content: space-between; font-size: 18px; }
.ship-meter { height: 8px; background: var(--bg); border: 1px solid #000; border-radius: 4px; overflow: hidden; }
.ship-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .3s; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); background: #000; color: var(--accent2); border: 2px solid var(--accent); padding: 10px 16px; border-radius: var(--radius); font-weight: 700; transition: transform .25s; z-index: 60; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); }

/* skeleton */
.skeleton { background: linear-gradient(90deg, var(--bg2), #2c2f37, var(--bg2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 260px; }
.skeleton.tall { min-height: 300px; grid-column: 1 / -1; }
@keyframes sk { to { background-position: -200% 0; } }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 16px; }

/* responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .featured-body, .pm { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nav { display: none; }
  .cart-btn { margin-left: auto; }
  .logo-text { font-size: 17px; }
  main { padding: 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; }
  .featured-body h3 { font-size: 20px; }
  .pm { padding: 14px; }
  .modal { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; margin: 0; }
}
