/* ============================================================
   CLICK A CART — retro arcade theme
   Palette: deep space purple bg, neon arcade accents
   ============================================================ */
:root {
  --bg:        #0f0f23;
  --bg-2:      #1a1033;
  --panel:     #241650;
  --panel-2:   #2e1c66;
  --ink:       #f4f4ff;
  --ink-dim:   #b7a9e8;

  --cyan:      #29e0d6;
  --magenta:   #ff5dcd;
  --yellow:    #ffd23f;
  --green:     #5ddd5d;
  --orange:    #ff8c42;
  --red:       #ff4d6d;

  --shadow:    #07071a;

  --pixel:     'Press Start 2P', monospace;
  --term:      'VT323', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 0%, #2a1a5e 0%, transparent 45%),
    radial-gradient(circle at 85% 10%, #3a1452 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 60%);
  color: var(--ink);
  font-family: var(--term);
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: .5px;
  overflow-x: hidden;
  image-rendering: pixelated;
}

img { image-rendering: pixelated; }
/* the logo is smooth line-art, not pixel blocks — render it crisp & smooth */
img[src$="logo.svg"] { image-rendering: auto; }

h1, h2, h3 { font-family: var(--pixel); line-height: 1.4; }

a { color: var(--cyan); text-decoration: none; }

/* ---------- CRT overlays ---------- */
.crt {
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
  mix-blend-mode: multiply;
}
.scanlines {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,.18) 3px,
    rgba(0,0,0,.18) 4px
  );
  opacity: .6;
  animation: flicker 6s infinite steps(60);
}
@keyframes flicker { 0%,97%{opacity:.6} 98%{opacity:.4} 99%{opacity:.7} 100%{opacity:.6} }

/* ---------- Screens / pages ---------- */
.screen[hidden] { display: none !important; }
.screen.start { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
body[data-screen="start"] .hud { display: none; }

/* ---------- Cart page (add-to-cart screen) ---------- */
.cartpage { max-width: 760px; margin: 0 auto; padding: 96px 18px 70px; min-height: 100vh; }
.cartpage__head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.cartpage__head .section-title { margin: 0; text-align: left; }
.cartpage__items { list-style: none; margin: 0 0 20px; padding: 4px 18px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 4px solid var(--shadow); box-shadow: 0 0 0 4px var(--cyan), 8px 8px 0 4px var(--shadow); }
.cartpage__items:empty { display: none; }
.cartpage__foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.cartpage__foot .drawer__total { margin: 0; font-size: 14px; gap: 16px; }
.cartpage__foot .btn { min-width: 220px; text-align: center; }
@media (max-width: 520px) { .cartpage__foot .btn { width: 100%; } }

/* ---------- Buttons (chunky pixel) ---------- */
.btn {
  font-family: var(--pixel);
  font-size: 11px;
  color: var(--bg);
  background: var(--yellow);
  border: 0;
  padding: 12px 16px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 6px var(--yellow),
    6px 6px 0 6px var(--shadow);
  transition: transform .05s ease;
  -webkit-user-select: none; user-select: none;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--yellow), 2px 2px 0 6px var(--shadow); }
.btn:focus-visible { outline: 3px dashed var(--cyan); outline-offset: 6px; }

.btn--big { font-size: 14px; padding: 16px 22px; background: var(--green);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--green), 6px 6px 0 6px var(--shadow); }
.btn--big:active { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--green), 2px 2px 0 6px var(--shadow); }

.btn--ghost { background: transparent; color: var(--cyan);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--cyan), 6px 6px 0 6px var(--shadow); }
.btn--ghost:active { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--cyan), 2px 2px 0 6px var(--shadow); }

.btn--cart { background: var(--magenta); font-size: 10px; padding: 10px 14px;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--magenta), 5px 5px 0 6px var(--shadow); }
.btn--cart:active { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--magenta), 1px 1px 0 6px var(--shadow); }

.btn--x { background: var(--red); color: var(--ink); font-size: 11px; padding: 8px 12px;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--red), 4px 4px 0 6px var(--shadow); }

.btn:disabled { filter: grayscale(.7) brightness(.7); cursor: not-allowed; }
.btn:disabled:active { transform: none; }

