/* ═══════════════════════════════════════════════════════════════
   MeckGrade — Holo Foil Lab
   Deep midnight · iridescent foil · electric mint signal
   Bricolage Grotesque · Geist · Geist Mono
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@300;400;500;600&display=swap');

:root {
  /* Surfaces */
  --bg:       #07070b;
  --bg-2:     #0b0b12;
  --surf:     #10101a;
  --surf-2:   #161622;
  --surf-3:   #1d1d2c;
  --surf-hi:  #23233a;

  /* Text */
  --text:     #F4F2EE;
  --text-2:   #C7C5D4;
  --text-3:   #8A88A0;
  --text-4:   #5C5A72;
  --text-5:   #3A3850;

  /* Lines */
  --line:     rgba(244, 242, 238, 0.08);
  --line-2:   rgba(244, 242, 238, 0.14);
  --line-3:   rgba(244, 242, 238, 0.22);

  /* Holo gradient (foil spectrum) */
  --holo-1: #c4a5ff;   /* lavender */
  --holo-2: #ff8fd3;   /* pink */
  --holo-3: #ffc585;   /* peach */
  --holo-4: #b8f5b0;   /* mint */
  --holo-5: #87d8ff;   /* cyan */
  --holo: linear-gradient(120deg,
    #c4a5ff 0%, #ff8fd3 25%, #ffc585 50%, #b8f5b0 75%, #87d8ff 100%);
  --holo-soft: linear-gradient(120deg,
    rgba(196,165,255,0.5) 0%, rgba(255,143,211,0.5) 25%, rgba(255,197,133,0.5) 50%, rgba(184,245,176,0.5) 75%, rgba(135,216,255,0.5) 100%);

  /* Signal */
  --mint:     oklch(0.88 0.17 165);
  --mint-bg:  oklch(0.30 0.10 165);
  --amber:    oklch(0.82 0.14 75);
  --amber-bg: oklch(0.28 0.08 75);
  --rose:     oklch(0.72 0.18 18);
  --rose-bg:  oklch(0.30 0.10 18);
  --violet:   oklch(0.74 0.16 290);
  --violet-bg:oklch(0.28 0.10 290);

  /* Type */
  --display: 'Bricolage Grotesque', 'Inter', sans-serif;
  --sans:    'Geist', 'Helvetica Neue', sans-serif;
  --mono:    'Geist Mono', 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

/* Ambient noise + holo glow on body */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 12% 8%, rgba(196,165,255,0.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 92% 88%, rgba(135,216,255,0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(184,245,176,0.06), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}

/* ═══════════ APP SHELL ═══════════ */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16,16,26,0.6), rgba(8,8,14,0.6));
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 22px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 8s ease-in-out infinite;
  position: relative;
  box-shadow: 0 0 24px rgba(196,165,255,0.3);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 6px;
  background: var(--bg);
}
.brand-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 8s ease-in-out infinite;
  z-index: 1;
  filter: blur(0.5px);
  mask: radial-gradient(circle at 50% 50%, black 30%, transparent 32%);
  -webkit-mask: radial-gradient(circle at 50% 50%, black 30%, transparent 32%);
}
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 24;
}
.brand-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: -2px;
}

.nav-section {
  margin-top: 14px;
}
.nav-label {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--text-4);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0 10px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}
.nav-item:hover {
  background: var(--surf);
  color: var(--text);
}
.nav-item.active {
  background: var(--surf-2);
  color: var(--text);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 6s ease-in-out infinite;
  box-shadow: 0 0 12px rgba(196,165,255,0.6);
}
.nav-icon {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: currentColor;
}
.nav-badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--surf-2);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 5px;
}
.nav-item.active .nav-badge {
  background: var(--surf-hi);
  color: var(--text);
}

.user-card {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surf), var(--surf-2));
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 8s ease-in-out infinite;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg);
}
.user-name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-tier { font-family: var(--mono); font-size: 9.5px; color: var(--text-3); letter-spacing: 0.1em; text-transform: uppercase; }

/* ═══════════ TOPBAR ═══════════ */

.main { min-width: 0; position: relative; }

.topbar {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center;
  padding: 12px 28px;
  gap: 14px;
  background: linear-gradient(180deg, rgba(7,7,11,0.88), rgba(7,7,11,0.6));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.crumbs .sep { color: var(--text-5); }
.crumbs .now { color: var(--text); }
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surf);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  width: 280px;
}
.kbd {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg);
  margin-left: auto;
}
.topbar-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surf);
  color: var(--text-2);
  cursor: pointer;
}
.topbar-btn:hover { background: var(--surf-2); color: var(--text); }

/* ═══════════ CONTENT ═══════════ */

.content {
  padding: 28px 36px 64px;
  position: relative;
  z-index: 1;
}
@media (min-width: 1700px) {
  .content { padding: 32px 56px 72px; }
}

/* Page head */
.page-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: end;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.eyebrow .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 10px var(--mint);
  position: relative;
}
.eyebrow .pulse::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--mint);
  animation: pingRing 2.2s ease-out infinite;
}
.page-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 96;
  margin: 0;
  text-wrap: balance;
}
.page-title em {
  font-style: italic;
  font-weight: 400;
  background: var(--holo);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: holoShift 6s ease-in-out infinite;
  font-variation-settings: "opsz" 96;
}
.page-sub {
  color: var(--text-3);
  max-width: 540px;
  font-size: 15px;
  margin-top: 18px;
  line-height: 1.55;
}
.page-actions { display: flex; gap: 10px; }

/* ═══════════ BUTTONS ═══════════ */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--text);
  transition: all 0.18s ease;
}
.btn:hover {
  background: var(--surf-2);
  border-color: rgba(196, 165, 255, 0.45);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(196,165,255,0.18), 0 8px 28px -10px rgba(196,165,255,0.4);
}
.btn-mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.btn-holo {
  position: relative;
  background: var(--bg);
  color: var(--text);
  border: 1px solid transparent;
  isolation: isolate;
  font-weight: 600;
  padding: 12px 22px;
}
.btn-holo::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 11px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 5s ease-in-out infinite;
  z-index: -1;
}
.btn-holo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: var(--bg);
  z-index: -1;
}
.btn-holo:hover { transform: translateY(-1px); }
.btn-holo:hover::before { filter: brightness(1.1) saturate(1.2); }

