/* LeninShop 3D storefront — chrome only. Everything else is drawn in WebGL. */

:root {
  --bg: #17130f;
  --panel: #221c16;
  --line: #3b3025;
  --text: #f3ece0;
  --text-dim: #a89880;
  --accent: #c8102e;
  --accent-hot: #e2263f;
  --yellow: #f5c518;   /* the painted steel columns */
  --brick: #8b4a3a;    /* the exposed back wall */
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* The pointer-lock look shouldn't select text or bounce the page. */
  user-select: none;
  overscroll-behavior: none;
}

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ── Overlays ──────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 35%, rgba(30, 30, 36, .92) 0%, rgba(10, 10, 12, .97) 70%);
  backdrop-filter: blur(6px);
}

.panel {
  width: min(420px, 100%);
  padding: 36px 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
  text-align: center;
}
.panel h1 { margin: 0 0 6px; font-size: 23px; font-weight: 600; letter-spacing: -.015em; }
.panel p { margin: 0 0 22px; font-size: 14px; }
.muted { color: var(--text-dim); }

.mark {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--accent) 0 18%, transparent 19%),
    repeating-radial-gradient(circle, #26262b 0 2px, #191919 2px 4px);
  animation: spin 5s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  display: inline-block;
  padding: 11px 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #232329;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #2a2a31; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 550; }
.btn-primary:hover { background: var(--accent-hot); border-color: var(--accent-hot); }

.bar {
  height: 3px;
  margin-top: 18px;
  background: #26262c;
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 999px;
  transition: width .25s ease;
}

.keys {
  list-style: none;
  margin: 24px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 9px;
  font-size: 13px;
  color: var(--text-dim);
}
.keys li { display: flex; align-items: center; gap: 7px; justify-content: center; }
.keys span { margin-left: 4px; }
kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  background: #232329;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  font: 11px/1.4 var(--mono);
  color: var(--text);
}

.leave {
  display: inline-block;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
}
.leave:hover { color: var(--text); }

/* ── HUD ───────────────────────────────────────────────────────────── */

#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }

#crosshair {
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55);
  transition: transform .12s ease, background .12s ease;
}
#crosshair.hot { transform: scale(1.9); background: var(--accent); }

.focus {
  position: absolute;
  left: 50%;
  top: calc(50% + 34px);
  transform: translateX(-50%);
  min-width: 240px;
  max-width: 380px;
  padding: 12px 16px;
  background: rgba(15, 15, 18, .88);
  border: 1px solid var(--line);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  text-align: center;
}
.focus-artist { font-size: 12px; color: var(--text-dim); }
.focus-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.focus-meta { font-size: 12px; color: var(--text-dim); font-family: var(--mono); margin-top: 4px; }
.focus-hint {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
}
.focus-oos { color: #e8776a; }

.hud-corner {
  position: absolute;
  left: 18px; bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--text-dim);
}
.hud-link { pointer-events: auto; color: var(--text-dim); text-decoration: none; }
.hud-link:hover { color: var(--text); }
.hud-count { font-family: var(--mono); }

/* ── Touch controls ────────────────────────────────────────────────── */

.touch-pad {
  position: absolute;
  left: 18px; bottom: 54px;
  display: grid;
  justify-items: center;
  gap: 6px;
  pointer-events: auto;
}
.touch-pad > div { display: flex; gap: 6px; }
.touch-pad button {
  width: 52px; height: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(25, 25, 30, .75);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  touch-action: none;
}
.touch-pad button:active { background: var(--accent); border-color: var(--accent); }

@media (max-width: 720px) {
  .panel { padding: 28px 22px; }
  .keys { display: none; }
}

/* ── Crate digging ─────────────────────────────────────────────────── */

.crate-view {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(60, 44, 30, .55) 0%, rgba(14, 11, 9, .97) 68%),
    var(--bg);
  backdrop-filter: blur(4px);
}

.crate-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.crate-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.crate-back svg { width: 17px; height: 17px; }
.crate-back:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.crate-heading { display: flex; align-items: baseline; gap: 12px; flex: 1; justify-content: center; }
.crate-divider {
  padding: 4px 16px;
  background: #e8e0cf;
  color: #2b2320;
  border-radius: 4px;
  font-weight: 750;
  font-size: 18px;
  letter-spacing: .06em;
  /* Reads as the card divider standing up in the bin. */
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.crate-count { color: var(--text-dim); font-size: 13px; font-family: var(--mono); }

.crate-tools { display: flex; gap: 8px; }
.crate-tools input, .crate-tools select {
  padding: 9px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}
.crate-tools input { width: 190px; }
.crate-tools input:focus, .crate-tools select:focus { border-color: var(--accent); }

.crate-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 16px;
  min-height: 0;
}

