/* ─── CSS Variables ─────────────────────────────────── */
:root {
  --bg: #0D0D0F;
  --surface: #1A1A1E;
  --surface2: #222227;
  --border: #2A2A2E;
  --border2: #333338;
  --amber: #D4A04A;
  --amber-dim: rgba(212,160,74,0.15);
  --amber-glow: rgba(212,160,74,0.4);
  --rust: #C45B3A;
  --rust-dim: rgba(196,91,58,0.15);
  --green: #4CAF82;
  --text: #E8E4DC;
  --text-dim: #9E9A92;
  --text-muted: #5A5650;
  --white: #FFFFFF;
  --nav-h: 72px;
  --app-w: min(100vw, 430px);
  --content-max: min(100%, 480px);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --shadow-card: 0 4px 20px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.12);
  --shadow-card-hover: 0 8px 28px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.15);
  --card-padding: 16px;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --safe-right: env(safe-area-inset-right);
}
[data-theme="light"] {
  --bg: #f5f0e8;
  --surface: #fff;
  --surface2: #ebe6de;
  --border: #e0dcd4;
  --border2: #d0ccc4;
  --amber: #b8781f;
  --amber-dim: rgba(184,120,31,0.12);
  --text: #1a1a1e;
  --text-dim: #5a5650;
  --text-muted: #7a7670;
  --white: #1a1a1e;
}
[data-theme="light"] body { background: #f5f0e8; }
[data-theme="light"] #app { background: var(--bg); }
[data-theme="light"] #bottom-nav { background: #ebe6de; border-top-color: var(--border); }

/* ─── Skeleton / Shimmer ─────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
}
.skeleton-card {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
}
.skeleton-text { height: 12px; width: 80%; margin-top: 6px; }
.skeleton-text-sm { height: 10px; width: 50%; margin-top: 4px; }
.skeleton-circle { border-radius: 50%; }
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
}
.skeleton-grid .skeleton-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ─── Reset & Base ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #060608; width: 100%; max-width: 100%; }
body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
}

/* Grain: must stay BELOW #app in stacking order. z-index:9999 on body::before sat
   above the whole app (header z-index 200), and Safari/WebKit often still ate clicks
   on the header despite pointer-events:none on the pseudo. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ─── App Shell ─────────────────────────────────────── */
#app {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* Grain inside app shell only — below header/nav (higher z-index), never intercepts taps */
#app::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none !important;
  z-index: 1;
  opacity: 0.5;
}

/* ─── Views ─────────────────────────────────────────── */
.view {
  position: absolute;
  inset: 0;
  bottom: var(--nav-h);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-left: max(var(--safe-left), 16px);
  padding-right: max(var(--safe-right), 16px);
  box-sizing: border-box;
}
.view::-webkit-scrollbar { display: none; }
.view:not(.active) { display: none !important; z-index: 0; }
.view.active { display: flex; z-index: 1; }

/* ─── Bottom Nav ────────────────────────────────────── */
#bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(var(--nav-h) + var(--safe-bottom));
  min-height: calc(72px + var(--safe-bottom));
  background: #111114;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  padding-bottom: var(--safe-bottom);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--radius-sm);
}
.nav-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .nav-btn { transition: none; }
}
.nav-btn.active { color: var(--amber); }
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn span {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── View Header ────────────────────────────────────── */
.view-header {
  padding: 24px 20px 16px;
  flex-shrink: 0;
}
.view-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  letter-spacing: 2px;
  color: var(--white);
  line-height: 1;
}
.view-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ─── Shared Card Styles ────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  padding: var(--card-padding);
}

/* ─── Badge ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-amber { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(212,160,74,0.3); }
.badge-rust { background: var(--rust-dim); color: var(--rust); border: 1px solid rgba(196,91,58,0.3); }
.badge-green { background: rgba(76,175,130,0.15); color: var(--green); border: 1px solid rgba(76,175,130,0.3); }
.badge-dim { background: rgba(255,255,255,0.06); color: var(--text-dim); border: 1px solid var(--border); }

/* ─── Toast ─────────────────────────────────────────── */
#toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-80px);
  background: var(--surface2);
  border: 1px solid var(--amber);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(212,160,74,0.2);
  max-width: calc(100vw - 40px);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════════
   SCAN VIEW
══════════════════════════════════════════════════════ */
#view-scan {
  background: #070709;
}

