@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Outfit:wght@300;400;600;800&family=Silkscreen:wght@400;700&display=swap');

:root {
  --bg0: #0d0018;
  --bg1: #1a0530;
  --pink: #ff6ec7;
  --lilac: #b794f4;
  --cyan: #00f5d4;
  --yellow: #ffe66d;
  --orange: #ff9f1c;
  --magenta: #c77dff;
  --panel: rgba(26, 5, 40, 0.88);
  --line: rgba(255, 110, 199, 0.35);
  --text: #fff5ff;
  --muted: #c4b5fd;
  --danger: #ff4d6d;
  --ok: #00f5d4;
  --font-arcade: "Press Start 2P", "Silkscreen", monospace;
  --font-ui: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,110,199,.25), transparent 45%),
    radial-gradient(ellipse at 90% 10%, rgba(0,245,212,.18), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(123,92,255,.22), transparent 50%),
    linear-gradient(180deg, #12001f 0%, #0d0018 100%);
  min-height: 100vh;
}

a { color: var(--cyan); text-decoration: none; }
button, .btn {
  font-family: var(--font-ui);
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: .75rem 1.25rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--pink), var(--magenta), var(--cyan));
  color: #12001f;
}
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
img { max-width: 100%; display: block; }

/* ===== DESKTOP ARCADE SHELL ===== */
.arcade-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
}
.cabinet {
  border: 4px solid transparent;
  border-image: linear-gradient(135deg, var(--pink), var(--yellow), var(--cyan), var(--magenta)) 1;
  background: var(--panel);
  box-shadow: 0 0 0 6px #2a0a45, 0 25px 80px rgba(255,110,199,.2);
  position: relative;
  overflow: hidden;
}
.cabinet::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,.03) 2px,
    rgba(255,255,255,.03) 4px
  );
  pointer-events: none;
  z-index: 2;
}
.marquee {
  background: linear-gradient(90deg, #2b0b4a, #4a156e, #2b0b4a);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--pink);
  position: relative;
  z-index: 3;
}
.brand {
  font-family: var(--font-arcade);
  font-size: clamp(.7rem, 1.6vw, 1.05rem);
  line-height: 1.5;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  animation: shimmer 6s linear infinite;
  background-size: 200% auto;
}
@keyframes shimmer {
  to { background-position: 200% center; }
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1rem;
  font-size: .9rem;
  font-weight: 600;
}
.nav-links a { color: var(--text); opacity: .9; }
.nav-links a:hover { color: var(--cyan); }

.hero-arcade {
  position: relative;
  z-index: 3;
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(255,230,109,.15), transparent 50%),
    linear-gradient(180deg, rgba(255,110,199,.12), transparent);
  min-height: 52vh;
  display: grid;
  place-content: center;
  gap: 1rem;
}
.hero-arcade h1 {
  font-family: var(--font-arcade);
  font-size: clamp(.85rem, 2.4vw, 1.55rem);
  line-height: 1.7;
  margin: 0;
  color: var(--yellow);
}
.hero-arcade p {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}
.cta-row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: .5rem; }

.flash-bar {
  z-index: 3;
  position: relative;
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: .85rem 1rem;
  background: #2a083f;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.flash-chip {
  flex: 0 0 auto;
  padding: .45rem .9rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,110,199,.25), rgba(0,245,212,.2));
  border: 1px solid var(--line);
  font-size: .85rem;
  white-space: nowrap;
}
.flash-chip .timer { color: var(--yellow); font-weight: 800; margin-left: .4rem; }

