/* ============================================================
   Sui Generis Games - site stylesheet
   Colors all derive from the variables below.
   Grader-tool class hooks (.upload-panel, .category-card, etc.)
   are preserved further down; app.js depends on them.
   ============================================================ */
:root {
  /* Brand: red primary, black/white base, gold accent. Light theme values. */
  --red: #d71920;
  --red-hover: #b3141a;
  --red-soft: rgba(215, 25, 32, 0.08);
  --on-red: #ffffff;
  --gold: #b8912a;
  --gold-text: #8a6a14;
  --bg: #ffffff;
  --surface: #f6f5f3;
  --surface-2: #ecebe7;
  --border: rgba(0, 0, 0, 0.1);
  --text: #111111;
  --text-dim: #55534e;
  --nav-bg: rgba(255, 255, 255, 0.88);
  --footer-bg: #f2f1ee;
  --badge-bg: rgba(255, 255, 255, 0.92);
  --good: #1f7a3d;
  --warn: #9a6a00;
  --bad: #c0271d;
  --radius: 14px;
  --maxw: 1120px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --red: #ed1c24;
  --red-hover: #ff3b42;
  --red-soft: rgba(237, 28, 36, 0.12);
  --on-red: #ffffff;
  --gold: #d4af37;
  --gold-text: #e3c25a;
  --bg: #0a0a0b;
  --surface: #151517;
  --surface-2: #1e1e21;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f3f1ed;
  --text-dim: #a9a6a0;
  --nav-bg: rgba(10, 10, 11, 0.86);
  --footer-bg: #070708;
  --badge-bg: rgba(10, 10, 11, 0.85);
  --good: #6fbf87;
  --warn: #e0b45f;
  --bad: #ff7a6e;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --red: #ed1c24;
    --red-hover: #ff3b42;
    --red-soft: rgba(237, 28, 36, 0.12);
    --gold: #d4af37;
    --gold-text: #e3c25a;
    --bg: #0a0a0b;
    --surface: #151517;
    --surface-2: #1e1e21;
    --border: rgba(255, 255, 255, 0.1);
    --text: #f3f1ed;
    --text-dim: #a9a6a0;
    --nav-bg: rgba(10, 10, 11, 0.86);
    --footer-bg: #070708;
    --badge-bg: rgba(10, 10, 11, 0.85);
    --good: #6fbf87;
    --warn: #e0b45f;
    --bad: #ff7a6e;
    color-scheme: dark;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.2;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); }
h3 { font-size: 1.2rem; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
main { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
section, .block { padding: 48px 0; }
.muted, .section-desc, .subtitle { color: var(--text-dim); }
.subtitle { font-size: 1.08rem; margin-top: 10px; }
.center { text-align: center; }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 22px;
}
.site-nav .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-nav .brand:hover { text-decoration: none; }
.brand .mark { width: 42px; height: 42px; flex: 0 0 auto; object-fit: contain; }
.brand .wordmark { display: block; height: 15px; width: auto; color: var(--text); }
.brand .wordmark svg { height: 100%; width: auto; display: block; }
.brand .tag { display: block; margin-top: 5px; font-size: 0.66rem; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gold-text); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.theme-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; width: 38px; height: 36px; padding: 0; font-size: 1rem;
  display: grid; place-items: center; box-shadow: none;
}
.theme-btn:hover, .theme-btn:hover:not(:disabled) { background: none; border-color: var(--gold); transform: none; box-shadow: none; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--text-dim); font-size: 0.94rem; font-weight: 600; }
.nav-links a:hover, .nav-links a.active { color: var(--red); text-decoration: none; }
.menu-btn { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 7px 12px; font-size: 1.05rem; cursor: pointer; }

@media (max-width: 860px) {
  .site-nav { position: relative; flex-wrap: wrap; }
  .menu-btn { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--surface);
    border-bottom: 1px solid var(--border); padding: 8px 0; z-index: 60;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 24px; width: 100%; }
}