.flip {
  width: 62px; height: 62px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, border-color .15s, transform .08s;
}
.flip svg { width: 26px; height: 26px; }
.flip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.flip:active { transform: scale(.93); }

.crate-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

/* Looking down into the bin.
 *
 * Matches the owner's own footage: you are above an open crate, the records
 * are tipped back away from you, and the one you're looking at leans toward
 * you clear of the rest. The whole stack is rotated on X so the view reads as
 * *down into* a box rather than straight at a shelf. */
.crate-stack {
  position: relative;
  width: min(46vh, 340px);
  height: min(46vh, 340px);
  perspective: 900px;
  perspective-origin: 50% 12%;
  /* Deliberately NOT preserve-3d. In a preserved 3D context z-index is
     ignored and paint order comes from actual depth, which put the crate's
     inner wall in front of every record in it. The cards keep their own
     preserve-3d so they can still be turned over. */
}

/* The crate around the records.
 *
 * Real elements rather than ::before/::after, and rendered in document order
 * around the cards: well, then sleeves, then front lip. Inside a perspective
 * context, z-index alone did not reliably keep the pseudo-elements behind the
 * stack — the well painted over every record in the crate. Document order
 * can't drift that way. */
.crate-well,
.crate-lip {
  position: absolute;
  left: -10%;
  right: -10%;
  pointer-events: none;
}
.crate-well {
  top: -6%;
  bottom: -2%;
  border-radius: 3px;
  background: linear-gradient(180deg, #3a4044 0%, #4b5155 58%, #585e62 100%);
  box-shadow: inset 0 22px 34px rgba(0, 0, 0, .72);
}
/* The front lip is what makes the stack read as being down inside a box
   rather than leaning against a wall. */
.crate-lip {
  bottom: -2%;
  height: 34px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(180deg, #838a8f 0%, #5f666a 52%, #454b4f 100%);
  box-shadow:
    0 -12px 20px rgba(0, 0, 0, .5),
    0 16px 40px rgba(0, 0, 0, .6);
}

.crate-card {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 2; /* above the crate's inner back, below its front lip */
  border-radius: 4px;
  background: #241d18;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .58);
  transform-style: preserve-3d;
  /* Depth 0 stands nearly upright and facing you; each one behind lies
     further back into the crate and rises up the screen. */
  transform:
    translateY(calc(var(--depth) * -9.5%))
    translateZ(calc(var(--depth) * -34px))
    rotateX(calc(9deg + var(--depth) * 5deg))
    rotateY(var(--flip, 0deg));
  transform-origin: 50% 100%;
  opacity: calc(1 - var(--depth) * 0.13);
  transition:
    transform .34s cubic-bezier(.22, .72, .28, 1),
    opacity .3s ease;
}
.crate-card.is-flipped { --flip: 180deg; }

.crate-card[data-front="1"] {
  cursor: pointer;
  box-shadow: 0 22px 48px rgba(0, 0, 0, .66);
}
.crate-card[data-front="1"]:hover { box-shadow: 0 22px 54px rgba(192, 57, 43, .42); }

/* Two faces on the front record so it can be turned over. */
.crate-face {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.crate-face-back { transform: rotateY(180deg); background: #171513; }

.crate-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.crate-ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 62px; color: #4a3f36;
  background: repeating-linear-gradient(45deg, #2a221c 0 10px, #221b16 10px 20px);
}

/* The generated back sleeve, when the owner hasn't photographed the real one. */
.sleeve-back {
  height: 100%;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  color: #e4ded2;
  background: #171513;
  overflow: hidden;
}
.sleeve-back h4 {
  margin: 0;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sleeve-back-title { margin: 0 0 6px; font-size: 12px; color: #a49b8d; }
.crate-tracks {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 11px;
  line-height: 1.55;
  color: #cdc5b7;
  columns: 2;
  column-gap: 16px;
  flex: 1;
  overflow: hidden;
}
.crate-tracks li { break-inside: avoid; }
.sleeve-back-empty { margin: 8px 0; font-size: 11px; font-style: italic; color: #7d766b; }
.sleeve-back-foot {
  margin: 6px 0 0;
  font-size: 10px;
  color: #8a8276;
  font-family: var(--mono);
}

.crate-actions { display: flex; justify-content: center; margin-top: 46px; }
.crate-flip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  transition: background .15s, border-color .15s;
}
.crate-flip svg { width: 16px; height: 16px; }
.crate-flip:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* A record being thumbed forward, or pushed back into the bin. */
@keyframes flip-fwd {
  0%   { transform: translateX(0) rotateZ(0deg); }
  40%  { transform: translateX(-9%) rotateZ(-2.2deg); }
  100% { transform: translateX(0) rotateZ(0deg); }
}
@keyframes flip-back {
  0%   { transform: translateX(0) rotateZ(0deg); }
  40%  { transform: translateX(9%) rotateZ(2.2deg); }
  100% { transform: translateX(0) rotateZ(0deg); }
}
.crate-stack.flip-fwd { animation: flip-fwd .32s ease-out; }
.crate-stack.flip-back { animation: flip-back .32s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .crate-stack.flip-fwd, .crate-stack.flip-back { animation: none; }
  .crate-card { transition: none; }
}

.crate-now {
  display: grid;
  gap: 2px;
  text-align: center;
  min-height: 68px;
}
.crate-artist { font-size: 19px; font-weight: 650; }
.crate-title { font-size: 15px; color: var(--text); }
.crate-meta { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.crate-position { color: var(--text-dim); font-size: 12px; font-family: var(--mono); }
.crate-empty { color: var(--text-dim); text-align: center; padding: 40px 0; }

.crate-hint {
  margin: 0;
  padding: 0 20px 18px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

@media (max-width: 720px) {
  .crate-tools input { width: 130px; }
  .crate-body { gap: 10px; }
  .flip { width: 50px; height: 50px; }
  .crate-heading { order: 3; flex-basis: 100%; }
}

/* ── Owner: editing a position from inside the shop ──────────────────── */

.admin-hint {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(20, 17, 16, .82);
  border: 1px solid rgba(245, 197, 24, .45);
  color: #f0e9dc;
  font-size: 12px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.admin-hint strong { color: var(--accent-2, #f5c518); }
.admin-hint kbd {
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .25);
  font-family: var(--mono);
  font-size: 11px;
}

.slot-editor {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(10, 9, 8, .72);
  backdrop-filter: blur(4px);
}
.slot-panel {
  width: min(400px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 14px;
  background: #171513;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.slot-panel h3 { margin: 0; font-size: 17px; }
.slot-slug {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  word-break: break-all;
}
.slot-panel label { display: grid; gap: 5px; font-size: 13px; }
.slot-panel label > span { color: var(--text-dim); }
.slot-panel input,
.slot-panel select {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.slot-error:empty { display: none; }
.slot-error {
  margin: 0;
  font-size: 12px;
  color: #e88;
}
.slot-buttons { display: flex; gap: 10px; justify-content: flex-end; }
.slot-buttons button {
  padding: 9px 18px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--line);
}
.slot-buttons .ghost { background: transparent; color: var(--text-dim); }
.slot-buttons .primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Skipping the walk in ───────────────────────────────────────────── */

.skip-arrival {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(14, 12, 10, .6);
  color: rgba(255, 255, 255, .82);
  font: inherit;
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s, color .15s;
}
.skip-arrival:hover { background: rgba(200, 16, 46, .85); color: #fff; }

/* ── The Esteef poster ──────────────────────────────────────────────── */

.egg {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 45%, rgba(58, 12, 74, .82) 0%, rgba(6, 4, 12, .95) 70%);
  backdrop-filter: blur(7px);
}

/* The card arrives in 3D — it should feel like the poster itself swung out
   of the wall, not like a dialog appeared. */
.egg-stage { perspective: 1200px; }

.egg-card {
  position: relative;
  width: min(460px, calc(100vw - 48px));
  padding: 2px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #00f6ff 0%, #ff2e8b 48%, #ffd23f 100%);
  box-shadow:
    0 0 70px rgba(255, 46, 139, .45),
    0 34px 90px rgba(0, 0, 0, .7);
  transform-style: preserve-3d;
}
/* The card swings up out of the floor and settles.
 *
 * This was a one-second move that finished before anyone had registered it
 * had started. It is longer now, comes from further away, overshoots more,
 * and the contents fade in *after* the card has landed rather than riding
 * along with it — so there is a moment where you see a thing arrive and then
 * a moment where you read it. Something you found by accident should feel
 * like it is presenting itself. */
.egg.is-open .egg-card { animation: egg-swing 1.45s cubic-bezier(.17, .89, .26, 1) both; }
.egg.is-open .egg-inner > * { animation: egg-rise .55s ease both; }
.egg.is-open .egg-kicker { animation-delay: .62s; }
.egg.is-open .egg-name { animation-delay: .70s; }
.egg.is-open .egg-langs { animation-delay: .80s; }
.egg.is-open .egg-body { animation-delay: .88s; }
.egg.is-open .egg-close { animation-delay: .98s; }
.egg.is-open .egg-glow { animation: egg-flare 1.6s ease-out both; }

@keyframes egg-swing {
  0%   { opacity: 0; transform: translateY(150px) rotateX(-78deg) rotateZ(-11deg) scale(.6); }
  45%  { opacity: 1; transform: translateY(-14px) rotateX(14deg) rotateZ(2.5deg) scale(1.07); }
  70%  { transform: translateY(4px) rotateX(-5deg) rotateZ(-1deg) scale(.99); }
  88%  { transform: translateY(-2px) rotateX(2deg) rotateZ(.4deg) scale(1.005); }
  100% { opacity: 1; transform: translateY(0) rotateX(0) rotateZ(0) scale(1); }
}

@keyframes egg-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes egg-flare {
  0%   { opacity: 0; transform: scale(.4); }
  35%  { opacity: 1; transform: scale(1.15); }
  100% { opacity: .55; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .egg.is-open .egg-card,
  .egg.is-open .egg-inner > *,
  .egg.is-open .egg-glow { animation: none; opacity: 1; transform: none; }
}

.egg-inner {
  position: relative;
  z-index: 3;
  padding: 34px 30px 26px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1a0b34 0%, #2b0f45 52%, #11061f 100%);
  text-align: center;
}

/* Sun, grid and bloom, echoing the poster on the wall. */
.egg-sun {
  position: absolute;
  left: 50%;
  top: 96px;
  width: 260px;
  height: 260px;
  margin-left: -130px;
  z-index: 1;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe259 0%, #ff8c42 46%, #ff2e8b 100%);
  -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 9px, transparent 9px 15px);
  mask-image: repeating-linear-gradient(180deg, #000 0 9px, transparent 9px 15px);
  opacity: .5;
  filter: blur(.4px);
}
.egg-grid {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  z-index: 2;
  background:
    repeating-linear-gradient(90deg, rgba(0,246,255,.24) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(0deg, rgba(0,246,255,.20) 0 1px, transparent 1px 22px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000);
  mask-image: linear-gradient(180deg, transparent, #000);
  opacity: .55;
}
.egg-glow {
  position: absolute;
  inset: -40%;
  z-index: 0;
  background: conic-gradient(from 0deg, #00f6ff, #ff2e8b, #ffd23f, #00f6ff);
  opacity: .22;
  animation: egg-spin 9s linear infinite;
}
@keyframes egg-spin { to { transform: rotate(360deg); } }

.egg-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #00f6ff;
}
.egg-name {
  margin: 0 0 18px;
  font-size: 56px;
  font-weight: 900;
  letter-spacing: .04em;
  line-height: 1;
  background: linear-gradient(180deg, #fff 0%, #9fdcff 42%, #2b6ea8 50%, #ffd9f2 58%, #ff2e8b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 16px rgba(255, 46, 139, .8));
}

.egg-langs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.egg-langs button {
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 246, 255, .4);
  background: transparent;
  color: rgba(226, 238, 255, .7);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.egg-langs button.is-on { background: rgba(0, 246, 255, .18); color: #eaf9ff; border-color: #00f6ff; }

.egg-body { color: #e4dcf2; font-size: 14.5px; line-height: 1.66; }
.egg-body p { margin: 0 0 12px; }
.egg-body a { color: #00f6ff; text-decoration: none; border-bottom: 1px solid rgba(0,246,255,.4); }
.egg-body a:hover { color: #fff; border-bottom-color: #fff; }
.egg-sign { color: #ffd23f; font-style: italic; }

.egg-close {
  margin-top: 18px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 46, 139, .6);
  background: rgba(255, 46, 139, .16);
  color: #ffd9ec;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.egg-close:hover { background: #ff2e8b; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .egg.is-open .egg-card { animation: none; }
  .egg-glow { animation: none; }
}

/* ── One album, taken down off the wall ───────────────────────────────
 *
 * Clicking a record on the wall used to navigate away to the flat catalogue,
 * which threw away the room you were standing in. It now comes down to you:
 * the card starts at the sleeve's own position on screen, at its own size,
 * and travels into the panel. The starting transform is measured at click
 * time and written into --from-*, because where a record is on screen depends
 * on where you were standing when you clicked it.
 */

.album-view {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}
.album-view[hidden] { display: none; }

.album-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, rgba(23, 19, 15, .82), rgba(9, 7, 6, .95));
  opacity: 0;
  transition: opacity .42s ease;
}
.album-view.is-open .album-scrim { opacity: 1; }

.album-close {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 3;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(34, 28, 22, .85);
  color: var(--text);
  cursor: pointer;
}
.album-close:hover { border-color: var(--accent); color: #fff; }
.album-close svg { width: 20px; height: 20px; }

.album-panel {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 34px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
  opacity: 0;
  transition: opacity .3s ease .12s;
}
.album-view.is-open .album-panel { opacity: 1; }

.album-stage {
  perspective: 1400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.album-card {
  position: relative;
  width: min(46vw, 340px);
  aspect-ratio: 1;
  margin: 0;
  border-radius: 5px;
  background: #241d18;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .7);
  transform-style: preserve-3d;
  transform: rotateY(var(--flip, 0deg));
  transition: transform .5s cubic-bezier(.22, .72, .28, 1);
}

/* The moment before the descent: sitting exactly where the sleeve is in the
   3D room. Transitions are suppressed while this is applied. */
.album-card.is-arriving {
  transition: none;
  transform:
    translate(var(--from-x, 0px), var(--from-y, 0px))
    scale(var(--from-scale, .2))
    rotateY(var(--flip, 0deg));
}
.album-card.is-descending {
  transition: transform .72s cubic-bezier(.19, .84, .26, 1);
  transform: rotateY(var(--flip, 0deg));
}
.album-card.is-flipped { --flip: 180deg; }

.album-face {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.album-face-back { transform: rotateY(180deg); background: #171513; }
.album-card img { width: 100%; height: 100%; object-fit: cover; display: block; }

.album-ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 70px; color: #4a3f36;
  background: repeating-linear-gradient(45deg, #2a221c 0 10px, #221b16 10px 20px);
}

.album-flip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(34, 28, 22, .9);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.album-flip:hover { border-color: var(--accent); }
.album-flip svg { width: 16px; height: 16px; }

.album-info { width: min(100%, 380px); }
.album-artist {
  margin: 0;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.album-title { margin: 4px 0 8px; font-size: 26px; line-height: 1.16; }
.album-meta { margin: 0 0 22px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.album-meta .is-oos { color: var(--accent-hot); }

.album-listen h3 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.album-spotify iframe {
  width: 100%;
  border: 0;
  border-radius: 12px;
  display: block;
}

/* Plenty of the shop's stock predates streaming, or never reached it. That is
   an ordinary fact about a second-hand record, not a failure, so it gets a
   proper panel rather than an empty gap. */
.album-none {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.45;
}
.album-none svg { width: 22px; height: 22px; flex: none; opacity: .5; }
.album-loading { font-size: 13px; color: var(--text-dim); font-style: italic; }

@media (max-width: 720px) {
  .album-panel { gap: 20px; }
  .album-card { width: min(62vw, 260px); }
  .album-title { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .album-card.is-arriving,
  .album-card.is-descending { transition: none; transform: rotateY(var(--flip, 0deg)); }
  .album-scrim, .album-panel { transition: none; }
}

/* The Spotify player lives on the back of the sleeve.
 *
 * Turning a record over to play it is the gesture the shop is built around,
 * and a player sitting permanently beside the cover made the flip decorative.
 * The back is now the tracklist and the player together, which is roughly
 * what is actually printed on a sleeve. */
.album-face-back {
  display: flex;
  flex-direction: column;
  background: #171513;
}
.album-face-back #album-back { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.album-face-back .album-spotify { flex: none; padding: 6px; }
.album-face-back .album-spotify iframe { height: 84px; border-radius: 8px; }

/* Anything interactive on the back must not also flip the card. */
.album-face-back .album-spotify { cursor: auto; }

.album-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}
.album-face-back .album-none {
  margin: 6px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.35;
  border-radius: 8px;
}
.album-face-back .album-none svg { width: 16px; height: 16px; }
.album-face-back .album-loading { padding: 8px 10px; font-size: 11px; }

.btn-quiet {
  display: block; width: 100%; margin-top: 10px;
  padding: 11px 18px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; cursor: pointer;
}
.btn-quiet:hover { border-color: var(--accent); background: #2a221b; }
.hud-link-btn { border: 0; background: none; font: inherit; cursor: pointer; }

/* The player on the back of a record in a bin. Same offer as turning one
   over off the wall — it was only on the wall before, which made the bins
   feel like a lesser copy of the same interaction. */
.sleeve-listen { margin-top: 6px; }
.sleeve-listen iframe { width: 100%; border: 0; border-radius: 8px; display: block; }
.sleeve-listen-none {
  margin: 6px 0 0;
  font-size: 10px;
  font-style: italic;
  color: #7d766b;
}
