:root {
  color-scheme: dark;
  --bg: #130807;
  --ink: #1f0f0b;
  --panel: rgba(255, 246, 226, .1);
  --panel-strong: rgba(255, 246, 226, .18);
  --cream: #fff2d3;
  --text: #fff9ec;
  --muted: #e7c7aa;
  --orange: #ff7a1a;
  --gold: #ffd166;
  --pink: #ff3d81;
  --claw: #70ffca;
  --danger: #ff4747;
  --line: rgba(255, 218, 168, .2);
  --shadow: 0 24px 70px rgba(34, 5, 0, .5);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 8%, rgba(255, 122, 26, .48), transparent 28rem),
    radial-gradient(circle at 85% 12%, rgba(255, 61, 129, .32), transparent 30rem),
    radial-gradient(circle at 45% 95%, rgba(112, 255, 202, .18), transparent 32rem),
    linear-gradient(135deg, #130807 0%, #26100d 46%, #100809 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .42;
  background-image:
    linear-gradient(135deg, rgba(255, 209, 102, .08) 10%, transparent 10% 50%, rgba(255, 209, 102, .08) 50% 60%, transparent 60%),
    radial-gradient(circle, rgba(255, 249, 236, .12) 1.5px, transparent 1.5px);
  background-size: 28px 28px, 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}
button, input, textarea, select { font: inherit; }
a { color: inherit; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  backdrop-filter: blur(18px);
  background: rgba(19, 8, 7, .78);
  border-bottom: 1px solid var(--line);
}
.brand, .nav-links { display: flex; align-items: center; gap: .85rem; }
.brand { font-weight: 1000; text-decoration: none; letter-spacing: -.045em; text-transform: lowercase; }
.brand-mark {
  display: grid; place-items: center;
  width: 2.7rem; height: 2.7rem;
  border-radius: 1rem 1rem 1.35rem 1.35rem;
  background: linear-gradient(135deg, var(--gold), var(--orange) 55%, var(--pink));
  box-shadow: 0 12px 34px rgba(255, 122, 26, .42), inset 0 -5px 0 rgba(31, 15, 11, .18);
}
.nav-links a, .cart-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 850;
}
.nav-links a:hover { color: var(--cream); }
.cart-button {
  color: var(--ink);
  border: 1px solid rgba(255, 209, 102, .45);
  border-radius: 999px;
  padding: .66rem 1rem;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  box-shadow: 0 10px 28px rgba(255, 122, 26, .24);
}
#cartCount { color: #4a160b; font-weight: 1000; }
main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto 5rem; }
.hero {
  min-height: 64vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
  align-items: center;
  gap: 2rem;
  padding: 5rem 0 3rem;
}
.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(3.2rem, 9vw, 7.2rem);
  line-height: .88;
  letter-spacing: -.085em;
  text-transform: lowercase;
  text-shadow: 0 9px 0 rgba(0, 0, 0, .18);
}
.hero p { color: var(--muted); font-size: 1.1rem; line-height: 1.7; max-width: 46rem; }
.eyebrow { margin: 0 0 .7rem; color: var(--claw); text-transform: uppercase; letter-spacing: .18em; font-size: .73rem; font-weight: 1000; }
.hero-actions, .form-actions, .data-tools { display: flex; gap: .75rem; flex-wrap: wrap; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.8rem;
  padding: .78rem 1.08rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 950;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-2px) rotate(-.5deg); border-color: rgba(255, 242, 211, .46); box-shadow: 0 14px 32px rgba(0, 0, 0, .22); }