/* ---------- HUD ---------- */
.hud {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #160c33, #0c0820);
  border-bottom: 4px solid var(--magenta);
  box-shadow: 0 4px 0 var(--shadow);
  flex-wrap: wrap;
}
.hud__brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.hud__logo { display: block; }
.hud__title { font-family: var(--pixel); font-size: 14px; color: var(--yellow);
  text-shadow: 2px 2px 0 var(--magenta); }
.hud__nav { display: flex; gap: 18px; margin-left: auto; font-family: var(--pixel); font-size: 11px; }
.hud__nav a { color: var(--ink-dim); }
.hud__nav a:hover { color: var(--cyan); text-shadow: 0 0 8px var(--cyan); }
.hud__stats { display: flex; align-items: center; gap: 14px; }
.hud__stat { font-family: var(--pixel); font-size: 11px; color: var(--cyan); white-space: nowrap; }
.hud__stat b { color: var(--ink); }
@media (max-width: 620px) {
  .hud__nav { display: none; }
  .hud__stats { margin-left: auto; }
}

/* ---------- HERO ---------- */
.hero { position: relative; padding: 60px 20px 80px; text-align: center; overflow: hidden; }
.hero__stars {
  position: absolute; inset: 0; z-index: 0; opacity: .5;
  background-image:
    radial-gradient(2px 2px at 10% 20%, #fff, transparent),
    radial-gradient(2px 2px at 30% 70%, var(--cyan), transparent),
    radial-gradient(2px 2px at 55% 35%, #fff, transparent),
    radial-gradient(2px 2px at 70% 80%, var(--magenta), transparent),
    radial-gradient(2px 2px at 85% 25%, #fff, transparent),
    radial-gradient(2px 2px at 45% 90%, var(--yellow), transparent),
    radial-gradient(2px 2px at 92% 60%, #fff, transparent);
  animation: twinkle 3s steps(2) infinite;
}
@keyframes twinkle { 50% { opacity: .25; } }
.hero__inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.hero__logo { width: 150px; height: 150px; animation: bob 1.4s steps(2) infinite; filter: drop-shadow(0 4px 8px rgba(7,7,26,.7)); }
@keyframes bob { 50% { transform: translateY(-8px); } }

.hero__title { margin: 18px 0 6px; font-size: clamp(34px, 9vw, 76px);
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero__title-line { color: var(--yellow); text-shadow: 4px 4px 0 var(--magenta), 8px 8px 0 var(--shadow); }
.hero__title-line:nth-child(2) { color: var(--cyan); text-shadow: 4px 4px 0 var(--red), 8px 8px 0 var(--shadow); }

.hero__sub { font-family: var(--pixel); font-size: 12px; color: var(--green); margin: 8px 0 18px; letter-spacing: 2px; }
.hero__blurb { font-size: 22px; color: var(--ink-dim); max-width: 560px; margin: 0 auto 26px; }
.hero__cta { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.hero__coin { font-family: var(--pixel); font-size: 10px; color: var(--cyan); margin-top: 34px; animation: blink 1s steps(2) infinite; }

/* glitch title */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  clip-path: inset(0 0 0 0);
}
.glitch::before { color: var(--cyan); transform: translate(-2px,0); opacity: .0; animation: glitch1 4s steps(2) infinite; }
.glitch::after  { color: var(--magenta); transform: translate(2px,0); opacity: .0; animation: glitch2 5s steps(2) infinite; }
@keyframes glitch1 { 2%,6% { opacity:.7; transform: translate(-3px,1px);} 4% { opacity:0;} }
@keyframes glitch2 { 3%,7% { opacity:.7; transform: translate(3px,-1px);} 5% { opacity:0;} }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; background: var(--magenta); color: var(--bg);
  border-top: 4px solid var(--shadow); border-bottom: 4px solid var(--shadow); padding: 8px 0; }
.marquee__track { display: flex; width: max-content; gap: 40px; font-family: var(--pixel); font-size: 11px;
  animation: scroll-x 22s linear infinite; }
.marquee__track span { white-space: nowrap; padding-right: 40px; }
@keyframes scroll-x { to { transform: translateX(-50%); } }

/* ---------- Section headers ---------- */
.section-head { text-align: center; margin: 60px auto 36px; padding: 0 16px; }
.section-title { font-size: clamp(20px, 5vw, 34px); color: var(--cyan);
  text-shadow: 3px 3px 0 var(--shadow); margin: 0; }
.section-sub { font-size: 22px; color: var(--ink-dim); margin: 10px 0 0; }

/* ---------- Product grid ---------- */
.shop { max-width: 1120px; margin: 0 auto; padding: 0 18px 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 26px; }

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 4px solid var(--shadow);
  box-shadow: 0 0 0 4px var(--cyan), 8px 8px 0 4px var(--shadow);
  padding: 18px;
  display: flex; flex-direction: column;
  position: relative;
  transition: transform .08s steps(2);
}
.card:hover { transform: translateY(-4px); }
.card__tag { position: absolute; top: -14px; right: 12px; font-family: var(--pixel); font-size: 9px;
  background: var(--yellow); color: var(--bg); padding: 5px 8px; box-shadow: 3px 3px 0 var(--shadow); }
.card__art { background: repeating-conic-gradient(#1d1242 0% 25%, #261655 0% 50%) 50% / 24px 24px;
  border: 3px solid var(--shadow); padding: 16px; display: grid; place-items: center; min-height: 150px; }
.card__art svg { width: 120px; height: 120px; filter: drop-shadow(4px 4px 0 var(--shadow)); }
.card__art img.brand-logo { max-width: 100%; max-height: 132px; width: auto; height: auto;
  object-fit: contain; image-rendering: auto; filter: drop-shadow(3px 3px 0 var(--shadow)); }
.card__name { font-size: 13px; margin: 14px 0 4px; color: var(--ink); }
.card__tagline { font-size: 19px; color: var(--ink-dim); margin: 0 0 12px; min-height: 2.4em; }

/* retro stat bars */
.stats { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.stat { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px;
  font-family: var(--pixel); font-size: 8px; color: var(--ink-dim); }
.stat__bar { height: 12px; background: #150d30; border: 2px solid var(--shadow); position: relative; }
.stat__fill { height: 100%; background: var(--green); box-shadow: inset 0 -3px 0 rgba(0,0,0,.3); }
.stat--spd .stat__fill { background: var(--cyan); }
.stat--cap .stat__fill { background: var(--yellow); }
.stat--arm .stat__fill { background: var(--magenta); }

.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__price { font-family: var(--pixel); font-size: 15px; color: var(--yellow); text-shadow: 2px 2px 0 var(--shadow); }
.card__price small { font-size: 9px; color: var(--ink-dim); }

/* add-to-cart pop feedback */
.card.added { animation: pop .3s steps(3); }
@keyframes pop { 50% { transform: scale(1.03); } }

/* ---------- How it works ---------- */
.how { max-width: 1000px; margin: 0 auto; padding: 0 18px 50px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { background: var(--panel); border: 4px solid var(--shadow);
  box-shadow: 0 0 0 4px var(--orange), 7px 7px 0 4px var(--shadow); padding: 22px; text-align: center; }
.step__num { font-family: var(--pixel); font-size: 22px; color: var(--bg); background: var(--orange);
  width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 14px; box-shadow: 4px 4px 0 var(--shadow); }
.step h3 { font-size: 12px; color: var(--cyan); margin: 0 0 8px; }
.step p { font-size: 19px; color: var(--ink-dim); margin: 0; }

/* ---------- About ---------- */
.about { max-width: 880px; margin: 0 auto; padding: 30px 18px 60px; }
.about__panel { background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 4px solid var(--shadow); box-shadow: 0 0 0 4px var(--green), 8px 8px 0 4px var(--shadow); padding: 30px; }
.about__panel .section-title { text-align: left; color: var(--green); }
.about__panel p { font-size: 21px; color: var(--ink-dim); }
.about__panel b { color: var(--ink); }
.about__badges { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.badge { font-family: var(--pixel); font-size: 9px; color: var(--bg); background: var(--cyan);
  padding: 8px 10px; box-shadow: 3px 3px 0 var(--shadow); }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 36px 18px 50px; border-top: 4px solid var(--magenta);
  background: #0c0820; margin-top: 30px; }
.footer p { font-size: 18px; color: var(--ink-dim); margin: 8px 0 0; }
.footer__small { font-size: 15px; color: #6f64a8; }

/* ---------- Cart drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5,3,18,.7); z-index: 200; backdrop-filter: blur(1px); }
.drawer {
  position: fixed; top: 0; right: 0; z-index: 201; height: 100%;
  width: min(420px, 92vw);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-left: 4px solid var(--cyan); box-shadow: -8px 0 0 var(--shadow);
  display: flex; flex-direction: column;
  transform: translateX(0);
}
.drawer[hidden] { display: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between;
  padding: 18px; border-bottom: 4px solid var(--shadow); }
.drawer__head h2 { font-size: 13px; color: var(--yellow); margin: 0; }
.drawer__items { list-style: none; margin: 0; padding: 14px; overflow-y: auto; flex: 1; }
.drawer__empty { text-align: center; color: var(--ink-dim); padding: 30px 18px; font-size: 20px; }

.line { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 2px dashed #3a2a72; }
.line__art { width: 48px; height: 48px; background: #1d1242; border: 2px solid var(--shadow); display: grid; place-items: center; }
.line__art svg { width: 36px; height: 36px; }
.line__art img.brand-logo { max-width: 42px; max-height: 42px; object-fit: contain; image-rendering: auto; }
.line__name { font-family: var(--pixel); font-size: 9px; color: var(--ink); }
.line__price { font-size: 18px; color: var(--ink-dim); }
.qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty button { font-family: var(--pixel); font-size: 10px; width: 26px; height: 26px; cursor: pointer;
  background: var(--panel-2); color: var(--ink); border: 2px solid var(--shadow); }
.qty button:hover { background: var(--magenta); color: var(--bg); }
.qty span { font-family: var(--pixel); font-size: 11px; min-width: 18px; text-align: center; color: var(--yellow); }
.line__rm { font-family: var(--pixel); font-size: 8px; color: var(--red); background: none; border: 0; cursor: pointer; padding: 0; margin-top: 4px; }
.line__rm:hover { text-decoration: underline; }

.drawer__foot { padding: 18px; border-top: 4px solid var(--shadow); }
.drawer__total { display: flex; justify-content: space-between; font-family: var(--pixel);
  font-size: 13px; color: var(--cyan); margin-bottom: 14px; }
.drawer__total b { color: var(--yellow); }
.drawer__foot .btn { width: 100%; text-align: center; }

/* ---------- Receipt modal ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: rgba(5,3,18,.85); padding: 20px; }
.modal[hidden] { display: none; }
.modal__box { background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 4px solid var(--yellow); box-shadow: 0 0 0 4px var(--shadow), 0 0 40px var(--magenta);
  padding: 36px; text-align: center; max-width: 440px; }
.modal__title { font-size: 20px; color: var(--green); margin: 0 0 10px; }
.modal__big { font-family: var(--pixel); font-size: 26px; color: var(--yellow); margin: 6px 0 16px; text-shadow: 3px 3px 0 var(--shadow); }
.modal__box p { font-size: 20px; color: var(--ink-dim); }
.modal__score { font-family: var(--pixel); font-size: 12px; color: var(--cyan); margin: 16px 0 22px; }
.modal__score b { color: var(--yellow); }

/* ---------- Start sequence overlay ---------- */
.startseq {
  position: fixed; inset: 0; z-index: 10001;
  display: grid; place-items: center;
  background: rgba(8,5,20,.94);
  overflow: hidden;
}
.startseq[hidden] { display: none; }
.startseq.is-on { animation: seqIn .12s steps(2) both; }
.startseq.out   { animation: seqOut .35s steps(3) forwards; }
@keyframes seqIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes seqOut { to { opacity: 0; } }
/* scanlines over the overlay */
.startseq::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.3) 3px 4px);
}
/* CRT power-on flash */
.startseq.flash::after {
  content: ""; position: absolute; inset: 0; background: #fff;
  animation: seqFlash .18s steps(2) forwards;
}
@keyframes seqFlash { from { opacity: .9; } to { opacity: 0; } }

.startseq__text { font-family: var(--pixel); text-align: center; line-height: 1.2; padding: 0 16px; }
.startseq__text.ready {
  font-size: clamp(28px, 8vw, 60px); color: var(--cyan);
  text-shadow: 4px 4px 0 var(--shadow), 0 0 26px var(--cyan);
  animation: readyPop .3s steps(3) both;
}
.startseq__text.go {
  font-size: clamp(48px, 15vw, 130px); color: var(--yellow);
  text-shadow: 6px 6px 0 var(--shadow), 0 0 34px var(--magenta);
  animation: goPop .3s steps(2) both;
}
@keyframes readyPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes goPop { 0% { transform: scale(.5); } 55% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* ---------- utility animations ---------- */
.blink { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto; }
}
