/* ============================================================================
   All Good Games — liquidation sale design system
   Warm, inviting, family-friendly: soft ivory base, brand red (#BF452C) accent,
   rounded friendly display type. Shared by shop / offer / admin / landing.
   ============================================================================ */

:root {
  /* Color — soft & welcoming, brand red as the single bold accent */
  --bg:        #FBF7F1;   /* warm ivory base */
  --surface:   #FFFFFF;   /* cards */
  --surface-2: #F4ECDF;   /* warm inset / hover */
  --ink:       #2C2622;   /* soft warm near-black text */
  --muted:     #8A7E70;   /* warm gray secondary text */
  --red:       #BF452C;   /* BRAND accent — prices, primary actions, sale chips */
  --red-deep:  #9C3621;   /* hover */
  --red-soft:  #F7E4DD;   /* tint backgrounds */
  --honey:     #E0A23C;   /* warm secondary highlight, used sparingly */
  --ok:        #2F8F6B;   /* success */
  --line:      #ECE2D3;   /* hairlines */
  --line-2:    #DED0BB;

  /* Type */
  --display: 'Fredoka', system-ui, sans-serif;
  --body:    'Hanken Grotesk', system-ui, sans-serif;
  --mono:    'Space Mono', ui-monospace, monospace;

  /* Scale / rhythm */
  --pad: clamp(16px, 4vw, 44px);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 480px at 88% -10%, rgba(224,162,60,0.12), transparent 60%),
    radial-gradient(820px 460px at -8% 4%, rgba(191,69,44,0.07), transparent 55%);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
a { color: var(--red-deep); text-decoration: none; }
a:hover { color: var(--red); }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

/* Type helpers --------------------------------------------------------------*/
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); }

