/* Hard Copy — one stylesheet. Dark room, loud carpet, neon signs, slatwall bays,
   shelf boards with price channels, keep cases / jewel cases / books.
   Signage: Bungee (OFL, vendored). Body: system UI, kept readable. Dark only. */

@font-face {
  font-family: "Bungee";
  src: url("/static/fonts/Bungee-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --room: #07060c;
  --carpet: #120e22;
  --panel: #15122a;
  --panel-2: #1d1935;
  --line: #2d2850;
  --ink: #ece9fb;
  --dim: #a29dc8;
  --mute: #6f6a96;
  --pink: #ff2d95;
  --cyan: #2de2ff;
  --yellow: #ffe84a;
  --green: #5cff7a;
  --tube: #d9f6ff;
  --star: #ffcf3a;
  --sign-font: "Bungee", "Impact", "Arial Black", sans-serif;
  --body-font: system-ui, "Segoe UI", Roboto, sans-serif;
  --topbar-h: 58px;
  /* the wall */
  --slat: #2a2735;
  --slat-groove: #15131c;
  --wood-hi: #8a5a36;
  --wood: #5e3a20;
  --wood-lo: #3a2312;
  --board-top: #d9d5cc;
  --board-front: #b9b4a8;
  --channel: #f1ede2;
  /* face-out case sizes */
  --dvd-w: 126px;  --dvd-h: 178px;
  --cd-w: 140px;   --cd-h: 140px;
  --book-w: 114px; --book-h: 172px;
  /* spine widths and heights */
  --dvd-sw: 22px;  --cd-sw: 16px;  --book-sw: 26px;
}

* { box-sizing: border-box; }
html { background: var(--room); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 15px/1.5 var(--body-font);
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.8) 70%),
    url("/static/img/carpet.svg") center top / 180px 180px repeat;
  background-color: var(--carpet);
  overflow-x: hidden;
}
a { color: var(--cyan); }
h1, h2, h3 { margin: 0; font-weight: 400; }
kbd { font: 11px/1 ui-monospace, Consolas, monospace; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; vertical-align: 1px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ neon + light */
.neon {
  font-family: var(--sign-font);
  letter-spacing: 0.06em;
  color: #fff;
  --neon: var(--pink);
  text-shadow: 0 0 2px #fff, 0 0 8px var(--neon), 0 0 18px var(--neon), 0 0 40px var(--neon);
}
.neon-pink { --neon: var(--pink); }
.neon-cyan { --neon: var(--cyan); }
.neon-yellow { --neon: var(--yellow); }
.neon-green { --neon: var(--green); }
.fx-on .flicker { animation: flicker 7s linear infinite; }
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.55; }
  21% { opacity: 0.85; }
}
.tube {
  position: fixed; top: 0; left: 6%; right: 6%; height: 5px; z-index: 1100;
  background: linear-gradient(#fff, var(--tube) 60%, #9ad7ea);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 0 18px 6px rgba(217, 246, 255, 0.45), 0 0 70px 24px rgba(217, 246, 255, 0.14);
  pointer-events: none;
}
.fx-on .tube { animation: tube 9s steps(1) infinite; }
@keyframes tube { 0%, 92%, 100% { opacity: 1; } 93%, 95% { opacity: 0.75; } 94% { opacity: 0.9; } }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: var(--topbar-h); padding: 8px 16px;
  background: rgba(7, 6, 12, 0.88); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 20px; text-decoration: none; white-space: nowrap; }
.doors-nav { display: flex; gap: 4px; }
.doors-nav a {
  color: var(--dim); text-decoration: none; font-family: var(--sign-font); font-size: 12px; letter-spacing: 0.08em;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap;
}
.doors-nav a:hover { color: var(--ink); background: var(--panel-2); }
.doors-nav a.active { color: var(--yellow); text-shadow: 0 0 8px rgba(255, 232, 74, 0.6); }
.search { flex: 1 1 240px; min-width: 160px; margin: 0; }
.search input {
  width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); font: 15px var(--body-font);
}
.search input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.btn {
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; font: 600 13px var(--body-font); cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--cyan); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn.primary { background: var(--pink); color: #1a0010; border-color: transparent; font-family: var(--sign-font); font-weight: 400; letter-spacing: 0.06em; }
.btn.primary kbd { background: rgba(0, 0, 0, 0.15); border-color: rgba(0, 0, 0, 0.2); color: #1a0010; }
.btn.link { background: transparent; border-color: transparent; color: var(--cyan); }
.btn.round { border-radius: 50%; width: 42px; height: 42px; padding: 0; font-size: 26px; line-height: 1; }
.fx-btn { font-family: var(--sign-font); font-size: 12px; font-weight: 400; letter-spacing: 0.08em; }
.fx-btn[aria-pressed="true"] { color: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(92, 255, 122, 0.35); }
.filters-toggle { display: none; }
.progress {
  font: 600 12px var(--body-font); color: var(--dim); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
}
.progress::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green); animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.25; } }
/* The filter bar: rounded pills for the everyday filters, the rest behind "More filters". */
.filters { display: flex; flex-direction: column; gap: 8px; flex-basis: 100%; }
.filter-main, .filter-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-more { padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--line); background: rgba(0, 0, 0, 0.18); }
.filter-more[hidden] { display: none; }
.pill {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 14px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--ink); cursor: pointer;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 6px rgba(0, 0, 0, 0.25);
  font: 600 13px var(--body-font); white-space: nowrap; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pill > span { font: 700 10px var(--body-font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.pill select {
  -webkit-appearance: none; appearance: none; border: 0; background: transparent no-repeat right center; color: var(--ink);
  font: 600 13px var(--body-font); padding: 0 18px 0 0; max-width: 180px; cursor: pointer;
  field-sizing: content;   /* as wide as the current choice, not the longest option */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b9ad98' stroke-width='1.6'/%3E%3C/svg%3E");
}
.pill select:focus { outline: none; }
.pill select option { color: var(--ink); background: var(--panel); }
.pill:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.pill:focus-within, .pill:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.pill.on { border-color: var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 24%, var(--panel-2)), color-mix(in srgb, var(--accent) 10%, var(--panel))); }
.pill.on > span { color: var(--ink); }
.pill.more .count {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font: 800 11px var(--body-font);
}
.pill.more .count[hidden] { display: none; }
.pill.more[aria-expanded="true"] { border-color: var(--accent); }
.pill.clear, .pill.link { background: transparent; box-shadow: none; border-color: transparent; color: var(--accent); text-decoration: none; }
.pill.clear[hidden] { display: none; }
body[data-page="storefront"] .filters, body[data-page="storefront"] .filters-toggle { display: none; }

