/* Hobby Box — dark collectible-shop theme. Mobile-first, no framework. */
:root {
  --bg: #0f1319;
  --bg2: #151b24;
  --card: #1b222d;
  --ink: #f4f6fa;
  --muted: #9aa5b5;
  --accent: #ffb224;        /* gold */
  --accent-dark: #dd9412;
  --cta: #ff5a36;           /* hot orange for buy buttons */
  --cta-dark: #d9482a;
  --line: #2b3442;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(1200px 400px at 50% -80px, rgba(255,178,36,.08), transparent);
  color: var(--ink);
  line-height: 1.5;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 1rem; }

.site-header {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #232c3d 0%, #141a25 100%);
  border-bottom: 2px solid var(--accent);
  color: #fff; padding: .8rem 1rem;
}
.brand {
  color: var(--accent); font-weight: 800; font-size: 1.4rem;
  text-decoration: none; letter-spacing: .02em;
}
.brand small {
  display: block; font-size: .68rem; font-weight: 600;
  color: var(--muted); letter-spacing: .14em; text-transform: uppercase;
}
.search { display: flex; gap: .4rem; flex: 1 1 240px; max-width: 420px; }
.search input {
  flex: 1; padding: .55rem .7rem; border: 1px solid var(--line);
  border-radius: 8px; font-size: 1rem;
  background: var(--bg2); color: var(--ink);
}
.search button {
  padding: .55rem .9rem; border: 0; border-radius: 8px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #1a1405; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.search button:hover { filter: brightness(1.08); }

.site-footer { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: .9rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 3rem 0; }
h1, h2, h3 { color: var(--ink); }
a { color: var(--accent); }

/* Binder page: 3x3 sleeves like a 9-pocket card binder. */
.grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(2, 1fr);
  background: linear-gradient(180deg, #171d27, #12161e);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: inset 0 2px 12px rgba(0,0,0,.5);
}
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); } }
/* The sleeve: a clear pocket holding the card. */
.card {
  background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  padding: .55rem .55rem .7rem;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 4px 12px rgba(0,0,0,.4);
  transition: transform .15s ease, box-shadow .15s ease;
}
/* Pocket lip: the top edge of the sleeve. */
.card::before {
  content: ""; position: absolute; top: .32rem; left: 10%; right: 10%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  border-radius: 2px;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 8px 24px rgba(0,0,0,.5), 0 0 0 1px var(--accent);
}
.thumb {
  aspect-ratio: 5 / 7; background: #232b38; display: flex;
  border-radius: 4px; overflow: hidden; margin-top: .35rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.55);
  border: 1px solid rgba(0,0,0,.4);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { margin: auto; color: var(--muted); font-size: .85rem; }
.no-photo.big { padding: 4rem 2rem; }
.card-body { padding: .7rem; display: flex; flex-direction: column; gap: .25rem; }
.card-title { font-weight: 600; font-size: .95rem; }
.card-meta { color: var(--muted); font-size: .8rem; }
.card-price { font-weight: 800; color: var(--accent); font-size: 1.05rem; margin-top: auto; }

.detail { display: grid; gap: 1.5rem; }
@media (min-width: 720px) { .detail { grid-template-columns: 1fr 1fr; } }
.detail-photo .flip.big { aspect-ratio: 5 / 7; max-width: 440px; width: 100%; }

