@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg: #17151b;
  --panel: #1f1d25;
  --panel-edge: #2c2934;
  --ink: #f4f1ea;
  --muted: #a29da8;
  --gold: #f2b705;
  --gold-ink: #17151b;
  --good: #57b98a;
  --bad: #e2685f;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
}

h1, h2, h3, .brand {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 600;
  margin: 0;
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.site {
  border-bottom: 1px solid var(--panel-edge);
  position: sticky;
  top: 0;
  background: rgba(23, 21, 27, 0.92);
  backdrop-filter: blur(6px);
  z-index: 20;
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  font-size: 20px;
  letter-spacing: 0.01em;
}
.brand span { color: var(--gold); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.nav-actions .who { color: var(--muted); margin-right: 4px; }

.btn {
  border: 1px solid var(--panel-edge);
  background: transparent;
  color: var(--ink);
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s ease;
}
.btn:hover { border-color: var(--muted); }
.btn-gold {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
  font-weight: 600;
}
.btn-gold:hover { filter: brightness(1.06); }
.btn-quiet {
  border-color: transparent;
  color: var(--muted);
}
.btn-quiet:hover { color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* Hero */
.hero {
  padding: 72px 0 48px;
  border-bottom: 1px solid var(--panel-edge);
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  max-width: 15ch;
}
.hero p {
  color: var(--muted);
  max-width: 46ch;
  font-size: 16px;
  margin-top: 16px;
}

/* Catalog */
.catalog { padding: 48px 0 80px; }
.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 24px;
}
.catalog-head h2 { font-size: 22px; }
.catalog-head .count { color: var(--muted); font-size: 14px; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 860px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card .cover {
  aspect-ratio: 16 / 10;
  background: #100f14 center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--panel-edge);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
}
.card .body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 17px; }
.card p.desc {
  color: var(--muted);
  font-size: 13.5px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.price-tag {
  font-family: 'Space Grotesk', monospace;
  font-size: 15px;
  color: var(--gold);
}
.owned-tag {
  font-size: 12.5px;
  color: var(--good);
  font-weight: 600;
}

/* Empty state */
.empty {
  border: 1px dashed var(--panel-edge);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 9, 12, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  padding: 28px;
}
.modal.wide { max-width: 640px; }
.modal h2 { font-size: 20px; margin-bottom: 4px; }
.modal .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%;
  background: #14131a;
  border: 1px solid var(--panel-edge);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14.5px;
  font-family: inherit;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.field input[type="file"] { padding: 8px 0; border: none; background: none; }
.field textarea { resize: vertical; min-height: 80px; }

.form-error {
  background: rgba(226, 104, 95, 0.12);
  border: 1px solid rgba(226, 104, 95, 0.4);
  color: var(--bad);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 14px;
}
.form-success {
  background: rgba(87, 185, 138, 0.12);
  border: 1px solid rgba(87, 185, 138, 0.4);
  color: var(--good);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 14px;
}

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.switch-line { margin-top: 16px; font-size: 13.5px; color: var(--muted); text-align: center; }
.switch-line button { background: none; border: none; color: var(--gold); font-size: 13.5px; padding: 0; }

.close-x {
  position: absolute;
  top: 18px; right: 18px;
  background: none; border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.modal { position: relative; }

#paypal-buttons-container { margin-top: 18px; min-height: 45px; }

/* Admin */
.admin-section { padding: 40px 0 80px; }
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
}
.admin-panel h2 { font-size: 18px; margin-bottom: 18px; }
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}
.admin-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--panel-edge);
  gap: 12px;
}
.admin-list-row:last-child { border-bottom: none; }
.admin-list-row .meta { font-size: 13.5px; color: var(--muted); }

footer.site {
  border-top: 1px solid var(--panel-edge);
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
}

.hidden { display: none !important; }