.primary { color: var(--ink); background: linear-gradient(135deg, var(--gold), var(--orange) 58%, var(--pink)); border-color: transparent; }
.secondary { background: rgba(255, 246, 226, .1); }
.danger { background: rgba(255, 71, 71, .16); color: #ffe0dc; }
.mini { min-height: 2.12rem; padding: .45rem .68rem; font-size: .78rem; }
.hero-card, .admin-panel, .product-card, .cart-panel, .toolbar {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 246, 226, .16), rgba(255, 246, 226, .07));
  border-radius: 2rem;
  box-shadow: var(--shadow);
}
.hero-card {
  position: relative;
  padding: 2rem;
  overflow: hidden;
  isolation: isolate;
  transform: rotate(1deg);
}
.hero-card::before {
  content: "";
  position: absolute;
  inset: auto -18% -28% 12%;
  aspect-ratio: 1;
  border-radius: 42% 58% 50% 50%;
  background: radial-gradient(circle at 40% 35%, var(--gold), var(--orange) 48%, var(--pink));
  opacity: .82;
  z-index: -1;
}
.hero-card::after {
  content: "CLAWBACK DEALS";
  display: grid;
  place-items: center;
  aspect-ratio: 1.8;
  margin-top: 1.3rem;
  border: 2px dashed rgba(31, 15, 11, .36);
  border-radius: 1.4rem;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 242, 211, .7), rgba(255, 209, 102, .78)),
    repeating-linear-gradient(-45deg, transparent 0 12px, rgba(31, 15, 11, .09) 12px 18px);
  font-weight: 1000;
  letter-spacing: .12em;
}
.cat-badge { font-size: clamp(4rem, 10vw, 7rem); line-height: 1; filter: drop-shadow(0 20px 20px rgba(0,0,0,.25)); }
.sparkle { display: inline-block; margin-top: 1rem; color: var(--claw); font-weight: 1000; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; }
.hero-card strong { display: block; margin-top: .7rem; font-size: 1.9rem; }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1.25rem; margin-bottom: 1rem; }
.toolbar h2, .section-heading h2, .cart-header h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.055em; }
.filter-controls { display: flex; gap: .75rem; flex-wrap: wrap; }
label { display: grid; gap: .45rem; color: var(--muted); font-weight: 850; }
input, textarea, select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(0, 0, 0, .28);
  padding: .85rem .95rem;
  outline: none;
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--claw); box-shadow: 0 0 0 4px rgba(112, 255, 202, .12); }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.product-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .16s ease, border-color .16s ease; }
.product-card:hover { transform: translateY(-4px); border-color: rgba(255, 209, 102, .46); }
.product-image { min-height: 220px; background-size: cover; background-position: center; background-color: rgba(255, 246, 226, .08); position: relative; }
.product-image::after { content: "😾"; position: absolute; right: .7rem; bottom: .7rem; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--pink)); box-shadow: 0 8px 18px rgba(0,0,0,.26); }
.product-body { padding: 1rem; display: flex; flex-direction: column; flex: 1; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.category-pill, .stock-pill { color: var(--claw); font-size: .72rem; font-weight: 1000; text-transform: uppercase; letter-spacing: .09em; }
.stock-pill { color: var(--muted); }
.product-card h3 { margin: .65rem 0 .4rem; font-size: 1.35rem; letter-spacing: -.03em; }
.description { color: var(--muted); line-height: 1.5; flex: 1; }
.product-footer { display: grid; gap: .75rem; }
.price { font-size: 1.5rem; color: var(--gold); }
.card-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.empty-state { text-align: center; color: var(--muted); padding: 3rem; }
.admin-panel { margin-top: 4rem; padding: 1.25rem; }
.section-heading p:last-child { color: var(--muted); }
.product-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.wide { grid-column: span 2; }
.data-tools { margin-top: 1.25rem; }
.import-label { cursor: pointer; }
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  justify-items: end;
  background: rgba(0, 0, 0, .58);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.cart-drawer.open { opacity: 1; pointer-events: auto; }
.cart-panel {
  width: min(460px, 100%);
  height: 100%;
  border-radius: 2rem 0 0 2rem;
  padding: 1.1rem;
  overflow-y: auto;
  background: rgba(31, 15, 11, .97);
}
.cart-header { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.icon-button { width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line); color: var(--text); background: var(--panel); font-size: 1.5rem; cursor: pointer; }
.cart-items { display: grid; gap: .75rem; margin: 1rem 0; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: .65rem; padding: .8rem; border: 1px solid var(--line); border-radius: 1rem; background: rgba(255, 246, 226, .07); }
.cart-item h4 { margin: 0 0 .25rem; }
.cart-item p { margin: 0; color: var(--muted); }
.qty-controls { display: flex; align-items: center; gap: .45rem; }
.qty-controls button { width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--line); color: var(--text); background: var(--panel); cursor: pointer; }
.cart-total { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 1.25rem; }
.checkout-form { display: grid; gap: .8rem; margin-top: 1rem; }
.notice { color: #fff0b8; background: rgba(255, 196, 76, .12); border: 1px solid rgba(255, 196, 76, .32); border-radius: 1rem; padding: .8rem; line-height: 1.45; }
.order-output { white-space: pre-wrap; color: var(--claw); background: rgba(0,0,0,.3); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem; overflow: auto; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-card { transform: none; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .site-header { align-items: flex-start; }
  .brand span:last-child { max-width: 8rem; }
  .nav-links { justify-content: flex-end; flex-wrap: wrap; font-size: .9rem; }
  .hero { padding-top: 3rem; }
  .hero h1 { font-size: clamp(3rem, 17vw, 4.7rem); }
  .toolbar { align-items: stretch; flex-direction: column; }
  .filter-controls, .filter-controls label { width: 100%; }
  .product-grid, .product-form { grid-template-columns: 1fr; }
  .wide { grid-column: span 1; }
  .product-image { min-height: 190px; }
  .cart-panel { border-radius: 0; }
}

.admin-toggle {
  border: 1px solid rgba(112, 255, 202, .34);
  border-radius: 999px;
  color: var(--claw);
  background: rgba(112, 255, 202, .08);
  padding: .62rem .95rem;
  cursor: pointer;
  font-weight: 950;
}
.admin-toggle[aria-pressed="true"] {
  color: var(--ink);
  background: linear-gradient(135deg, var(--claw), var(--gold));
}
.admin-only { display: none !important; }
body.admin-mode section.admin-only { display: block !important; }
body.admin-mode .button.admin-only { display: inline-flex !important; }
body.admin-mode .card-actions .admin-only { display: inline-flex !important; }

.chat-widget {
  position: fixed;
  right: clamp(1rem, 3vw, 1.5rem);
  bottom: clamp(1rem, 3vw, 1.5rem);
  z-index: 35;
  display: grid;
  justify-items: end;
  gap: .75rem;
  pointer-events: none;
}
.chat-widget > * { pointer-events: auto; }
.chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 3.3rem;
  padding: .8rem 1.1rem;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold), var(--orange) 58%, var(--pink));
  box-shadow: 0 18px 46px rgba(0,0,0,.38);
  cursor: pointer;
  font-weight: 1000;
}
.chat-panel {
  width: min(380px, calc(100vw - 2rem));
  max-height: min(620px, calc(100vh - 6rem));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.45rem;
  background: rgba(31, 15, 11, .98);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.chat-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.chat-header h2 { margin: 0; letter-spacing: -.045em; }
.chat-demo-note {
  margin: .75rem 0;
  color: #fff0b8;
  background: rgba(255, 196, 76, .12);
  border: 1px solid rgba(255, 196, 76, .32);
  border-radius: .95rem;
  padding: .7rem;
  line-height: 1.4;
  font-size: .9rem;
}
.chat-messages {
  display: grid;
  gap: .55rem;
  max-height: 260px;
  overflow-y: auto;
  padding: .35rem .15rem .75rem;
}
.chat-message {
  width: fit-content;
  max-width: 88%;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: .7rem .8rem;
  line-height: 1.4;
  background: rgba(255, 246, 226, .08);
}
.chat-message.user {
  justify-self: end;
  color: var(--ink);
  background: linear-gradient(135deg, var(--claw), var(--gold));
}
.chat-message.bot { color: var(--text); }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-top: .25rem; }
.chat-quick-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }
.chat-quick-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 246, 226, .08);
  padding: .48rem .65rem;
  cursor: pointer;
  font-weight: 850;
}
.chat-quick-actions button:hover { color: var(--cream); border-color: rgba(255, 242, 211, .42); }

