:root {
  --magenta: #FF2BD6;
  --cyan: #22E5FF;
  --bg: #0B0B14;
  --bg-2: #14141f;
  --card: #1b1b2a;
  --ink: #f4f3ff;
  --ink-dim: #a9a7c4;
  --shelf: linear-gradient(180deg, #2a1b12, #140d09);
  --radius: 10px;
  --glow-pink: 0 0 6px rgba(255,43,214,.7), 0 0 18px rgba(255,43,214,.45);
  --glow-cyan: 0 0 6px rgba(34,229,255,.7), 0 0 18px rgba(34,229,255,.45);
}
/* Lights On = accessible daytime store: high contrast, no glow */
:root[data-theme="lights"] {
  --bg: #f6f4ef; --bg-2: #efe9dd; --card: #ffffff;
  --ink: #16151f; --ink-dim: #4a4760;
  --shelf: linear-gradient(180deg,#d8c7a8,#c3ad84);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="neon"] body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #241437 0%, transparent 60%),
    var(--bg);
}
a { color: var(--cyan); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 50; }

/* ---------- Marquee header ---------- */
.marquee {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(11,11,20,.96), rgba(11,11,20,.82));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 14px 16px 12px;
}
:root[data-theme="lights"] .marquee {
  background: var(--bg-2); border-bottom: 1px solid rgba(0,0,0,.12);
}
.marquee-inner { display: flex; align-items: center; gap: 16px; max-width: 1200px; margin: 0 auto; }
.sign { font-family: "Bebas Neue", Impact, sans-serif; font-size: clamp(30px, 7vw, 52px); line-height: .9; letter-spacing: 2px; display: flex; gap: 12px; }
.sign-neon { color: var(--cyan); text-shadow: var(--glow-cyan); }
.sign-neon.pink { color: var(--magenta); text-shadow: var(--glow-pink); }
:root[data-theme="lights"] .sign-neon { color: #0a7ea4; text-shadow: none; }
:root[data-theme="lights"] .sign-neon.pink { color: #c2156a; text-shadow: none; }
/* BETA patch — a sewn-on cloth patch hanging off the sign */
.patch {
  align-self: flex-start; margin-left: 4px; margin-top: 2px;
  font-family: Inter, sans-serif; font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  color: #0a0a12; background: #ffd23f; padding: 3px 8px; border-radius: 4px;
  border: 2px dashed rgba(0,0,0,.35);            /* stitching */
  transform: rotate(6deg); line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
.marquee-meta { flex: 1 1 auto; min-width: 0; }
.marquee-actions { display: flex; gap: 8px; flex: 0 0 auto; align-self: flex-start; }
.donate {
  cursor: pointer; border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 700;
  color: #fff; background: var(--magenta); border: 1px solid transparent; box-shadow: var(--glow-pink);
}
:root[data-theme="lights"] .donate { background: #c2156a; box-shadow: none; }
.donate-card { max-width: 440px; }
.donate-links { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 14px; }
.open-sign {
  font-family: "Bebas Neue", sans-serif; letter-spacing: 2px; color: #39ff88;
  text-shadow: 0 0 6px rgba(57,255,136,.7); font-size: 18px;
}
:root[data-theme="lights"] .open-sign { color: #138a4a; text-shadow: none; }
.now-browsing { margin: 2px 0 0; color: var(--ink-dim); font-size: 13px; }
.now-browsing strong { color: var(--ink); }
.freshness { margin: 1px 0 0; color: var(--ink-dim); font-size: 12px; }
.lights {
  flex: 0 0 auto; cursor: pointer;
  background: var(--card); color: var(--ink); border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600;
}
.search-wrap { max-width: 1200px; margin: 12px auto 0; }
#search {
  width: 100%; padding: 11px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16); background: var(--card); color: var(--ink);
  font-size: 15px;
}
#search::placeholder { color: var(--ink-dim); }
#search:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }

/* ---------- Aisles ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; }
.aisle-section { margin: 26px 0; }
.aisle-head {
  font-family: "Bebas Neue", sans-serif; letter-spacing: 1.5px;
  font-size: 26px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px;
}
.sticker {
  background: var(--magenta); color: #fff; font-size: 12px; font-family: Inter, sans-serif;
  font-weight: 700; padding: 3px 8px; border-radius: 4px; transform: rotate(-4deg);
  box-shadow: var(--glow-pink);
}
:root[data-theme="lights"] .sticker { box-shadow: none; }

/* ---------- The shelf bay: cases stand on a wooden shelf against a back wall ---------- */
.wall {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr);
  align-items: end;                    /* cases rest ON the shelf plank */
  gap: 16px; overflow-x: auto;
  padding: 24px 16px 14px;
  scroll-snap-type: x proximity;
  border-radius: 10px 10px 5px 5px;
  position: relative;
  /* layered: plank seams, wood plank (bottom), dark back wall */
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,.30) 0 1px, transparent 1px 46px),
    linear-gradient(180deg, #6a4526, #38240f),
    linear-gradient(180deg, #0c0813 0%, #17100b 100%);
  background-size: 100% 42px, 100% 42px, 100% 100%;
  background-position: left bottom, left bottom, left top;
  background-repeat: repeat-x, repeat-x, no-repeat;
  box-shadow: inset 0 -44px 24px -24px rgba(0,0,0,.6), inset 0 2px 0 rgba(255,220,170,.08);
}
.wall::-webkit-scrollbar { height: 9px; }
.wall::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 8px; }
:root[data-theme="lights"] .wall {
  background-image:
    repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 1px, transparent 1px 46px),
    linear-gradient(180deg, #caa877, #a67f4d),
    linear-gradient(180deg, #efe7d7, #e0d4bc);
}

/* ---------- VHS clamshell case (rental-case format) ---------- */
.case {
  scroll-snap-align: start; cursor: pointer; text-align: left;
  position: relative; display: flex; min-width: 0; color: inherit;
  padding: 0; border: 0; border-radius: 5px 7px 7px 5px;
  background: linear-gradient(135deg, #1b1b23, #050507);   /* black plastic body */
  box-shadow:
    0 15px 11px -8px rgba(0,0,0,.78),                      /* contact shadow on shelf */
    inset 0 0 0 1px rgba(255,255,255,.06);
  transition: transform .16s ease, box-shadow .16s ease;
}
.case:hover, .case:focus-visible {
  transform: translateY(-9px) rotate(-.5deg); outline: none;
  box-shadow: 0 26px 24px -10px rgba(0,0,0,.85), inset 0 0 0 1px rgba(255,255,255,.1);
}
.case::after {                         /* clear-plastic gloss over the whole case */
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 3;
  background: linear-gradient(118deg, rgba(255,255,255,.18) 0, transparent 22%, transparent 76%, rgba(255,255,255,.08) 100%);
}

/* paper sleeve inside the clamshell */
.sleeve {
  flex: 1 1 auto; min-width: 0; margin: 4px 0 4px 5px;
  display: flex; flex-direction: column; overflow: hidden;
  background: #f4efe2; border-radius: 3px 0 0 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.18);
}
.sleeve-head {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 3px 5px; background: #fbf8ef; border-bottom: 1px solid rgba(0,0,0,.08);
}
.store { font-size: 7.5px; font-weight: 800; letter-spacing: .3px; color: #2a2620; text-transform: uppercase; white-space: nowrap; }
.barcode {
  width: 40px; height: 11px; flex: 0 0 auto;
  background: repeating-linear-gradient(90deg, #17150f 0 1px, transparent 1px 2px, #17150f 2px 4px, transparent 4px 5px, #17150f 5px 6px, transparent 6px 8px);
}
.rental-band {
  font-family: "Bebas Neue", sans-serif; letter-spacing: 1.5px; font-size: 12px; line-height: 1;
  padding: 3px 6px; color: #0a0a12; text-align: center;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
}
.art { position: relative; flex: 1 1 auto; }
.art .poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: #000; }
.art .plastic {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(130deg, rgba(255,255,255,.22) 0, transparent 30%, transparent 85%, rgba(255,255,255,.12) 100%);
}
.case-label { padding: 5px 7px 6px; background: #efe9d8; border-top: 1px dashed rgba(0,0,0,.18); }
.case-label .t { font-size: 11.5px; font-weight: 700; line-height: 1.12; margin: 0 0 3px; color: #17150f;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.case-label .sub { font-size: 10px; color: #5c5544; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.badge { font-size: 9px; padding: 1px 4px; border-radius: 3px; border: 1px solid rgba(0,0,0,.22); background: rgba(0,0,0,.03); }
.badge.fmt { color: #0a4e63; border-color: rgba(10,78,99,.4); }
.badge.in  { color: #0a6b33; border-color: rgba(10,107,51,.45); }
.badge.out { color: #a12020; border-color: rgba(161,32,32,.45); }
.badge.rate{ color: #8a6a00; border-color: rgba(138,106,0,.45); }

/* black spine on the right, title running vertically */
.case-spine {
  flex: 0 0 15px; position: relative; border-radius: 0 6px 6px 0;
  background: linear-gradient(90deg, #000, #242430 55%, #0a0a0e);
  box-shadow: inset 1px 0 0 rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
}
.spine-t {
  writing-mode: vertical-rl; text-orientation: mixed;
  font-size: 8px; font-weight: 700; letter-spacing: .5px; color: #d2d2e2;
  max-height: 92%; overflow: hidden; white-space: nowrap; text-transform: uppercase;
}

/* ---------- Neon flicker on the sign ---------- */
@keyframes neon-flicker {
  0%, 16%, 18%, 39%, 41%, 69%, 71%, 100% { opacity: 1; filter: brightness(1.05); }
  17% { opacity: .35; filter: brightness(.4); }
  40% { opacity: .6; filter: brightness(.6); }
  70% { opacity: .25; filter: brightness(.3); }
}
:root[data-theme="neon"] .sign-neon { animation: neon-flicker 5s steps(1, end) infinite; }
:root[data-theme="neon"] .sign-neon.pink { animation-duration: 6.3s; animation-delay: -1.3s; }

/* ---------- Clamshell open for the detail sheet ---------- */
@keyframes clamshell-open {
  from { transform: perspective(1500px) rotateY(-86deg); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: perspective(1500px) rotateY(0deg); opacity: 1; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet:not([hidden]) .sheet-card { transform-origin: left center; animation: clamshell-open .44s cubic-bezier(.22,.68,.2,1) both; }
.sheet:not([hidden]) .sheet-backdrop { animation: fade-in .3s both; }

/* ---------- Detail sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; }
/* The author display:grid above outranks the UA [hidden] rule, so restore it. */
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(2,2,8,.72); backdrop-filter: blur(3px); }
.sheet-card {
  position: relative; max-width: 720px; width: 100%; max-height: 88vh; overflow: auto;
  background: var(--bg-2); border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.sheet-close {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px;
  border-radius: 50%; border: none; cursor: pointer; font-size: 16px;
  background: rgba(0,0,0,.5); color: #fff;
}
.sheet-body { padding: 20px; }
.sheet-hero { display: flex; gap: 16px; }
.sheet-hero img { width: 120px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; flex: 0 0 auto; }
.sheet h3 { font-family: "Bebas Neue", sans-serif; letter-spacing: 1px; font-size: 28px; margin: 0 0 6px; }
.sheet .meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.sheet .overview { color: var(--ink-dim); line-height: 1.5; margin: 14px 0; }
.sheet .cast { font-size: 13px; color: var(--ink-dim); }
.trailer { position: relative; aspect-ratio: 16/9; margin: 14px 0; border-radius: 10px; overflow: hidden; background: #000; }
.trailer iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trailer button.play {
  position: absolute; inset: 0; width: 100%; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,.5), rgba(0,0,0,.1)); font-size: 15px; font-weight: 600;
}
.reserve {
  display: inline-block; margin-top: 6px; background: var(--magenta); color: #fff;
  text-decoration: none; font-weight: 700; padding: 11px 18px; border-radius: 999px;
  box-shadow: var(--glow-pink);
}
:root[data-theme="lights"] .reserve { box-shadow: none; }
.reserve.small { font-size: 14px; padding: 9px 14px; }

.empty { text-align: center; color: var(--ink-dim); padding: 40px; }
.store-footer { max-width: 1200px; margin: 0 auto; padding: 24px 16px 48px; color: var(--ink-dim); font-size: 12px; }
.store-footer .rewind { font-family: "Bebas Neue", sans-serif; letter-spacing: 1px; font-size: 18px; color: var(--ink); }
.store-footer a { color: var(--cyan); }

@media (max-width: 560px) {
  .marquee-inner { flex-wrap: wrap; }
  .wall { grid-auto-columns: minmax(118px, 42vw); }
  .sheet-hero { flex-direction: column; }
  .sheet-hero img { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