.btn-glow {
  background: var(--mint);
  color: #052016;
  border: none;
  font-weight: 600;
  position: relative;
  box-shadow: 0 0 0 0 rgba(184,245,176,0.7), 0 0 30px rgba(184,245,176,0.25);
  animation: glowPulse 3s ease-in-out infinite;
  padding: 12px 22px;
}
.btn-glow:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  color: #052016;            /* dark text on bright mint */
  background: var(--mint);   /* keep mint — `.btn:hover` would otherwise dim it to surf-2 */
  border-color: transparent;
  box-shadow: 0 0 0 0 rgba(184,245,176,0.7), 0 0 50px rgba(184,245,176,0.5);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-2);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(196, 165, 255, 0.5);
  background: rgba(196, 165, 255, 0.06);
  box-shadow: 0 0 0 1px rgba(196,165,255,0.15), 0 8px 28px -12px rgba(196,165,255,0.45);
}
.btn-holo:hover {
  color: var(--text);
  box-shadow: 0 0 60px rgba(196,165,255,0.4);
}
/* Universal safety net — any hovered button keeps readable text.
   `!important` because `.btn-glow` overrides via box-shadow + filter and
   any future component variant must not accidentally darken the text. */
.btn:hover, .btn-ghost:hover, .btn-holo:hover, button.btn:hover {
  color: var(--text) !important;
  text-shadow: none;
}
.btn-glow:hover, button.btn-glow:hover {
  /* mint button: explicit dark text — never inherits the lavender override */
  color: #052016 !important;
}
.btn:focus-visible {
  outline: 2px solid rgba(184,245,176,0.6);
  outline-offset: 2px;
}
/* Plain <a> + <button> outside .btn, used in actions / chips */
a:hover, button:hover { color: inherit; }

/* ═══════════ CARDS / PANELS ═══════════ */

.panel {
  background: linear-gradient(180deg, var(--surf), var(--surf-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.panel-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.panel-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 24;
}
.panel-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.panel-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-4);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.panel-holo {
  position: relative;
}
.panel-holo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 7s ease-in-out infinite;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}

/* ═══════════ STATS ═══════════ */

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surf), var(--surf-2));
  position: relative;
  overflow: hidden;
}
.stat-label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.stat-value {
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 48;
  font-feature-settings: "tnum";
}
.stat-value .unit { font-size: 14px; color: var(--text-3); margin-left: 4px; font-weight: 500; }
.stat-delta {
  font-family: var(--mono);
  font-size: 11px;
  margin-top: 8px;
  color: var(--text-3);
}
.stat-delta.up { color: var(--mint); }
.stat-delta.down { color: var(--rose); }
.stat-spark { position: absolute; right: 14px; bottom: 12px; opacity: 0.7; }

/* Featured stat (holo border) */
.stat-feature {
  background: linear-gradient(180deg, var(--surf-2), var(--surf-3));
  position: relative;
}
.stat-feature::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 1px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 8s ease-in-out infinite;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.55;
}
.stat-feature .stat-value {
  background: var(--holo);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: holoShift 6s ease-in-out infinite;
}

/* ═══════════ ANIMATIONS ═══════════ */

@keyframes holoShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184,245,176,0.4), 0 0 30px rgba(184,245,176,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(184,245,176,0), 0 0 50px rgba(184,245,176,0.35); }
}
@keyframes pingRing {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes scanBeam {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}
@keyframes drift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(20px, -30px); }
  100% { transform: translate(0, 0); }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes barFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes shimmerSweep {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes dotTrail {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
@keyframes ringTrace {
  0% { stroke-dashoffset: 999; }
  100% { stroke-dashoffset: 0; }
}
@keyframes holoFlare {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(200%) rotate(45deg); }
}

.fade-up { animation: countUp 0.6s ease-out both; }
.fade-up-1 { animation: countUp 0.6s ease-out 0.06s both; }
.fade-up-2 { animation: countUp 0.6s ease-out 0.12s both; }
.fade-up-3 { animation: countUp 0.6s ease-out 0.18s both; }

/* ═══════════ HOLO ELEMENTS ═══════════ */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--text-2);
}
.chip.mint { color: var(--mint); border-color: rgba(184,245,176,0.35); background: rgba(184,245,176,0.06); }
.chip.amber { color: var(--amber); border-color: rgba(255,197,133,0.35); background: rgba(255,197,133,0.06); }
.chip.rose { color: var(--rose); border-color: rgba(255,143,143,0.35); background: rgba(255,143,143,0.06); }
.chip.violet { color: var(--violet); border-color: rgba(196,165,255,0.35); background: rgba(196,165,255,0.06); }
.chip.holo {
  background: var(--bg);
  color: var(--text);
  border-color: transparent;
  position: relative;
}
.chip.holo::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 7px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 6s ease-in-out infinite;
  z-index: -1;
}
.chip.holo::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 6px;
  background: var(--bg);
  z-index: -1;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ═══════════ GRADE DISPLAY ═══════════ */

