/* Vol. 30 – The Collection
   Creative direction: Velvet Disco. A limited-edition record release:
   midnight black first, deep velvet purple second, champagne gold third.
   Claret and amber appear only inside the five-colour retro stripes.
   Type: Bodoni Moda (editorial serif) + Jost (geometric sans), unchanged. */

:root {
  /* brand palette */
  --midnight: #100d14;
  --velvet: #301b3d;
  --gold: #c8a66a;
  --ivory: #f3e9d8;
  --violet: #9559b5;
  --claret: #811638;
  --amber: #d98a42;
  --deep-violet: #653478;

  /* supporting tones */
  --gold-lt: #e3cc98;          /* top of the gold button gradient */
  --gold-muted: #a88c5a;
  --aubergine: #1e1226;        /* locked tiles */
  --lavender: #bfaed0;         /* secondary text on dark */
  --parchment: #f3e9d8;        /* liner-note story area */
  --ink: #221a29;              /* text on parchment */
  --ink-soft: #5a4d63;

  --display: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --text: 'Jost', 'Futura', 'Avenir Next', system-ui, sans-serif;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* textures and lighting */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --spotlight: radial-gradient(95% 58% at 50% 0%, rgba(122,62,150,.62) 0%, rgba(72,36,92,.42) 40%, rgba(16,13,20,0) 76%);
  --grooves: repeating-radial-gradient(circle at 50% 50%, transparent 0 3px, rgba(243,233,216,.035) 3px 4px);
  --groove-sheen: conic-gradient(from 200deg at 50% 50%, transparent 0 10%, rgba(149,89,181,.22) 16%, transparent 24% 60%, rgba(149,89,181,.14) 66%, transparent 74%);
  --gold-gradient: linear-gradient(180deg, var(--gold-lt), var(--gold));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--midnight); }
