/* BrickPocket v1.3 — Star Wars collection theme ("galaxy"). Layered last, after app.css and motion.css. */
:root {
  --bg: #04060c;
  --bg-2: #070b14;
  --surface: #0b111c;
  --surface-2: #101826;
  --surface-3: #182335;
  --line: rgba(150, 190, 255, .075);
  --line-2: rgba(150, 190, 255, .15);
  --text: #e9eff9;
  --muted: #95a3ba;
  --faint: #5f6d84;
  --accent: #58b6ff;
  --accent-soft: rgba(88, 182, 255, .13);
  --accent-ink: #02101c;
  --glow: 0 0 18px rgba(88, 182, 255, .45);
  --red: #ff5a52;
  --green: #4fd18b;
  --serif: 'Oxanium', 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --display: 'Oxanium', 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 16px;
  --radius-sm: 10px;
}
/* accent = lightsaber colours */
[data-accent="blue"], [data-accent="silver"] { --accent: #58b6ff; --accent-soft: rgba(88,182,255,.13); --accent-ink: #02101c; --glow: 0 0 18px rgba(88,182,255,.45); }
[data-accent="red"]    { --accent: #ff5a52; --accent-soft: rgba(255,90,82,.13); --accent-ink: #1d0302; --glow: 0 0 18px rgba(255,90,82,.45); }
[data-accent="green"]  { --accent: #5ee07a; --accent-soft: rgba(94,224,122,.12); --accent-ink: #031a08; --glow: 0 0 18px rgba(94,224,122,.4); }
[data-accent="purple"] { --accent: #b48cff; --accent-soft: rgba(180,140,255,.13); --accent-ink: #12052a; --glow: 0 0 18px rgba(180,140,255,.45); }
[data-accent="gold"]   { --accent: #ffd84a; --accent-soft: rgba(255,216,74,.12); --accent-ink: #1c1600; --glow: 0 0 18px rgba(255,216,74,.4); }

/* ---------- deep space ---------- */
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 700px at 88% -12%, var(--accent-soft), transparent 62%), radial-gradient(900px 600px at -8% 108%, rgba(130, 90, 255, .07), transparent 60%);
  background-attachment: fixed;
}
body::before, body::after { content: ''; position: fixed; inset: -50% 0 0; height: 200%; z-index: -1; pointer-events: none; }
body::before {
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 140px 90px, rgba(200,225,255,.45), transparent 60%),
    radial-gradient(1.4px 1.4px at 260px 170px, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1px 1px at 330px 40px, rgba(190,215,255,.35), transparent 60%),
    radial-gradient(1px 1px at 80px 250px, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1.2px 1.2px at 390px 290px, rgba(220,235,255,.5), transparent 60%);
  background-size: 420px 320px;
  opacity: .55;
}
body::after {
  background-image:
    radial-gradient(1.8px 1.8px at 60px 120px, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 420px 380px, rgba(180,215,255,.7), transparent 60%),
    radial-gradient(1.6px 1.6px at 710px 60px, rgba(255,255,255,.6), transparent 60%);
  background-size: 820px 620px;
  opacity: .5;
}
@keyframes drift { to { transform: translateY(25%); } }
[data-motion="reduce"] body::before, [data-motion="reduce"] body::after { animation: none; }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } }

/* ---------- type ---------- */
.page-title { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; font-size: clamp(34px, 5vw, 52px); line-height: 1.04; }
.page-title em { font-style: normal; color: var(--accent); text-shadow: var(--glow); }
.section-title { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; font-size: 22px; }
.eyebrow { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .16em; color: var(--muted); }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.brand-name em { font-style: normal; color: var(--accent); }
.brand-tag { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); margin-top: 3px; }
.brand-mark { border-radius: 9px; box-shadow: var(--glow); }
.hero-num, .kpi-line b, .stat .v, .facts b, .donut-center b, .detail h2, .pick h3, .empty h3 { font-family: var(--display); }
.hero-num { font-weight: 600; letter-spacing: -.04em; }
.kpi-line b { font-weight: 600; font-size: 26px; }
.stat .v { font-weight: 600; letter-spacing: -.02em; }
.detail h2 { font-weight: 600; letter-spacing: -.02em; font-size: 32px; }
.facts b { font-weight: 600; font-size: 22px; }
.pick h3 { font-weight: 600; font-size: 21px; letter-spacing: -.01em; }
.num-tag, .mono { font-family: var(--mono); }
.footer-note { max-width: 640px; margin-left: auto; margin-right: auto; line-height: 1.6; }