.grade-mega {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(120px, 13vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.06em;
  font-variation-settings: "opsz" 96;
  background: var(--holo);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: holoShift 5s ease-in-out infinite;
  font-feature-settings: "tnum";
}
.grade-mega-shadow {
  position: absolute;
  inset: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(120px, 13vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244,242,238,0.06);
  pointer-events: none;
  filter: blur(0.5px);
  font-feature-settings: "tnum";
}

/* ═══════════ CARD VISUAL (holo) ═══════════ */

.card-holo {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surf);
  aspect-ratio: 63/88;
  isolation: isolate;
}
.card-holo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  position: relative; z-index: 1;
}
.card-holo::after {
  content: "";
  position: absolute;
  top: 0; left: -50%;
  width: 60%;
  height: 200%;
  background: linear-gradient(110deg,
    transparent 30%,
    rgba(196,165,255,0.18) 45%,
    rgba(255,143,211,0.22) 50%,
    rgba(184,245,176,0.18) 55%,
    transparent 70%);
  animation: holoFlare 5.5s ease-in-out infinite;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ═══════════ SCAN OVERLAY ═══════════ */

.scan-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
}
.scan-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(184,245,176,0.0) 45%,
    rgba(184,245,176,0.45) 50%,
    rgba(184,245,176,0.0) 55%,
    transparent 100%);
  animation: scanBeam 2.4s linear infinite;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
}
.scan-corner {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--mint);
  z-index: 4;
}
.scan-corner.tl { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.scan-corner.tr { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.scan-corner.bl { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.scan-corner.br { bottom: 10px; right: 10px; border-left: none; border-top: none; }

/* ═══════════ BARS ═══════════ */

.score-row {
  display: grid;
  grid-template-columns: 110px 1fr 60px;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.score-row:last-child { border-bottom: none; }
.score-label {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bar {
  height: 6px;
  background: var(--surf-3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 6s ease-in-out infinite, barFill 1.2s cubic-bezier(.2,.8,.2,1) both;
  transform-origin: left;
  border-radius: 3px;
}
.bar-fill.solid { background: var(--mint); }
.bar-fill.amber { background: var(--amber); }
.bar-fill.rose { background: var(--rose); }
.score-num {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  text-align: right;
  font-feature-settings: "tnum";
}

/* ═══════════ TABLES ═══════════ */

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.tbl th {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
table.tbl td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}
table.tbl tr:hover td { background: rgba(244,242,238,0.02); }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl .num { font-family: var(--mono); font-feature-settings: "tnum"; color: var(--text); }
table.tbl .name { color: var(--text); font-weight: 500; }

/* ═══════════ GRID UTILS ═══════════ */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.gap-8 { gap: 8px; }
.gap-24 { gap: 20px; }
.muted { color: var(--text-3); }
.mono { font-family: var(--mono); }
.display { font-family: var(--display); font-variation-settings: "opsz" 32; letter-spacing: -0.02em; font-weight: 600; }
.tnum { font-feature-settings: "tnum"; }
.section { margin-top: 28px; }
.section-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 32;
}

/* ═══════════ ONBOARD ═══════════ */

.onboard {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: stretch;
}
.onboard-left {
  position: relative;
  padding: 56px 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
/* Animated gradient blobs that drift across the left panel */
.onboard-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -2;
  will-change: transform;
}
.onboard-blob.b1 {
  width: 720px; height: 720px;
  top: -180px; left: -120px;
  background: radial-gradient(circle at 50% 50%, rgba(196,165,255,0.42), transparent 68%);
  animation: blobDrift1 28s ease-in-out infinite alternate;
}
.onboard-blob.b2 {
  width: 540px; height: 540px;
  bottom: -120px; right: -80px;
  background: radial-gradient(circle at 50% 50%, rgba(135,216,255,0.34), transparent 65%);
  animation: blobDrift2 36s ease-in-out infinite alternate;
}
.onboard-blob.b3 {
  width: 480px; height: 480px;
  top: 35%; left: 35%;
  background: radial-gradient(circle at 50% 50%, rgba(184,245,176,0.22), transparent 65%);
  animation: blobDrift3 22s ease-in-out infinite alternate;
}
.onboard-blob.b4 {
  width: 380px; height: 380px;
  top: 10%; right: 10%;
  background: radial-gradient(circle at 50% 50%, rgba(255,143,211,0.22), transparent 65%);
  animation: blobDrift4 32s ease-in-out infinite alternate;
}
@keyframes blobDrift1 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(180px, 220px) scale(1.15); }
  100% { transform: translate(40px, 380px) scale(0.9); }
}
@keyframes blobDrift2 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-220px, -180px) scale(1.2); }
  100% { transform: translate(-80px, -340px) scale(0.85); }
}
@keyframes blobDrift3 {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-260px, 140px) scale(1.1); }
  66%  { transform: translate(180px, -200px) scale(0.95); }
  100% { transform: translate(80px, 260px) scale(1.05); }
}
@keyframes blobDrift4 {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(-160px, 280px) scale(1.25); }
  100% { transform: translate(40px, 80px) scale(0.9); }
}

/* Mouse-tracked dot grid overlay (canvas) */
.onboard-dotgrid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}
.onboard-hero {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(46px, 5.5vw, 86px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variation-settings: "opsz" 96;
  margin: 0;
}
.onboard-hero em {
  font-style: italic;
  font-weight: 400;
  background: var(--holo);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: holoShift 5s ease-in-out infinite;
}
.onboard-right {
  background: var(--surf);
  border-left: 1px solid var(--line);
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
}
.input:focus { border-color: var(--line-3); }
.label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

/* ═══════════ COLLECTION GRID ═══════════ */

.coll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 22px;
}
.coll-card {
  background: linear-gradient(180deg, var(--surf), var(--surf-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
}
.coll-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: 0 12px 40px -12px rgba(196,165,255,0.2);
}
.coll-grade {
  position: absolute;
  top: 22px; right: 22px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  z-index: 5;
  font-feature-settings: "tnum";
}
.coll-grade.holo {
  border: none;
  position: relative;
  isolation: isolate;
}
.coll-grade.holo::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 6px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 5s ease-in-out infinite;
  z-index: -1;
}
.coll-grade.holo span {
  background: var(--holo);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: holoShift 5s ease-in-out infinite;
}
.coll-info { padding: 12px 4px 4px; }
.coll-name { font-weight: 600; font-size: 14px; }
.coll-meta { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); letter-spacing: 0.06em; margin-top: 3px; }

/* ═══════════ SUBMISSION ═══════════ */

.sub-row {
  display: grid;
  grid-template-columns: 60px 90px 1fr 110px 110px 110px 32px;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surf);
  margin-bottom: 10px;
}
.sub-row .thumb {
  width: 60px; aspect-ratio: 63/88;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surf-2);
}
.sub-row .thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════ KPI BIG ═══════════ */

.kpi-big {
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 96;
  font-feature-settings: "tnum";
}
.kpi-big.holo {
  background: var(--holo);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: holoShift 6s ease-in-out infinite;
}

/* ═══════════ SCROLLBAR ═══════════ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surf-3); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--surf-hi); }

/* ═══════════ LOADER DOTS ═══════════ */

.loader-dots {
  display: inline-flex; gap: 5px;
}
.loader-dots span {
  width: 6px; height: 6px;
  background: var(--mint);
  border-radius: 50%;
  animation: dotTrail 1.4s ease-in-out infinite;
}
.loader-dots span:nth-child(2) { animation-delay: 0.16s; }
.loader-dots span:nth-child(3) { animation-delay: 0.32s; }

/* ═══════════ HOLO TICKER ═══════════ */

.ticker {
  display: flex;
  gap: 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  animation: tickerScroll 38s linear infinite;
}
.ticker .up { color: var(--mint); }
.ticker .down { color: var(--rose); }
@keyframes tickerScroll {
  to { transform: translateX(-50%); }
}
.ticker-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surf);
  padding: 11px 0;
  position: relative;
}
.ticker-wrap::before, .ticker-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 0;
  width: 60px; z-index: 2; pointer-events: none;
}
.ticker-wrap::before { left: 0; background: linear-gradient(90deg, var(--surf), transparent); }
.ticker-wrap::after { right: 0; background: linear-gradient(-90deg, var(--surf), transparent); }