@media (max-width: 640px) {
  .chat-widget { right: .75rem; bottom: .75rem; }
  .chat-panel { width: calc(100vw - 1.5rem); max-height: calc(100vh - 5.4rem); }
  .chat-form { grid-template-columns: 1fr; }
  .admin-toggle { padding: .56rem .75rem; }
}

/* NFT-style collectible drop layer */
.hero-card, .product-card, .cart-panel, .chat-panel, .admin-panel, .toolbar {
  backdrop-filter: blur(18px) saturate(1.25);
}
.hero-card::after {
  content: "DEMO COLLECTIBLE DROP";
  border-color: rgba(112, 255, 202, .42);
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(112, 255, 202, .24), rgba(255, 61, 129, .22), rgba(255, 209, 102, .2)),
    repeating-linear-gradient(-45deg, transparent 0 10px, rgba(255,255,255,.08) 10px 14px);
  box-shadow: inset 0 0 38px rgba(112, 255, 202, .2), 0 0 42px rgba(255, 61, 129, .2);
}
.product-card {
  position: relative;
  isolation: isolate;
  border-color: rgba(112, 255, 202, .22);
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05)),
    radial-gradient(circle at 18% 0%, rgba(112, 255, 202, .18), transparent 16rem),
    radial-gradient(circle at 94% 8%, rgba(255, 61, 129, .22), transparent 15rem);
}
.product-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(112,255,202,.55), rgba(255,61,129,.45), rgba(255,209,102,.48));
  opacity: 0;
  filter: blur(18px);
  transition: opacity .18s ease;
}
.product-card:hover::before { opacity: .42; }
.product-card:hover { box-shadow: 0 24px 80px rgba(112, 255, 202, .12), 0 18px 60px rgba(255, 61, 129, .14); }
.product-image {
  min-height: 250px;
  overflow: hidden;
}
.product-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(255,255,255,.24) 45%, transparent 54% 100%),
    radial-gradient(circle at 22% 18%, rgba(112,255,202,.32), transparent 8rem),
    linear-gradient(to top, rgba(19,8,7,.84), transparent 48%);
  mix-blend-mode: screen;
  transform: translateX(-40%);
  animation: holo-sweep 7s ease-in-out infinite;
}
.product-image::after {
  content: "⛓️";
  background: linear-gradient(135deg, var(--claw), var(--pink));
  box-shadow: 0 0 26px rgba(112,255,202,.44), 0 8px 18px rgba(0,0,0,.26);
}
.rarity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .7rem;
}
.rarity-pill, .chain-pill {
  border: 1px solid rgba(112, 255, 202, .35);
  border-radius: 999px;
  padding: .35rem .55rem;
  color: var(--ink);
  background: linear-gradient(135deg, var(--claw), var(--gold));
  font-size: .68rem;
  font-weight: 1000;
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: 0 0 18px rgba(112, 255, 202, .18);
}
.chain-pill {
  color: var(--muted);
  background: rgba(255, 246, 226, .08);
  border-color: var(--line);
}
.trait-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin: .65rem 0 .2rem;
}
.trait-list div {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: .9rem;
  padding: .58rem;
  background: rgba(0,0,0,.18);
}
.trait-list dt {
  color: var(--claw);
  font-size: .64rem;
  font-weight: 1000;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.trait-list dd {
  margin: .18rem 0 0;
  color: var(--cream);
  font-weight: 900;
}
@keyframes holo-sweep {
  0%, 68%, 100% { transform: translateX(-55%); opacity: .2; }
  34% { transform: translateX(55%); opacity: .72; }
}
@media (prefers-reduced-motion: reduce) {
  .product-image::before { animation: none; transform: none; }
}
