:root {
  --gold: #e8b64a;
  --paper: #efe6d2;
  --dim: #4a4036;
  --wall: #18223a;  /* the room's paint: a deep navy */
  --ink: var(--paper); /* text on the wall */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--paper);
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 600;
  background: var(--wall);
}

@font-face { font-family: 'Blockletter'; src: url('fonts/Blockletter.otf') format('opentype'); font-display: swap; }
header { position: relative; max-width: 1120px; margin: 0 auto; text-align: center; padding: 44px 20px 6px; color: var(--ink); }
h1 {
  margin: 0;
  font-family: 'Bungee', 'Impact', sans-serif;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: clamp(2rem, 5.6vw, 3.4rem);
  line-height: 1;
}
h1 span { color: var(--gold); }
h1.ticket img { display: block; margin: 0 auto; width: min(380px, 78vw); height: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); }

/* arrows either side of the ticket: flip to the year before / after */
.ticket-row { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 3vw, 34px); }
.ticket-row h1.ticket { flex: 0 1 auto; }
.ticket-row h1.ticket img { width: min(380px, 62vw); }
.shelf-arrow {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 64px; color: #f1c203; text-decoration: none;
  font-family: 'Blockletter', 'Impact', sans-serif; font-size: 1.25rem; letter-spacing: .04em; line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45));
  transition: transform .15s ease, color .15s ease;
}
.shelf-arrow[hidden] { display: flex; visibility: hidden; } /* keep its room so the ticket stays centred */
.shelf-arrow svg { width: 34px; height: 42px; fill: none; stroke: currentColor; stroke-width: 9; stroke-linecap: square; stroke-linejoin: miter; }
.shelf-arrow.next { flex-direction: column-reverse; }
.shelf-arrow:hover, .shelf-arrow:focus-visible { color: #ffd84a; outline: none; }
.shelf-arrow.prev:hover, .shelf-arrow.prev:focus-visible { transform: translateX(-4px); }
.shelf-arrow.next:hover, .shelf-arrow.next:focus-visible { transform: translateX(4px); }
@media (max-width: 640px) { .shelf-arrow { width: 40px; font-size: .95rem; } .shelf-arrow svg { width: 24px; height: 30px; stroke-width: 8; } }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tally {
  position: absolute; right: 14px; bottom: -30px; margin: 0;
  font-family: 'Blockletter', 'Impact', sans-serif; font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.6rem, 4vw, 3.2rem); line-height: .8; letter-spacing: .04em;
  color: #f1c203; text-shadow: 0 4px 12px rgba(0,0,0,.45);
}
.tally #count { font-size: 2em; letter-spacing: .02em; margin-right: .12em; }
@media (max-width: 640px) { .tally { position: static; margin: 10px 0 -40px; text-align: right; padding-right: 4px; } }

/* sort + genre filter: bottom left of the header, opposite the tally */
.controls {
  position: absolute; left: 14px; bottom: -34px; z-index: 9; /* over the case (for the genre list), under the viewer (10) */
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; text-align: left;
}
.controls[hidden] { display: none; }
.controls .label { opacity: .55; margin-right: 2px; }
.controls button {
  appearance: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--paper);
  background: rgba(10,14,28,.35); border: 1px solid rgba(239,230,210,.28); border-radius: 99px;
  padding: 3px 11px; cursor: pointer; line-height: 1.3;
}
.controls button:hover { border-color: rgba(239,230,210,.6); }
.controls button.on { background: #f1c203; border-color: #f1c203; color: #1a1408; }
.controls button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sort { display: flex; align-items: center; gap: 6px; }
.sort button.on::after { content: attr(data-arrow); margin-left: 4px; }
.genre-pick { position: relative; }
#genre-btn .label { opacity: .7; }
#genre-btn.on .label { opacity: .6; }
#genre-btn .caret { font-size: .7em; margin-left: 2px; }
.genre-list {
  position: absolute; top: calc(100% + 8px); left: 0; width: min(420px, 86vw);
  display: flex; flex-wrap: wrap; gap: 6px; padding: 12px;
  background: rgba(14,19,36,.97); border: 1px solid rgba(239,230,210,.18); border-radius: 6px;
  box-shadow: 0 14px 34px rgba(0,0,0,.55);
}
.genre-list[hidden] { display: none; }
.genre-list small { opacity: .55; margin-left: 2px; font-size: .85em; }
@media (max-width: 640px) {
  .controls { position: relative; left: auto; bottom: auto; margin: 16px 0 0; justify-content: flex-start; gap: 8px 12px; font-size: .74rem; }
  .controls button { padding: 3px 9px; }
}

/* ---------- shelf ----------
   A home-built pine case (after Ian's reference photo): a wide honey-stained face frame, light
   woodgrain wall panelling behind with dark grooves at uneven spacing, and thin shelf boards
   resting on little cleat blocks at each end. Grain is SVG turbulence, so there are no image files. */
:root {
  /* stained pine: dark late-wood streaks, paler figure, fine pores */
  --pine-h: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='1400' height='200'><filter id='g' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0016 .09' numOctaves='4' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .16 0 0 0 0 .04 0 0 0 0 .02 3.8 0 0 0 -1.55'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --pine-hl: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='1600' height='220'><filter id='g' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.0011 .05' numOctaves='3' seed='21' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .70 0 0 0 0 .33 0 0 0 0 .20 2.4 0 0 0 -1.0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --pine-hf: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='120'><filter id='g' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.012 .75' numOctaves='2' seed='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .33 0 0 0 0 .17 0 0 0 0 .04 2.0 0 0 0 -.85'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --pine-v: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='1400'><filter id='g' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.09 .0016' numOctaves='4' seed='11' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .16 0 0 0 0 .04 0 0 0 0 .02 3.8 0 0 0 -1.55'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --pine-vl: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='1600'><filter id='g' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.05 .0011' numOctaves='3' seed='23' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .70 0 0 0 0 .33 0 0 0 0 .20 2.4 0 0 0 -1.0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --pine-vf: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='600'><filter id='g' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.75 .012' numOctaves='2' seed='5' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .33 0 0 0 0 .17 0 0 0 0 .04 2.0 0 0 0 -.85'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  /* the wall panelling: printed woodgrain, softer and paler */
  --panel-v: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='1400'><filter id='g' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.06 .0025' numOctaves='4' seed='31' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42 0 0 0 0 .30 0 0 0 0 .16 2.2 0 0 0 -.95'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --panel-vf: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='600'><filter id='g' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.5 .015' numOctaves='2' seed='37' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .40 0 0 0 0 .28 0 0 0 0 .15 1.6 0 0 0 -.7'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --stain: #6b2c1a;
}
#shelves {
  --side: 26px;     /* the face frame's stiles */
  --end-gap: 12px;  /* breathing room at each end of a shelf (app.js reads this) */
  position: relative;
  max-width: 1120px;
  margin: 72px auto 120px;
  padding: 0 var(--side);
  background:
    linear-gradient(90deg, rgba(255,205,175,.35), rgba(255,205,175,.08) 2px, transparent 20%, transparent 80%, rgba(60,30,5,.35)) left / var(--side) 100% no-repeat,
    linear-gradient(270deg, rgba(60,30,5,.45), rgba(60,30,5,.15) 2px, transparent 25%, transparent 80%, rgba(255,205,175,.15)) right / var(--side) 100% no-repeat,
    var(--pine-vf), var(--pine-v), var(--pine-vl),
    linear-gradient(180deg, #6e2d1a, #5c2415 60%, #4c1d11);
  box-shadow: 0 34px 54px -22px rgba(4,8,18,.8), 0 6px 22px rgba(4,8,18,.35);
}
/* top and bottom rails of the face frame */
#shelves::before, #shelves::after {
  content: ""; position: absolute; left: 0; right: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(60,30,5,.25), transparent 3%, transparent 97%, rgba(60,30,5,.3)),
    var(--pine-hf), var(--pine-h), var(--pine-hl),
    linear-gradient(180deg, #78331f, #5a2314);
}
#shelves::before {
  top: -38px; height: 38px; border-radius: 2px 2px 0 0;
  box-shadow: inset 0 2px 0 rgba(255,205,175,.4), inset 0 -2px 0 rgba(60,30,5,.45);
}
#shelves::after {
  bottom: -34px; height: 34px; border-radius: 0 0 2px 2px;
  box-shadow: inset 0 2px 0 rgba(255,205,175,.3), 0 18px 24px -8px rgba(4,8,18,.75);
}