body {
  margin: 0;
  font: 400 17px/1.5 var(--text);
  color: var(--ivory);
  background: var(--midnight);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
/* Functional headings: Bodoni Moda's semibold at a text optical size, which has
   sturdier hairlines than its display cut, so headings hold up on dark screens. */
h1, h2, .sleeve-name {
  font-weight: 600; font-style: normal;
  font-optical-sizing: none; font-variation-settings: "opsz" 20;
  letter-spacing: -0.005em;
}
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.screen { min-height: 100dvh; position: relative; }

/* ============================================================ COMPONENTS */

/* buttons */
.btn {
  display: block; width: 100%;
  min-height: 56px; padding: 0 24px;
  border: 0; border-radius: 999px;
  font-weight: 500; font-size: 17px; letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform .12s ease, background-color .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-gold { background: var(--gold-gradient); color: var(--midnight); box-shadow: 0 10px 28px -14px rgba(200,166,106,.7); }
.btn-dark { background: var(--midnight); color: var(--ivory); }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-ghost-light { background: transparent; color: var(--ivory); box-shadow: inset 0 0 0 1.5px rgba(243,233,216,.55); }

/* Vol. 30 wordmark: italic ivory "Vol.", larger bold gold "30", shared baseline,
   five stripes beneath, small spaced tagline. Size it with --vol-size. */
.vol-mark { --vol-size: 22px; display: inline-flex; flex-direction: column; align-items: center; gap: calc(var(--vol-size) * .32); }
.vol-lockup { display: inline-flex; flex-direction: column; align-items: stretch; gap: calc(var(--vol-size) * .32); }
.vol-edition { font: 500 calc(var(--vol-size) * .42)/1 var(--text); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); text-align: center; margin-right: -.3em; }
.vol-word { display: flex; align-items: baseline; justify-content: center; gap: calc(var(--vol-size) * .3); line-height: .9; }
.vol-v { font: italic 400 var(--vol-size) var(--display); color: var(--ivory); }
.vol-n { font: 800 calc(var(--vol-size) * 2.15) var(--display); color: var(--gold); letter-spacing: -.01em; }
.vol-wave { display: block; width: 0; min-width: 100%; height: calc(var(--vol-size) * .85); margin-top: calc(var(--vol-size) * .12); overflow: visible; }
.stripe-divider { display: flex; flex-direction: column; gap: 3px; }
.stripe-divider i { display: block; height: 2px; }
.stripe-divider i:nth-child(1) { background: var(--claret); }
.stripe-divider i:nth-child(2) { background: var(--deep-violet); }
.stripe-divider i:nth-child(3) { background: var(--violet); }
.stripe-divider i:nth-child(4) { background: var(--amber); }
.stripe-divider i:nth-child(5) { background: var(--gold); }
.vol-tag { font: 500 calc(var(--vol-size) * .42)/1.2 var(--text); letter-spacing: .28em; text-transform: uppercase; color: var(--lavender); text-align: center; margin-right: -.28em; white-space: nowrap; }
.vol-mark-sm { --vol-size: 17px; }
.vol-mark-md { --vol-size: 24px; }
/* The Collection header: the Vol. 30 brand signature (lettering and tagline still, ribbons animated) */
.brand-mark { display: block; width: clamp(200px, 62vw, 300px); height: auto; aspect-ratio: 1100 / 532; margin: 0 auto 18px; overflow: visible; }
.brand-tag { font-family: var(--display); font-weight: 700; font-size: 48px; letter-spacing: .28em; font-variation-settings: "opsz" 11; fill: #ead5a3;
  stroke: rgba(20, 10, 28, .55); stroke-width: 3px; stroke-linejoin: round; paint-order: stroke fill; }   /* faint dark edge lifts it off the purple */

/* retro ribbon: sits on corners and edges, never behind text */
.ribbon { position: absolute; width: 170px; height: 170px; pointer-events: none; opacity: .9; z-index: 0; }
.ribbon-tr { top: 0; right: 0; }
.ribbon-bl { bottom: 0; left: 0; transform: rotate(180deg); }
.ribbon-small { width: 118px; height: 118px; opacity: .8; }

/* disco starburst: occasional gold accents */
.spark { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); pointer-events: none; opacity: .85; z-index: 0; }

/* =========================================================== A. WELCOME */
.welcome {
  background: var(--grain), var(--midnight);
  color: var(--ivory);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(18px + var(--safe-t)) 20px calc(40px + var(--safe-b));
  overflow: hidden;
}
.welcome > * { position: relative; z-index: 1; }
.welcome > .ribbon { position: absolute; z-index: 0; }
.record-wrap .spark { z-index: 2; }

.record-wrap {
  position: relative;
  width: min(71vw, 330px); aspect-ratio: 1;
  margin: 10px 0 24px;
}
/* nightclub backlight behind the record: stays still while the record turns.
   A diffused deep-violet pool that reaches just past the rim and fades into midnight,
   with a restrained disco-violet key from the upper left. */