/* ---------- surfaces ---------- */
.card, .set-card, .fig-card, .pick, .ach, .list, .stats, .owned-box, .compare, .fig { background: linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0) 40%), var(--surface); }
.card, .list, .stats { box-shadow: inset 0 1px 0 rgba(160, 200, 255, .05); }
.hero { background: linear-gradient(135deg, var(--surface-2), var(--surface) 65%); border-color: var(--line-2); border-radius: 20px; }
/* HUD corner brackets */
.hero::before { content: ''; position: absolute; inset: 10px; pointer-events: none; border-radius: 12px; opacity: .55;
  background:
    linear-gradient(var(--accent), var(--accent)) top left / 18px 1.5px no-repeat, linear-gradient(var(--accent), var(--accent)) top left / 1.5px 18px no-repeat,
    linear-gradient(var(--accent), var(--accent)) top right / 18px 1.5px no-repeat, linear-gradient(var(--accent), var(--accent)) top right / 1.5px 18px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom left / 18px 1.5px no-repeat, linear-gradient(var(--accent), var(--accent)) bottom left / 1.5px 18px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom right / 18px 1.5px no-repeat, linear-gradient(var(--accent), var(--accent)) bottom right / 1.5px 18px no-repeat; }
.btn-primary { box-shadow: 0 0 0 1px rgba(255,255,255,.08) inset, 0 8px 26px -8px var(--accent); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 10px 32px -6px var(--accent); }
.btn.is-on { border-color: var(--red); color: #ff9a92; }
.nav-link.active { background: linear-gradient(90deg, var(--accent-soft), transparent 85%); box-shadow: inset 2px 0 0 var(--accent); }
.nav-link.active svg { filter: drop-shadow(0 0 6px var(--accent)); }
.sidebar { background: rgba(4, 6, 12, .78); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.seg button.on { background: var(--surface-3); box-shadow: inset 0 -2px 0 var(--accent); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.tab-ind { box-shadow: 0 0 18px -2px var(--accent); }
.fab { border-radius: 18px; }
.mini-prog i, .prog i, .bar-row .fill { background: var(--accent); box-shadow: 0 0 10px -1px var(--accent); }
.set-card:hover, .fig-card:hover, .pick:hover { border-color: rgba(150, 200, 255, .22); }

/* ---------- set artwork: holographic blueprint ---------- */
.art { background:
    radial-gradient(120% 90% at 85% 0%, hsla(var(--h), 85%, 60%, .28), transparent 60%),
    linear-gradient(rgba(140, 190, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(140, 190, 255, .07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(160deg, hsl(calc(var(--h) + 190) 45% 12%), #060a14 70%); }
.art::before { opacity: .9; background-image: radial-gradient(circle at 50% 50%, hsla(var(--h), 90%, 75%, .35) 0 1px, transparent 1.5px); background-size: 22px 22px; mask-image: radial-gradient(70% 80% at 80% 10%, #000, transparent 75%); -webkit-mask-image: radial-gradient(70% 80% at 80% 10%, #000, transparent 75%); }
.art::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 12px; height: 1px; background: linear-gradient(90deg, hsla(var(--h), 90%, 70%, .6), transparent); }
.art .art-num { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; color: hsl(var(--h) 90% 88%); text-shadow: 0 0 22px hsla(var(--h), 90%, 60%, .55); bottom: 14px; }
.art .art-theme { font-family: var(--mono); letter-spacing: .14em; color: hsla(var(--h), 85%, 80%, .75); bottom: 62px; }
.art img { background: #eef2f7; }
.pick .art .art-theme { bottom: 82px; }
.detail .art .art-theme { bottom: 104px; }
.row .thumb .art::after, .pal-thumb .art::after, .thumbmini .art::after { display: none; }
.pal-thumb .art-num, .row .thumb .art-num { bottom: 3px; text-shadow: none; }

/* ---------- minifigures ---------- */
.fig-stage { position: relative; aspect-ratio: 1; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(85% 70% at 50% 35%, #f4f7fb, #dfe6ef 70%, #cfd8e4); }
.fig-stage img { position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain; opacity: 0; transition: opacity .35s, transform .6s var(--ease); mix-blend-mode: multiply; }
.fig-stage img.ok { opacity: 1; }
.fig-stage .fig-ph { color: #9fb0c6; width: 42%; display: grid; place-items: center; }
.fig-stage .fig-ph svg { width: 100%; height: auto; stroke-width: 1.4; }
.fig-stage img.ok + .fig-ph, .fig-stage .fig-ph:has(+ img.ok) { opacity: 0; }
.fig-stage::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: 7%; height: 7%; border-radius: 50%; background: radial-gradient(closest-side, rgba(10, 30, 60, .25), transparent); }
.fig-stage.lg { border-radius: 18px; aspect-ratio: 4 / 4.2; }
.fig-stage.sm { border-radius: 10px; }
.fig-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.fig-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.fig-card:active { transform: scale(.975); }
@media (hover: hover) { .fig-card:hover .fig-stage img.ok { transform: scale(1.06) translateY(-2%); } }
.fig-card .body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.fig-card .name { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fig-card .num-tag { font-size: 10.5px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fig-card .meta { font-size: 12px; color: var(--faint); display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.fig-card .corner { position: absolute; top: 9px; right: 9px; display: flex; gap: 6px; z-index: 2; }
.fig-card .badges { position: absolute; top: 9px; left: 9px; z-index: 2; }
.fig-card .round-btn { background: rgba(4, 8, 16, .72); }
.fig-card .round-btn.on { background: var(--accent); }
.fig-card .round-btn.heart.on { background: var(--red); }
.grid.figs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 700px) { .grid.figs { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); } }
.fig-avatar { background: radial-gradient(circle at 50% 35%, #f1f5fa, #d5dde8); }
.fig-avatar svg { color: #8ea0b7; }
.fig-avatar img { mix-blend-mode: multiply; }
.fig-list { display: flex; flex-direction: column; gap: 8px; }
.fig-btn { width: 100%; padding: 10px 12px; text-align: left; cursor: pointer; border: 1px solid var(--line); }
.fig-btn > svg:last-child { width: 16px; height: 16px; color: var(--faint); flex: none; }
.fig-btn:hover { border-color: var(--line-2); }
.fig-detail .fig-stage.lg { max-width: 420px; margin: 0 auto; }
.pal-fig .fig-avatar { width: 46px; height: 46px; border-radius: 10px; }
.kind-switch { display: inline-flex; gap: 4px; padding: 4px; margin-top: 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.kind-switch button { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14.5px; cursor: pointer; transition: background .2s, color .2s; }
.kind-switch button svg { width: 18px; height: 18px; }
.kind-switch button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.kind-switch button.on svg { color: var(--accent); }
.kind-switch + .toolbar { margin-top: 14px; }

/* ---------- minifigure of the day ---------- */
.motd-wrap { margin-top: 28px; }
.motd-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.motd-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: live 1.6s ease-in-out infinite; }
@keyframes live { 50% { opacity: .35; } }
.motd-head .section-title { margin-top: 6px; font-size: 26px; }

.motd-cd { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(8, 14, 26, .7); }
.motd-cd .eyebrow { font-size: 10px; letter-spacing: .14em; max-width: 90px; line-height: 1.35; }
.cd-digits { display: flex; align-items: center; gap: 3px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cd-digits b { display: inline-block; min-width: 38px; padding: 6px 4px; text-align: center; font-size: 22px; font-weight: 600; border-radius: 8px; background: var(--surface-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.cd-digits b.tick { animation: cd-tick .45s var(--ease); }
.cd-digits i { font-style: normal; color: var(--faint); font-weight: 600; animation: blink 1s steps(1) infinite; }
@keyframes cd-tick { from { transform: translateY(-35%); opacity: .2; } }
@keyframes blink { 50% { opacity: .25; } }
.cd-at { font-size: 11.5px; font-family: var(--mono); }
.motd-cd.soon b { color: var(--accent); box-shadow: 0 0 14px -3px var(--accent); }
.motd-cd.arriving .eyebrow::after { content: ' · arriving'; color: var(--accent); }
@media (max-width: 600px) { .motd-cd { width: 100%; justify-content: space-between; } .motd-cd .cd-at { display: none; } .cd-digits b { min-width: 34px; font-size: 20px; } }

.motd-card { position: relative; display: grid; grid-template-columns: 1fr; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-2);
  background: radial-gradient(90% 120% at 25% 100%, rgba(88,182,255,.08), transparent 60%), linear-gradient(160deg, #0c1424, #060a13 70%); box-shadow: 0 30px 80px -40px rgba(0,0,0,.9); }
@media (min-width: 820px) { .motd-card { grid-template-columns: minmax(300px, 0.95fr) 1.25fr; min-height: 420px; } }
.motd-stage { position: relative; min-height: 340px; overflow: hidden; display: grid; place-items: center; padding: 28px 28px 56px;
  background: radial-gradient(60% 55% at 50% 88%, var(--accent-soft), transparent 70%), linear-gradient(rgba(140,190,255,.05) 1px, transparent 1px) 0 0 / 24px 24px, linear-gradient(90deg, rgba(140,190,255,.05) 1px, transparent 1px) 0 0 / 24px 24px; }
.motd-stage .hyper { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity .35s; }
.motd-card.jump .hyper { opacity: 1; }
.motd-card.materialise .hyper { opacity: 0; transition-duration: .6s; }

.holo { position: relative; width: min(280px, 70%); }
.holo-case { position: relative; aspect-ratio: 1 / 1.08; border-radius: 18px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(85% 70% at 50% 35%, #f4f7fb, #dfe6ef 70%, #cad4e1); box-shadow: 0 30px 60px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.06);
  transition: filter 1s var(--ease), box-shadow 1s; }
.holo-case img { position: absolute; inset: 5%; width: 90%; height: 90%; object-fit: contain; mix-blend-mode: multiply; opacity: 0; transition: opacity .3s; }
.holo-case img.ok { opacity: 1; }
.holo-ph { width: 46%; color: #9fb0c6; }
.holo-ph svg { width: 100%; height: auto; stroke-width: 1.3; }
.holo-case img.ok ~ .holo-ph { opacity: 0; }
.holo-scan { position: absolute; inset: 0; border-radius: 18px; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, rgba(120, 200, 255, .22) 0 1px, transparent 1px 4px); mix-blend-mode: screen; }
.emitter { position: absolute; left: 50%; bottom: 26px; width: 150px; height: 18px; transform: translateX(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent), transparent); opacity: .55; filter: blur(2px); }
.emitter i { position: absolute; left: 50%; bottom: 8px; width: 70%; height: 260px; transform: translateX(-50%); opacity: 0;
  background: linear-gradient(to top, var(--accent-soft), transparent 80%); clip-path: polygon(30% 100%, 70% 100%, 100% 0, 0 0); }
.flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, #fff, rgba(200,230,255,.85) 30%, transparent 75%); opacity: 0; pointer-events: none; }

/* sealed: encrypted transmission waiting */
.sealed-ui { position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 20px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(4, 10, 22, .55), rgba(4, 8, 16, .92)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.sealed-ui .sig { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--accent); box-shadow: var(--glow), inset 0 0 18px var(--accent-soft); margin-bottom: 8px; animation: sig 2s ease-in-out infinite; }
.sealed-ui .sig svg { width: 26px; height: 26px; }
@keyframes sig { 50% { transform: scale(1.08); box-shadow: 0 0 34px var(--accent), inset 0 0 22px var(--accent-soft); } }
.sealed-ui b { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: .02em; }
.sealed-ui .btn { margin-top: 14px; }
.motd-card.is-sealed .sealed-ui { display: flex; }
.motd-card.is-sealed .holo-case { filter: blur(6px) grayscale(1) brightness(.6); }
.motd-card.jump .sealed-ui { display: flex; animation: fade-out .3s forwards; }

/* info column */
.motd-info { position: relative; padding: 28px 28px 30px; display: flex; flex-direction: column; justify-content: center; }
@media (min-width: 820px) { .motd-info { padding: 40px 44px 40px 20px; } }
.redacted { display: none; flex-direction: column; gap: 14px; }
.redacted i { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.6s infinite; }
.redacted i:first-child { height: 34px; margin-bottom: 6px; }
.motd-card.is-sealed .redacted { display: flex; }
.motd-card.is-sealed .reveal-body { display: none; }
.motd-card.jump:not(.show-info) .reveal-body { display: none; }
.motd-card.jump:not(.show-info) .redacted { display: flex; }
.motd-name { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -.02em; margin: 10px 0 14px; text-shadow: 0 0 30px var(--accent-soft); overflow-wrap: anywhere; }
.motd-headline { font-family: var(--display); font-size: 18px; font-weight: 500; color: var(--accent); margin: 0 0 12px; }
.motd-text { color: #c4cfdf; font-size: 15.5px; line-height: 1.65; margin: 0 0 12px; max-width: 62ch; }
.motd-fact { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(150,200,255,.12); font-size: 14px; margin: 4px 0 14px; }
.motd-fact svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 1px; }
.motd-sets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 18px; font-size: 13px; }
.motd-sets .chip { height: 30px; font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* reveal choreography */
.motd-card.flashing .flash { animation: flash .75s ease-out forwards; }
@keyframes flash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
.holo-case::after { content: ''; position: absolute; inset: 0; background: var(--accent); mix-blend-mode: color; opacity: 0; transition: opacity 1.1s var(--ease); pointer-events: none; }
.holo-case::before { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(80% 60% at 50% 40%, transparent, rgba(10, 40, 90, .55)); opacity: 0; transition: opacity 1.1s var(--ease); pointer-events: none; }
.motd-card.materialise .holo-case { animation: project 1.1s var(--ease) both; box-shadow: 0 0 60px -10px var(--accent), 0 0 0 1px var(--accent); }
.motd-card.materialise .holo-case::after { opacity: .9; transition-duration: .2s; }
.motd-card.materialise .holo-case::before { opacity: 1; transition-duration: .2s; }
.motd-card.solid .holo-case::after, .motd-card.solid .holo-case::before { opacity: 0; transition-duration: 1.1s; }
.motd-card.materialise .holo-scan { opacity: 1; animation: scan 1.2s linear infinite; }
.motd-card.materialise .holo { animation: flicker 1.3s steps(1) both; }
.motd-card.materialise .emitter { opacity: 1; }
.motd-card.materialise .emitter i { opacity: 1; transition: opacity .4s; }
.motd-card.solid .holo-case { box-shadow: 0 30px 60px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.06); }
.motd-card.solid .holo-scan { opacity: 0; transition: opacity .8s; }
.motd-card.solid .emitter i { opacity: 0; transition: opacity 1s; }
@keyframes project { from { clip-path: inset(100% 0 0 0 round 18px); transform: translateY(16px) scale(.94); } to { clip-path: inset(0 0 0 0 round 18px); transform: none; } }
@keyframes scan { to { background-position: 0 40px; } }
@keyframes flicker { 0% { opacity: .2; } 8% { opacity: .9; } 12% { opacity: .4; } 20% { opacity: 1; } 34% { opacity: .75; } 38%, 100% { opacity: 1; } }
.motd-card.show-info .r-line { animation: line-in .6s var(--ease) both; animation-delay: calc(var(--r, 0) * 110ms + 250ms); }
@keyframes line-in { from { opacity: 0; transform: translateY(10px); } }
.motd-card.jump .motd-name { color: var(--accent); }
.motd-card.solid .motd-name { color: var(--text); transition: color .8s; }

/* previous days */
.motd-prev { margin-top: 18px; }
.motd-prev-row { display: grid; grid-auto-flow: column; grid-auto-columns: 112px; gap: 10px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.motd-prev-row::-webkit-scrollbar { display: none; }
.motd-prev-item { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.motd-prev-item .fig-stage { transition: transform .2s var(--ease); }
.motd-prev-item:hover .fig-stage { transform: translateY(-3px); }
.motd-prev-item .d { font-family: var(--mono); font-size: 10.5px; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; }
.motd-prev-item .n { font-size: 12.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 959px) { .motd-prev-row { margin-right: -16px; padding-right: 16px; } }

/* reduced motion: no reveal choreography */
[data-motion="reduce"] .motd-card *, [data-motion="reduce"] .live-dot, [data-motion="reduce"] .cd-digits * { animation: none !important; transition: none !important; }

/* ---------- small fixes for the new type ---------- */
.stat .v { font-size: clamp(28px, 3.4vw, 38px); }
.topbar-title { font-family: var(--display); font-weight: 600; }
.tabbar a { font-family: var(--sans); }
.palette { background: #070c16; }
.ctx { background: #0e1626; }
.sheet, .pane { background: #060a13; }
.overlay { background: rgba(0, 2, 8, calc(.7 * var(--dim, 1))); }
.motd-card.jump:not(.materialise) .holo { opacity: 0; }
.motd-card.jump:not(.materialise) .emitter { opacity: 0; }
.detail > div { min-width: 0; }
.pane .fig-detail .fig-stage.lg { max-width: 300px; }

/* ---------- v1.4 performance: nothing blurs what's behind it while you scroll ---------- */
/* A moving background under backdrop-filter forces a full re-blur every frame, so the starfield is static,
   and per-card buttons/badges use solid tints instead of blurring the page behind them. */
body::before, body::after { transform: translateZ(0); }
.set-card .badges .badge, .round-btn, .fig-card .round-btn { backdrop-filter: none; -webkit-backdrop-filter: none; }
.set-card .badges .badge { background: rgba(4, 8, 16, .82); }
.round-btn { background: rgba(4, 8, 16, .8); }
.sidebar { backdrop-filter: none; background: rgba(4, 6, 12, .96); }
.tabbar { backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3); background: rgba(5, 8, 15, .9); }
.pane-head, .sheet-head { backdrop-filter: none; background: rgba(6, 10, 19, .97); }
@media (max-width: 759px) { .overlay, .palette-ov { backdrop-filter: none; } }
@media (max-width: 959px) { .topbar.scrolled { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: rgba(4, 6, 12, .86); } }
/* cards render independently, which keeps long grids smooth */
.set-card, .fig-card { contain: layout style; }
.set-card, .fig-card, .pick { transition: transform .22s var(--ease), border-color .2s; }
@media (hover: hover) {
  .set-card::after, .fig-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: 0 24px 50px -24px rgba(0,0,0,.85); opacity: 0; transition: opacity .22s; }
  .set-card:hover::after, .fig-card:hover::after { opacity: 1; }
  .set-card:hover, .fig-card:hover { box-shadow: none; }
}
/* state changes on a card fade instead of snapping */
.badge { animation: badge-in .3s var(--ease); }
@keyframes badge-in { from { opacity: 0; transform: scale(.9); } }
[data-motion="reduce"] .badge { animation: none; }
/* replay the reveal */
.motd-replay { position: absolute; top: 14px; left: 14px; z-index: 4; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border-radius: 99px;
  border: 1px solid var(--line-2); background: rgba(4, 8, 16, .8); color: var(--muted); font: 600 12.5px var(--sans); cursor: pointer;
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .3s, transform .3s var(--ease), color .15s, border-color .15s; }
.motd-replay svg { width: 15px; height: 15px; transition: transform .5s var(--ease); }
.motd-card.is-revealed:not(.jump) .motd-replay { opacity: 1; transform: none; pointer-events: auto; }
.motd-replay:hover { color: var(--text); border-color: var(--accent); }
.motd-replay:hover svg { transform: rotate(180deg); color: var(--accent); }
.motd-replay:active { transform: scale(.94); }
/* ---------- popups ---------- */
.popup-ov { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 20px; background: rgba(0, 3, 10, .72); animation: fade .25s; }
.popup-ov.closing { animation: fade-out .26s forwards; }
.popup { position: relative; width: min(460px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 22px; border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #0e1729, #070b14 70%); box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(88,182,255,.06), 0 0 80px -40px var(--accent);
  animation: popup-in .5s var(--spring); }
.popup-ov.closing .popup { animation: popup-out .24s var(--ease-in) forwards; }
@keyframes popup-in { from { opacity: 0; transform: translateY(18px) scale(.94); } }
@keyframes popup-out { to { opacity: 0; transform: translateY(10px) scale(.96); } }
.popup-img { aspect-ratio: 16 / 9; background: #0b1220; overflow: hidden; }
.popup-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.popup-img img.ok { opacity: 1; }
.popup-glow { height: 6px; background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 30px var(--accent); opacity: .8; }
.popup-x { position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(4, 8, 16, .75); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.popup-x svg { width: 16px; height: 16px; }
.popup-x:hover { color: var(--text); }
.popup-body { padding: 24px 26px 24px; }
.popup-body h2 { font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.15; letter-spacing: -.01em; margin: 6px 0 10px; padding-right: 30px; }
.popup-text { color: #c4cfdf; font-size: 15px; line-height: 1.6; }
.popup-text p { margin: 0 0 10px; }
.popup-text a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.popup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.popup-actions .btn { height: 44px; padding: 0 20px; }
[data-motion="reduce"] .popup, [data-motion="reduce"] .popup-ov { animation: none; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; box-shadow: 0 0 10px -1px var(--accent); }
.split > * { min-width: 0; }
/* toast actions (Undo, Reload…) */
.toast.has-action { padding-right: 8px; }
.toast-btn { margin-left: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--accent); font: 700 13px var(--sans); cursor: pointer; flex: none; }
.toast-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* v1.5 — quality of life */
.result-count { margin: -6px 0 14px; font-size: 13px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.offline-bar { position: fixed; left: 50%; z-index: 60; display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(560px, calc(100vw - 32px));
  padding: 9px 16px; border-radius: 99px; font-size: 13px; line-height: 1.35; color: var(--text); background: rgba(20, 24, 34, .94);
  border: 1px solid var(--line-2); box-shadow: 0 12px 30px -12px rgba(0,0,0,.7);
  top: calc(env(safe-area-inset-top, 0px) + 10px); transform: translate(-50%, -160%); opacity: 0; pointer-events: none;
  transition: transform .4s cubic-bezier(.2,.9,.3,1.1), opacity .25s; }
.offline-bar svg { width: 16px; height: 16px; flex: none; color: #ffb35c; }
.is-offline .offline-bar { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 899px) { .offline-bar { top: calc(env(safe-area-inset-top, 0px) + 58px); } }
@media (prefers-reduced-motion: reduce) { .offline-bar { transition: opacity .2s; } }