/* ═══════════ CENTERING EDITOR v2 ═══════════ */
.cedit-host { display: flex; flex-direction: column; gap: 14px; }

.cedit-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.cedit-tabs {
  display: inline-flex; padding: 3px;
  background: var(--surf-2); border: 1px solid var(--line); border-radius: 10px;
}
.cedit-tab {
  background: transparent; border: none; color: var(--text-3);
  font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  padding: 7px 14px; border-radius: 7px; cursor: pointer;
}
.cedit-tab:hover { color: var(--text); }
.cedit-tab.active { background: var(--surf-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.cedit-tools { display: inline-flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cedit-legend {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-3);
}
.cedit-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.cedit-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3); cursor: pointer; user-select: none;
}
.cedit-check input { accent-color: var(--mint); }
.cedit-btn {
  background: var(--surf-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; font-size: 11px; font-weight: 500; cursor: pointer;
}
.cedit-btn:hover { background: var(--surf-3); border-color: var(--line-2); }

.cedit-live {
  display: grid; grid-template-columns: 1fr 1fr 1.4fr;
  gap: 0;
  background: var(--surf-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.cedit-live-cell {
  padding: 14px 18px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
}
.cedit-live-cell:last-child { border-right: none; }
.cedit-live-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-4);
}
.cedit-live-big {
  font-family: var(--display); font-size: 30px; font-weight: 700;
  letter-spacing: -0.02em; line-height: 1; color: var(--text);
  font-feature-settings: "tnum"; font-variation-settings: "opsz" 48;
}
.cedit-live-grade.mint  { color: var(--mint); }
.cedit-live-grade.amber { color: var(--amber); }
.cedit-live-grade.rose  { color: var(--rose); }
.cedit-live-sub {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  font-feature-settings: "tnum";
}
.cedit-live-score { background: linear-gradient(180deg, rgba(184,245,176,0.04), transparent); }

.cedit-stage {
  position: relative; width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 280px;
  display: flex; align-items: center; justify-content: center;
}
.cedit-canvas { display: block; touch-action: none; max-width: 100%; }
.cedit-magnifier {
  position: absolute;
  width: 220px; height: 220px;
  border: 2px solid var(--holo-1);
  border-radius: 12px;
  box-shadow: 0 16px 50px rgba(196,165,255,0.45);
  pointer-events: none;
  background: var(--bg);
}
.cedit-magnifier.hidden { display: none; }
.cedit-empty {
  display: flex; align-items: center; justify-content: center;
  height: 240px; color: var(--text-3); font-size: 13px;
}
.cedit-hint {
  font-size: 11.5px; color: var(--text-3); line-height: 1.5;
}

/* ═══════════ CORNER VIZ ═══════════ */
.corner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1180px) { .corner-grid { grid-template-columns: repeat(2, 1fr); } }
.corner-card {
  background: var(--surf-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column;
}
.corner-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.corner-img, .corner-mask, .corner-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.corner-img { object-fit: contain; image-rendering: -webkit-optimize-contrast; }
.corner-mask { mix-blend-mode: screen; opacity: 0.85; }
.corner-overlay { z-index: 2; }
.corner-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-4); font-size: 11px;
}
.corner-meta {
  font-family: var(--mono); font-size: 11px; color: var(--text-2);
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.corner-meta-row {
  display: flex; justify-content: space-between;
}
.corner-meta-row > span:first-child { color: var(--text-4); letter-spacing: 0.04em; }
.corner-pens { display: flex; flex-direction: column; gap: 5px; }
.corner-pen-row {
  display: grid;
  grid-template-columns: 64px 1fr 38px;
  align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px;
}
.corner-pen-label { color: var(--text-3); }
.corner-pen-bar {
  height: 5px; background: var(--surf-3);
  border-radius: 4px; overflow: hidden;
}
.corner-pen-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
.corner-pen-val { text-align: right; color: var(--text-2); font-feature-settings: "tnum"; }

/* ═══════════ INDETERMINATE LOOKUP BAR ═══════════ */
.lookup-loader { width: 100%; }
.lookup-bar {
  position: relative; height: 4px; width: 100%;
  background: var(--surf-2); border: 1px solid var(--line);
  border-radius: 4px; overflow: hidden;
}
.lookup-bar-fill {
  position: absolute; top: 0; bottom: 0; width: 35%;
  background: linear-gradient(90deg, transparent, var(--mint), transparent);
  border-radius: 4px;
  animation: lookupSlide 1.4s cubic-bezier(.4,.0,.2,1) infinite;
}
@keyframes lookupSlide {
  0%   { left: -35%; }
  100% { left: 100%; }
}

/* Quarantined feature notice */
.holo-quarantine {
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(244, 242, 238, 0.02);
  font-size: 12px;
  color: var(--text-3);
  margin-top: 12px;
}
.holo-quarantine strong { color: var(--text-2); }

/* ═══════════ TYPE-AHEAD CARD SEARCH ═══════════ */
.card-search-pop {
  position: absolute;
  z-index: 200;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.55);
  max-height: 380px;
  overflow-y: auto;
}
.card-search-pop-fixed {
  position: fixed !important;
  z-index: 9999;
  top: auto;
  bottom: auto;
}
/* Panels containing an active search lift above sibling panels AND
   undo the default overflow:hidden so the autocomplete dropdown can
   extend beyond the panel border. */
.panel:has(.card-search-pop) {
  z-index: 100;
  position: relative;
  overflow: visible;
}
/* Ancestor wrappers also need to allow overflow when the dropdown is open */
.panel:has(.card-search-pop) ~ * { /* no-op selector kept for ordering */ }
.col:has(.card-search-pop), .grid-2:has(.card-search-pop) { overflow: visible; }
.card-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
}
.card-search-row:hover { background: var(--surf-2); }
.card-search-row:last-child { border-bottom: none; }
.card-search-thumb {
  width: 38px;
  aspect-ratio: 63 / 88;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surf-3);
}
.card-search-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-search-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-search-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

