:root {
  --bg: #120914;
  --bg2: #1f1022;
  --card: rgba(31, 16, 36, 0.9);
  --card-border: rgba(255, 215, 130, 0.22);
  --text: #fff8eb;
  --muted: #cab8d4;
  --gold: #f5c34b;
  --gold-hi: #ffea9f;
  --gold-lo: #b67d14;
  --accent: #e53d5c;
  --accent-hi: #ff6b86;
  --radius: 18px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

body[data-theme="wood"] {
  --bg: #1e140e;
  --bg2: #2d1e14;
  --card: rgba(45, 30, 20, 0.92);
  --card-border: rgba(242, 198, 132, 0.25);
  --muted: #d8c3ae;
}

body[data-theme="disco"] {
  --bg: #0b0d24;
  --bg2: #16183d;
  --card: rgba(22, 24, 61, 0.9);
  --card-border: rgba(125, 226, 255, 0.28);
  --muted: #bac4eb;
  --accent: #a855f7;
  --accent-hi: #c084fc;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 50% -10%, var(--bg2) 0%, var(--bg) 65%);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-hi); text-decoration: none; }
h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; margin: 0 0 10px; line-height: 1.15; }
p { margin: 0 0 12px; line-height: 1.55; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(18, 9, 20, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar-in {
  display: flex; align-items: center; justify-content: space-between;
  height: 58px; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-family: 'Fraunces', serif; font-size: 18px; }
.brand-icon { font-size: 22px; }
.topnav { display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 600; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--text); }
.stars-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(245, 195, 75, 0.16);
  border: 1px solid rgba(245, 195, 75, 0.45);
  color: var(--gold-hi);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font-size: 13px; font-weight: 700;
}

.main-app { padding: 22px 16px 40px; }
.loading-box { text-align: center; padding: 60px 20px; color: var(--muted); }

/* Hero / Create layout */
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
}

.kicker {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11px; font-weight: 700; color: var(--gold); margin-bottom: 8px;
}
.hero-title { font-size: clamp(28px, 5vw, 44px); margin-bottom: 10px; }
.hero-sub { color: var(--muted); font-size: 15px; margin-bottom: 18px; }

.card-panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

/* Shelf visual stage */
.shelf-stage {
  position: relative;
  border-radius: 22px;
  padding: 20px 16px 24px;
  background: linear-gradient(180deg, #3c1020 0%, #230914 100%);
  border: 2px solid rgba(245, 195, 75, 0.35);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
body[data-theme="wood"] .shelf-stage {
  background: linear-gradient(180deg, #4b311e 0%, #2d1b10 100%);
  border-color: rgba(232, 180, 110, 0.4);
}
body[data-theme="disco"] .shelf-stage {
  background: linear-gradient(180deg, #211d5c 0%, #101033 100%);
  border-color: rgba(145, 212, 255, 0.4);
}
.shelf-stage.vip {
  background: linear-gradient(160deg, #4c2d06 0%, #231403 55%, #3d2405 100%) !important;
  border: 2px solid #ffd875 !important;
  box-shadow: 0 0 40px rgba(255, 210, 90, 0.25), 0 24px 60px rgba(0, 0, 0, 0.6) !important;
}
.shelf-stage.vip::before {
  content: "";
  position: absolute; inset: -40% -20%;
  background: radial-gradient(circle at 50% 0%, rgba(255, 232, 150, 0.22), transparent 55%);
  pointer-events: none;
}

.shelf-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px; position: relative; z-index: 2;
}
.shelf-title { font-size: 22px; margin: 0; }
.shelf-meta { font-size: 13px; color: var(--muted); }
.vip-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #fff0b3, #e6a825);
  color: #211202; font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
}

.trophy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative; z-index: 2;
}
@media (max-width: 480px) {
  .trophy-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.trophy-slot {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  padding: 12px 10px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  min-height: 158px;
}
.trophy-slot:hover { transform: translateY(-3px); border-color: rgba(255, 215, 130, 0.55); }
.trophy-slot.empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.18);
  justify-content: center;
  color: var(--muted);
}
.trophy-slot.style-gold {
  background: linear-gradient(180deg, rgba(255, 214, 102, 0.18), rgba(180, 120, 16, 0.08));
  border-color: rgba(255, 214, 102, 0.65);
}
.trophy-slot.style-diamond {
  background: linear-gradient(180deg, rgba(160, 230, 255, 0.2), rgba(70, 120, 220, 0.08));
  border-color: rgba(160, 230, 255, 0.7);
}
.trophy-slot.style-goat {
  background: linear-gradient(180deg, rgba(255, 120, 200, 0.22), rgba(255, 210, 90, 0.12));
  border-color: rgba(255, 180, 230, 0.75);
  box-shadow: 0 0 22px rgba(255, 150, 220, 0.2);
}

.trophy-svg { width: 68px; height: 72px; display: block; margin: 0 auto 4px; }
.trophy-name {
  font-size: 12.5px; font-weight: 700; line-height: 1.25;
  color: var(--text); margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.trophy-from { font-size: 11px; color: var(--muted); }
.lock-pill {
  position: absolute; top: 8px; right: 8px;
  font-size: 11px; background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px; padding: 2px 6px; color: var(--gold-hi);
}

/* Forms & buttons */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type="text"], textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
input[type="text"]:focus, textarea:focus { border-color: var(--gold); }
textarea { min-height: 88px; resize: vertical; }

.theme-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.theme-btn {
  padding: 10px 8px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  color: var(--text); font-size: 13px; font-weight: 600;
}
.theme-btn.active { border-color: var(--gold); background: rgba(245, 195, 75, 0.18); color: var(--gold-hi); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 13px; border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08); color: var(--text);
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.btn:hover { opacity: 0.94; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-gold {
  background: linear-gradient(135deg, #ffe899 0%, #f0b636 55%, #cf8b15 100%);
  color: #1c1002; border: 0;
  box-shadow: 0 8px 24px rgba(240, 182, 54, 0.3);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent-hi), var(--accent));
  color: #fff; border: 0;
}
.btn-wide { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-link {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 4px 0; text-decoration: underline;
}

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }

/* Award preset picker */
.group-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.tab-btn {
  flex: 1; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted); font-size: 13px; font-weight: 700;
}
.tab-btn.active { background: rgba(245, 195, 75, 0.2); border-color: var(--gold); color: var(--gold-hi); }