/* Tap-to-flip card (3D). .flipped toggles via JS. */
.flip {
  position: relative; width: 100%; height: 100%;
  perspective: 1200px; outline: none; cursor: pointer;
  touch-action: manipulation; /* no double-tap zoom delay on mobile */
}
.flip-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4, .1, .3, 1);
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: var(--radius); overflow: hidden;
  background: #232b38;
  border: 1px solid var(--line);
}
.flip-back { transform: rotateY(180deg); }
.flip-face img { width: 100%; height: 100%; object-fit: cover; }
.flip-face .no-photo { padding: 1rem; text-align: center; }
.flip-hint {
  position: absolute; right: .5rem; bottom: .5rem;
  background: rgba(0,0,0,.65); color: var(--accent);
  font-size: .7rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px;
  pointer-events: none; letter-spacing: .02em;
}
.detail-info h1 { margin-top: 0; }
.price-big { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.desc { white-space: pre-wrap; color: #d7dce4; }
.buy {
  width: 100%; padding: .9rem; font-size: 1.1rem; font-weight: 800;
  background: linear-gradient(180deg, var(--cta), var(--cta-dark));
  color: #fff; border: 0; border-radius: var(--radius); cursor: pointer;
  box-shadow: 0 4px 14px rgba(255,90,54,.35);
}
.buy:hover { filter: brightness(1.08); }

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; margin: 1rem 0;
}
.panel.narrow { max-width: 420px; margin: 2rem auto; }

label { display: block; margin: .8rem 0; font-weight: 600; }
input, textarea, select {
  display: block; width: 100%; margin-top: .3rem; padding: .6rem;
  border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; font-family: inherit;
  background: var(--bg2); color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,178,36,.25);
}
textarea { resize: vertical; }
.row { display: grid; gap: 0 .8rem; grid-template-columns: 1fr 1fr; }
.price-row { display: flex; gap: .5rem; }
.price-row input { flex: 1; }
.linklike {
  background: none; border: 0; color: var(--accent); cursor: pointer;
  text-decoration: underline; font-size: inherit; padding: 0;
}
.preview { max-width: 220px; border-radius: 6px; margin-top: .4rem; }
.form-actions { display: flex; gap: .6rem; margin-top: 1rem; }

.btn {
  display: inline-block; padding: .6rem 1rem; border-radius: 8px;
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  color: #1a1405; text-decoration: none;
  border: 0; font-size: 1rem; cursor: pointer; font-weight: 700;
}
.btn:hover { filter: brightness(1.08); }
.btn.small { padding: .35rem .6rem; font-size: .85rem; }
.btn.ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--bg2); filter: none; }
.btn.danger { background: linear-gradient(180deg, #c0392b, #96281b); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
form.inline { display: inline; }

.alert {
  background: rgba(194, 59, 43, .15); border: 1px solid #a93226; color: #ff9d8f;
  padding: .7rem; border-radius: 8px;
}

.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th {
  background: #232b38; font-size: .85rem; text-transform: uppercase;
  letter-spacing: .03em; color: var(--accent);
}
.t-thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.nowrap { white-space: nowrap; }

.pill {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
}
.pill.active { background: rgba(46, 204, 113, .15); color: #6fe3a1; }
.pill.sold { background: rgba(231, 76, 60, .15); color: #ff9d8f; }
.pill.hidden { background: #2b3442; color: var(--muted); }
.pill.paid { background: rgba(46, 204, 113, .15); color: #6fe3a1; }
.pill.pending { background: rgba(255, 178, 36, .15); color: var(--accent); }
.pill.failed { background: rgba(231, 76, 60, .15); color: #ff9d8f; }

.admin-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.admin-bar h1 { margin: 0; }
.nav-links { display: flex; gap: 1rem; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: .95rem; white-space: nowrap; }
.nav-links a:hover { color: var(--accent); text-decoration: underline; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0 1.5rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.stat b { display: block; font-size: 1.4rem; color: var(--accent); }
.stat span { color: var(--muted); font-size: .85rem; }

/* Seller binders */
.seller-link { color: var(--accent); text-decoration: underline; cursor: pointer; font-weight: 600; }
.binder-head h1 { margin-bottom: .2rem; }
.binder-head { margin-bottom: 1rem; }
.binder-list { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; }
.binder-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .9rem 1.1rem; text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.binder-row:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.4), 0 0 0 1px var(--accent); }
.binder-name { font-weight: 700; font-size: 1.05rem; }
.binder-count { color: var(--muted); font-size: .9rem; white-space: nowrap; }