/* ═══════════ COLLECTION 3D TILT + FREISTELLEN ═══════════ */
.coll-card.tilt {
  --rx: 0deg;
  --ry: 0deg;
  --hx: 50%;
  --hy: 50%;
  background: transparent;
  border: none;
  padding: 14px;
  perspective: 1100px;
  transform-style: preserve-3d;
}
.coll-card.tilt .tilt-inner {
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.18s cubic-bezier(.2, .9, .3, 1.2);
  transform-style: preserve-3d;
  position: relative;
  border-radius: 14px;
}
.coll-card.tilt:hover .tilt-inner {
  transition: transform 0.05s linear;
}
.coll-card.tilt .tilt-card {
  position: relative;
  display: block;
  aspect-ratio: 63 / 88;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  box-shadow:
    0 18px 40px -16px rgba(0,0,0,0.55),
    0 6px 18px -6px rgba(196,165,255,0.25);
  transition: box-shadow 0.3s ease;
}
.coll-card.tilt:hover .tilt-card {
  box-shadow:
    0 32px 80px -20px rgba(0,0,0,0.7),
    0 18px 40px -12px rgba(196,165,255,0.45);
}
.coll-card.tilt .tilt-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Slight z-lift so the image sits in front of the holo gloss layer */
  transform: translateZ(20px);
  transform-style: preserve-3d;
}
/* Holo shimmer follows cursor */
.coll-card.tilt .tilt-gloss {
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 14px;
  background: radial-gradient(
    circle at var(--hx) var(--hy),
    rgba(255,255,255,0.35) 0%,
    rgba(255,255,255,0.08) 14%,
    rgba(196,165,255,0.18) 28%,
    rgba(135,216,255,0.10) 42%,
    transparent 65%
  );
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.25s ease;
  transform: translateZ(60px);
}
.coll-card.tilt:hover .tilt-gloss { opacity: 1; }
.coll-card.tilt .tilt-prism {
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: 14px;
  background: linear-gradient(
    115deg,
    rgba(196,165,255,0) 30%,
    rgba(255,143,211,0.28) 45%,
    rgba(255,197,133,0.32) 50%,
    rgba(184,245,176,0.28) 55%,
    rgba(135,216,255,0) 70%
  );
  background-size: 240% 240%;
  background-position: var(--hx) var(--hy);
  mix-blend-mode: color-dodge;
  opacity: 0;
  transition: opacity 0.25s ease, background-position 0.05s linear;
  transform: translateZ(40px);
}
.coll-card.tilt:hover .tilt-prism { opacity: 0.7; }
.coll-card.tilt .tilt-grade {
  position: absolute; top: 12px; right: 12px;
  z-index: 4;
  transform: translateZ(80px);
}
.coll-card.tilt .tilt-info {
  margin-top: 14px;
  padding: 0 4px;
  transform: translateZ(0);
}
.coll-card.tilt .tilt-info .coll-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}
.coll-card.tilt .tilt-info .coll-meta {
  color: var(--text-3);
  font-size: 12px;
  margin-bottom: 8px;
}

/* ═══════════ TOAST ═══════════ */
.holo-toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.holo-toast {
  background: var(--surf);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--mint);
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 18px 36px -12px rgba(0,0,0,0.6);
  font-size: 13px;
  color: var(--text);
  max-width: 360px;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(.2,.8,.3,1.1), opacity 0.3s;
  font-family: var(--sans);
}
.holo-toast.show { transform: translateX(0); opacity: 1; }
.holo-toast.error { border-left-color: var(--rose); }
.holo-toast.warn  { border-left-color: var(--amber); }
.holo-toast .holo-toast-title { font-weight: 600; margin-bottom: 2px; font-size: 13px; }
.holo-toast .holo-toast-body  { color: var(--text-2); font-size: 12px; line-height: 1.5; }

/* ═══════════ MODAL ═══════════ */
.holo-modal-back {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 11, 0.72);
  backdrop-filter: blur(6px);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s ease;
}
.holo-modal {
  background: var(--surf);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 28px;
  min-width: 380px;
  max-width: 540px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  animation: fadeUp 0.2s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════ TOPBAR BADGE ═══════════ */
.topbar-btn { position: relative; }
.topbar-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: var(--rose);
  color: #fff;
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 8px rgba(255,143,143,0.6);
}

/* ═══════════ NOTIFICATIONS DROPDOWN ═══════════ */
.notif-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 520px;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  z-index: 500;
}
.notif-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 13px;
}
.notif-empty { padding: 36px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.notif-list { padding: 6px 0; }
.notif-row {
  display: flex; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--surf-2); }
.notif-row.unread { background: rgba(196,165,255,0.04); }
.notif-dot {
  flex-shrink: 0;
  width: 8px; height: 8px; border-radius: 50%;
  margin-top: 6px;
  box-shadow: 0 0 8px currentColor;
}
.notif-title { font-weight: 600; font-size: 13px; color: var(--text); }
.notif-body  { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.notif-ts    { font-size: 10.5px; color: var(--text-4); margin-top: 4px; font-family: var(--mono); }

/* ═══════════ CMD+K PALETTE ═══════════ */
.cmdk-shell {
  width: 640px; max-width: 92vw; max-height: 70vh;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.cmdk-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
}
.cmdk-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--sans); font-size: 16px;
}
.cmdk-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.cmdk-section {}
.cmdk-section-title {
  padding: 10px 18px 6px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-4);
}
.cmdk-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 18px;
  cursor: pointer; transition: background 0.12s ease;
  font-size: 13.5px; color: var(--text-2);
}
.cmdk-row:hover { background: var(--surf-2); color: var(--text); }
.cmdk-row-icon {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); flex-shrink: 0;
}
.cmdk-row-title { flex: 1; }
.cmdk-row-hint { font-family: var(--mono); font-size: 11px; color: var(--text-4); }
.cmdk-empty { padding: 24px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ═══════════ AVATAR PICKER ═══════════ */
.avatar-picker {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.avatar-pick {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--surf);
}
.avatar-pick:hover { background: var(--surf-2); transform: translateY(-1px); }
.avatar-pick.on {
  border-color: var(--mint);
  box-shadow: 0 0 18px rgba(184,245,176,0.4);
}

/* ═══════════ PROFILE / VITRINE ═══════════ */
.profile-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surf);
}
.profile-stat {
  padding: 22px 24px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.profile-stat:last-child { border-right: none; }
.profile-stat span {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3);
}
.profile-stat strong {
  font-family: var(--display); font-size: 24px; font-weight: 700;
  letter-spacing: -0.02em; color: var(--text);
}
.profile-stat { padding: 16px 20px; }
.profile-hero {
  display: flex; align-items: center; gap: 24px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--surf), var(--surf-2));
  margin-top: 24px;
}
.profile-avatar {
  width: 96px; height: 96px;
  background: var(--bg-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 50px;
  border: 2px solid var(--line-2);
  box-shadow: 0 0 32px rgba(196,165,255,0.18);
}
.profile-handle {
  font-family: var(--mono); font-size: 14px; color: var(--text-2);
}
.profile-since {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  letter-spacing: 0.08em; margin-top: 4px;
}

.vitrine-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  margin-top: 14px;
}
.vitrine-grid.public { gap: 28px; }
.vitrine-slot {
  display: flex; flex-direction: column;
}
.vitrine-card {
  position: relative;
  aspect-ratio: 63 / 88;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surf-3);
  box-shadow: 0 18px 50px -12px rgba(196,165,255,0.35);
}
.vitrine-card.glow {
  box-shadow:
    0 24px 60px -16px rgba(196,165,255,0.55),
    0 0 0 1px rgba(196,165,255,0.25);
}
.vitrine-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vitrine-rank {
  position: absolute; top: 12px; left: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 14px;
  color: var(--text);
  z-index: 2;
}
.vitrine-rank.holo {
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 5s ease-in-out infinite;
  color: #1a0f26;
  border: none;
}
.vitrine-name {
  font-family: var(--display); font-weight: 700; font-size: 16px;
  margin-top: 12px; color: var(--text);
}
.vitrine-meta {
  font-size: 12px; color: var(--text-3); margin-top: 2px;
  font-family: var(--mono);
}
.vitrine-empty {
  aspect-ratio: 63 / 88;
  border: 2px dashed var(--line-2);
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  color: var(--text-3);
  cursor: pointer; transition: all 0.18s ease;
}
.vitrine-empty:hover { border-color: var(--holo-1); color: var(--text); }