.section {
  position: relative;
  z-index: 3;
  padding: 1.75rem 1.25rem;
}
.section h2 {
  font-family: var(--font-arcade);
  font-size: .75rem;
  color: var(--cyan);
  margin: 0 0 1rem;
  letter-spacing: .02em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.product {
  background: linear-gradient(160deg, rgba(255,110,199,.12), rgba(0,245,212,.06));
  border: 1px solid var(--line);
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.product:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(255,110,199,.25);
}
.product .thumb {
  aspect-ratio: 1;
  background:
    linear-gradient(135deg, #ff6ec744, #7b5cff44, #00f5d444),
    repeating-conic-gradient(from 0deg, #2a0a45 0deg 10deg, #1a0530 10deg 20deg);
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}
.product .badge {
  position: absolute;
  top: .4rem; left: .4rem;
  background: var(--pink);
  color: #12001f;
  font-size: .7rem;
  font-weight: 800;
  padding: .2rem .45rem;
  border-radius: 4px;
}
.product h3 { margin: 0; font-size: 1rem; }
.price-row { display: flex; align-items: baseline; gap: .5rem; }
.price { color: var(--yellow); font-weight: 800; font-size: 1.1rem; }
.compare { color: var(--muted); text-decoration: line-through; font-size: .85rem; }
.meta { font-size: .75rem; color: var(--lilac); }

.footer {
  position: relative;
  z-index: 3;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: 2fr 1fr 1fr;
  font-size: .9rem;
  color: var(--muted);
}
.footer strong { color: var(--text); display: block; margin-bottom: .4rem; }

/* Cart drawer */
.cart-fab {
  position: fixed;
  right: 1rem; bottom: 1rem;
  z-index: 50;
  box-shadow: 0 10px 40px rgba(255,110,199,.4);
}
.cart-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(400px, 100%);
  background: #160228;
  border-left: 2px solid var(--pink);
  z-index: 60;
  transform: translateX(105%);
  transition: transform .28s ease;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.cart-panel.open { transform: translateX(0); }
.cart-line { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; border-bottom: 1px solid #2a0a45; padding: .5rem 0; }
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 55; opacity: 0; pointer-events: none; transition: .2s;
}
.overlay.show { opacity: 1; pointer-events: auto; }

/* Forms */
.form {
  display: grid;
  gap: .75rem;
  max-width: 520px;
}
.form input, .form select, .form textarea {
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #12001f;
  color: var(--text);
  font: inherit;
}
.form label { font-size: .85rem; color: var(--lilac); }

/* Signup gift popup */
.gift-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(13, 0, 24, 0.72);
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: giftFade 0.35s ease both;
}
@keyframes giftFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.gift-modal {
  position: relative;
  width: min(420px, 100%);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,110,199,.22), transparent 45%),
    linear-gradient(165deg, #2b0b4a, #12001f);
  border: 2px solid var(--line);
  padding: 1.5rem 1.25rem 1.25rem;
  box-shadow: 0 24px 60px rgba(255, 110, 199, 0.25);
  text-align: center;
  animation: giftPop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes giftPop {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.gift-modal h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-arcade);
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--yellow);
}
.gift-modal p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
.gift-modal .gift-label {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-weight: 700;
  font-size: 0.9rem;
}
.gift-modal .gift-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}
.gift-close {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.35rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0;
  cursor: pointer;
}