/* ------------------------------------------------------------ storefront */
.storefront { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - var(--topbar-h)); padding: 24px 16px 48px; }
.facade {
  position: relative; width: 100%; max-width: 960px; margin: 0 auto; text-align: center;
  padding: 44px 20px 28px;
  background: linear-gradient(180deg, #1a1530, #0d0a1a 60%, #09071a);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 0 120px rgba(45, 226, 255, 0.05);
}
.awning {
  position: absolute; top: -14px; left: 24px; right: 24px; height: 26px; border-radius: 6px 6px 0 0;
  background: repeating-linear-gradient(90deg, var(--pink) 0 28px, #f5f5f5 28px 56px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 96% 72%, 92% 100%, 88% 72%, 84% 100%, 80% 72%, 76% 100%, 72% 72%, 68% 100%, 64% 72%, 60% 100%, 56% 72%, 52% 100%, 48% 72%, 44% 100%, 40% 72%, 36% 100%, 32% 72%, 28% 100%, 24% 72%, 20% 100%, 16% 72%, 12% 100%, 8% 72%, 4% 100%, 0 72%);
}
.marquee { font-size: clamp(44px, 9vw, 96px); line-height: 1; margin-top: 8px; }
.tagline { font-size: clamp(13px, 2.2vw, 20px); margin: 10px 0 0; letter-spacing: 0.3em; }
.open-sign {
  display: inline-block; margin: 18px auto 0; padding: 4px 18px; font-size: 22px;
  border: 3px solid currentColor; border-radius: 10px; color: var(--green);
  text-shadow: 0 0 6px var(--green), 0 0 18px var(--green);
  box-shadow: 0 0 12px rgba(92, 255, 122, 0.5), inset 0 0 12px rgba(92, 255, 122, 0.3);
}
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 28px; max-width: 760px; margin: 34px auto 0; }
.doors.three { max-width: 1000px; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 22px; }
.door { text-decoration: none; color: inherit; display: block; }
.door-frame {
  position: relative; display: block; padding: 12px; border-radius: 10px;
  background: linear-gradient(180deg, #4b4e5c, #2a2c37);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 2px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.door-glass {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 300px; padding: 24px 18px; border-radius: 6px;
  background: linear-gradient(160deg, rgba(45, 226, 255, 0.12), rgba(7, 6, 12, 0.9) 40%, rgba(255, 45, 149, 0.08));
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.6);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.door:hover .door-frame, .door:focus-visible .door-frame { transform: translateY(-4px); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(45, 226, 255, 0.15); }
.door:hover .door-glass, .door:focus-visible .door-glass { background: linear-gradient(160deg, rgba(45, 226, 255, 0.2), rgba(20, 16, 40, 0.9) 40%, rgba(255, 45, 149, 0.16)); box-shadow: inset 0 0 80px rgba(255, 232, 74, 0.08); }
.door:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; border-radius: 12px; }
.door-sign { font-size: clamp(26px, 4vw, 36px); margin-bottom: 8px; }
.door-count { font-family: var(--sign-font); font-size: 52px; line-height: 1; color: var(--ink); }
.door-unit { font-size: 13px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.14em; }
.door-sub { font-size: 13px; color: var(--ink); margin-top: 10px; }
.door-sub.dim { color: var(--dim); margin-top: 2px; }
.door-sub.hot { color: var(--yellow); margin-top: 2px; }
.handle { position: absolute; right: 22px; top: 50%; width: 8px; height: 70px; margin-top: -35px; border-radius: 4px; background: linear-gradient(90deg, #e4e6ef, #8c8f9d); box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6); }
.sticker { position: absolute; left: 24px; top: 24px; font-family: var(--sign-font); font-size: 10px; letter-spacing: 0.2em; color: #1a0010; background: var(--yellow); padding: 3px 8px; border-radius: 3px; transform: rotate(-6deg); }
.hours { margin: 30px 0 0; color: var(--dim); font-size: 13px; }

/* ------------------------------------------------------------ the floor */
.floor { padding: 18px 16px 80px; max-width: 1840px; margin: 0 auto; }
.floor-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin: 6px 0 18px; }
.hanging-sign { font-size: clamp(26px, 4vw, 40px); }
.floor-meta { margin: 0; color: var(--dim); font-size: 13px; }
.back-link { margin-left: auto; }
.floor-empty { margin: 60px auto; text-align: center; color: var(--dim); }

.aisle { margin: 0 0 56px; }
.aisle-sign-wrap { position: relative; display: flex; justify-content: center; margin: 0 0 18px; padding-top: 22px; }
.aisle-sign-wrap::before, .aisle-sign-wrap::after {  /* the two wires the sign hangs from */
  content: ""; position: absolute; top: 0; width: 1px; height: 26px; background: linear-gradient(#000, #777);
}
.aisle-sign-wrap::before { left: calc(50% - 90px); }
.aisle-sign-wrap::after { left: calc(50% + 90px); }
.aisle-sign {
  font-size: clamp(22px, 3vw, 32px); padding: 8px 26px; border-radius: 10px;
  background: rgba(10, 8, 20, 0.9); border: 3px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 14px var(--neon), inset 0 0 14px rgba(0, 0, 0, 0.8), 0 18px 30px rgba(0, 0, 0, 0.5);
}

/* A wall bay: wooden uprights either side, slatwall behind, lit from the top. */
.bay {
  position: relative; padding: 10px 22px 6px;
  border-left: 16px solid var(--wood); border-right: 16px solid var(--wood);
  border-image: linear-gradient(90deg, var(--wood-lo), var(--wood-hi) 35%, var(--wood) 60%, var(--wood-lo)) 16;
  background:
    radial-gradient(ellipse 80% 120px at 50% 0, rgba(217, 246, 255, 0.10), transparent),
    linear-gradient(90deg, rgba(0, 0, 0, 0.45), transparent 70px, transparent calc(100% - 70px), rgba(0, 0, 0, 0.45)),
    repeating-linear-gradient(180deg, var(--slat) 0 20px, var(--slat-groove) 20px 23px, #3a3646 23px 24px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), inset 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 2px;
}
.bay::before { /* crown moulding */
  content: ""; position: absolute; left: -16px; right: -16px; top: -12px; height: 14px;
  background: linear-gradient(180deg, var(--wood-hi), var(--wood) 60%, var(--wood-lo));
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); border-radius: 2px;
}
.subsign { font-size: 18px; margin: 18px 0 2px 4px; }

.shelf { position: relative; margin: 6px 0 20px; }
.shelf-head { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px 2px; }
.sign {
  display: inline-block; font-size: 15px; padding: 4px 12px; text-decoration: none; line-height: 1.3;
  border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 7px; background: rgba(8, 6, 16, 0.75);
  box-shadow: 0 0 10px var(--neon), inset 0 0 8px rgba(255, 255, 255, 0.06);
  transition: transform 0.15s ease;
}
.sign:hover, .sign:focus-visible { transform: translateY(-2px); outline: none; border-color: #fff; }
.sign small { font: 600 11px var(--body-font); letter-spacing: 0; margin-left: 10px; color: var(--ink); opacity: 0.85; text-shadow: none; vertical-align: 2px; }
.sign.static { pointer-events: none; }

/* The rail: cases standing on a shelf board, scrolling sideways. */
.rail {
  position: relative; display: flex; align-items: flex-end; gap: 12px;
  padding: 18px 12px 0; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #5a5566 transparent;
  content-visibility: auto; contain-intrinsic-size: auto 230px;
}
.rail.spines { gap: 2px; }
.board {  /* the shelf the cases stand on: top surface, front edge with a price channel */
  position: relative; height: 26px; margin: 0 -10px;
  background:
    linear-gradient(180deg, var(--board-top) 0 7px, #8d887d 7px 8px, var(--board-front) 8px 100%);
  border-radius: 2px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.6), 0 -1px 0 rgba(255, 255, 255, 0.25) inset;
}
.board::before { /* the price channel strip */
  content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 12px;
  background: linear-gradient(180deg, #fff, var(--channel) 40%, #d8d2c3);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.25);
}
.board .label {
  position: absolute; left: 18px; top: 10px; height: 14px; padding: 0 8px;
  font: 700 9px/14px var(--body-font); letter-spacing: 0.12em; color: #222; text-transform: uppercase;
  background: var(--yellow); border: 1px solid rgba(0, 0, 0, 0.25); white-space: nowrap;
}
.board .label.tier { left: auto; right: 18px; background: #fff; }

/* ------------------------------------------------------------ cases */
.case {
  position: relative; flex: 0 0 auto; scroll-snap-align: start; cursor: pointer; outline: none;
  --w: var(--dvd-w); --h: var(--dvd-h);
  width: var(--w); height: var(--h);
  transition: transform 0.18s ease;
  filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.55));
}
.case.cd { --w: var(--cd-w); --h: var(--cd-h); }
.case.book { --w: var(--book-w); --h: var(--book-h); }
.case:hover, .case:focus-visible, .case.open { transform: translateY(-10px); z-index: 5; }
.case:focus-visible .face { outline: 3px solid var(--cyan); outline-offset: 3px; }

.face { position: absolute; inset: 0; overflow: hidden; background: hsl(var(--hue) 50% 28%); }
.face img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* DVD keep case: black plastic rim, hinge on the left, clear sleeve sheen */
.case.dvd .face { border-radius: 4px; border: 3px solid #0d0d10; border-left-width: 9px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.case.dvd .face::before {
  content: ""; position: absolute; left: -9px; top: -3px; bottom: -3px; width: 9px; z-index: 2;
  background: repeating-linear-gradient(180deg, #19191e 0 3px, #0b0b0e 3px 5px);
}
/* CD jewel case: clear edges, ridged hinge */
.case.cd .face { border-radius: 2px; border: 2px solid rgba(220, 230, 255, 0.35); border-left: 10px solid rgba(200, 210, 235, 0.25); }
.case.cd .face::before {
  content: ""; position: absolute; left: -10px; top: 0; bottom: 0; width: 10px; z-index: 2;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0 1px, rgba(255, 255, 255, 0.05) 1px 4px);
}
/* Book: page block on the right, rounded spine shading on the left */
.case.book .face {
  border-radius: 2px 4px 4px 2px;
  box-shadow: 1px 0 0 #f4eedd, 2px 0 0 #d9d1bb, 3px 0 0 #f4eedd, 4px 0 0 #cfc6ad, 5px 1px 0 #e9e2cf;
}
.case.book .face::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 12%; z-index: 2;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(255, 255, 255, 0.12) 45%, rgba(0, 0, 0, 0.15));
}
/* light catching the plastic */
.face::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.04) 30%, transparent 45%, transparent 80%, rgba(255, 255, 255, 0.06));
}
.case.book .face::after { background: linear-gradient(115deg, rgba(255, 255, 255, 0.08), transparent 40%); }