.vitrine-pick-list { max-height: 60vh; overflow-y: auto; margin-top: 8px; }
.vitrine-pick-row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px; border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.vitrine-pick-row:hover { background: var(--surf-2); }
.vitrine-pick-thumb {
  width: 40px; aspect-ratio: 63/88;
  border-radius: 5px; overflow: hidden;
  background: var(--surf-3);
}
.vitrine-pick-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ═══════════ FRIENDS ═══════════ */
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surf-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.user-avatar.large {
  width: 64px; height: 64px;
  font-size: 32px;
  margin-bottom: 12px;
}
.friends-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-top: 12px;
}
.friend-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surf);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}
.friend-card:hover {
  background: var(--surf-2);
  border-color: rgba(196,165,255,0.3);
  transform: translateY(-2px);
}
.friend-name {
  font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--text);
}
.friend-bio { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* ═══════════ PUBLIC CARD GRID ═══════════ */
.public-card-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  margin-top: 8px;
}
.public-card {
  display: flex; flex-direction: column; gap: 4px;
}
.public-card img {
  width: 100%; aspect-ratio: 63/88; object-fit: cover;
  border-radius: 8px;
  background: var(--surf-3);
}
.public-card-name {
  font-size: 11px; font-weight: 600; margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.public-card-grade {
  font-family: var(--mono); font-size: 10px; color: var(--mint);
}

/* ═══════════ SETS BROWSE ═══════════ */
.sets-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px;
}
.sets-thumb {
  position: relative;
  width: 54px; aspect-ratio: 63/88;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surf-3);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.sets-thumb:hover { transform: scale(1.06); }
.sets-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sets-thumb-grade {
  position: absolute; top: 2px; right: 2px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  padding: 1px 4px; border-radius: 3px;
}

/* ═══════════ TEXTAREA ═══════════ */
textarea.input { resize: vertical; font-family: var(--sans); }

/* ═══════════ AVATAR (img + emoji unified) ═══════════ */
.avatar-img, .avatar-emoji {
  display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surf-3);
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
}
.avatar-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-emoji {
  /* Emoji rendering scales by font-size */
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.user-avatar-slot { box-shadow: 0 0 12px rgba(196,165,255,0.25); }
.profile-avatar-img {
  width: 96px; height: 96px;
  border: 2px solid var(--line-2);
  box-shadow: 0 0 32px rgba(196,165,255,0.18);
}
.profile-stat.avatar-stat {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.friend-avatar { margin-bottom: 12px; }

/* ═══════════ AVATAR UPLOAD (Settings) ═══════════ */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surf);
}
.avatar-preview {
  width: 84px; height: 84px;
  border: 2px solid var(--line-2);
  box-shadow: 0 0 24px rgba(196,165,255,0.25);
}
.avatar-actions {
  display: flex; flex-direction: column; gap: 6px;
}

/* ═══════════ PROFILE V2 (Holo design handoff) ═══════════ */
.profile-screen {
  --p-accent: var(--mint);
  --p-accent-text: #052016;
  margin: -28px -36px 0;
  position: relative;
}
@media (min-width: 1700px) { .profile-screen { margin: -32px -56px 0; } }

.profile-banner {
  position: relative;
  height: 260px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-2);
}
.profile-foil {
  position: absolute; inset: 0;
  background-size: 200% 200%;
  animation: holoShift 10s ease-in-out infinite;
}
.foil-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.18) 1px, transparent 1px);
  background-size: 36px 36px;
  mix-blend-mode: overlay;
  opacity: 0.55;
}
.foil-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,0.55), rgba(255,255,255,0) 70%);
  mix-blend-mode: screen;
  filter: blur(20px);
  pointer-events: none;
  animation: drift 14s ease-in-out infinite;
}
.foil-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7,7,11,0) 50%, rgba(7,7,11,0.55) 100%),
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(7,7,11,0) 50%, rgba(7,7,11,0.45) 100%);
}
.profile-banner-inner {
  position: absolute; inset: 0;
  padding: 22px 36px;
  z-index: 2;
}
.profile-banner-shadow {
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(180deg, transparent, var(--bg));
  pointer-events: none;
}

.btn-on-foil {
  background: rgba(7,7,11,0.55);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
}
.btn-on-foil:hover { background: rgba(7,7,11,0.75); color: #fff; }
.btn-on-foil-solid {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--p-accent);
  color: var(--p-accent-text);
  border: none;
  font-weight: 600;
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 30px -12px var(--p-accent);
}
.btn-on-foil-solid:hover { transform: translateY(-1px); }

.profile-id-v2 {
  display: grid;
  grid-template-columns: 132px 1fr auto;
  gap: 28px;
  padding: 0 36px 28px;
  margin-top: -64px;
  position: relative;
  z-index: 3;
  align-items: flex-start;
}
.profile-avatar-v2 {
  width: 132px; height: 132px;
  border-radius: 28px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}