.aa-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(13, 0, 24, 0.72);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.aa-auth-card {
  position: relative;
  width: min(400px, 100%);
  background: #160228;
  border: 2px solid var(--line);
  padding: 1.35rem 1.25rem 1.25rem;
  box-shadow: 0 24px 60px rgba(255, 110, 199, 0.2);
}
.aa-auth-card h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-arcade);
  font-size: 0.65rem;
  color: var(--yellow);
  line-height: 1.5;
}
.aa-auth-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.aa-auth-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.aa-auth-tabs button {
  flex: 1;
  border-radius: 999px;
  padding: 0.45rem;
  font-weight: 700;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.aa-auth-tabs button.active {
  background: linear-gradient(90deg, var(--pink), var(--magenta), var(--cyan));
  color: #12001f;
  border-color: transparent;
}
.aa-auth-close {
  position: absolute;
  top: 0.4rem;
  right: 0.55rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0;
  cursor: pointer;
}

/* ===== MOBILE ARCADE APP (layout compact, theme colours match desktop) ===== */
@media (max-width: 820px) {
  body {
    background:
      radial-gradient(ellipse at 20% 0%, rgba(255,110,199,.28), transparent 45%),
      radial-gradient(ellipse at 90% 10%, rgba(0,245,212,.16), transparent 40%),
      linear-gradient(180deg, #12001f 0%, #0d0018 100%);
    color: var(--text);
  }
  .arcade-shell { padding: 0 0 4.5rem; max-width: none; }
  .cabinet {
    border: none;
    box-shadow: none;
    background: transparent;
  }
  .cabinet::before { display: none; }
  .marquee {
    background: linear-gradient(90deg, #2b0b4a, #4a156e, #2b0b4a);
    border-bottom: 2px solid var(--pink);
    padding: .65rem .9rem;
    position: sticky;
    top: 0;
    z-index: 40;
  }
  .brand {
    font-family: var(--font-arcade);
    font-size: .55rem;
    font-weight: 400;
    line-height: 1.5;
    background: linear-gradient(90deg, var(--pink), var(--yellow), var(--cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
  }
  .nav-links { display: none; }
  .hero-arcade {
    min-height: auto;
    padding: 1rem .9rem .25rem;
    text-align: left;
    background:
      radial-gradient(circle at 30% 20%, rgba(255,230,109,.12), transparent 50%),
      linear-gradient(180deg, rgba(255,110,199,.14), transparent);
    border-radius: 0;
  }
  .hero-arcade h1 {
    font-family: var(--font-arcade);
    font-size: .72rem;
    font-weight: 400;
    color: var(--yellow);
    line-height: 1.65;
  }
  .hero-arcade p { margin: 0; color: var(--muted); font-size: .9rem; }
  .cta-row { justify-content: flex-start; }
  .flash-bar {
    background: rgba(42, 8, 63, 0.85);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    gap: .5rem;
    padding: .65rem .9rem;
  }
  .flash-chip {
    background: linear-gradient(90deg, rgba(255,110,199,.22), rgba(0,245,212,.14));
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 8px;
    font-size: .78rem;
  }
  .flash-chip .timer { color: var(--yellow); }
  .section { padding: .9rem; }
  .section h2 {
    font-family: var(--font-arcade);
    font-size: .55rem;
    font-weight: 400;
    color: var(--cyan);
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .55rem;
  }
  .product {
    background: linear-gradient(160deg, rgba(255,110,199,.14), rgba(0,245,212,.06));
    border: 1px solid var(--line);
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: none;
  }
  .product:hover { transform: none; box-shadow: none; }
  .product .thumb { border-radius: 8px 8px 0 0; }
  .product h3 { font-size: .82rem; font-weight: 600; padding: .45rem .45rem 0; color: var(--text); }
  .price-row { padding: 0 .45rem .55rem; }
  .price { color: var(--yellow); font-size: .95rem; }
  .compare { color: var(--lilac); }
  .meta { display: none; }
  .footer {
    grid-template-columns: 1fr;
    background: rgba(22, 2, 40, 0.9);
    color: var(--muted);
    border-top: 1px solid var(--line);
  }
  .footer strong { color: var(--text); }
  .footer a { color: var(--cyan); }
  .mobile-tabbar {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #160228;
    border-top: 1px solid var(--line);
    z-index: 45;
    padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom));
    text-align: center;
    font-size: .65rem;
    color: var(--muted);
  }
  .mobile-tabbar a { color: var(--muted); display: grid; gap: .15rem; justify-items: center; }
  .mobile-tabbar a.active, .mobile-tabbar a:hover { color: var(--cyan); }
  .cart-fab {
    bottom: 4.2rem;
    background: linear-gradient(90deg, var(--pink), var(--magenta));
    color: #12001f;
  }
  .cart-panel {
    background: #160228;
    color: var(--text);
    border-left: 2px solid var(--pink);
  }
  .cart-line { border-bottom-color: #2a0a45; }
  .form input, .form select, .form textarea {
    background: #12001f;
    color: var(--text);
    border-color: var(--line);
  }
  .form label { color: var(--lilac); }
  .overlay { background: rgba(13, 0, 24, 0.7); }
}

.mobile-tabbar { display: none; }

/* Legal PDF look */
.legal-doc {
  max-width: 860px;
  margin: 1.5rem auto;
  background: #faf8f5;
  color: #1a1a1a;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  font-family: "Times New Roman", Georgia, serif;
  line-height: 1.45;
}
.legal-doc h1 { text-align: center; font-size: 1.6rem; margin-bottom: .25rem; }
.legal-doc .seal { text-align: center; color: #666; font-size: .85rem; margin-bottom: 1.5rem; }
.legal-doc .clause { margin: .55rem 0; font-size: .92rem; }
.legal-doc .clause b { font-family: Georgia, serif; }

/* Admin */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.admin-nav {
  background: #160228;
  border-right: 1px solid var(--line);
  padding: 1rem;
}
.admin-nav a {
  display: block;
  padding: .55rem .7rem;
  color: var(--muted);
  border-radius: 8px;
  margin-bottom: .25rem;
}
.admin-nav a.active, .admin-nav a:hover { background: #2a0a45; color: var(--cyan); }
.admin-main { padding: 1.25rem; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { border-bottom: 1px solid #2a0a45; padding: .55rem; text-align: left; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stat {
  background: #1a0530;
  border: 1px solid var(--line);
  padding: 1rem;
  border-radius: 12px;
}
.stat b { display: block; font-size: 1.4rem; color: var(--yellow); }

@media (max-width: 820px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { display: flex; gap: .35rem; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; }
}