/* Placeholder sleeve when there is no cover yet */
.sleeve {
  position: absolute; inset: 0; padding: 10px 9px 8px; display: flex; flex-direction: column;
  background:
    linear-gradient(135deg, hsl(var(--hue) 70% 46%) 0 18%, transparent 18.5%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 40%),
    hsl(var(--hue) 55% 30%);
}
.case.has-cover .sleeve { display: none; }
.sleeve .fmt { align-self: flex-end; font: 700 8px var(--body-font); letter-spacing: 0.18em; color: #fff; background: rgba(0, 0, 0, 0.45); padding: 2px 5px; border-radius: 2px; }
.sleeve h3 {
  margin: auto 0 4px; font-family: var(--sign-font); font-size: 13px; line-height: 1.08; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); overflow-wrap: anywhere; hyphens: auto;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
}
.sleeve p { margin: 0 0 6px; font-size: 10px; line-height: 1.25; color: rgba(255, 255, 255, 0.85); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sleeve .barcode { height: 12px; width: 46px; background: repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 3px, #fff 3px 5px, transparent 5px 6px); opacity: 0.8; }
.case.book .sleeve { background: linear-gradient(180deg, hsl(var(--hue) 70% 46%) 0 14%, transparent 14.5%), hsl(var(--hue) 35% 22%); padding-left: 16px; }
.pick {  /* STAFF PICK sticker, on real covers too */
  position: absolute; right: -16px; top: 16px; z-index: 4; transform: rotate(14deg);
  font-family: var(--sign-font); font-size: 8px; letter-spacing: 0.1em; color: #1a0010;
  background: var(--yellow); padding: 3px 18px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Spines (the ALL shelf): the cover's left edge as the spine, title across it */
.case.spine { --w: var(--dvd-sw); --h: var(--dvd-h); filter: drop-shadow(2px 6px 5px rgba(0, 0, 0, 0.5)); }
.case.spine.cd { --w: var(--cd-sw); --h: var(--cd-h); }
.case.spine.book { --w: var(--book-sw); --h: var(--book-h); }
.case.spine .face {
  border: 0; border-radius: 2px; box-shadow: none;
  background-color: hsl(var(--hue) 50% 26%); background-size: auto 100%; background-position: 6% 50%;
}
.case.spine .face::before {
  content: ""; position: absolute; inset: 0; left: 0; width: auto; z-index: 1;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), rgba(255, 255, 255, 0.14) 30%, rgba(255, 255, 255, 0.04) 55%, rgba(0, 0, 0, 0.5));
}
.case.spine.dvd .face { background-color: #111; }
.case.spine:not(.has-cover) .face { background-image: linear-gradient(180deg, hsl(var(--hue) 65% 46%) 0 13%, hsl(var(--hue) 55% 28%) 13%); }
.case.spine .spine-title {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(90deg);
  width: calc(var(--h) - 22px); text-align: center;
  font-family: var(--sign-font); font-size: 9.5px; letter-spacing: 0.03em; line-height: 1;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 3px 4px; background: rgba(0, 0, 0, 0.55); border-radius: 2px;
}
.case.spine.cd .spine-title { font-size: 8px; padding: 2px 3px; }
.case.spine .sleeve, .case.spine img.cover, .case.spine .pick { display: none; }
/* Hovering (or keyboard focus) pulls a spine out face-first: it widens to the full case and
   shows its cover (or the placeholder sleeve), pushing its neighbours aside. The short delay
   keeps a quick sweep along the shelf from flicking every case open. */
.case.spine { transition: transform 0.18s ease, width 0.18s ease; }
.case.spine:hover, .case.spine:focus-visible {
  --w: var(--dvd-w); transform: translateY(-10px); z-index: 5;
  transition: transform 0.18s ease, width 0.24s ease 0.12s;
}
.case.spine.cd:hover, .case.spine.cd:focus-visible { --w: var(--cd-w); }
.case.spine.book:hover, .case.spine.book:focus-visible { --w: var(--book-w); }
.case.spine:hover .face, .case.spine:focus-visible .face { background-size: cover; background-position: center; border-radius: 4px; }
.case.spine .face::before, .case.spine .spine-title { transition: opacity 0.15s ease; }
.case.spine:hover .face::before, .case.spine:focus-visible .face::before,
.case.spine:hover .spine-title, .case.spine:focus-visible .spine-title { opacity: 0; }
.case.spine:not(.has-cover):hover .sleeve, .case.spine:not(.has-cover):focus-visible .sleeve { display: flex; }

/* little shelf talker under a hovered/focused case */
.case .tag {
  position: absolute; left: 50%; top: -28px; transform: translateX(-50%);
  font: 600 11px var(--body-font); color: var(--ink); background: rgba(7, 6, 12, 0.95);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s; z-index: 30; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
}
.case:hover .tag, .case:focus-visible .tag { opacity: 1; }
.case .tag .stars { color: var(--star); letter-spacing: 1px; }

/* shelf pages: big face-out grid on one long board per row */
.shelf.big .rail { flex-wrap: wrap; overflow: visible; gap: 26px 20px; content-visibility: visible; padding-bottom: 6px; }
.shelf.big .case { --w: 160px; --h: 226px; }
.shelf.big .case.cd { --w: 176px; --h: 176px; }
.shelf.big .case.book { --w: 146px; --h: 220px; }
.shelf.big .sleeve h3 { font-size: 15px; }

/* ------------------------------------------------------------ the case off the shelf */
body.modal { overflow: hidden; }
.case-overlay { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.ov-backdrop { position: absolute; inset: 0; background: rgba(3, 2, 8, 0.86); backdrop-filter: blur(4px); }
.ov-stage { position: relative; perspective: 1800px; }
.flip { --ar: 0.7; width: min(92vw, calc((100vh - 120px) * var(--ar)), 540px); aspect-ratio: var(--ar); }
.flip.cd { --ar: 1; width: min(92vw, calc(100vh - 120px), 620px); }
.flip.book { --ar: 0.68; width: min(92vw, calc((100vh - 120px) * var(--ar)), 520px); }
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.2, 1); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 6px; overflow: hidden; }
.flip-front { padding: 0; border: 0; cursor: pointer; background: transparent; box-shadow: 0 40px 90px rgba(0, 0, 0, 0.8); }
.flip-front:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
.flip-front .case { position: absolute; inset: 0; width: 100%; height: 100%; transform: none !important; filter: none; cursor: pointer; }
.flip-front .case .tag { display: none; }
.flip-front .case.dvd .face { border-width: 6px; border-left-width: 18px; }
.flip-front .case.dvd .face::before { left: -18px; width: 18px; top: -6px; bottom: -6px; }
.flip-front .case.cd .face { border-left-width: 18px; }
.flip-front .case.cd .face::before { left: -18px; width: 18px; }
.flip-front .sleeve { padding: 22px 20px; }
.flip-front .sleeve h3 { font-size: clamp(20px, 4vw, 30px); -webkit-line-clamp: 6; }
.flip-front .sleeve p { font-size: 15px; }
.flip-front .sleeve .fmt { font-size: 11px; }
.flip-front .pick { font-size: 12px; right: -30px; top: 34px; padding: 5px 34px; }
.flip-front .hint {
  position: absolute; z-index: 5; left: 50%; bottom: 14px; transform: translateX(-50%);
  font: 600 12px var(--body-font); color: #fff; background: rgba(0, 0, 0, 0.6); padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

/* the back of the box */
.flip-back {
  transform: rotateY(180deg);
  background:
    linear-gradient(180deg, hsl(var(--hue) 45% 16%), #0c0a14 46%),
    #0c0a14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.8);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 20px 22px 26px; color: var(--ink); font-size: 14px; line-height: 1.5;
}
.back-title { font-family: var(--sign-font); font-size: clamp(18px, 3.2vw, 26px); line-height: 1.1; color: #fff; }
.back-byline { color: var(--dim); margin: 6px 0 14px; font-size: 13px; }
.back-score { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); }
.back-score .big { font-family: var(--sign-font); font-size: 34px; line-height: 1; color: var(--star); text-shadow: 0 0 12px rgba(255, 207, 58, 0.45); }
.back-score .big.none { font-size: 18px; color: var(--dim); text-shadow: none; }
.back-score .meta { font-size: 12px; color: var(--dim); line-height: 1.4; }
.chip { display: inline-block; font: 700 11px var(--body-font); letter-spacing: 0.06em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); }
.chip.t1 { color: #1a0010; background: var(--yellow); border-color: var(--yellow); }
.ratings { margin: 14px 0 6px; display: grid; gap: 8px; }
.rating { display: grid; grid-template-columns: 112px auto 1fr; align-items: center; gap: 10px; }
.rating .rlabel { font-family: var(--sign-font); font-size: 12px; letter-spacing: 0.08em; }
.rating .rlabel small { display: block; margin-top: 2px; font: 600 10px var(--body-font); letter-spacing: 0.04em; color: var(--dim); }
.rating .rdesc { font-size: 11.5px; color: var(--dim); line-height: 1.3; }
.rating-note { margin: 6px 0 0; font-size: 12px; color: var(--dim); }
.rating-note a { color: var(--accent, var(--cyan)); }
/* stars filled to the quarter: a dim row of five, a lit row on top cut to the value */
.sf { position: relative; display: inline-block; line-height: 1; white-space: nowrap; font-size: 24px; letter-spacing: 0; }
.sf-off { color: rgba(255, 255, 255, 0.16); }
.sf-on { position: absolute; left: 0; top: 0; overflow: hidden; color: var(--star); text-shadow: 0 0 8px rgba(255, 207, 58, 0.45); pointer-events: none; }
.qstars { display: inline-flex; align-items: center; gap: 8px; border-radius: 6px; outline: none; user-select: none; }
.qstars .sf { cursor: pointer; padding: 4px 0; touch-action: pan-y; }   /* a sideways slide sets the value; up/down still scrolls */
.qstars:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.qstars.previewing .sf-on { color: color-mix(in srgb, var(--star) 70%, white); }
.qs-num { min-width: 34px; font: 700 14px var(--body-font); color: var(--star); font-variant-numeric: tabular-nums; }
.qs-clear { border: 0; background: none; color: var(--dim); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 4px; opacity: 0.6; }
.qs-clear:hover { opacity: 1; color: var(--ink); }
.score-stars { font-size: 18px; }
.back h4, .flip-back h4 { font-family: var(--sign-font); font-weight: 400; font-size: 12px; letter-spacing: 0.14em; color: var(--cyan); margin: 18px 0 6px; }
.flip-back p { margin: 0 0 8px; }
.summary { color: #dcd8ee; }
.people dt { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; }
.people dd { margin: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0; font-size: 13px; }
.facts dt { color: var(--dim); }
.facts dd { margin: 0; }
.awards li, .funfacts li { margin-bottom: 5px; }
.awards, .funfacts { margin: 0; padding-left: 18px; }
.funfacts li::marker { content: "★ "; color: var(--star); }
.tracks { margin: 0; padding-left: 26px; columns: 2 200px; column-gap: 24px; font-size: 13px; }
.tracks li { break-inside: avoid; }
.tracks .len { color: var(--mute); margin-left: 6px; font-variant-numeric: tabular-nums; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a { font: 600 12px var(--body-font); color: var(--ink); text-decoration: none; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); }
.links a:hover { border-color: var(--cyan); }
.status-row { display: flex; gap: 6px; flex-wrap: wrap; }
.review textarea {
  width: 100%; min-height: 84px; resize: vertical; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, 0.35); color: var(--ink); font: 14px/1.45 var(--body-font);
}
.review textarea:focus { outline: 2px solid var(--cyan); }
.review .saved { font-size: 11px; color: var(--mute); min-height: 16px; }
.credit { margin-top: 16px; font-size: 11px; color: var(--mute); }
.pending { color: var(--dim); font-style: italic; }
.ov-toolbar { position: relative; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }

/* ------------------------------------------------------------ owned / watched toggles */
.btn.toggle { display: inline-flex; align-items: center; gap: 7px; }
.btn.toggle .tick {
  width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--mute); display: inline-block; position: relative;
}
.btn.toggle[aria-pressed="true"] { border-color: var(--green); color: #eafff0; box-shadow: 0 0 10px rgba(92, 255, 122, 0.25); }
.btn.toggle[aria-pressed="true"] .tick { border-color: var(--green); background: var(--green); }
.btn.toggle[aria-pressed="true"] .tick::after {
  content: ""; position: absolute; left: 3px; top: 0; width: 5px; height: 9px;
  border: solid #07060c; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.flags-row { display: flex; gap: 8px; margin: 0 0 12px; }
.flags-row .chip.on { color: #06210d; background: var(--green); border-color: var(--green); }
.case .seen-dot {
  position: absolute; z-index: 4; left: 6px; bottom: 6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px rgba(92, 255, 122, 0.7);
}
.case .seen-dot::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid #07060c; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.case.spine .seen-dot { left: 50%; transform: translateX(-50%); bottom: 4px; width: 12px; height: 12px; }
.case.spine .seen-dot::after { left: 4px; top: 1px; width: 3px; height: 6px; }

/* ------------------------------------------------------------ rankings */
body[data-page="rankings"] .filters, body[data-page="rankings"] .filters-toggle { display: none; }
.rank-tabs { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; margin-top: 6px; }
.rank-tabs a {
  font-family: var(--sign-font); font-size: 12px; letter-spacing: 0.08em; text-decoration: none; color: var(--dim);
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
}
.rank-tabs a small { font: 600 11px var(--body-font); margin-left: 6px; opacity: 0.8; }
.rank-tabs a[aria-current="page"] { color: #1a0010; background: var(--yellow); border-color: var(--yellow); }
.rank-board {
  max-width: 1100px; margin: 0 auto; padding: 14px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(21, 18, 42, 0.95), rgba(10, 8, 20, 0.95));
  border: 1px solid var(--line); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row {
  display: grid; grid-template-columns: 64px 54px 1fr auto auto; align-items: center; gap: 16px;
  width: 100%; text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); font: inherit; cursor: pointer; border-radius: 8px;
}
.rank-row:hover, .rank-row:focus-visible { background: rgba(255, 255, 255, 0.05); outline: none; }
.rank-row:focus-visible { box-shadow: inset 0 0 0 2px var(--cyan); }
.rank-num { font-family: var(--sign-font); font-size: 30px; line-height: 1; text-align: right; color: var(--dim); }
.rank-row:nth-child(1) .rank-num { color: var(--yellow); text-shadow: 0 0 12px rgba(255, 232, 74, 0.6); }
.rank-row:nth-child(2) .rank-num, .rank-row:nth-child(3) .rank-num { color: #fff; }
.rank-num.none { font-size: 14px; letter-spacing: 0.08em; }
.rank-thumb { width: 54px; height: 76px; border-radius: 3px; overflow: hidden; position: relative; background: hsl(var(--hue) 50% 28%); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); }
.rank-thumb.cd { height: 54px; }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rank-thumb span { position: absolute; inset: 4px; font-family: var(--sign-font); font-size: 7px; line-height: 1.1; color: #fff; overflow: hidden; }
.rank-title { min-width: 0; }
.rank-title strong { display: block; font-family: var(--sign-font); font-weight: 400; font-size: 16px; line-height: 1.15; overflow-wrap: anywhere; }
.rank-title span { display: block; color: var(--dim); font-size: 13px; }
.rank-bars { display: grid; grid-template-columns: auto auto; gap: 1px 10px; font-size: 11px; color: var(--dim); align-items: center; }
.rank-bars b { font-weight: 600; letter-spacing: 0.06em; }
.mini-stars { white-space: nowrap; }
.mini-stars .sf { font-size: 12px; }
.rank-score { font-family: var(--sign-font); font-size: 26px; color: var(--star); min-width: 70px; text-align: right; }
.rank-score.none { font: 600 12px var(--body-font); color: var(--mute); }
.rank-empty { text-align: center; padding: 40px 16px; color: var(--dim); }
.rank-empty p { margin: 0 0 14px; }
.rank-section { margin: 18px 0 6px 12px; font-family: var(--sign-font); font-size: 12px; letter-spacing: 0.12em; color: var(--cyan); }

/* ------------------------------------------------------------ top menu dropdowns */
.menu { position: relative; display: inline-flex; }
.submenu {
  position: absolute; top: 100%; left: 0; z-index: 1200; min-width: 150px; padding: 6px;
  display: none; flex-direction: column; gap: 2px;
  background: rgba(13, 11, 24, 0.98); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.menu:hover .submenu, .menu:focus-within .submenu { display: flex; }
.submenu a { padding: 7px 10px !important; border-radius: 6px; color: var(--ink) !important; }
.submenu a:hover, .submenu a:focus-visible { background: var(--panel-2); outline: none; color: var(--yellow) !important; }
.add-btn { font-family: var(--sign-font); font-weight: 400; letter-spacing: 0.06em; color: #06210d; background: var(--green); border-color: transparent; box-shadow: 0 0 12px rgba(92, 255, 122, 0.35); }
.add-btn:hover { filter: brightness(1.08); border-color: transparent; }
.type-tabs { margin-top: 2px; }
.rank-tabs a.empty { opacity: 0.45; }

/* ------------------------------------------------------------ game cases: coloured keep case with a top band */
.case.game .face { border-radius: 4px; border: 3px solid #0d2a66; border-left-width: 8px; }
.case.game .face::before {
  content: ""; position: absolute; left: -8px; top: -3px; bottom: -3px; width: 8px; z-index: 2;
  background: repeating-linear-gradient(180deg, #123a8a 0 3px, #0a2257 3px 5px);
}
.case.game .sleeve { background: linear-gradient(180deg, #0f3fa8 0 13%, transparent 13.5%), hsl(var(--hue) 45% 24%); }
.case.spine.game .face { background-color: #0d2a66; }
.flip-front .case.game .face { border-width: 6px; border-left-width: 16px; }
.flip-front .case.game .face::before { left: -16px; width: 16px; top: -6px; bottom: -6px; }
.rank-thumb.game { height: 76px; }

/* ------------------------------------------------------------ + Add dialog */
.add-overlay { position: fixed; inset: 0; z-index: 3500; display: flex; justify-content: center; align-items: flex-start; padding: 6vh 16px 16px; }
.add-panel {
  position: relative; width: min(760px, 100%); max-height: 88vh; display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px; border-radius: 14px; background: linear-gradient(180deg, #17132e, #0c0a16);
  border: 1px solid var(--line); box-shadow: 0 40px 90px rgba(0, 0, 0, 0.8);
}
.add-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.add-head h2 { font-size: clamp(18px, 3vw, 24px); }
.add-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.add-kinds button {
  font: 600 13px var(--body-font); color: var(--dim); background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
}
.add-kinds button[aria-checked="true"] { color: #1a0010; background: var(--yellow); border-color: var(--yellow); }
.add-kinds button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.add-form { display: flex; gap: 8px; }
.add-form input { flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 15px var(--body-font); }
.add-form input:focus { outline: 2px solid var(--cyan); }
.add-notes { margin: 0; font-size: 12.5px; color: var(--yellow); }
.add-results { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 4px; }
.add-results li { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); }
.add-results .thumb { width: 52px; height: 72px; border-radius: 3px; overflow: hidden; background: var(--panel-2); display: grid; place-items: center; font-size: 9px; color: var(--mute); }
.add-results .thumb.square { height: 52px; }
.add-results .thumb img { width: 100%; height: 100%; object-fit: cover; }
.add-results strong { display: block; font-family: var(--sign-font); font-weight: 400; font-size: 15px; line-height: 1.15; }
.add-results .meta { display: block; color: var(--dim); font-size: 12.5px; }
.add-results .sub { display: block; color: var(--mute); font-size: 12px; }
.add-results .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.add-results .acts .btn { padding: 6px 10px; }
.add-results .done { color: var(--green); font: 600 12px var(--body-font); }
.add-status { color: var(--dim); font-size: 13px; padding: 10px 4px; }
.remove-link { margin-top: 18px; background: none; border: 0; color: var(--mute); font: 12px var(--body-font); text-decoration: underline; cursor: pointer; padding: 0; }
.remove-link:hover { color: var(--pink); }

/* ------------------------------------------------------------ CRT effects (toggleable, off on phones by default) */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 2500; display: none; }
.fx-on .fx { display: block; }
.fx-scanlines { background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
.fx-grain {
  inset: -50%; width: 200%; height: 200%; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.6s steps(5) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .fx-on .flicker, .fx-on .tube, .fx-grain, .progress::before { animation: none; }
  .case, .door-frame, .door-glass, .sign, .flip-inner { transition: none; }
}

/* ------------------------------------------------------------ phones and small screens */
@media (max-width: 768px) {
  :root {
    --dvd-w: 100px; --dvd-h: 142px;
    --cd-w: 112px; --cd-h: 112px;
    --book-w: 92px; --book-h: 138px;
    --dvd-sw: 19px; --cd-sw: 14px; --book-sw: 22px;
  }
  .topbar { padding: 8px 12px; gap: 8px; }
  .logo { font-size: 16px; }
  .doors-nav a { padding: 6px 7px; font-size: 11px; }
  .search { flex-basis: 100%; order: 5; }
  .progress { order: 6; }
  .filters-toggle { display: inline-block; order: 7; }
  .fx-btn { order: 8; margin-left: auto; }
  .filters { display: none; order: 9; }
  .filters.open { display: flex; }
  .filters .pill[data-key] { flex: 1 1 calc(50% - 8px); justify-content: space-between; }
  .filters .pill select { flex: 1; max-width: none; text-align: right; }
  .floor { padding: 12px 8px 60px; }
  .bay { padding: 8px 10px 4px; border-left-width: 9px; border-right-width: 9px; border-image-slice: 9; }
  .bay::before { left: -9px; right: -9px; }
  .rail { gap: 9px; padding: 16px 6px 0; }
  .sign { font-size: 13px; padding: 3px 9px; }
  .board .label.tier { display: none; }
  .shelf.big .rail { justify-content: center; gap: 22px 12px; }
  .shelf.big .case { --w: 110px; --h: 156px; }
  .shelf.big .case.cd { --w: 120px; --h: 120px; }
  .shelf.big .case.book { --w: 102px; --h: 154px; }
  .case-overlay { justify-content: flex-start; padding: 12px 8px; overflow-y: auto; }
  .flip { width: min(94vw, calc((100vh - 110px) * var(--ar))); }
  .flip.cd { width: min(94vw, calc(100vh - 110px)); }
  .flip-back { padding: 16px 14px 20px; }
  .rating { grid-template-columns: 96px auto; }
  .rating .rdesc { grid-column: 1 / -1; margin-top: -4px; }
  .rank-board { padding: 6px; }
  .rank-row { grid-template-columns: 34px 44px 1fr auto; gap: 10px; padding: 10px 6px; }
  .rank-num { font-size: 20px; }
  .rank-thumb { width: 44px; height: 62px; }
  .rank-thumb.cd { height: 44px; }
  .rank-bars { grid-column: 3 / -1; grid-row: 2; }
  .rank-score { font-size: 20px; min-width: 0; }
  .ov-toolbar .btn.toggle { padding: 7px 10px; }
  .add-btn { order: 4; }
  .doors-nav .menu .submenu { left: -20px; }
  .add-overlay { padding: 8px; }
  .add-panel { max-height: 94vh; padding: 14px 12px; }
  .add-results li { grid-template-columns: 44px 1fr; }
  .add-results .thumb { width: 44px; height: 62px; }
  .add-results .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .marquee { font-size: clamp(28px, 9.5vw, 64px); letter-spacing: 0.02em; }
  .tagline { letter-spacing: 0.18em; }
  .door-glass { min-height: 220px; }
  .facade { padding: 36px 12px 24px; }
  .awning { left: 10px; right: 10px; }
}