.preset-list {
  display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px;
  max-height: 175px; overflow-y: auto; padding-right: 4px;
}
.preset-chip {
  padding: 7px 10px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  color: var(--text); font-size: 12.5px; font-weight: 600;
}
.preset-chip.active { background: var(--gold); color: #1d1103; border-color: var(--gold); }

/* Trophy wrap selector */
.wrap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
@media (max-width: 480px) { .wrap-grid { grid-template-columns: repeat(2, 1fr); } }
.wrap-opt {
  padding: 10px 6px; border-radius: 12px; cursor: pointer; text-align: center;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14);
  color: var(--text); font-size: 12px; font-weight: 700;
}
.wrap-opt small { display: block; color: var(--gold-hi); font-weight: 600; margin-top: 2px; }
.wrap-opt.active { border-color: var(--gold); background: rgba(245, 195, 75, 0.2); }

.chk-row {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px;
  font-size: 13.5px; color: var(--text); cursor: pointer;
}
.chk-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--gold); }

/* Share box & Code box */
.code-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(245, 195, 75, 0.45);
  border-radius: 14px; padding: 12px 14px; margin: 12px 0;
}
.code-big {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 20px; font-weight: 800; letter-spacing: 0.14em; color: var(--gold-hi);
}

.vip-card {
  background: linear-gradient(135deg, rgba(255, 224, 130, 0.16), rgba(160, 100, 12, 0.18));
  border: 1px solid rgba(255, 215, 115, 0.55);
  border-radius: 16px; padding: 16px; margin-top: 14px;
}

.muted { color: var(--muted); font-size: 14px; }
.err-msg { color: #ff8ca0; font-size: 13px; font-weight: 600; margin-bottom: 10px; }

/* How section & footer */
.how-section { padding: 36px 0 48px; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 20px; }
.how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
@media (max-width: 780px) { .how-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .how-grid { grid-template-columns: 1fr; } }
.how-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 16px;
}
.step-num {
  display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: 999px; background: var(--gold); color: #1c1002;
  font-weight: 800; font-size: 13px; margin-bottom: 10px;
}
.how-card h3 { font-size: 17px; }
.how-card p { font-size: 13.5px; color: var(--muted); margin: 0; }

.footer { border-top: 1px solid rgba(255,255,255,0.08); padding: 22px 0; font-size: 13px; color: var(--muted); }
.footer-in { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 14px; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(6, 3, 10, 0.78); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 16px;
}
.modal-box {
  max-width: 450px; width: 100%; max-height: 90vh; overflow-y: auto;
  background: #221127; border: 1px solid rgba(255, 215, 130, 0.35);
  border-radius: 22px; padding: 22px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}
.speech-box {
  background: rgba(255, 250, 236, 0.08);
  border: 1px solid rgba(255, 215, 130, 0.3);
  border-radius: 14px; padding: 16px; margin: 14px 0;
  font-size: 16px; line-height: 1.55;
}
.sealed-box {
  background: rgba(0, 0, 0, 0.38);
  border: 1px dashed rgba(255, 215, 130, 0.45);
  border-radius: 14px; padding: 18px; margin: 14px 0; text-align: center;
}
.clue-list {
  list-style: none; padding: 0; margin: 10px 0 0;
  display: grid; gap: 6px;
}
.clue-list li {
  background: rgba(245, 195, 75, 0.14); border: 1px solid rgba(245, 195, 75, 0.35);
  border-radius: 10px; padding: 8px 12px; font-size: 13.5px; color: var(--gold-hi);
}

.pack-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 14px; margin-bottom: 10px; cursor: pointer;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.16);
  color: var(--text); text-align: left; font-family: inherit;
}
.pack-btn.best { border-color: var(--gold); background: rgba(245, 195, 75, 0.16); }

/* Pricing page */
.prose-page { padding: 32px 16px 60px; max-width: 760px; }
.price-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.price-table th, .price-table td { padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: left; }
.pill-best { background: var(--gold); color: #1c1002; font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 800; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80;
  background: #fff8eb; color: #1a0f1f; padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 700; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  max-width: 92vw; text-align: center;
}
.hide { display: none !important; }