.shelf-row { margin: 0; }
.shelf {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0;
  height: 284px;
  padding: 0 var(--end-gap);
  /* the panelling: planks of uneven width, dark V-grooves, lit from the room in front */
  background:
    linear-gradient(180deg, rgba(40,22,6,.55) 0, rgba(40,22,6,.18) 14px, transparent 46px),
    linear-gradient(0deg, rgba(40,22,6,.28), transparent 18px),
    /* the inside faces of the case's sides, seen at an angle */
    linear-gradient(90deg, #3f170d 0, #55210f 9px, rgba(40,22,6,.45) 9px, rgba(40,22,6,.12) 16px, transparent 34px) left / 50% 100% no-repeat,
    linear-gradient(270deg, #36140b 0, #4c1d0e 9px, rgba(40,22,6,.5) 9px, rgba(40,22,6,.15) 16px, transparent 34px) right / 50% 100% no-repeat,
    repeating-linear-gradient(90deg,
      transparent 0 92px, rgba(58,48,40,.85) 92px 94px, rgba(255,240,210,.18) 94px 95px,
      transparent 95px 241px, rgba(58,48,40,.85) 241px 243px, rgba(255,240,210,.18) 243px 244px,
      transparent 244px 371px, rgba(58,48,40,.85) 371px 373px, rgba(255,240,210,.18) 373px 374px,
      transparent 374px 486px),
    var(--panel-vf), var(--panel-v),
    linear-gradient(180deg, #9a7a58, #a98864 40%, #a0805d);
}
.shelf-row:first-child .shelf::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, #36140b, #55210f 80%, rgba(30,10,4,.5));
}
/* each tape casts a soft shadow onto the panelling */
.shelf .spine { box-shadow: inset 1px 0 0 rgba(0,0,0,.3), inset -1px 0 0 rgba(0,0,0,.4), 0 -3px 7px rgba(40,22,6,.35), 3px 0 6px rgba(40,22,6,.25); }

/* a thin pine board: a sliver of its top in front of the tapes, then the sawn front edge */
.board {
  position: relative; z-index: 2;
  height: 19px;
  background:
    linear-gradient(180deg, rgba(30,15,3,.6) 0, rgba(30,15,3,.2) 2px, transparent 5px) 0 0 / 100% 6px no-repeat,
    linear-gradient(180deg, transparent 6px, rgba(255,205,175,.5) 6px, rgba(255,205,175,.1) 7.5px, transparent 10px, transparent 75%, rgba(50,25,5,.4)),
    linear-gradient(90deg, rgba(50,25,5,.35), transparent 3%, transparent 97%, rgba(50,25,5,.35)),
    var(--pine-hf), var(--pine-h), var(--pine-hl),
    linear-gradient(180deg, #8c4128 0, #7c3621 6px, #6b2c1a 6px, #521f12);
  box-shadow: 0 8px 10px -4px rgba(40,22,6,.55);
}
/* the cleats it rests on, one under each end */
.board::before, .board::after {
  content: ""; position: absolute; top: 100%; width: 22px; height: 24px; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(30,15,3,.55), transparent 5px),
    linear-gradient(90deg, rgba(255,205,175,.2), transparent 30%, transparent 70%, rgba(30,15,3,.35)),
    var(--pine-vf),
    linear-gradient(180deg, #4e1e10, #3a160b);
  box-shadow: 0 4px 6px rgba(40,22,6,.45);
}
.board::before { left: 9px; }
.board::after { right: 9px; }
.shelf-row:last-child .board::before, .shelf-row:last-child .board::after { display: none; }
.shelf-row:last-child .board { box-shadow: none; }

.loading { padding: 56px 20px 64px; text-align: center; }
.loading img { display: block; margin: 0 auto; width: min(420px, 100%); height: auto; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.loading p { margin: 16px 0 0; font-family: 'Blockletter', 'Impact', sans-serif; text-transform: uppercase; letter-spacing: .06em; font-size: 1.3rem; color: #f1c203; }

/* ---------- posters on the wall (desktop only) ----------
   Full-size one-sheets in black frames, hung either side of the case at roughly the same scale as
   the tapes. The case never gives up width for them: they hang off its edges and simply run off the
   window on narrower screens. Below 1100px they come down altogether. */
.wall-poster { display: none; }
@media (min-width: 1100px) {
  html, body { overflow-x: clip; }
  .room { position: relative; max-width: 1120px; margin: 0 auto; }
  .wall-poster.left { position: absolute; top: 0; right: calc(100% + 64px); }
  .wall-poster.right { position: absolute; top: 0; left: calc(100% + 64px); }
  .wall-poster {
    display: block;
    width: 560px;
    margin: 0;
    padding: 14px;                     /* the moulding */
    background:
      linear-gradient(135deg, rgba(255,255,255,.16), transparent 18%, transparent 82%, rgba(255,255,255,.05)),
      linear-gradient(180deg, #1c1c1c, #0a0a0a);
    border-radius: 1px;
    box-shadow:
      inset 0 0 0 1px rgba(255,255,255,.07),   /* outer arris */
      inset 0 1px 0 rgba(255,255,255,.22),
      0 2px 3px rgba(4,8,18,.55),
      0 22px 34px -10px rgba(4,8,18,.7);
  }
  .wall-poster.left { transform: rotate(-.3deg); margin-top: 58px; }
  .wall-poster.right { transform: rotate(.35deg); margin-top: 96px; }
  .wall-poster img {
    display: block; width: 100%; height: auto;
    filter: saturate(.92) contrast(1.02) sepia(.06);
  }
  /* the frame's lip shading the edge of the print, and the glass catching the light */
  .wall-poster::before, .wall-poster::after { content: ""; position: absolute; inset: 14px; pointer-events: none; }
  .wall-poster::before { box-shadow: inset 0 0 0 1px rgba(0,0,0,.6), inset 0 3px 6px rgba(0,0,0,.55), inset 0 0 14px rgba(0,0,0,.25); }
  .wall-poster::after {
    background:
      linear-gradient(118deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.04) 26%, transparent 27%, transparent 64%, rgba(255,255,255,.05) 78%, transparent 79%),
      linear-gradient(180deg, rgba(255,214,160,.08), transparent 40%);
  }
}

.credit { max-width: 640px; margin: 0 auto 50px; padding: 0 20px; text-align: center; font-size: .72rem; line-height: 1.5; opacity: .5; color: var(--ink); }
.credit p { margin: 0; }
.credit a { color: inherit; }
.credit a:hover { opacity: 1; color: var(--gold); }

/* ---------- spines ---------- */
.spine {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  flex: none;
  position: relative;
  width: var(--w);
  height: var(--h);
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), transparent 22%, transparent 80%, rgba(0,0,0,.22)),
    var(--c);
  border-radius: 1px 1px 0 0;
  cursor: pointer;
  color: var(--t);
  transition: transform .22s ease, filter .22s ease;
  box-shadow: inset 1px 0 0 rgba(0,0,0,.3), inset -1px 0 0 rgba(0,0,0,.4);
}
/* plastic-sleeve shading: lit on the left, falling off to the right */
.spine::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background:
    linear-gradient(90deg, rgba(255,255,255,.2), transparent 12%, transparent 78%, rgba(0,0,0,.45)),
    linear-gradient(180deg, rgba(255,255,255,.1) 0, transparent 5px);
}
/* a designed spine picture (posters/<name>-spine-b.jpg): the image is the whole spine */
.spine.designed { background-size: 100% 100%; background-repeat: no-repeat; background-color: #111; }
.spine.designed::after { background: linear-gradient(90deg, rgba(255,255,255,.06), transparent 14%, transparent 80%, rgba(0,0,0,.22)); }
/* a Disney/Pixar clamshell: soft moulded plastic, so the ends roll over instead of meeting at a square corner */
.spine.designed.clam { border-radius: 4px; } /* the ends are nearly square: only the corners are eased */
.spine.designed.clam::after { border-radius: inherit; background:
  linear-gradient(90deg, rgba(0,0,0,.30) 0, rgba(0,0,0,.06) 9%, rgba(255,255,255,.10) 30%, transparent 55%, rgba(0,0,0,.10) 86%, rgba(0,0,0,.42) 100%),
  linear-gradient(180deg, rgba(0,0,0,.08) 0, transparent 3px, transparent calc(100% - 3px), rgba(0,0,0,.12)); }
body.designed-spine .vcr-respine { display: none; }
.spine:hover, .spine:focus-visible { transform: translateY(-9px); filter: brightness(1.15); outline: none; }
.spine:focus-visible { box-shadow: 0 0 0 2px var(--gold); }

.spine .logo {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  max-width: calc(100% - 10px); max-height: 26px; object-fit: contain;
  filter: brightness(0) invert(1); opacity: .88;
}
.spine .logo.mono { filter: none; opacity: .9; }
/* illustrated logos keep their artwork, a touch aged like the rest of the print */
.spine .logo.color { filter: saturate(.85) contrast(1.05) sepia(.08) drop-shadow(0 .5px .5px rgba(0,0,0,.6)); opacity: .95; max-height: 30px; }
.spine .art { position: absolute; left: 2px; top: var(--top); z-index: 1; display: block; }
.spine .title {
  position: absolute; left: 0; right: 0; top: var(--top); bottom: calc(var(--bot) + 6px); z-index: 1;
  display: flex; align-items: center; justify-content: center;
  writing-mode: vertical-rl;
  font-family: var(--f);
  font-size: var(--fs);
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--t);
  text-shadow: 1px 1px 0 rgba(0,0,0,.45);
}
.spine .base {
  position: absolute; left: 0; right: 0; bottom: 9px; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2.5px;
  color: var(--t); pointer-events: none;
}
.spine .vhs { font: italic 900 13px/1 "Arial Black", "Helvetica Neue", Arial, sans-serif; letter-spacing: -.05em; padding-right: .05em; }
.spine .vhs.v0 { background: #c3262c; color: #fff; font-size: 11px; padding: 1.5px 3px 1px 2.5px; border-radius: 1px; }
.spine .vhs.v1 { opacity: .92; }
.spine .vhs.v2 { font-size: 10px; padding: 1px 3px 1px 2px; border: 1px solid currentColor; opacity: .88; }
.spine .hifi { font: 700 5.5px/1 Arial, Helvetica, sans-serif; letter-spacing: .03em; opacity: .82; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.spine .cat { font: 600 5px/1 Arial, Helvetica, sans-serif; letter-spacing: .05em; opacity: .8; white-space: nowrap; }
.spine .tag {
  position: absolute; left: 0; right: 0; top: 8px; z-index: 1; text-align: center; white-space: pre; color: var(--t);
  font: 700 5px/1.25 Arial, Helvetica, sans-serif; letter-spacing: .05em; opacity: .85; pointer-events: none;
}
/* a framed crop of the poster near the top of some spines */
.spine .photo {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 1; display: block;
  border: 1.5px solid rgba(240,232,210,.92); border-radius: 1px;
  filter: saturate(.82) contrast(1.06) sepia(.1); box-shadow: 0 1px 2px rgba(0,0,0,.55);
}
.spine .photo.round { border-radius: 50%; border-color: rgba(240,232,210,.0); box-shadow: 0 0 0 1.5px rgba(240,232,210,.9), 0 1px 2px rgba(0,0,0,.5); }
/* library barcode label and the rewind sticker, stuck over the lower title like on rented tapes */
.spine .lib, .spine .rew {
  position: absolute; left: 50%; z-index: 3; transform: translateX(-50%) rotate(var(--rot, 0deg));
  width: calc(100% - 10px); box-sizing: border-box; text-align: center; white-space: pre; pointer-events: none;
  box-shadow: 0 1px 1.5px rgba(0,0,0,.55);
}
.spine .lib {
  padding: 3px 2px; color: #26221b; font: 600 5px/1.2 "Courier New", monospace;
  background: linear-gradient(170deg, #eee3c3, #d9ccA6 70%, #e4d8b6);
  clip-path: polygon(0 0, 100% 0, 100% 96%, 82% 100%, 60% 97%, 30% 100%, 0 97%);
}
.spine .lib .bc { display: block; height: 30px; margin: 3px 1px 1px; }
.spine .rew {
  padding: 3px 1px; background: #f4f1e8; color: #121212; border-radius: 3px;
  font: 800 6.3px/1.08 Arial, Helvetica, sans-serif; letter-spacing: .01em;
}
/* the thumb-notch cut into the bottom of every sleeve */
.spine .notch {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 6;
  width: 13px; height: 6px; border-radius: 7px 7px 0 0;
  background: #170e08; box-shadow: inset 0 2px 2px rgba(0,0,0,.7);
}

/* ---- wear and tear (the white-cardboard fray, scuffs and creases are painted by app.js) ---- */
.spine .wear { position: absolute; left: 0; pointer-events: none; z-index: 4; filter: blur(.28px); }
/* sun fade */
.spine.dmg-fade::before {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: linear-gradient(180deg, rgba(235,220,180,.3), rgba(235,220,180,.08) 60%, transparent);
}
/* rental sticker, slightly peeling */
.spine .sticker {
  position: absolute; z-index: 3; left: 50%; top: 6px;
  transform: translateX(-50%) rotate(calc(var(--flip) * 2deg));
  writing-mode: vertical-rl;
  padding: 4px 2px; background: #f08a2c; color: #2a1608;
  font: 700 5.5px/1 Arial, Helvetica, sans-serif; letter-spacing: .08em;
  box-shadow: 0 1px 1px rgba(0,0,0,.5);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 70% 100%, 0 100%);
}

.spine.pulling { transform: translateY(-14px) scale(1.07); transition-duration: .18s; z-index: 3; }
.spine.out { visibility: hidden; }
.spine.back { animation: slideBack .5s cubic-bezier(.2,.8,.2,1); }
@keyframes slideBack {
  from { transform: translateY(-14px) scale(1.07); }
  to   { transform: none; }
}

/* ---------- viewer ---------- */
.viewer { position: fixed; inset: 0; display: none; z-index: 10; }
.viewer.open { display: block; }
.backdrop {
  position: absolute; inset: 0;
  background: rgba(6,4,2,.82);
  backdrop-filter: blur(4px);
  animation: fade .3s ease;
}
@keyframes fade { from { opacity: 0; } }

.panel {
  position: relative;
  height: 100%;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "prev stage next" "info info info";
  align-items: center;
  align-content: center;
  justify-items: center;
  padding: 20px 12px max(24px, env(safe-area-inset-bottom));
  pointer-events: none;
  /* cover height: whatever the screen has left after the text underneath (phones, portrait) */
  --ch: clamp(200px, calc(100vh - 395px), 600px);
  --ch: clamp(200px, calc(100dvh - 395px), 600px);
}
.panel > * { pointer-events: auto; }
.stage { grid-area: stage; perspective: 1500px; }
.nav {
  appearance: none; border: 0; background: none; color: var(--paper);
  font-size: 3.4rem; line-height: 1; opacity: .45; cursor: pointer; padding: 10px 18px;
}
.nav:hover { opacity: 1; }
.nav.prev { grid-area: prev; justify-self: end; }
.nav.next { grid-area: next; justify-self: start; }

.cover {
  position: relative;
  display: block;
  width: min(calc(var(--ch) * .5593), 72vw); /* real VHS sleeve: 4 1/8 x 7 3/8 in */
  aspect-ratio: 4.125 / 7.375;
  color: var(--paper);
  text-decoration: none;
  background: #111 center / cover no-repeat;
  border-radius: 3px;
  overflow: hidden;
  transform-origin: left center;
  box-shadow: 0 30px 60px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.08);
  animation: pull .65s cubic-bezier(.2,.8,.2,1);
  cursor: pointer;
}
@keyframes pull {
  from { transform: translateX(-90px) rotateY(-88deg); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.cover::before { /* sleeve edge + inner border */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  box-shadow: inset 0 0 0 4px rgba(0,0,0,.55), inset 8px 0 10px rgba(255,255,255,.1), inset -8px 0 14px rgba(0,0,0,.35);
}
.cover::after { /* plastic gloss */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.22) 0%, transparent 32%, transparent 68%, rgba(255,255,255,.08) 100%);
}
.cover .fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 18px; text-align: center; text-transform: uppercase;
  font-size: 2rem; line-height: 1.05; color: var(--t);
  background: linear-gradient(160deg, var(--c), #0b0806);
}
.cover .hint {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; padding: 10px;
  text-align: center; font-size: .78rem; letter-spacing: .08em;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  opacity: 0; transform: translateY(6px); transition: .2s;
}
.cover:hover .hint, .cover:focus-visible .hint { opacity: 1; transform: none; }

.info { grid-area: info; text-align: center; max-width: 560px; margin-top: 16px; }
.info h2 {
  margin: 0; font-family: var(--f, 'Bebas Neue'); font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: .05em; text-transform: uppercase;
}
.facts { margin: 6px 0 14px; opacity: .65; font-size: .9rem; }
.rating { font-size: 1.9rem; letter-spacing: .08em; line-height: 1; }
.star { color: var(--dim); }
.star.full { color: var(--gold); }
.star.half {
  background: linear-gradient(90deg, var(--gold) 50%, var(--dim) 50%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rating small { font-size: .85rem; letter-spacing: 0; opacity: .6; margin-left: 10px; vertical-align: middle; }
.imdb-score { margin: 8px 0 0; font-size: .85rem; letter-spacing: .08em; opacity: .7; }
.imdb-score:empty { display: none; }
.watched { margin: 12px 0 10px; font-size: .9rem; }
.genres { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.genres span { border: 1px solid rgba(239,230,210,.3); border-radius: 99px; padding: 2px 12px; font-size: .75rem; letter-spacing: .06em; }
.note { margin: 16px 0 0; font-style: italic; opacity: .8; }
.note:empty { display: none; }
.close {
  appearance: none; margin-top: 22px; background: none; color: var(--paper);
  border: 1px solid rgba(239,230,210,.4); border-radius: 2px;
  padding: 8px 20px; font: inherit; letter-spacing: .1em; cursor: pointer;
}
.close:hover { background: rgba(239,230,210,.12); }

@media (max-width: 640px) {
  #shelves { --side: 14px; --end-gap: 8px; margin-top: 56px; }
  #shelves::before { top: -26px; height: 26px; }
  #shelves::after { bottom: -24px; height: 24px; }
  .shelf { height: 270px; }
  .board::before, .board::after { width: 14px; height: 18px; }
  .board::before { left: 6px; } .board::after { right: 6px; }
  .nav { font-size: 2.2rem; padding: 6px; }
  .info { margin-top: 12px; }
  .info h2 { font-size: clamp(1.35rem, 6.4vw, 1.9rem); line-height: 1.1; }
  .facts { margin: 4px 0 8px; font-size: .8rem; }
  .rating { font-size: 1.5rem; }
  .watched { margin: 8px 0 8px; font-size: .82rem; }
  .genres { gap: 6px; }
  .genres span { padding: 1px 10px; font-size: .7rem; }
  .note { margin-top: 10px; font-size: .85rem; }
  .close { margin-top: 12px; padding: 7px 18px; }
}
/* desktop / landscape: cover on the left filling the height, details beside it */
@media (min-width: 900px) and (orientation: landscape) {
  .panel {
    --ch: min(calc(100vh - 56px), 860px);
    --ch: min(calc(100dvh - 56px), 860px);
    grid-template-columns: 1fr auto minmax(300px, 440px) 1fr;
    grid-template-areas: "prev stage info next";
    padding: 28px 12px;
  }
  .cover { width: calc(var(--ch) * .5593); }
  .info { text-align: left; margin: 0 0 0 44px; max-width: 440px; }
  .genres { justify-content: flex-start; }
  .nav.next { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .cover, .spine, .backdrop { animation: none !important; transition: none !important; }
}

/* ---------- VCR (type "vcr" to open; see vcr.js) ---------- */
.vcr { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 16px; }
.vcr.open { display: grid; }
.vcr-backdrop { position: absolute; inset: 0; background: rgba(5,3,2,.78); backdrop-filter: blur(3px); }
.vcr-box {
  position: relative; width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: linear-gradient(180deg, #1d1d1f, #111113); color: var(--paper);
  border: 1px solid #333; border-radius: 6px; padding: 0 20px 18px;
  box-shadow: 0 30px 60px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06);
  font-size: .86rem; line-height: 1.45;
}
.vcr-top {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  margin: 0 -20px 14px; padding: 12px 20px; background: #0d0d0e; border-bottom: 1px solid #2a2a2c;
}
.vcr-top h2 { margin: 0; font: 400 1.5rem/1 'Bebas Neue', sans-serif; letter-spacing: .3em; }
.vcr-led { width: 8px; height: 8px; border-radius: 50%; background: #e33; box-shadow: 0 0 8px #f44; animation: vcr-blink 1.4s steps(2) infinite; }
.vcr-mode { font: 400 .95rem 'Orbitron', monospace; color: #6fe3ff; text-shadow: 0 0 6px rgba(111,227,255,.6); letter-spacing: .15em; }
@keyframes vcr-blink { 50% { opacity: .15; } }
.vcr-x { margin-left: auto; appearance: none; background: none; border: 0; color: var(--paper); font-size: 1.6rem; line-height: 1; cursor: pointer; opacity: .6; }
.vcr-x:hover { opacity: 1; }

.vcr-keys details { margin-bottom: 12px; }
.vcr-keys summary { cursor: pointer; opacity: .65; }
.vcr-field { display: grid; gap: 3px; margin: 10px 0; }
.vcr-field span { opacity: .7; font-size: .78rem; }
.vcr-field input {
  font: inherit; color: var(--paper); background: #0a0a0b; border: 1px solid #333; border-radius: 3px; padding: 7px 9px;
}
.vcr-field input:focus { outline: 1px solid var(--gold); border-color: var(--gold); }

.vcr-drop {
  display: grid; gap: 4px; place-items: center; text-align: center; cursor: pointer;
  padding: 18px 14px; border: 1px dashed #555; border-radius: 4px; background: #0a0a0b;
}
.vcr-drop:hover, .vcr-drop.over { border-color: var(--gold); background: #15120c; }
.vcr-drop strong { font: 400 1.15rem 'Bebas Neue', sans-serif; letter-spacing: .14em; color: var(--gold); }
.vcr-drop span { opacity: .55; font-size: .78rem; }
.vcr-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.vcr-out { margin-top: 12px; }
.vcr-status { margin: 10px 0; }
.vcr-status.ok { color: #9fe39a; }
.vcr-status.err { color: #ff8b7a; }
.vcr-status a { color: var(--gold); }
.vcr-list { margin: 8px 0; }
.vcr-list summary { cursor: pointer; }
.vcr-list ul { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; opacity: .75; font-size: .8rem; }
.vcr-hint { margin: 16px 0 10px; opacity: .7; font-size: .8rem; }
.vcr-cards { display: grid; gap: 14px; }
.vcr-card { display: flex; gap: 14px; align-items: flex-start; padding: 10px; background: #0a0a0b; border: 1px solid #262628; border-radius: 4px; }
.vcr-info { display: grid; gap: 2px; min-width: 0; }
.vcr-info strong { font: 400 1.25rem/1.1 'Bebas Neue', sans-serif; letter-spacing: .06em; }
.vcr-dim { opacity: .5; font-size: .76rem; }
.vcr-warn { color: #ffb36b; font-size: .78rem; }
.vcr-edit { flex: 0 0 auto; width: 170px; }
.vcr-poster { position: relative; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.vcr-poster img { display: block; width: 100%; border-radius: 2px; pointer-events: none; }
.vcr-boxes { position: absolute; inset: 0; }
.vcr-boxes i {
  position: absolute; border: 1.5px solid var(--gold); background: rgba(232,182,74,.18);
  font: normal 9px/1 ui-monospace, monospace; color: #111; text-align: left; padding: 1px 2px; pointer-events: none;
}
.vcr-boxes i:not(.live)::before { content: ''; }
.vcr-boxes i.live { border-style: dashed; }
.vcr-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; font-size: .74rem; }
.vcr-link { appearance: none; background: none; border: 0; padding: 0; color: var(--gold); font: inherit; cursor: pointer; text-decoration: underline; }
.vcr-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.vcr-go {
  appearance: none; cursor: pointer; font: 400 1.05rem 'Bebas Neue', sans-serif; letter-spacing: .16em;
  color: #fff; background: #b8271f; border: 0; border-radius: 3px; padding: 9px 18px;
}
.vcr-go:hover:not(:disabled) { background: #d4342a; }
.vcr-go:disabled { background: #333; color: #777; cursor: default; }
@media (max-width: 520px) {
  .vcr-card { flex-direction: column; }
  .vcr-edit { width: 100%; max-width: 260px; }
}

/* re-mark a spine (vcr.js; the button only shows where the GitHub token is saved) */
.vcr-respine {
  display: block; margin: 14px auto 0; appearance: none; background: none; border: 0; cursor: pointer;
  color: var(--paper); opacity: .45; font: inherit; font-size: .78rem; text-decoration: underline;
}
.vcr-respine:hover { opacity: 1; color: var(--gold); }
@media (min-width: 900px) and (orientation: landscape) { .vcr-respine { margin-left: 0; } }
.vcr-spine .vcr-box { width: min(560px, 100%); }
.vcr-spine-body { display: flex; gap: 22px; align-items: flex-start; justify-content: center; }
.vcr-edit-big { width: min(300px, 62vw); }
.vcr-preview { display: grid; justify-items: center; gap: 6px; }
.vcr-preview-shelf {
  display: flex; align-items: flex-end; min-width: 80px; min-height: 270px; padding: 10px 14px 0;
  background: linear-gradient(180deg, #0a0704 0%, #1b120b 100%); border-bottom: 8px solid #43291a;
  box-shadow: inset 0 14px 22px rgba(0,0,0,.65);
}
.vcr-preview-shelf .spine { cursor: default; }
.vcr-spine .vcr-foot { justify-content: flex-start; align-items: center; gap: 16px; }
.vcr-spine .vcr-go { margin-left: auto; }
.vcr-save {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  box-shadow: 0 10px 24px rgba(0,0,0,.6);
}
.vcr-save[hidden], .vcr-respine[hidden] { display: none; }

/* spine editor: tabs, top-of-spine choices, logo crop and studio picker */
.vcr-spine .vcr-box { width: min(620px, 100%); }
.vcr-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid #2a2a2c; }
.vcr-tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--paper); opacity: .55; font: inherit; padding: 6px 10px; cursor: pointer;
}
.vcr-tab.on { opacity: 1; border-bottom-color: var(--gold); color: var(--gold); }
.vcr-pane { flex: 1; min-width: 0; display: grid; justify-items: center; }
.vcr-pane .vcr-hint { margin: 0 0 10px; justify-self: stretch; }
.vcr-row { display: flex; gap: 14px; margin-top: 8px; font-size: .78rem; justify-self: stretch; }
.vcr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; justify-self: stretch; }
.vcr-chip {
  appearance: none; font: inherit; font-size: .76rem; color: var(--paper); cursor: pointer;
  background: #0a0a0b; border: 1px solid #3a3a3d; border-radius: 999px; padding: 4px 10px;
}
.vcr-chip:hover:not(:disabled) { border-color: var(--gold); }
.vcr-chip.on { background: var(--gold); border-color: var(--gold); color: #1a1208; }
.vcr-chip:disabled { opacity: .35; cursor: default; }
.vcr-boxes i.sq { border-radius: 1px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); }
.vcr-edit-logo { width: min(260px, 62vw); }
.vcr-edit-logo .vcr-poster {
  padding: 0; background: repeating-conic-gradient(#d9d9d9 0 25%, #f2f2f2 0 50%) 0 0 / 14px 14px; border-radius: 3px;
}
.vcr-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; justify-self: stretch; font-size: .72rem; }
.vcr-logo-pick {
  appearance: none; cursor: pointer; display: grid; gap: 4px; justify-items: center; padding: 8px 6px 6px;
  background: #f2f2f2; border: 2px solid transparent; border-radius: 4px; color: #222; font: inherit;
}
.vcr-logo-pick:hover:not(:disabled) { border-color: var(--gold); }
.vcr-logo-pick img { max-width: 100%; height: 34px; object-fit: contain; }
.vcr-logo-pick span { line-height: 1.2; text-align: center; }
.vcr-poster { overflow: hidden; }
.vcr-chips-sm { align-items: center; margin: 10px 0 0; }
.vcr-chips-sm .vcr-dim { margin-right: 4px; }

/* The Vault (?shelf=1990s etc.): no ticket image, so a plate in the ticket's colours and Blockletter */
h1.ticket.vault { display: flex; justify-content: center; }
.vault-plate {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 14px 34px 12px; margin: 6px 0 4px;
  background: #233bac; border: 7px solid #f2bd0a; border-radius: 6px;
  box-shadow: inset 0 0 0 2px #233bac, inset 0 0 0 4px #f2bd0a, 0 6px 14px rgba(0,0,0,.45);
  color: #f2bd0a; font-family: 'Blockletter', 'Bebas Neue', sans-serif; line-height: .9; letter-spacing: .02em;
  transform: rotate(-2deg);
}
.vault-plate .v1 { font-size: clamp(30px, 6vw, 54px); }
.vault-plate .v2 { font-size: clamp(22px, 4.2vw, 38px); }
/* the Vault's asterisk and its footnote: Vault tapes were watched before 2016 and have no viewing date */
.vault-plate { position: relative; }
.vault-star { position: absolute; top: -26px; right: -30px; width: clamp(40px, 7vw, 58px); transform: rotate(12deg); filter: drop-shadow(3px 3px 0 #233bac) drop-shadow(0 4px 8px rgba(0,0,0,.45)); }
.vault-star svg, .vault-note .mark svg { display: block; width: 100%; height: auto; fill: none; stroke: #f2bd0a; stroke-width: 7; stroke-linecap: round; }
.vault-note {
  display: flex; align-items: flex-start; justify-content: center; gap: 8px;
  max-width: 470px; margin: 14px auto 0; text-align: left;
  font-size: .95rem; line-height: 1.3; letter-spacing: .02em; color: rgba(239,230,210,.82);
}
.vault-note .mark { flex: none; width: 22px; margin-top: 1px; }
@media (max-width: 640px) { .vault-note { font-size: .85rem; margin-top: 10px; } }

/* ---------- the store directory (app.js): every shelf as a tile, a search across all of them, Surprise me ----------
   Opened by clicking the ticket / Vault plate, "Find a tape", or pressing "/". In the ticket's blue and yellow. */
h1.ticket[role="button"] { cursor: pointer; border-radius: 6px; }
h1.ticket[role="button"] img, h1.ticket[role="button"] .vault-plate { transition: transform .15s ease; }
h1.ticket[role="button"]:hover img, h1.ticket[role="button"]:hover .vault-plate { transform: rotate(-1deg) scale(1.02); }
h1.ticket[role="button"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
/* Find a tape / Surprise me: top right of the header on wide screens (clear of the tally), a row under the ticket below that */
.finder { display: flex; justify-content: center; gap: 8px; margin: 14px 0 0; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; }
.finder[hidden] { display: none; }
.finder button {
  appearance: none; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; line-height: 1.3;
  color: #f2bd0a; background: rgba(35,59,172,.55); border: 2px solid #f2bd0a; border-radius: 4px; padding: 5px 12px 4px;
  box-shadow: 0 4px 10px rgba(0,0,0,.3); transition: background .12s ease, color .12s ease;
}
.finder button:hover { background: #f2bd0a; color: #233bac; }
.finder button:focus-visible { outline: 2px solid #fff2b8; outline-offset: 2px; }
@media (min-width: 1000px) {
  .finder { position: absolute; top: 44px; right: 14px; margin: 0; flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) { .finder { justify-content: flex-start; margin: 10px 0 0; font-size: .74rem; } }
#find-btn svg, .store-search svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; vertical-align: -.12em; margin-right: 5px; }

.store { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; }
.store[hidden] { display: none; }
body.store-open { overflow: hidden; }
.store-backdrop { position: absolute; inset: 0; background: rgba(6,9,20,.72); backdrop-filter: blur(3px); }
.store-box {
  position: relative; width: min(760px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: #233bac; border: 7px solid #f2bd0a; border-radius: 8px;
  box-shadow: inset 0 0 0 2px #233bac, inset 0 0 0 4px #f2bd0a, 0 24px 60px rgba(0,0,0,.6);
  color: #f2bd0a; animation: store-in .18s ease-out;
}
@keyframes store-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
.store-head { display: flex; align-items: baseline; gap: 14px; padding: 18px 22px 8px; }
.store-head h2 { margin: 0; font: 400 clamp(28px, 5vw, 42px)/.9 'Blockletter', 'Bebas Neue', sans-serif; letter-spacing: .02em; text-transform: uppercase; }
.store-head p { margin: 0; flex: 1; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(242,189,10,.75); }
.store-x { margin-left: auto; appearance: none; background: none; border: 0; color: #f2bd0a; font-size: 34px; line-height: .7; cursor: pointer; padding: 0 2px; align-self: center; }
.store-x:hover, .store-x:focus-visible { color: #fff2b8; outline: none; }

.store-search { display: flex; align-items: center; margin: 4px 22px 14px; padding: 0 14px; background: var(--paper); border-radius: 4px; color: #233bac; box-shadow: inset 0 2px 0 rgba(0,0,0,.12); }
.store-search svg { width: 20px; height: 20px; flex: none; }
.store-search input { flex: 1; min-width: 0; appearance: none; border: 0; background: none; outline: none; padding: 12px 4px; font: 600 1.15rem 'Barlow Condensed', sans-serif; color: #1a1d33; }
.store-search input::placeholder { color: rgba(35,59,172,.55); }
.store-search:focus-within { box-shadow: 0 0 0 3px #fff2b8; }

.store-aisles, .store-results { overflow-y: auto; padding: 0 22px 8px; overscroll-behavior: contain; }
.store-aisles[hidden], .store-results[hidden] { display: none; }
.store-aisles h3 { margin: 6px 0 8px; font: 400 1.3rem/1 'Blockletter', 'Bebas Neue', sans-serif; letter-spacing: .03em; text-transform: uppercase; }
.store-aisles h3 small { font: 600 .78rem 'Barlow Condensed', sans-serif; letter-spacing: .1em; color: rgba(242,189,10,.7); margin-left: 6px; }
.store-aisles section + section { margin-top: 14px; }
.aisle { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bay {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 10px 4px 8px; min-height: 64px; text-decoration: none; color: #f2bd0a;
  border: 2px solid rgba(242,189,10,.75); border-radius: 4px; background: rgba(10,20,80,.25);
  transition: background .12s ease, transform .12s ease;
}
.bay .nm { font: 400 1.65rem/.9 'Blockletter', 'Bebas Neue', sans-serif; letter-spacing: .02em; }
.bay .nm small { font-size: .62em; }
.bay .n { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(239,230,210,.85); }
.bay:hover, .bay:focus-visible { background: rgba(242,189,10,.16); transform: translateY(-2px); outline: none; border-color: #f2bd0a; }
.bay.here { background: #f2bd0a; color: #233bac; border-color: #f2bd0a; }
.bay.here .n { color: #233bac; }
.bay .you { position: absolute; top: -8px; left: 50%; transform: translateX(-50%) rotate(-3deg); white-space: nowrap; background: #e0412c; color: #fff; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border-radius: 2px; box-shadow: 0 2px 4px rgba(0,0,0,.35); }

.store-results { display: flex; flex-direction: column; gap: 4px; }
.hit {
  display: grid; grid-template-columns: 22px 1fr 54px 112px; align-items: center; gap: 12px;
  padding: 6px 10px 6px 8px; border-radius: 4px; text-decoration: none; color: var(--paper);
  background: rgba(10,20,80,.3); border: 1px solid transparent;
}
.hit:hover, .hit.sel { background: rgba(242,189,10,.16); border-color: rgba(242,189,10,.75); }
.hit .sp { width: 22px; height: 52px; border-radius: 2px; overflow: hidden; background: rgba(0,0,0,.35); }
.hit .sp img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hit .tx { min-width: 0; display: flex; flex-direction: column; }
.hit .tx b { font-size: 1.12rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff6dc; }
.hit .tx small { font-size: .82rem; letter-spacing: .03em; color: rgba(239,230,210,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit .mine { text-align: right; white-space: nowrap; font: 400 1.25rem 'Blockletter', 'Bebas Neue', sans-serif; color: #f2bd0a; }
.hit .mine small { font-size: .6em; opacity: .7; }
.hit .where { justify-self: end; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: #f2bd0a; border: 1px solid rgba(242,189,10,.6); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.hit .where.here { background: #f2bd0a; color: #233bac; }
.store-results .none { margin: 8px 2px 10px; color: rgba(239,230,210,.8); font-size: .95rem; }

.store-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px 16px; border-top: 2px solid rgba(242,189,10,.35); margin-top: 6px; }
#store-lucky {
  appearance: none; cursor: pointer; font: 400 1.15rem/1 'Blockletter', 'Bebas Neue', sans-serif; letter-spacing: .04em; text-transform: uppercase;
  background: #f2bd0a; color: #233bac; border: 0; border-radius: 4px; padding: 9px 16px 7px; box-shadow: 0 3px 0 #a07a00;
}
#store-lucky:hover { background: #ffd84a; }
#store-lucky:active { transform: translateY(2px); box-shadow: 0 1px 0 #a07a00; }
#store-lucky:focus-visible { outline: 2px solid #fff2b8; outline-offset: 3px; }
.store-foot .keys { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(239,230,210,.7); }
.store-foot kbd { font: 600 .8rem 'Barlow Condensed', sans-serif; color: #233bac; background: var(--paper); border-radius: 3px; padding: 0 5px; margin: 0 2px 0 8px; box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.store-foot kbd + kbd { margin-left: 2px; }
@media (max-width: 640px) {
  .store { padding: 10px 8px; }
  .store-box { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
  .store-head, .store-foot { padding-left: 14px; padding-right: 14px; }
  .store-head { flex-wrap: wrap; row-gap: 4px; }
  .store-head p { order: 3; flex-basis: 100%; }
  .store-search { margin: 4px 14px 12px; }
  .store-aisles, .store-results { padding: 0 14px 8px; }
  .aisle { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .bay .nm { font-size: 1.35rem; }
  .hit { grid-template-columns: 18px 1fr 46px; gap: 10px; }
  .hit .sp { width: 18px; height: 44px; }
  .hit .where { grid-column: 2 / 4; justify-self: start; margin-top: -2px; }
  .store-foot .keys { display: none; }
}