.scan-search-bar {
  display: flex;
  gap: 10px;
  padding: 16px 20px 0;
  flex-shrink: 0;
  z-index: 2;
}
.scan-search-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.scan-search-input::placeholder { color: var(--text-muted); }
.scan-search-input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber-dim);
}
.scan-search-btn { flex-shrink: 0; }
.scan-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 8px;
  flex-shrink: 0;
  z-index: 2;
}
.scan-hint {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.batch-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
}
.batch-toggle:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.batch-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.toggle-switch {
  width: 36px;
  height: 20px;
  background: var(--border2);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
}
.toggle-switch.on { background: var(--amber); }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.toggle-switch.on::after { transform: translateX(16px); }

/* Camera Viewfinder */
.viewfinder-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  min-height: 340px;
}
.viewfinder {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  background: #0a0a0c;
}

/* Camera grain */
.viewfinder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(40,40,50,0.6) 0%, #000 100%);
  z-index: 1;
}

/* Corner brackets */
.vf-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  z-index: 3;
}
.vf-corner::before, .vf-corner::after {
  content: '';
  position: absolute;
  background: var(--amber);
}
.vf-corner.tl { top: 16px; left: 16px; }
.vf-corner.tr { top: 16px; right: 16px; }
.vf-corner.bl { bottom: 16px; left: 16px; }
.vf-corner.br { bottom: 16px; right: 16px; }

.vf-corner.tl::before { top:0; left:0; width:2px; height:100%; }
.vf-corner.tl::after  { top:0; left:0; height:2px; width:100%; }
.vf-corner.tr::before { top:0; right:0; width:2px; height:100%; }
.vf-corner.tr::after  { top:0; right:0; height:2px; width:100%; }
.vf-corner.bl::before { bottom:0; left:0; width:2px; height:100%; }
.vf-corner.bl::after  { bottom:0; left:0; height:2px; width:100%; }
.vf-corner.br::before { bottom:0; right:0; width:2px; height:100%; }
.vf-corner.br::after  { bottom:0; right:0; height:2px; width:100%; }

/* Center crosshair */
.vf-crosshair {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vf-crosshair::before {
  content: '';
  width: 40px;
  height: 1px;
  background: rgba(212,160,74,0.5);
  position: absolute;
}
.vf-crosshair::after {
  content: '';
  width: 1px;
  height: 40px;
  background: rgba(212,160,74,0.5);
  position: absolute;
}

/* Scan line */
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--amber) 30%, rgba(212,160,74,0.9) 50%, var(--amber) 70%, transparent 100%);
  box-shadow: 0 0 12px var(--amber-glow), 0 0 24px var(--amber-glow);
  z-index: 4;
  top: 0;
  opacity: 0;
}
.scan-line.scanning {
  opacity: 1;
  animation: scanMove 1.6s ease-in-out infinite;
}
@keyframes scanMove {
  0%   { top: 10%; }
  50%  { top: 85%; }
  100% { top: 10%; }
}

/* Grid overlay */
.vf-grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: 
    linear-gradient(rgba(212,160,74,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,160,74,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Status text in viewfinder */
.vf-status {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(212,160,74,0.7);
  white-space: nowrap;
}

/* Scan Button */
.scan-controls {
  padding: 12px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.scan-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--amber);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.scan-btn:hover { transform: scale(1.05); box-shadow: 0 0 30px var(--amber-glow); }
.scan-btn:active { transform: scale(0.96); }
.scan-btn-inner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.scan-btn.scanning .scan-btn-inner { background: var(--rust); animation: pulseScan 1s ease-in-out infinite; }
@keyframes pulseScan {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.scan-btn-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ─── Match Result Sheet ────────────────────────────── */
.result-sheet {
  position: absolute;
  bottom: var(--nav-h);
  left: 0;
  right: 0;
  max-height: 85vh;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 50;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.32,0.72,0,1);
  padding-bottom: 24px;
  overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.35);
}
.result-sheet.open { transform: translateY(0); }
.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 12px auto 16px;
}
.sheet-inner {
  padding: 0 24px;
}
.sheet-match-header {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.sheet-art {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.sheet-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sheet-meta { flex: 1; }
.sheet-artist {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.1;
}
.sheet-title {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.sheet-details {
  font-size: 12px;
  color: var(--text-muted);
}
.sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sheet-row:last-of-type { border-bottom: none; }
.sheet-row-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.sheet-value-large {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  color: var(--amber);
  letter-spacing: 1px;
}
.condition-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cond-pill {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s;
}
.cond-pill.active {
  background: var(--amber-dim);
  border-color: var(--amber);
  color: var(--amber);
}
.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.btn-primary, .btn-secondary {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-transform: uppercase;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: var(--amber);
  color: #0D0D0F;
}
.btn-primary:hover { background: #e0b054; }
.btn-primary:active { transform: scale(0.97); }
.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  color: var(--amber);
  -webkit-tap-highlight-color: transparent;
}
.btn-text:hover { opacity: 0.8; }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--amber); color: var(--amber); }
.btn-secondary:active { transform: scale(0.97); }

/* ══════════════════════════════════════════════════════
   COLLECTION VIEW
══════════════════════════════════════════════════════ */
.stats-bar {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
  padding: 18px 20px;
  margin: 0 16px;
  margin-top: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.stat-item { flex: 1; text-align: center; }
.stat-val {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--amber);
  line-height: 1;
}
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 2px;
}
.stat-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  margin: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-dim);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.filter-pill.active {
  background: var(--amber-dim);
  border-color: var(--amber);
  color: var(--amber);
}
.sort-select {
  margin-left: auto;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text-dim);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  flex-shrink: 0;
}