/* ---------- Buttons ---------- */
.button, button, .btn {
  display: inline-block; padding: 12px 26px; border-radius: 10px;
  font-weight: 700; font-size: 0.95rem; cursor: pointer;
  border: none; font-family: inherit;
  background: var(--red); color: var(--on-red);
  transition: transform 0.15s, box-shadow 0.15s;
}
.button:hover, button:hover:not(:disabled), .btn:hover { transform: translateY(-1px); text-decoration: none; background: var(--red-hover); box-shadow: 0 6px 20px rgba(215, 25, 32, 0.3); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.button.secondary, .btn-ghost {
  background: transparent; color: var(--text); border: 1px solid var(--border); box-shadow: none;
}
.button.secondary:hover, .btn-ghost:hover { background: transparent; border-color: var(--red); color: var(--red); box-shadow: none; }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; border-radius: 8px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; position: relative; }
.hero .kicker {
  font-size: 0.75rem; letter-spacing: 3.5px; text-transform: uppercase;
  color: var(--gold-text); font-weight: 700; margin-bottom: 14px;
}
.hero .tagline { color: var(--gold-text); letter-spacing: 2px; text-transform: uppercase; font-size: 0.8rem; margin-top: 8px; }
.hero p.lead, .hero > p { max-width: 640px; margin-top: 18px; color: var(--text-dim); font-size: 1.08rem; }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
}
.card h3 { margin-bottom: 8px; color: var(--red); }

.stat { text-align: center; padding: 22px 10px; }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--red); }
.stat .lbl { font-size: 0.85rem; color: var(--text-dim); letter-spacing: 1px; text-transform: uppercase; }

.link-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: 20px; }
.link-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; display: flex; flex-direction: column; gap: 5px; color: var(--text);
  transition: border-color 0.18s, transform 0.18s;
}
.link-card:hover { border-color: var(--red); transform: translateY(-3px); text-decoration: none; }
.link-card .link-title { font-weight: 700; color: var(--red); }
.link-card .link-desc { font-size: 0.88rem; color: var(--text-dim); }
.link-card.placeholder { border-style: dashed; }
.placeholder-badge {
  display: inline-block; font-size: 0.7rem; letter-spacing: 0.6px; text-transform: uppercase;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 100px;
  padding: 2px 9px; margin-top: 6px;
}

/* ---------- Beta flag + notice ---------- */
.beta-tag {
  display: inline-block; vertical-align: middle;
  font-family: "Manrope", sans-serif; font-size: 0.8rem; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 100px;
  padding: 3px 12px; margin-left: 10px;
}
.nav-links .beta-dot {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 100px;
  padding: 1px 6px; margin-left: 5px; vertical-align: middle;
}
.notice {
  background: var(--red-soft);
  border: 1px solid var(--warn);
  border-left-width: 4px;
  border-radius: 12px; padding: 22px 26px;
}
.notice h3 { color: var(--warn); margin-bottom: 10px; }
.notice p { color: var(--text-dim); }
.notice strong { color: var(--text); }

/* ---------- Shop ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0; }
.chip {
  padding: 8px 18px; border-radius: 100px; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); font-weight: 600;
  font-size: 0.88rem; cursor: pointer; font-family: inherit; box-shadow: none;
}
.chip:hover { transform: none; box-shadow: none; background: transparent; border-color: var(--red); color: var(--text); }
.chip.active, .chip.active:hover { background: var(--red); color: var(--on-red); border-color: var(--red); }

.item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.18s, border-color 0.18s;
}
.item:hover { transform: translateY(-4px); border-color: var(--red); }
.item .ph { aspect-ratio: 3 / 4; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; position: relative; }
.item .ph img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.item .ph .ph-empty { text-align: center; padding: 20px; color: var(--text-dim); font-size: 0.85rem; }
.item .ph .ph-empty .big { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.badge {
  position: absolute; top: 12px; left: 12px; background: var(--badge-bg);
  border: 1px solid var(--gold); color: var(--gold-text); font-size: 0.7rem;
  font-weight: 700; padding: 4px 10px; border-radius: 100px; letter-spacing: 0.8px;
}
.item .body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.item .title { font-weight: 700; font-size: 0.95rem; line-height: 1.4; flex: 1; }
.item .price { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.item .actions { display: flex; gap: 9px; flex-wrap: wrap; }
.item .actions a { flex: 1; text-align: center; min-width: 110px; }

/* ---------- Forms ---------- */
form.sgg, #grading-form { display: grid; gap: 18px; max-width: 640px; }
form.sgg label, #grading-form label { font-weight: 700; font-size: 0.9rem; display: block; margin-bottom: 6px; }
form.sgg input, form.sgg textarea, form.sgg select,
#grading-form input, #grading-form textarea {
  width: 100%; padding: 13px 15px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-family: inherit; font-size: 1rem;
}
form.sgg input:focus, form.sgg textarea:focus { outline: 2px solid var(--red); border-color: transparent; }
.form-note { font-size: 0.85rem; color: var(--text-dim); }
.form-status { font-weight: 700; margin-top: 12px; }
.form-status.err { color: var(--bad); }
.form-status.ok { color: var(--good); }