.record-wrap::before {
  content: ''; position: absolute; inset: -24%; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(circle closest-side at 40% 36%, rgba(149,89,181,.34) 0%, rgba(149,89,181,.16) 72%, rgba(149,89,181,0) 100%),
    radial-gradient(circle closest-side, rgba(101,52,120,.62) 0%, rgba(101,52,120,.5) 62%, rgba(84,44,104,.34) 72%, rgba(48,27,61,.16) 85%, rgba(48,27,61,0) 100%);
}
.record {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-radial-gradient(circle at 50% 50%, #0b090e 0 1.2px, #1d1822 1.2px 2.4px),
    #0e0c11;
  box-shadow: 0 30px 60px rgba(0,0,0,.6), inset 0 0 0 1px #261f2c, inset 0 0 0 6px #0b090d;
  animation: spin 22s linear infinite;
}
.record-label { position: absolute; inset: 20.75%; width: 58.5%; height: 58.5%; overflow: visible; }   /* label ~12.5% larger; record unchanged */
.lb-line { fill: none; stroke: var(--gold); }
.lb-dots { fill: none; stroke: var(--gold); stroke-width: 1; stroke-dasharray: .1 2.6; stroke-linecap: round; }
.lb-ring { font: 600 8.6px var(--text); letter-spacing: .19em; fill: var(--gold-lt); text-transform: uppercase; }
.lb-title { font-family: var(--display); }
.lb-vol { font: italic 400 22px var(--display); fill: var(--ivory); }
.lb-30 { font: 800 52px var(--display); fill: var(--gold); }
.lb-tag { font: 600 6.2px var(--text); letter-spacing: .16em; fill: var(--ivory); text-transform: uppercase; }
.lb-small { font: 600 6.9px var(--text); letter-spacing: .15em; fill: var(--gold-lt); text-transform: uppercase; }
.lb-micro { font: 600 4.8px var(--text); letter-spacing: .13em; fill: #d8cbe4; text-transform: uppercase; }
.label-hole { fill: #0a080c; }
/* surface lighting stays still while the record turns: violet reflections, a touch of champagne,
   and grooves that catch the light inside those reflections. Only the vinyl is lit, never the label. */
.record-sheen, .record-rim { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.record-sheen {
  background:
    conic-gradient(from 0deg, transparent 0 100deg, rgba(149,89,181,.26) 120deg, transparent 142deg 276deg, rgba(205,165,240,.34) 300deg, transparent 326deg),
    conic-gradient(from 0deg, transparent 0 18deg, rgba(228,206,153,.17) 30deg, transparent 42deg 198deg, rgba(228,206,153,.1) 210deg, transparent 222deg),
    conic-gradient(from 0deg, transparent 0 236deg, rgba(149,89,181,.1) 250deg, transparent 264deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 58.6%, #000 59.6%, #000 98.8%, transparent 100%);
          mask: radial-gradient(circle closest-side, transparent 58.6%, #000 59.6%, #000 98.8%, transparent 100%);
}
.record-glints {
  position: absolute; inset: 0; border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, transparent 0 1.2px, rgba(238,224,244,.17) 1.2px 2.4px);
  -webkit-mask: conic-gradient(from 0deg, transparent 0 18deg, rgba(0,0,0,.7) 30deg, transparent 42deg 100deg, rgba(0,0,0,.8) 120deg, transparent 142deg 198deg, rgba(0,0,0,.4) 210deg, transparent 222deg 276deg, #000 300deg, transparent 326deg);
          mask: conic-gradient(from 0deg, transparent 0 18deg, rgba(0,0,0,.7) 30deg, transparent 42deg 100deg, rgba(0,0,0,.8) 120deg, transparent 142deg 198deg, rgba(0,0,0,.4) 210deg, transparent 222deg 276deg, #000 300deg, transparent 326deg);
}
/* violet rim light on parts of the edge (strongest upper left, a softer kick lower right) - not a full ring */
.record-rim {
  background: conic-gradient(from 0deg, transparent 0 96deg, rgba(149,89,181,.5) 128deg, transparent 160deg 252deg, rgba(176,122,214,.7) 284deg, rgba(222,190,244,.95) 312deg, rgba(176,122,214,.6) 338deg, transparent 360deg);
  -webkit-mask: radial-gradient(circle closest-side, transparent 95.2%, #000 98.4%, #000 99.3%, transparent 100%);
          mask: radial-gradient(circle closest-side, transparent 95.2%, #000 98.4%, #000 99.3%, transparent 100%);
}
@keyframes spin { to { transform: rotate(360deg); } }

.gold-caps { font: 500 12px/1.4 var(--text); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-right: -.3em; }
.signoff { font: italic 400 22px var(--display); color: var(--gold); }

/* personal welcome: centred, like a printed invitation */
.welcome-card { width: 100%; max-width: 380px; text-align: center; }
.welcome-card .gold-caps { margin-bottom: 8px; }
.welcome-card h1 { font-size: clamp(32px, 9vw, 40px); line-height: 1.08; color: var(--ivory); margin-bottom: 12px; text-wrap: balance; }
.welcome-card p:not(.gold-caps):not(.signoff) { color: #ded2e8; margin: 0 auto; max-width: 31ch; font-size: 16px; line-height: 1.55; }
.welcome-card .signoff { margin-top: 10px; font-size: 21px; }

/* The Collection feature card */
.feature-card {
  position: relative; width: 100%; max-width: 380px; margin-top: 24px; text-align: center;
  padding: 26px 22px 22px; border-radius: 22px;
  border: 1px solid rgba(200,166,106,.6);
  background:
    var(--grain),
    radial-gradient(110% 70% at 50% 0%, rgba(149,89,181,.42), rgba(101,52,120,.2) 45%, rgba(48,27,61,0) 75%),
    linear-gradient(180deg, rgba(48,27,61,.92), rgba(30,18,38,.95));
  box-shadow: 0 0 46px -14px rgba(149,89,181,.65), inset 0 1px 0 rgba(243,233,216,.06);
}
.feature-card .spark { position: absolute; }
.feature-kicker { font: italic 600 13px/1.45 var(--display); letter-spacing: .12em; text-transform: uppercase; color: #e4ce99; text-shadow: 0 1px 2px rgba(16,13,20,.45); margin: 0 auto 8px; padding: 0 16px; text-wrap: balance; }
.feature-card h2 { font-size: clamp(30px, 8.5vw, 36px); line-height: 1.08; color: var(--ivory); margin-bottom: 12px; }
.feature-card p:not(.feature-kicker):not(.inapp-warning) { color: #ded2e8; font-size: 16px; line-height: 1.55; margin: 0 auto 8px; max-width: 30ch; }
.preview-pips { display: flex; justify-content: center; gap: 8px; list-style: none; margin: 14px 0 4px; padding: 0; }
.preview-pips li { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--gold); }
.feature-card .btn { margin: 18px 0 0; }
.feature-card .inapp-warning { background: rgba(149,89,181,.18); border-left: 2px solid var(--gold); padding: 10px 12px; color: var(--ivory); font-size: 14px; text-align: left; margin: 14px 0 0; }
.optional-note { margin-top: 18px; font: italic 400 17px/1.4 var(--display); color: var(--gold-lt); text-align: center; }
.welcome .fineprint { margin-top: 6px; font-size: 13.5px; color: #a596b4; text-align: center; max-width: 34ch; }

/* a gentle hint that there's more below, shown until the guest scrolls */
.scroll-cue {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; height: calc(40px + var(--safe-b));
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: calc(6px + var(--safe-b));
  pointer-events: none;
  background: linear-gradient(to top, rgba(16,13,20,.5), rgba(16,13,20,0));
  opacity: 0; transition: opacity .35s ease;
}
.scroll-cue.show { opacity: 1; }
.scroll-cue.show svg { animation: cue-bob 2.2s ease-in-out infinite; }
.scroll-cue svg { width: 22px; height: 22px; fill: none; stroke: var(--gold-lt); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes cue-bob { 50% { transform: translateY(4px); } }

/* ====================================================== B. COLLECTION */
.collection {
  background: var(--grain), var(--spotlight), var(--midnight);
  --gutter: 20px;
  padding: calc(28px + var(--safe-t)) var(--gutter) calc(124px + var(--safe-b));
  max-width: 560px; margin: 0 auto;
  overflow: hidden;
}
body[data-screen="collection"] {
  background: radial-gradient(120% 60% at 50% 0%, rgba(48,27,61,.7), var(--midnight) 70%) var(--midnight);
}
.collection > * { position: relative; z-index: 1; }
.collection > .ribbon { position: absolute; z-index: 0; }

.home-btn {
  position: absolute; z-index: 3; top: calc(14px + var(--safe-t)); left: max(14px, env(safe-area-inset-left));
  background: rgba(48,27,61,.82); border: 1px solid rgba(200,166,106,.5);
}
.home-btn svg { stroke: var(--gold-lt); stroke-width: 1.8; stroke-linejoin: round; }
.collection > .home-btn { position: absolute; }
.collection-head { padding: 6px 0 28px; text-align: center; }
.collection-head h1 { font-size: clamp(38px, 11vw, 52px); line-height: 1.02; margin: 0 0 18px; color: var(--ivory); }

.progress { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 14px; }
.progress-pips { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.progress-pips li {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--gold); background: transparent;
  transition: background-color .3s ease;
}
.progress-pips li.on { background: var(--gold-gradient); box-shadow: 0 0 10px rgba(200,166,106,.45); }
.progress-text { font-weight: 500; font-size: 15px; color: var(--gold); }

.sleeves {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px 14px;
}
.sleeve-btn {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.sleeve-btn:active .sleeve-art { transform: scale(.98); }
.sleeve-art {
  display: block; transition: transform .12s ease;
  position: relative; aspect-ratio: 400 / 376; overflow: hidden;   /* matches the locked artwork */
  background: var(--midnight);
  border: 1px solid rgba(200,166,106,.4);
  box-shadow: 0 14px 22px -14px rgba(0,0,0,.8);
}
.sleeve-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; }
.is-collected .sleeve-art { border-color: rgba(200,166,106,.75); }
/* locked tiles: the supplied artwork carries its own background, grooves, border and number */
.is-locked .sleeve-art { background: none; border-color: transparent; }
.sleeve-art img.sleeve-locked { object-fit: contain; object-position: 50% 50%; }
.sleeve-no {
  position: absolute; top: 8px; left: 10px;
  font: italic 500 15px var(--display); color: var(--gold);
}
.is-collected .sleeve-no { color: var(--ivory); text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.sleeve-name { display: block; font-family: var(--display); font-size: 18px; line-height: 1.2; margin-top: 10px; color: var(--ivory); overflow-wrap: anywhere; }
.sleeve-state { display: block; font-size: 14px; color: var(--lavender); margin-top: 3px; }
.is-collected .sleeve-state { color: var(--gold); font-weight: 500; }

.collection-hint { margin: 28px 0 0; font-size: 15px; color: var(--lavender); max-width: 40ch; }

/* Collection Complete: appears above the grid once all six are found */
.complete {
  position: relative; text-align: center; margin: 0 0 26px; padding: 18px 18px 16px;
  border: 1px solid rgba(200,166,106,.6); border-radius: 20px;
  background: var(--grain), radial-gradient(110% 80% at 50% 0%, rgba(149,89,181,.4), rgba(48,27,61,.35) 50%, rgba(16,13,20,.6) 100%);
  box-shadow: 0 0 40px -12px rgba(149,89,181,.6);
}
.complete-spark { width: 18px; height: 18px; display: block; margin: 0 auto 6px; }
.complete h2 { font-size: 28px; line-height: 1.1; color: var(--ivory); }
.complete p { font: italic 400 17px/1.45 var(--display); color: var(--gold-lt); margin: 8px auto 0; max-width: 30ch; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 18px 20px calc(16px + var(--safe-b));
  padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right));
  background: linear-gradient(to top, var(--midnight) 55%, rgba(16,13,20,0));
}
.dock .btn { max-width: 520px; margin: 0 auto; }
.reset-link { display: block; margin: 24px auto 0; background: none; border: 0; color: var(--lavender); text-decoration: underline; font-size: 14px; }

/* =========================================================== C. SCAN */
.scan { position: fixed; inset: 0; background: #000; color: var(--ivory); overflow: hidden; }
#ar-container { position: absolute; inset: 0; overflow: hidden; }
#ar-container video { position: absolute; }
#ar-container .ar-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }

.scan-ui { position: absolute; inset: 0; pointer-events: none; }
.scan-ui button { pointer-events: auto; }
.scan-top {
  display: flex; align-items: center; gap: 10px;
  padding: calc(14px + var(--safe-t)) 16px 0;
}
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(16,13,20,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: grid; place-items: center;
}
.icon-btn svg { width: 20px; height: 20px; stroke: var(--ivory); stroke-width: 2; fill: none; stroke-linecap: round; }
.scan-count {
  margin-right: auto; margin-left: 4px;
  font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 999px;
  background: rgba(16,13,20,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.torch-btn[aria-pressed="true"] { background: var(--gold-lt); }
.torch-btn[aria-pressed="true"] svg { stroke: var(--midnight); }

/* square frame matching the QR codes */
.reticle {
  position: absolute; left: 50%; top: 47%;
  width: min(62vw, 280px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  transition: opacity .35s ease, transform .35s ease;
}
.reticle i { position: absolute; width: 34px; height: 34px; border: 0 solid var(--gold-lt); }
.reticle i:nth-child(1) { top: 0; left: 0; border-width: 3px 0 0 3px; }
.reticle i:nth-child(2) { top: 0; right: 0; border-width: 3px 3px 0 0; }
.reticle i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.reticle i:nth-child(4) { bottom: 0; right: 0; border-width: 0 3px 3px 0; }
.scan[data-state="searching"] .reticle { animation: breathe 2.4s ease-in-out infinite; }
.scan[data-state="starting"] .reticle { opacity: .35; }
.scan[data-state="found"] .reticle,
.scan[data-state="collected"] .reticle,
.scan[data-state="error"] .reticle { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
@keyframes breathe { 50% { transform: translate(-50%, -50%) scale(.97); } }

.scan-status {
  position: absolute; left: 50%; bottom: calc(32px + var(--safe-b)); transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 40px); text-align: center;
  padding: 12px 20px; border-radius: 999px; font-weight: 500; font-size: 16px;
  background: rgba(16,13,20,.74); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color .25s ease, color .25s ease;
}
.scan-status:empty { display: none; }
.scan[data-state="found"] .scan-status,
.scan[data-state="collected"] .scan-status { background: var(--gold-lt); color: var(--midnight); }

/* unlock card + problem card: parchment, like liner notes */
.sheet, .problem {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  padding: 0 12px calc(12px + var(--safe-b));
}
.problem { align-items: center; background: rgba(16,13,20,.6); }
.sheet-card, .problem-card {
  width: 100%; max-width: 520px; margin: 0 auto;
  background: var(--grain-dark), var(--parchment); color: var(--ink);
  border-radius: 22px; padding: 18px;
  box-shadow: 0 30px 60px rgba(0,0,0,.5);
}
.sheet-card { display: grid; grid-template-columns: 92px 1fr; gap: 16px; animation: rise .45s cubic-bezier(.2,.9,.25,1.15); }
.sheet-thumb { width: 92px; height: 92px; object-fit: cover; object-position: 50% 30%; border: 1px solid var(--gold); }
.sheet-kicker { font: italic 500 15px var(--display); color: var(--deep-violet); }
.sheet-card h2 { font-size: 26px; line-height: 1.1; margin: 2px 0 6px; }
.sheet-progress { font-size: 14px; font-weight: 500; margin-top: 8px; color: var(--ink-soft); }
.sheet-actions { grid-column: 1 / -1; display: grid; gap: 10px; margin-top: 4px; }
.problem-card { padding: 26px 22px 20px; }
.problem-card h2 { font-size: 28px; margin-bottom: 10px; }
.problem-text { color: var(--ink-soft); margin-bottom: 20px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

.noscript { color: var(--ivory); padding: 40px 24px; }

/* ===================================================== TOKEN DETAILS */
body.no-scroll { overflow: hidden; }
.token-sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.token-backdrop { position: absolute; inset: 0; background: rgba(16,13,20,.7); }
.token-card {
  position: relative; width: 100%; max-width: 560px; overflow-y: auto; overflow-x: hidden;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - max(24px, var(--safe-t) + 16px));
  background: var(--grain-dark), var(--parchment); color: var(--ink);
  border-radius: 24px 24px 0 0; padding-bottom: calc(28px + var(--safe-b));
  animation: rise .4s cubic-bezier(.2,.9,.25,1.1);
}
.token-close {
  position: sticky; top: 14px; z-index: 3;
  margin: 14px max(14px, env(safe-area-inset-right)) -60px auto;   /* right-aligned, overlapping the artwork */
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.icon-btn-light { background: rgba(243,233,216,.88); }
.icon-btn-light svg { stroke: var(--midnight); }
/* the dark graphic section: purple to black, grooves, a soft spotlight */
.token-art {
  display: grid; place-items: center; border-radius: 24px 24px 0 0; overflow: hidden;
  background: var(--spotlight), linear-gradient(180deg, var(--velvet), var(--midnight));
}
.token-art img { display: block; width: 100%; max-height: 56dvh; object-fit: contain; }
.token-sheet[data-state="locked"] .token-art {
  padding: 20px max(20px, env(safe-area-inset-left)) 20px;
  background: linear-gradient(180deg, var(--velvet), var(--midnight));
}
.token-art img.token-locked { width: auto; height: auto; max-width: min(100%, 400px); max-height: 46dvh; }
.stripe-divider { gap: 2px; }
.stripe-divider i { height: 2px; }
.token-body { padding: 22px 24px 0; }
.token-meta { font: italic 500 16px var(--display); color: var(--deep-violet); }
.token-body h2 { font-size: 34px; line-height: 1.05; margin: 4px 0 16px; color: var(--ink); }
.token-story p { margin-bottom: 12px; max-width: 62ch; line-height: 1.6; }
.token-story p:last-child { font-family: var(--text); font-style: italic; font-weight: 600; font-size: inherit; line-height: 1.6; color: var(--velvet); }
.token-hint { margin-top: 8px; padding-top: 14px; border-top: 1px solid rgba(48,27,61,.18); font-size: 15px; color: var(--ink-soft); }
.token-hint:empty { display: none; }

/* ============================================ LANDING (native QR scan) */
.landing {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px;
  background: rgba(16,13,20,.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.landing-card {
  width: 100%; max-width: 400px; text-align: center; color: var(--ivory);
  background: var(--grain), var(--spotlight), var(--midnight);
  border: 1px solid rgba(200,166,106,.4); border-radius: 26px; padding: 30px 24px 22px;
}
.landing-card .vol-mark { margin-bottom: 22px; }
.landing-card h2 { font-size: 34px; margin: 0 0 12px; color: var(--ivory); }
.landing-card p { color: var(--lavender); margin-bottom: 22px; }
.landing-card .btn + .btn { margin-top: 10px; }

/* ================================================ D. PRIZE REDEMPTION */
.redeem {
  position: fixed; inset: 0; z-index: 40; overflow: hidden; color: var(--ivory);
  height: 100vh; height: 100dvh;
  background: var(--grain), var(--midnight);
}
.redeem-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 50% 38%, rgba(149,89,181,.55), rgba(101,52,120,.25) 45%, rgba(16,13,20,0) 75%),
    radial-gradient(80% 50% at 50% 0%, rgba(122,62,150,.4), rgba(16,13,20,0) 70%);
}
.redeem-ribbon-tr { top: 0; right: 0; width: 150px; height: 150px; }
.redeem-ribbon-bl { bottom: 0; left: 0; width: 150px; height: 150px; transform: rotate(180deg); }
/* fine gold border with a light that travels around it: a live screen, not a screenshot */
.redeem-border {
  position: absolute; pointer-events: none; z-index: 1; border-radius: 22px; padding: 1.5px;
  top: calc(10px + var(--safe-t)); bottom: calc(10px + var(--safe-b)); left: 10px; right: 10px;
  background: linear-gradient(110deg, var(--gold-muted) 0%, var(--gold) 30%, #fff3d2 45%, var(--gold) 60%, var(--gold-muted) 100%);
  background-size: 300% 100%;
  animation: border-sweep 4.5s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
@keyframes border-sweep { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.redeem-close { position: absolute; z-index: 3; top: calc(20px + var(--safe-t)); right: 20px; background: rgba(48,27,61,.85); border: 1px solid rgba(200,166,106,.4); }
.redeem-scroll {
  position: relative; z-index: 2; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(30px + var(--safe-t)) 26px calc(34px + var(--safe-b));
}
.redeem-inner { max-width: 400px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.redeem-inner h2 { font-size: clamp(28px, 8vw, 36px); line-height: 1.1; margin: 6px 0 2px; padding: 0 36px; }
.pin-stage { position: relative; width: min(64vw, 290px, 36vh); width: min(64vw, 290px, 36dvh); aspect-ratio: 1; margin: 8px 0 12px; }
.pin-spot { position: absolute; inset: -18%; border-radius: 50%; background: radial-gradient(circle, rgba(170,110,210,.55), rgba(101,52,120,.25) 45%, rgba(16,13,20,0) 70%); }
.pin { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 18px 30px rgba(0,0,0,.55)); }
/* a metallic glint that passes across the pin, shaped by the artwork itself */
.pin-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 0 38%, rgba(255,246,220,.42) 48%, transparent 58% 100%);
  background-size: 260% 100%;
  animation: pin-sheen 5s ease-in-out infinite;
  -webkit-mask: url(../assets/reward/pin.png) center / contain no-repeat;
          mask: url(../assets/reward/pin.png) center / contain no-repeat;
  mix-blend-mode: screen;
}
@keyframes pin-sheen { 0%, 35% { background-position: 120% 0; } 75%, 100% { background-position: -40% 0; } }
.spark.twinkle { z-index: 2; animation: twinkle 3.2s ease-in-out infinite; animation-delay: var(--d); }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1) rotate(25deg); } }
.redeem-status { margin: 0 0 12px; }
.redeem-status span {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  font: 600 clamp(15px, 5.2vw, 20px)/1 var(--text); letter-spacing: .2em; text-transform: uppercase; color: var(--midnight); white-space: nowrap;
  background: var(--gold-gradient); box-shadow: 0 0 0 1px rgba(255,243,210,.5), 0 0 34px rgba(200,166,106,.55);
  animation: status-glow 2.6s ease-in-out infinite;
}
@keyframes status-glow { 50% { box-shadow: 0 0 0 1px rgba(255,243,210,.7), 0 0 50px rgba(227,204,152,.85); } }
.redeem-instr { font-size: 16.5px; line-height: 1.5; color: var(--ivory); max-width: 30ch; margin-bottom: 12px; }
.redeem-note { font: italic 400 18px/1.45 var(--display); color: #ded2e8; margin-bottom: 4px; }
.redeem-limit { margin-top: 10px; font: italic 400 15px var(--display); color: var(--lavender); }

/* ============================================================== LAYOUT */
@media (min-width: 700px) {
  .sleeves { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 360px) {
  .ribbon { width: 130px; height: 130px; }
  .ribbon-small { width: 96px; height: 96px; }
  .sleeve-name { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .record, .scan[data-state="searching"] .reticle, .sheet-card, .token-card,
  .redeem-border, .pin-sheen, .spark.twinkle, .redeem-status span, .scroll-cue.show svg { animation: none; }
  .spark.twinkle { opacity: .85; }
}