.records-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 16px;
  flex-shrink: 0;
}

/* View switcher */
.view-switcher { display:flex; gap:4px; background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:4px; margin:0 16px 14px; box-shadow: var(--shadow-card); overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; flex-shrink:0; }
.view-switcher::-webkit-scrollbar { display:none; }
.view-switcher-btn { flex:0 0 auto; border:none; background:transparent; color:var(--text-muted); font-size:11px; font-weight:600; padding:6px 10px; border-radius:16px; cursor:pointer; transition:all 0.2s; display:flex; align-items:center; justify-content:center; gap:4px; white-space:nowrap; }
.view-switcher-btn.active { background:var(--amber); color:#000; }
.view-switcher-btn svg { width:14px; height:14px; flex-shrink:0; }

/* Crate-dig view */
.crate-container { padding:0 16px 80px; flex-shrink:0; }
.crate-letter-group { margin-bottom:24px; }
.crate-letter-header { position:sticky; top:0; z-index:5; font-family:'Bebas Neue',sans-serif; font-size:28px; color:var(--amber); padding:8px 0 4px; border-bottom:1px solid var(--border); background:var(--bg); margin-bottom:8px; }
.crate-letter-jump { display:flex; flex-wrap:wrap; gap:4px; padding:8px 16px 4px; justify-content:center; }
.crate-letter-jump-btn { width:28px; height:28px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text-muted); font-family:'Bebas Neue',sans-serif; font-size:14px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all 0.15s; }
.crate-letter-jump-btn:hover, .crate-letter-jump-btn.has-items { color:var(--text); border-color:var(--border2); }
.crate-letter-jump-btn.active { background:var(--amber); color:#000; border-color:var(--amber); }
.crate-record { display:flex; gap:12px; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); cursor:pointer; transition:background 0.15s; }
.crate-record:hover { background:rgba(212,160,74,0.04); }
.crate-record:last-child { border-bottom:none; }
.crate-thumb { width:56px; height:56px; border-radius:4px; flex-shrink:0; background:var(--surface2); overflow:hidden; }
.crate-thumb img { width:100%; height:100%; object-fit:cover; }
.crate-info { flex:1; min-width:0; }
.crate-artist { font-family:'Oswald',sans-serif; font-size:14px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crate-album { font-size:12px; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crate-meta { font-size:11px; color:var(--text-muted); margin-top:2px; }
.crate-value { font-family:'Oswald',sans-serif; font-size:14px; color:var(--amber); font-weight:600; flex-shrink:0; }

/* Netflix-style row view */
/* List view */
.list-container { padding:0 16px 80px; flex-shrink:0; }
.list-item { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid var(--border); cursor:pointer; }
.list-item:active { background:var(--surface2); }
.list-item-thumb { width:44px; height:44px; border-radius:4px; object-fit:cover; flex-shrink:0; background:var(--surface2); }
.list-item-info { flex:1; min-width:0; }
.list-item-artist { font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-item-album { font-size:12px; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-item-meta { font-size:10px; color:var(--text-muted); margin-top:1px; }
.list-item-value { font-family:'Oswald',sans-serif; font-size:13px; color:var(--amber); font-weight:600; flex-shrink:0; }

/* Digital crates view */
.crates-view-container { padding:0 16px 80px; flex-shrink:0; }
.crates-view-section { margin-bottom:24px; }
.crates-view-header { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); margin-bottom:10px; cursor:pointer; }
.crates-view-header:hover { opacity:0.85; }
.crates-view-icon { font-size:22px; flex-shrink:0; }
.crates-view-name { font-family:'Bebas Neue',sans-serif; font-size:20px; color:var(--white); letter-spacing:1px; }
.crates-view-count { font-size:12px; color:var(--text-muted); font-family:'DM Sans',sans-serif; margin-left:auto; }
.crates-view-empty { font-size:13px; color:var(--text-dim); padding:8px 0; }
.crates-view-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(110px, 1fr)); gap:10px; }
.crates-view-card { cursor:pointer; transition:transform 0.15s; }
.crates-view-card:hover { transform:scale(1.04); }
.crates-view-card-art { width:100%; aspect-ratio:1; border-radius:var(--radius); overflow:hidden; background:var(--surface2); border:1px solid var(--border); }
.crates-view-card-art img { width:100%; height:100%; object-fit:cover; }
.crates-view-card-title { font-size:11px; color:var(--text); font-weight:600; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crates-view-card-artist { font-size:10px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.crates-view-uncrated { margin-top:32px; }
.crates-view-uncrated-title { font-family:'Oswald',sans-serif; font-size:14px; color:var(--text-muted); text-transform:uppercase; letter-spacing:1px; margin-bottom:8px; }

/* ─── Vinyl Browser View ────────────────────────────── */
.vinyl-browser {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 0 80px;
  overflow: hidden;
}
.vinyl-letter-bar {
  display: flex;
  gap: 2px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  justify-content: center;
}
.vinyl-letter-bar::-webkit-scrollbar { display: none; }
.vinyl-letter-btn {
  min-width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.vinyl-letter-btn:hover { color: var(--text); background: var(--surface2); }
.vinyl-letter-btn.active { background: var(--amber); color: #000; }

.vinyl-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 0;
  overflow: hidden;
  perspective: 900px;
  perspective-origin: 50% 60%;
}
.vinyl-arrow {
  position: absolute;
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(17,17,20,0.85);
  color: var(--text);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.vinyl-arrow:hover { background: var(--surface); border-color: var(--amber); color: var(--amber); }
.vinyl-arrow-left { left: 8px; top: 50%; transform: translateY(-50%); }
.vinyl-arrow-right { right: 8px; top: 50%; transform: translateY(-50%); }

.vinyl-track {
  width: 280px;
  height: 360px;
  position: relative;
  transform-style: preserve-3d;
}

.vinyl-card {
  position: absolute;
  width: 100%;
  cursor: pointer;
  transform-origin: 50% 100%;
  backface-visibility: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s;
}
.vinyl-card-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface2);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
}
.vinyl-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.vinyl-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  gap: 4px;
}
.vinyl-card-placeholder span {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.vinyl-card-info {
  padding: 6px 2px 0;
  text-align: center;
}
.vinyl-card-album {
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vinyl-card-artist {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes vinylFallForward {
  0%   { transform: rotateX(0deg) translateY(0) translateZ(0) scale(1); opacity: 1; }
  25%  { transform: rotateX(-25deg) translateY(15px) translateZ(80px) scale(1.03); opacity: 1; }
  55%  { transform: rotateX(-55deg) translateY(80px) translateZ(200px) scale(1.0); opacity: 0.85; }
  80%  { transform: rotateX(-78deg) translateY(150px) translateZ(250px) scale(0.95); opacity: 0.4; }
  100% { transform: rotateX(-88deg) translateY(200px) translateZ(260px) scale(0.9); opacity: 0; }
}
@keyframes vinylReturnBack {
  0%   { transform: rotateX(-88deg) translateY(200px) translateZ(260px) scale(0.9); opacity: 0; }
  30%  { transform: rotateX(-60deg) translateY(100px) translateZ(180px) scale(0.95); opacity: 0.4; }
  60%  { transform: rotateX(-30deg) translateY(40px) translateZ(80px) scale(0.98); opacity: 0.8; }
  100% { transform: rotateX(0deg) translateY(0) translateZ(0) scale(1); opacity: 1; }
}
.vinyl-card-falling {
  animation: vinylFallForward 0.55s ease-in forwards;
  pointer-events: none;
}
.vinyl-card-returning {
  animation: vinylReturnBack 0.45s ease-out forwards;
  pointer-events: none;
}
.vinyl-card-dismissed {
  display: none;
}

.vinyl-letter-label {
  text-align: center;
  padding: 12px 16px 4px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.vinyl-big-letter {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px;
  color: var(--white);
  line-height: 1;
  letter-spacing: 2px;
}
.vinyl-count {
  font-size: 13px;
  color: var(--text-muted);
}
.vinyl-stack-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  opacity: 0.6;
}

@media (min-width: 768px) {
  .vinyl-track { width: 320px; height: 400px; }
  .vinyl-letter-bar { padding: 16px 24px; }
  .vinyl-card-album { font-size: 13px; }
  .vinyl-card-artist { font-size: 12px; }
}
@media (min-width: 1280px) {
  .vinyl-track { width: 360px; height: 440px; }
}

.netflix-container { padding:0 0 80px; flex-shrink:0; }
.netflix-row { margin-bottom:24px; }
.netflix-row-title { font-family:'Bebas Neue',sans-serif; font-size:18px; color:var(--text); padding:0 16px 8px; display:flex; align-items:center; gap:8px; }
.netflix-row-count { font-size:12px; color:var(--text-muted); font-family:'DM Sans',sans-serif; }
.netflix-scroll { display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; padding:0 16px; scrollbar-width:none; }
.netflix-scroll::-webkit-scrollbar { display:none; }
.netflix-card { flex-shrink:0; width:140px; scroll-snap-align:start; cursor:pointer; transition:transform 0.2s; }
.netflix-card:hover { transform:scale(1.05); }
.netflix-card-art { width:140px; height:140px; border-radius:var(--radius); overflow:hidden; background:var(--surface2); border:1px solid var(--border); }
.netflix-card-art img { width:100%; height:100%; object-fit:cover; }
.netflix-card-art-fallback { width:100%; height:100%; display:flex; align-items:center; justify-content:center; padding:8px; text-align:center; }
.netflix-card-art-text { font-family:'Oswald',sans-serif; font-size:11px; font-weight:600; color:rgba(255,255,255,0.8); line-height:1.2; text-shadow:0 1px 3px rgba(0,0,0,0.5); }
.netflix-card-info { padding:6px 2px 0; }
.netflix-card-artist { font-size:12px; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.netflix-card-album { font-size:11px; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
@media (min-width: 768px) {
  .netflix-card { width:160px; }
  .netflix-card-art { width:160px; height:160px; }
}
@media (min-width: 1024px) {
  .netflix-card { width:180px; }
  .netflix-card-art { width:180px; height:180px; }
}

.record-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.2s;
  box-shadow: var(--shadow-card);
  -webkit-tap-highlight-color: transparent;
}
.record-card-custom {
  border-left: 3px solid var(--amber);
}
.record-card:hover {
  border-color: var(--border2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.record-card:active { transform: scale(0.98); }

.record-art {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
}
.record-art-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
}
.record-art-name {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.record-info {
  padding: 14px;
}
.record-artist {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.record-album {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.record-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.record-year-fmt {
  font-size: 10px;
  color: var(--text-muted);
}
.record-badges {
  display: flex;
  gap: 3px;
}
.val-badge {
  background: var(--amber-dim);
  color: var(--amber);
  border: 1px solid rgba(212,160,74,0.25);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
}
.cond-badge {
  background: rgba(255,255,255,0.07);
  color: var(--text-dim);
  border: 1px solid var(--border2);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
}
.rare-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--rust);
  border-radius: 50%;
  border: 1px solid rgba(196,91,58,0.5);
  animation: rarePulse 2s ease-in-out infinite;
}
@keyframes rarePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,91,58,0.6); }
  50% { box-shadow: 0 0 0 5px rgba(196,91,58,0); }
}

/* ─── Detail Modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-overlay-center { align-items: center; }
.modal-overlay-center .modal-sheet { border-radius: var(--radius); max-height: 90vh; transform: none; box-shadow: var(--shadow-card-hover); }
.modal-sheet {
  width: 100%;
  max-width: var(--content-max, var(--app-w));
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 88vh;
  overflow-y: auto;
  scrollbar-width: none;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.35);
}
.modal-sheet::-webkit-scrollbar { display: none; }
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  margin: 12px auto 16px;
}
.modal-art-large {
  width: 100%;
  aspect-ratio: 1;
  max-height: 200px;
  overflow: hidden;
}
.modal-art-large-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-body { padding: 24px; }
.modal-title-row {
  margin-bottom: 16px;
}
.modal-artist {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--white);
  line-height: 1;
}
.modal-album {
  font-size: 16px;
  color: var(--text-dim);
  margin-top: 2px;
}
.modal-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.detail-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.15);
}
.detail-block-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 3px;
}
.detail-block-val {
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  color: var(--text);
}
.detail-block-val.amber { color: var(--amber); }

/* Sparkline section */
.sparkline-section {
  margin-bottom: 16px;
}
.sparkline-title {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sparkline-title span { color: var(--green); font-weight: 600; }
.sparkline-wrap {
  position: relative;
  height: 60px;
}

.notes-field {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  padding: 14px 16px;
  resize: none;
  height: 80px;
  margin-bottom: 16px;
  outline: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.notes-field::placeholder { color: var(--text-muted); }
.notes-field:focus { border-color: var(--amber); }

.modal-section-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.form-input { width: 100%; padding: 10px 12px; font-size: 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); box-sizing: border-box; }
.form-input:focus { border-color: var(--amber); outline: none; }
.form-input::placeholder { color: var(--text-muted); }

.modal-actions {
  display: flex;
  gap: 10px;
}
.btn-danger {
  flex: 1;
  padding: 13px;
  border-radius: 10px;
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(196,91,58,0.4);
  background: transparent;
  color: var(--rust);
  text-transform: uppercase;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-danger:hover { background: var(--rust-dim); }

/* ══════════════════════════════════════════════════════
   DASHBOARD VIEW
══════════════════════════════════════════════════════ */
.dashboard-hero {
  padding: 28px 20px 24px;
  margin: 16px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}
.hero-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.hero-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px;
  color: var(--white);
  letter-spacing: 2px;
  line-height: 1;
}
.hero-change {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 14px;
  color: var(--green);
  font-weight: 500;
}
.arrow-up {
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid var(--green);
}

.dash-section {
  padding: 24px 20px;
  margin: 0 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}
.dash-section:last-child { margin-bottom: 24px; }
.section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}
.dash-integration-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.dash-connect-cta {
  font-size: 13px;
  color: var(--text-dim);
}
.dash-connect-cta .btn-sm { margin-top: 4px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.dash-games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.dash-game-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.dash-game-card:hover {
  border-color: var(--amber);
  background: var(--amber-dim);
  box-shadow: var(--shadow-card);
}
.dash-game-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.dash-game-title {
  font-size: 13px;
  font-weight: 600;
}

.chart-wrap {
  height: 180px;
  position: relative;
}

/* Gainers / Most Valuable */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.rank-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.rank-info { flex: 1; min-width: 0; }
.rank-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-sub { font-size: 11px; color: var(--text-muted); }
.rank-val {
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  color: var(--amber);
  flex-shrink: 0;
}
.rank-change-pos {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
}

/* Breakdown bars */
.breakdown-block { margin-bottom: 16px; }
.breakdown-block:last-child { margin-bottom: 0; }
.breakdown-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.breakdown-bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bar-key { font-size: 12px; color: var(--text-dim); width: 40px; flex-shrink: 0; }
.bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--amber);
  transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
}
.bar-count { font-size: 12px; color: var(--text-muted); width: 20px; text-align: right; flex-shrink: 0; }

/* Price Alerts */
.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--rust);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.alert-icon { font-size: 16px; flex-shrink: 0; }
.alert-text { font-size: 13px; color: var(--text); line-height: 1.4; }

/* ══════════════════════════════════════════════════════
   WANTLIST VIEW
══════════════════════════════════════════════════════ */
.wantlist-header {
  padding: 24px 20px 16px;
  flex-shrink: 0;
}
.wantlist-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.wantlist-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--white);
}
.wantlist-sub {
  font-size: 12px;
  color: var(--amber);
  font-weight: 600;
}
.wantlist-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.wantlist-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.want-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0;
  transition: border-color 0.15s, opacity 0.3s, transform 0.3s, box-shadow 0.2s;
  box-shadow: var(--shadow-card);
  position: relative;
}
.want-item:hover { box-shadow: var(--shadow-card-hover); }
.want-item.removing {
  opacity: 0;
  transform: translateX(60px);
}
.want-art {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  overflow: hidden;
}
.want-art-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  text-align: center;
}
.want-art-name {
  font-family: 'Oswald', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.want-info { flex: 1; padding: 14px; min-width: 0; }
.want-artist {
  font-family: 'Oswald', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.1;
}
.want-album { font-size: 12px; color: var(--text-dim); margin-bottom: 2px; }
.want-pressing { font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.want-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.heat-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.heat-hot { background: var(--rust-dim); color: var(--rust); border: 1px solid rgba(196,91,58,0.3); }
.heat-warm { background: rgba(212,160,74,0.12); color: #c89040; border: 1px solid rgba(212,160,74,0.25); }
.heat-cold { background: rgba(100,160,220,0.1); color: #5ba3e0; border: 1px solid rgba(100,160,220,0.25); }
.stars { color: var(--amber); font-size: 11px; letter-spacing: 1px; }
.want-price {
  font-family: 'Oswald', sans-serif;
  font-size: 12px;
  color: var(--amber);
}
.want-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px;
  flex-shrink: 0;
}
.found-btn {
  padding: 6px 10px;
  background: var(--amber);
  border: none;
  border-radius: 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #0D0D0F;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.found-btn:hover { background: #e0b054; }
.found-btn:active { transform: scale(0.95); }
.remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.remove-btn:hover { color: var(--rust); }

/* ══════════════════════════════════════════════════════
   PROFILE VIEW
══════════════════════════════════════════════════════ */
.profile-hero {
  padding: 32px 20px 28px;
  margin: 0 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber) 0%, #b87830 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: #0D0D0F;
  letter-spacing: 2px;
  margin-bottom: 12px;
  border: 2px solid rgba(212,160,74,0.4);
  box-shadow: 0 0 24px rgba(212,160,74,0.2);
}
.profile-username {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--white);
}
.profile-since {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-section {
  padding: 24px 20px;
  margin: 0 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}
.profile-section:last-child { margin-bottom: 24px; }
.profile-section-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
}

/* Stats grid */
.profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.profile-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.profile-stat-val {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  color: var(--amber);
  line-height: 1;
}
.profile-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Services */
.service-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.service-row:last-child { border-bottom: none; }
.service-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.service-info { flex: 1; }
.service-name { font-size: 14px; font-weight: 600; color: var(--text); }
.service-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.service-status { font-size: 12px; color: var(--text-muted); }
.service-status.connected { color: var(--green); }
.connect-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--amber);
  background: transparent;
  color: var(--amber);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.connect-btn:hover { background: var(--amber-dim); }

/* Preferences */
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.pref-row:last-child { border-bottom: none; }
.pref-label { font-size: 13px; color: var(--text); }
.pref-val { font-size: 13px; color: var(--text-dim); font-weight: 500; }

/* Version */
.app-version {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
}
.app-wordmark {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--amber);
  text-align: center;
  margin-bottom: 4px;
}
.app-tagline-small {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
  font-style: italic;
}