/* ---------- FAQ ---------- */
details.faq {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 4px 22px; margin-bottom: 12px;
}
details.faq summary {
  cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--red); font-size: 1.4rem; font-weight: 400; }
details.faq[open] summary::after { content: "\2013"; }
details.faq .a { padding: 0 0 18px; color: var(--text-dim); }

/* ---------- Reviews ---------- */
.review .quote { font-size: 1.9rem; color: var(--gold); line-height: 1; font-family: Georgia, serif; }
.review .who { margin-top: 14px; font-weight: 700; color: var(--text); font-size: 0.9rem; }
.review .when { color: var(--text-dim); font-size: 0.8rem; }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 18px; }
.step { display: flex; gap: 18px; align-items: flex-start; }
.step .n {
  counter-increment: step; flex: 0 0 40px; height: 40px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--gold);
  color: var(--gold-text); font-weight: 800; display: grid; place-items: center;
}
.step .n::before { content: counter(step); }

/* ---------- Consignment tiers ---------- */
.tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 20px; }
.tier-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px; text-align: center;
}
.tier-card .tier-range { font-size: 0.88rem; color: var(--text-dim); }
.tier-card .tier-payout { font-size: 2.1rem; font-weight: 800; color: var(--red); line-height: 1.2; }
.tier-card .tier-sub { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

/* ============================================================
   CARD GRADER TOOL
   Class hooks below are referenced by app.js. Do not rename.
   ============================================================ */
.upload-panel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 28px 0; }
@media (max-width: 620px) { .upload-panel { grid-template-columns: 1fr; } }
.upload-slot {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 22px; text-align: center;
}
.upload-slot label { display: block; font-weight: 700; margin-bottom: 12px; color: var(--red); }
.upload-slot input[type="file"] { width: 100%; color: var(--text-dim); font-family: inherit; font-size: 0.88rem; }
.preview { margin: 16px auto 0; max-height: 280px; width: auto; border-radius: 10px; border: 1px solid var(--border); }

#status { margin-top: 14px; color: var(--text-dim); font-weight: 600; }
#status.err { color: var(--bad); }

.overall {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: 28px; margin: 28px 0;
}
.overall-score { display: flex; align-items: baseline; gap: 6px; }
.overall-score #overall-score-value { font-size: 3.4rem; font-weight: 800; color: var(--red); line-height: 1; }
.overall-score .scale { font-size: 1.1rem; color: var(--text-dim); }
.overall-meta .grade-label { font-size: 1.3rem; font-weight: 700; font-family: "Playfair Display", serif; }
.overall-meta .confidence { color: var(--text-dim); font-size: 0.9rem; }

.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.category-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.category-card h3 {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-bottom: 14px; color: var(--text);
}
.category-card h3 .score { font-family: "Manrope", sans-serif; font-size: 1rem; font-weight: 800; color: var(--red); }
.category-card > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.category-card > div:last-of-type { border-bottom: none; }
.category-card > div span:first-child { color: var(--text-dim); }
.category-card .notes {
  display: block; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-dim); border-bottom: none;
}

/* ---------- Packing slip (printable) ---------- */
.slip {
  background: #fff; color: #1a1a1a; border-radius: 12px; padding: 34px;
  max-width: 720px; margin: 26px auto; font-size: 0.95rem;
}
.slip h2, .slip h3 { color: #1a1a1a; }
.slip table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.slip td, .slip th { border: 1px solid #ccc; padding: 9px 12px; text-align: left; }
.slip th { background: #f4e9e9; }
.slip .ref { font-weight: 800; color: #b3141a; }
@media print {
  body * { visibility: hidden; }
  .slip, .slip * { visibility: visible; }
  .slip { position: absolute; top: 0; left: 0; width: 100%; margin: 0; border-radius: 0; }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); padding: 44px 0 36px; margin-top: 40px;
  background: var(--footer-bg);
}
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
@media (max-width: 700px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.site-footer a { display: block; color: var(--text-dim); padding: 4px 0; font-size: 0.92rem; }
.site-footer a:hover { color: var(--red); }
.site-footer .fine { max-width: var(--maxw); margin: 30px auto 0; padding: 0 22px; font-size: 0.8rem; color: var(--text-dim); }
.menu-btn:hover, .menu-btn:hover:not(:disabled) { background: none; transform: none; box-shadow: none; border-color: var(--red); }
@media (max-width: 860px) {
  .site-nav { flex-wrap: nowrap; padding: 12px 16px; }
  .brand .mark { width: 36px; height: 36px; }
  .brand .wordmark { height: 12px; }
  .brand .tag { font-size: 0.58rem; letter-spacing: 1.8px; }
}