/* ── Top bar ────────────────────────────────────────────────────────────────*/
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 11px var(--pad);
  background: rgba(251,247,241,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 19px;
  color: var(--ink); letter-spacing: 0; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.nav { display: none; gap: 18px; margin-left: 8px; }
.nav a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.spacer { flex: 1; }
.offer-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--red); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(191,69,44,0.22);
}
.offer-pill:hover { color: #fff; background: var(--red-deep); }
.offer-pill .count { font-family: var(--mono); }

@media (min-width: 820px) { .nav { display: flex; } }

/* ── Hero ─────────────────────────────────────────────────────────────────────*/
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-wall {
  position: absolute; inset: 0;
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  grid-auto-rows: 96px;
  opacity: 0.22;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 70%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 70%);
}
.hero-wall img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    radial-gradient(1100px 520px at 16% 26%, rgba(251,247,241,0.7), transparent 72%),
    linear-gradient(180deg, rgba(251,247,241,0.78) 0%, rgba(251,247,241,0.92) 70%, var(--bg) 100%);
}
.hero-inner { position: relative; padding: clamp(48px, 10vw, 112px) 0 clamp(38px, 6vw, 68px); }
.hero-logo { width: 76px; height: 76px; filter: drop-shadow(0 6px 16px rgba(191,69,44,0.18)); }
.hero h1 {
  font-size: clamp(38px, 7.5vw, 78px);
  letter-spacing: -0.02em; max-width: 17ch; margin: 14px 0 0;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero .sub {
  margin: 20px 0 0; max-width: 52ch; font-size: clamp(16px, 2.1vw, 20px);
  color: #5e554b;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 28px; }
.statline {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 24px;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
}
.statline b { color: var(--ink); }
.statline .sep { color: var(--line-2); }

/* ── Buttons ─────────────────────────────────────────────────────────────────*/
.btn {
  font-family: var(--body); font-weight: 700; font-size: 15px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 12px 20px; border-radius: 999px; cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-brass, .btn-red {
  background: var(--red); color: #fff; border-color: transparent;
  box-shadow: 0 6px 18px rgba(191,69,44,0.20);
}
.btn-brass:hover, .btn-red:hover { background: var(--red-deep); }
.btn-ghost { background: transparent; }

/* ── Category filter row ─────────────────────────────────────────────────────*/
.filters {
  position: sticky; top: 55px; z-index: 30;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 14px var(--pad); background: rgba(251,247,241,0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { color: #fff; background: var(--red); border-color: transparent; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"]:hover { color: #fff; }

/* ── Product grid + component card ───────────────────────────────────────────*/
.grid {
  display: grid; gap: 16px; padding: 26px 0 80px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.count-row { display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding-top: 26px; }
.count-row h2 { font-size: 22px; }
.count-row .n { font-family: var(--mono); color: var(--muted); font-size: 13px; }

.card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 2px rgba(44,38,34,0.04);
  transition: box-shadow 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}
.card:hover { box-shadow: 0 10px 26px rgba(44,38,34,0.10); transform: translateY(-2px); border-color: var(--line-2); }
.card .ph { aspect-ratio: 1 / 1; background: var(--surface-2); position: relative; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .noimg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; padding: 12px;
}
.card .disc {
  position: absolute; top: 10px; left: 10px;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--red); color: #fff; padding: 4px 8px; border-radius: 6px;
}
.card .body { display: flex; flex-direction: column; gap: 9px; padding: 13px 14px 15px; flex: 1; }
.card h3 { font-size: 16px; line-height: 1.18; font-weight: 600; }
.card .statline { margin: 0; font-size: 11px; gap: 6px; flex-wrap: wrap; letter-spacing: 0.01em; }
.card .buy { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-family: var(--mono); font-weight: 700; font-size: 18px; color: var(--red); }
.price.req { font-size: 13px; color: var(--muted); font-weight: 400; }
.compare { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: 6px; }
.add {
  font-family: var(--body); font-weight: 700; font-size: 13px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  padding: 8px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.add:hover { background: var(--red); color: #fff; border-color: transparent; }

/* ── Footer ──────────────────────────────────────────────────────────────────*/
.footer { border-top: 1px solid var(--line); padding: 44px 0 60px; color: var(--muted); background: var(--surface-2); }
.footer h2 { font-size: 24px; color: var(--ink); max-width: 24ch; }
.footer p { max-width: 62ch; margin: 14px 0 0; }
.footer .meta { margin-top: 22px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
.footer .fineprint { margin-top: 16px; font-size: 13px; color: var(--muted); max-width: 70ch; }

/* ── Offer page ──────────────────────────────────────────────────────────────*/
.sheet { max-width: 880px; margin-inline: auto; padding: 40px var(--pad) 90px; }
.sheet h1 { font-size: clamp(30px, 6vw, 50px); }
.sheet .lead { color: #5e554b; margin: 14px 0 30px; max-width: 56ch; }
.offer-table { width: 100%; border-collapse: collapse; }
.offer-table thead th {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); text-align: left; padding: 0 10px 10px; border-bottom: 1px solid var(--line);
}
.offer-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.offer-table .t-item { font-weight: 600; }
.offer-table .t-item small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 3px; }
.offer-table input { font-family: var(--mono); }
.num { width: 78px; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: 8px; padding: 9px 10px; font-size: 14px; }
.num:focus { border-color: var(--red); outline: none; }
.linkbtn { background: none; border: none; color: var(--red); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px; }
.linkbtn:hover { color: var(--red-deep); }
.totalrow { display: flex; align-items: baseline; justify-content: flex-end; gap: 14px; margin-top: 22px; }
.totalrow .lbl { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.totalrow .amt { font-family: var(--mono); font-weight: 700; font-size: 30px; color: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.empty a { font-weight: 700; }

.offer-form { margin-top: 34px; display: grid; gap: 14px; }
.offer-form label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field { width: 100%; background: var(--surface); border: 1px solid var(--line-2); color: var(--ink);
  border-radius: 10px; padding: 13px 14px; font-size: 16px; font-family: var(--body); }
.field:focus { border-color: var(--red); outline: none; }
textarea.field { min-height: 96px; resize: vertical; }
.status { font-family: var(--mono); font-size: 13px; min-height: 20px; margin: 0; }
.status.ok { color: var(--ok); }
.status.err { color: var(--red); }

/* ── Landing ─────────────────────────────────────────────────────────────────*/
.cats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.cat { font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em;
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.signup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 5vw, 38px); box-shadow: 0 8px 26px rgba(44,38,34,0.07); }
.signup h2 { font-size: clamp(22px, 4vw, 30px); max-width: 20ch; }
.signup p { color: var(--muted); margin: 12px 0 20px; max-width: 52ch; }
.signup form { display: flex; flex-wrap: wrap; gap: 10px; }
.signup .field { flex: 1; min-width: 220px; }

/* ── Admin ───────────────────────────────────────────────────────────────────*/
.admin-main { max-width: 640px; margin-inline: auto; padding: 22px var(--pad) 90px; }
.tabs { display: flex; gap: 6px; margin: 4px 0 22px; }
.tab { flex: 1; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 11px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--red); color: #fff; border-color: transparent; }
.panel { display: none; } .panel[data-open="true"] { display: block; }
.bigbtn { width: 100%; font-size: 16px; padding: 16px; }
.scanwrap { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4/3; margin-bottom: 14px; }
.scanwrap video { width: 100%; height: 100%; object-fit: cover; }
.editcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; box-shadow: 0 6px 20px rgba(44,38,34,0.06); }
.editcard h3 { font-size: 18px; margin-bottom: 4px; }
.editrow { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.editrow label { flex: 0 0 96px; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.stepper button { width: 52px; height: 48px; font-size: 22px; background: var(--surface-2); color: var(--ink); border: none; cursor: pointer; }
.stepper button:hover { background: var(--red); color: #fff; }
.stepper .q { width: 64px; text-align: center; font-family: var(--mono); font-size: 20px; }
.savemsg { font-family: var(--mono); font-size: 12px; min-height: 18px; margin-top: 10px; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.offer-admin { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; background: var(--surface); }
.offer-admin .head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.offer-admin .who { font-weight: 700; } .offer-admin .when { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.offer-admin ul { margin: 10px 0 0; padding-left: 18px; font-size: 14px; }
.offer-admin select { font-family: var(--mono); background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; }
.login { max-width: 360px; margin: 12vh auto 0; text-align: center; padding-inline: var(--pad); }
.login h1 { font-size: 26px; margin-bottom: 6px; }
.login p { color: var(--muted); margin: 0 0 20px; }