/* ─── Utility ────────────────────────────────────────── */
/* Center main column in #app flex stack (margin:auto alone is unreliable with flex stretch) */
.view-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  align-self: center;
  width: min(100%, var(--content-max));
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: max(var(--safe-left), 16px);
  padding-right: max(var(--safe-right), 16px);
  box-sizing: border-box;
}
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 12px 20px;
  background: var(--amber);
  color: #0D0D0F;
  font-weight: 600;
  z-index: 10000;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid var(--white);
  outline-offset: 2px;
}
.load-more-wrap { padding: 12px 16px; text-align: center; flex-shrink: 0; }
.load-more-wrap .btn-secondary { max-width: 200px; }
.pb-extra { height: 16px; flex-shrink: 0; }
.muted-small { font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.event-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.event-row:last-child { border-bottom: none; }
.event-row a { color: var(--amber); text-decoration: none; }
.event-row .event-mute-btn { margin-left: 8px; font-size: 12px; color: var(--text-muted); background: none; border: none; cursor: pointer; text-decoration: underline; }
.event-row .event-mute-btn:hover { color: var(--text-dim); }
.event-prefs-wrap { margin-bottom: 12px; }
.event-prefs-wrap .btn-text { color: var(--text-dim); padding: 4px 0; }
.event-prefs-panel { margin-top: 10px; padding: 12px; background: var(--surface2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.event-prefs-row { margin-bottom: 12px; }
.event-prefs-row:last-child { margin-bottom: 0; }
.event-prefs-label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.event-prefs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 24px; }
.event-prefs-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; background: var(--amber-dim); border-radius: 6px; font-size: 13px; color: var(--text); }
.event-prefs-tag button { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0 2px; font-size: 14px; line-height: 1; }
.event-prefs-tag button:hover { color: var(--rust); }
.event-prefs-add { display: flex; gap: 8px; align-items: center; }
.event-prefs-add .input-sm { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 14px; }
.event-prefs-add .input-sm::placeholder { color: var(--text-muted); }
.event-main { flex: 1; }
.event-artist { font-size: 14px; font-weight: 600; color: var(--text); }
.event-venue { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.event-date { font-size: 12px; color: var(--amber); margin-left: 12px; }

/* ─── Responsive: mobile → tablet → laptop → desktop → widescreen ───── */
@media (max-width: 360px) {
  .view-header { padding: 20px 16px 14px; }
  .filter-row, .stats-bar { margin-left: 12px; margin-right: 12px; }
  .record-info { padding: 12px; }
  .want-info { padding: 12px; }
}
/* ─── Top Header (desktop) ────────────────────────── */
#top-header {
  display: none;
  width: 100%;
  flex-shrink: 0;
}
.header-theme-btn, .app-theme-toggle-mobile {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.header-theme-btn:hover, .app-theme-toggle-mobile:hover { background: var(--surface2); color: var(--amber); }
.app-theme-toggle-mobile {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 300;
  width: 44px;
  height: 44px;
}
@media (min-width: 768px) {
  .app-theme-toggle-mobile { display: none !important; }
}
@media (max-width: 767px) {
  .app-theme-toggle-mobile { display: inline-flex !important; }
  .header-theme-btn { display: none !important; }
}
.header-logo {
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: var(--amber);
  letter-spacing: 2px;
}
.header-nav {
  display: flex;
  gap: 4px;
}
.header-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.header-tab:hover { color: var(--text); background: var(--surface); }
.header-tab.active { color: var(--amber); background: var(--amber-dim); }
.header-tab svg { width: 18px; height: 18px; flex-shrink: 0; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.header-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.header-search-btn:hover { color: var(--amber); border-color: var(--amber); }
.header-search-btn svg { width: 16px; height: 16px; }

/* ─── Footer ────────────────────────────────────────── */
#app-footer {
  display: none;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
}
.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.footer-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  color: var(--amber);
  letter-spacing: 1.5px;
}
.footer-tagline {
  font-size: 12px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }
.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Responsive ─────────────────────────────────────── */

/* Tablet portrait & large phone */
@media (min-width: 480px) {
  :root { --app-w: min(100vw, 720px); --content-max: min(100%, 720px); }
}

/* Tablet landscape & small laptop — switch to desktop layout */
@media (min-width: 768px) {
  :root { --app-w: min(100vw, 1000px); --nav-h: 0px; --content-max: 900px; }

  html { height: auto; }
  body { height: auto; overflow: auto; overflow-x: hidden; }

  #top-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    height: 56px;
    width: 100%;
    background: #111114;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 500;
    pointer-events: auto;
    flex-shrink: 0;
  }

  #bottom-nav { display: none; }

  #app {
    width: 100% !important;
    max-width: 100% !important;
    box-shadow: none;
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
  }

  .view-wrap {
    align-self: center;
    max-width: var(--content-max, 900px);
    width: min(100%, var(--content-max, 900px));
    margin-left: auto;
    margin-right: auto;
  }

  .view {
    position: relative !important;
    inset: auto !important;
    bottom: auto !important;
    overflow: visible !important;
    min-height: 0;
    height: auto;
  }
  .view:not(.active) {
    display: none !important;
  }
  .view.active {
    display: block !important;
    flex: 1;
  }
  .view-wrap {
    display: block;
    overflow: visible !important;
  }

  #app-footer {
    display: block;
    background: #111114;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    margin-top: auto;
  }

  .view-header { padding: 24px 24px 16px; }
  .records-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 24px; }
  .dash-games-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .stats-bar { padding: 18px 24px; margin: 16px 24px 16px; }
  .filter-row { padding: 14px 24px; margin: 0 24px 12px; }
  .scan-search-bar { padding: 20px 24px 0; }
  .dashboard-hero { padding: 28px 24px 24px; margin: 16px 24px 16px; }
  .dash-section { padding: 24px; margin: 0 24px 16px; }
  .wantlist-header { padding: 24px 24px 16px; }
  .wantlist-body { padding: 20px 24px; }
  .profile-hero { margin: 16px 24px 16px; }
  .profile-section { margin: 0 24px 16px; }
}