.profile-avatar-inner {
  width: 100%; height: 100%;
  border-radius: 22px;
  background-size: 200% 200%;
  animation: holoShift 8s ease-in-out infinite;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.profile-avatar-inner span.pa-init {
  font-family: var(--display);
  font-weight: 800;
  font-size: 50px;
  letter-spacing: -0.04em;
  color: rgba(7,7,11,0.85);
  font-variation-settings: "opsz" 96;
  position: relative; z-index: 2;
}
.profile-avatar-inner img.pa-img {
  position: relative; z-index: 2;
  width: 100%; height: 100%; object-fit: cover; border-radius: 22px;
}
.profile-avatar-inner::after {
  content: "";
  position: absolute;
  top: 0; left: -50%;
  width: 60%; height: 200%;
  background: linear-gradient(110deg,
    transparent 30%,
    rgba(255,255,255,0.4) 50%,
    transparent 70%);
  animation: shimmerSweep 4s ease-in-out infinite;
  mix-blend-mode: screen;
}
.profile-name-v2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 48;
  margin: 0;
}
@media (min-width: 1101px) {
  .profile-name-v2 { margin-top: 80px; }
  .profile-meta-stats { margin-top: 80px; }
}
.profile-bio-v2 {
  margin: 14px 0 0;
  max-width: 64ch;
  color: var(--text-2);
  font-size: 14.5px;
  line-height: 1.55;
}
.profile-meta-stats {
  display: flex;
  gap: 22px;
  align-items: flex-start;
}
.profile-meta-stats > div {
  text-align: right;
}
.pmeta-v {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
}
.pmeta-l {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
}

.profile-stats-v2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0 36px 36px;
}
.pst {
  padding: 18px 24px;
  border-right: 1px solid var(--line);
}
.pst:last-child { border-right: none; }
.pst-l {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.pst-v {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.025em;
  font-feature-settings: "tnum";
}
.pst-u { font-size: 14px; color: var(--text-3); margin-left: 4px; font-weight: 500; }

.profile-screen .section { padding: 0 36px; margin-top: 36px; }
.profile-screen .section + .section { margin-top: 36px; }

/* Grails — Podium */
.grail-podium {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 18px;
  align-items: stretch;
}
.grail-pod {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surf), var(--surf-2));
  padding: 22px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.grail-pod.center {
  border: none;
  background: linear-gradient(180deg, var(--surf-2), var(--surf-3));
  isolation: isolate;
}
.grail-pod.center::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 18px;
  padding: 1px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 6s ease-in-out infinite;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.grail-rank {
  position: absolute;
  top: 14px; right: 18px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-3);
  font-variation-settings: "opsz" 96;
  z-index: 2;
}
.grail-pod.center .grail-rank {
  background: var(--holo);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 0;
  animation: holoShift 6s ease-in-out infinite;
}
.grail-img {
  margin: 16px auto 18px;
  max-width: 220px;
  width: 100%;
  align-self: center;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  border-radius: 14px; overflow: hidden; aspect-ratio: 63/88;
  background: var(--surf-3);
}
.grail-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grail-pod.center .grail-img { max-width: 240px; transform: translateY(-8px); }
.grail-meta { margin-top: auto; }
.grail-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variation-settings: "opsz" 32;
}
.grail-quote {
  margin: 12px 0 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-2);
  letter-spacing: -0.005em;
}
.grail-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px dashed var(--line-2);
  border-radius: 18px;
  padding: 42px 18px;
  cursor: pointer;
  color: var(--text-3); font-size: 13px;
  background: rgba(255,255,255,0.01);
  transition: border-color 0.18s, color 0.18s;
}
.grail-empty:hover { border-color: var(--p-accent); color: var(--p-accent); }

/* Grails — Stack */
.grail-stack {
  display: grid;
  grid-template-columns: 38px 90px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surf);
}
.grail-stack .grail-rank {
  position: static;
  font-size: 36px;
  -webkit-text-stroke: 1px var(--line-3);
  color: transparent;
}
.grail-stack-img {
  width: 90px; aspect-ratio: 63/88; border-radius: 8px; overflow: hidden;
  flex-shrink: 0; background: var(--surf-3);
}
.grail-stack-img img { width: 100%; height: 100%; object-fit: cover; }

/* Favourites */
.fav-grid-wide {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 1280px) { .fav-grid-wide { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .fav-grid-wide { grid-template-columns: repeat(3, 1fr); } }
.fav-item {
  position: relative;
  cursor: pointer;
  transition: transform 0.2s;
}
.fav-item:hover { transform: translateY(-3px); }
.fav-item .fav-card {
  width: 100%; aspect-ratio: 63/88;
  border-radius: 10px; overflow: hidden;
  background: var(--surf-3);
  box-shadow: 0 14px 30px -12px rgba(0,0,0,0.5);
}
.fav-item .fav-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fav-info { margin-top: 10px; }
.fav-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 63/88;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  color: var(--text-3); font-size: 11px; cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.fav-empty:hover { border-color: var(--p-accent); color: var(--p-accent); }
.fav-grade-pill {
  position: absolute; top: 8px; right: 8px;
  font-family: var(--mono); font-size: 11px;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(7,7,11,0.7); color: #fff;
  backdrop-filter: blur(8px);
}

/* Badges */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.badge-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surf);
}
.badge-ic {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surf-3);
  color: var(--text-2);
  flex-shrink: 0;
}
.badge-card.mint .badge-ic { background: rgba(184,245,176,0.12); color: var(--mint); }
.badge-card.amber .badge-ic { background: rgba(255,197,133,0.12); color: var(--amber); }
.badge-card.violet .badge-ic { background: rgba(196,165,255,0.12); color: var(--violet); }
.badge-card.rose .badge-ic { background: rgba(255,143,143,0.12); color: var(--rose); }
.badge-card.holo {
  position: relative; isolation: isolate; border: none;
}
.badge-card.holo::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 12px;
  padding: 1px;
  background: var(--holo);
  background-size: 200% 200%;
  animation: holoShift 7s ease-in-out infinite;
  -webkit-mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  mask: linear-gradient(#000, #000) content-box, linear-gradient(#000, #000);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.badge-card.locked { opacity: 0.45; }

/* Friends row */
.friend-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
}
.friend-avatar-v2 {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--surf-3), var(--surf-hi));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}
.friend-avatar-v2 img { width: 100%; height: 100%; object-fit: cover; }