/* Laptop */
@media (min-width: 1024px) {
  .records-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .dash-games-grid { grid-template-columns: repeat(4, 1fr); }
  #top-header { padding: 0 32px; }
  .header-tab { padding: 8px 18px; font-size: 14px; }
}

/* Desktop */
@media (min-width: 1280px) {
  :root { --content-max: 1000px; }
  .records-grid { grid-template-columns: repeat(5, 1fr); gap: 20px; padding: 28px 32px; }
  .view-header { padding: 24px 32px 16px; }
  .stats-bar { padding: 20px 32px; margin: 16px 32px 16px; }
  .filter-row { padding: 16px 32px; margin: 0 32px 16px; }
  .dashboard-hero { padding: 32px; margin: 16px 32px 16px; }
  .dash-section { padding: 28px 32px; margin: 0 32px 20px; }
  .wantlist-header { padding: 24px 32px 16px; }
  .wantlist-body { padding: 20px 32px; }
  .profile-hero { margin: 16px 32px 16px; }
  .profile-section { margin: 0 32px 20px; }
}

/* Large desktop */
@media (min-width: 1600px) {
  :root { --content-max: 1100px; }
  .records-grid { grid-template-columns: repeat(6, 1fr); }
}
/* Focus visible for keyboard users */
button:focus-visible, .filter-pill:focus-visible, .connect-btn:focus-visible,
a:focus-visible, [tabindex="0"]:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
@media (prefers-reduced-motion: reduce) {
  .result-sheet, .modal-overlay .modal-sheet, * { transition: none !important; }
}
/* Minimum touch target (WCAG 2.5.5) */
.filter-pill, .cond-pill, .connect-btn, .btn-primary, .btn-secondary,
.found-btn, .remove-btn { min-height: 44px; min-width: 44px; }