/* Customize rail */
.custom-rail {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 380px;
  background: linear-gradient(180deg, rgba(13,13,22,0.96), rgba(8,8,14,0.98));
  border-left: 1px solid var(--line-2);
  backdrop-filter: blur(20px);
  z-index: 50;
  padding: 22px 24px;
  overflow-y: auto;
  box-shadow: -30px 0 60px -20px rgba(0,0,0,0.6);
  animation: railSlide 0.32s cubic-bezier(.2,.8,.2,1);
}
@keyframes railSlide {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.custom-panel { display: flex; flex-direction: column; gap: 22px; }
.cust-sec { display: flex; flex-direction: column; gap: 10px; }
.cust-lab {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.foil-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  background: var(--surf);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 12.5px;
  transition: all 0.18s;
}
.foil-chip:hover { border-color: var(--line-2); }
.foil-chip.on {
  border-color: var(--p-accent);
  background: var(--surf-2);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--p-accent);
}
.foil-chip-bar {
  width: 28px; height: 28px;
  border-radius: 7px;
  background-size: 200% 200%;
  animation: holoShift 8s ease-in-out infinite;
}
.seg-btn {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--surf);
  color: var(--text-2);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.seg-btn.on {
  background: var(--p-accent);
  color: var(--p-accent-text);
  border-color: var(--p-accent);
}
.acc-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.acc-dot.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px currentColor; outline: none; }
.cust-toggle {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-2);
  cursor: pointer; user-select: none;
}
.cust-toggle input { display: none; }
.cust-toggle-track {
  width: 32px; height: 18px;
  background: var(--surf-3);
  border-radius: 9px;
  position: relative;
  transition: background 0.2s;
}
.cust-toggle-knob {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-3);
  transition: all 0.2s;
}
.cust-toggle input:checked + .cust-toggle-track { background: var(--p-accent); }
.cust-toggle input:checked + .cust-toggle-track .cust-toggle-knob { left: 16px; background: var(--p-accent-text); }

/* Share modal */
.share-overlay {
  position: fixed; inset: 0;
  background: rgba(7,7,11,0.7);
  backdrop-filter: blur(10px);
  z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  animation: countUp 0.3s ease-out;
}
.share-card {
  width: 480px; max-width: 100%;
  background: linear-gradient(180deg, var(--surf), var(--surf-2));
  border: 1px solid var(--line-2);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.7);
}
.share-slab {
  position: relative;
  height: 200px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  isolation: isolate;
}
.share-slab-content {
  position: absolute; inset: 0;
  padding: 22px;
  display: flex; flex-direction: column; justify-content: space-between;
  z-index: 2; color: #fff;
}
.share-stat-row { display: flex; gap: 28px; }
.ssr-v {
  font-family: var(--display);
  font-weight: 700; font-size: 22px;
  letter-spacing: -0.02em; color: #fff;
  font-feature-settings: "tnum";
}
.ssr-l {
  font-family: var(--mono);
  font-size: 9.5px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 2px;
}
.share-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-2);
}

/* responsive */
@media (max-width: 1100px) {
  .profile-id-v2 {
    grid-template-columns: 100px 1fr;
    margin-top: -48px;
  }
  .profile-avatar-v2 { width: 100px; height: 100px; border-radius: 22px; }
  .profile-avatar-inner span.pa-init { font-size: 38px; }
  .profile-name-v2 { font-size: 28px; margin-top: 56px; }
  .profile-meta-stats {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    padding-top: 16px;
    justify-content: space-between;
  }
  .grail-podium { grid-template-columns: 1fr; }
}

/* ═══════════ PROFILE TILT (3D mouse hover for grails + favourites) ═══════════ */
.profile-tilt {
  perspective: 1000px;
  width: 100%; height: 100%;
  position: relative;
}
.profile-tilt > * {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.18s cubic-bezier(.2, .8, .2, 1);
  border-radius: inherit;
}
.profile-tilt-prism {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%),
              rgba(196, 165, 255, 0.18),
              rgba(135, 216, 255, 0.10) 40%,
              transparent 70%);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.profile-tilt-gloss {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg,
              transparent 35%,
              rgba(255, 255, 255, 0.30) 50%,
              transparent 65%);
  background-size: 220% 220%;
  background-position: var(--hx, 50%) var(--hy, 50%);
  mix-blend-mode: overlay;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.profile-tilt:hover .profile-tilt-prism,
.profile-tilt:hover .profile-tilt-gloss { opacity: 1; }

.grail-img-wrap {
  margin: 16px auto 18px;
  max-width: 220px;
  width: 100%;
  align-self: center;
  aspect-ratio: 63/88;
}
.grail-pod.center .grail-img-wrap { max-width: 240px; transform: translateY(-8px); }

.grail-img-inner {
  width: 100%; height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surf-3);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  position: relative;
}
.grail-img-inner img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.grail-stack-tilt {
  width: 90px; aspect-ratio: 63/88;
  flex-shrink: 0;
}

.fav-card { position: relative; }

/* ═══════════ COLLECTION MULTI-SELECT ═══════════ */
.coll-card-wrap { position: relative; }
.coll-card-wrap.selecting .coll-card { cursor: pointer; }
.coll-card-wrap.selected .coll-card,
.coll-card-wrap.selected .tilt-card {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
  border-radius: 12px;
}
.coll-checkbox {
  position: absolute; top: 12px; left: 12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: rgba(7,7,11,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 4;
  cursor: pointer;
  transition: all 0.15s;
}
.coll-card-wrap.selected .coll-checkbox {
  background: var(--mint);
  border-color: var(--mint);
  color: #052016;
  box-shadow: 0 0 18px rgba(184,245,176,0.5);
}
.coll-checkbox-list {
  width: 18px; height: 18px;
  border: 2px solid var(--line-2);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.coll-checkbox-list.on {
  background: var(--mint);
  border-color: var(--mint);
  color: #052016;
}

/* ═══════════ CARD DETAIL — image archive grid ═══════════ */
.card-detail-imgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.card-img-panel {
  background: var(--surf-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex; flex-direction: column;
}
.card-img-frame {
  position: relative;
  aspect-ratio: 63 / 88;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0d12;
  margin-bottom: 12px;
}
.card-img-frame img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.card-img-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  color: var(--text-4);
  font-size: 11px; text-align: center; padding: 12px;
}
.card-img-meta { margin-top: auto; }
