/* =========================================================
   Crate Digger — interfaccia
   Riferimenti: barra in basso (standard iOS/Android), home a
   un'azione (Duolingo), ascolto a schermo intero con sfondo dalla
   copertina (Spotify) e voto a trascinamento (Tinder).
   Spazi: multipli di 4px. Raggi: 10 / 14 / 20.
   ========================================================= */

:root {
  --bg: #0b0b0f;
  --bg-2: #111117;
  --panel: #15151c;
  --panel-2: #1c1c25;
  --line: #262632;
  --line-2: #33333f;
  --text: #f1f0f6;
  --text-2: #b9b7c6;
  --muted: #8b8999;
  --accent: #c6ff3d;
  --accent-ink: #10130a;
  --accent-soft: rgba(198, 255, 61, 0.12);
  --hot: #ff5c39;
  --hot-soft: rgba(255, 92, 57, 0.14);
  --warm: #ffc53d;
  --warm-soft: rgba(255, 197, 61, 0.14);
  --cool: #7b88ff;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --radius: var(--r);
  --radius-sm: var(--r-sm);
  --font: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --display: 'Bricolage Grotesque', 'Space Grotesk', system-ui, sans-serif; /* marchio e titoli */
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  --tabbar-h: 64px;
  --col: 560px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1, .cta-text b, .intro h2, .level-card h1, .sheet-head h2, .wordmark { font-family: var(--display); font-optical-sizing: auto; }
h1 { font-weight: 800; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- TOP BAR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, calc((100vw - var(--col)) / 2)) 10px;
  background: rgba(11, 11, 15, 0.86);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; font-weight: 500; font-size: 17px; letter-spacing: 0.01em; }
.brand svg { width: 30px; height: 30px; color: var(--accent); }
.brand b { color: var(--accent); font-weight: 800; }
.wordmark { font-weight: 800; font-size: 21px; letter-spacing: -0.02em; color: var(--text); }
.wordmark { white-space: nowrap; }
/* "digs": la i è senza puntino (ı) e il puntino è un cerchio lime, come l'etichetta del disco nel logo.
   Misure di Bricolage Grotesque 800: puntino al centro della lettera, 0,678 em sopra la riga di base;
   il riquadro della riga parte 0,93 em sopra la base. */
.wm-i { position: relative; }
.wm-i::after { content: ''; position: absolute; left: 50%; top: calc(0.93em - 0.678em - 0.092em); width: 0.184em; height: 0.184em; margin-left: -0.092em; border-radius: 50%; background: var(--accent); }
.hud { display: flex; align-items: center; gap: 8px; }
.hud-chip {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 99px; background: var(--panel); border: 1px solid var(--line);
  font-size: 14px; color: var(--text-2);
}
.hud-chip b { color: var(--text); font-family: var(--mono); font-weight: 600; }
.hud-chip.streak .i { width: 18px; height: 18px; color: var(--hot); }
.lvl-num { font-size: 13px; white-space: nowrap; }
.hud-chip .xpbar { width: 44px; }
.xpbar { display: block; height: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.xpbar.big { height: 10px; margin: 10px 0 6px; }
.xpbar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }

/* ---------- LAYOUT ---------- */
main:not(.l-main) { max-width: var(--col); margin: 0 auto; padding: 20px 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }
body.has-mini main:not(.l-main) { padding-bottom: calc(var(--tabbar-h) + 104px + env(safe-area-inset-bottom)); }
.view { display: none; animation: fade 0.3s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* Cambio scheda con le View Transitions: barra in alto e in basso restano ferme, il contenuto si dissolve. */
.vt .view { animation: none; }
.topbar { view-transition-name: topbar; }
.tabs { view-transition-name: tabbar; }
::view-transition-old(root) { animation: 120ms ease-out both vtOut; }
::view-transition-new(root) { animation: 220ms ease-out both vtIn; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(6px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.page-head h1 { font-size: 30px; letter-spacing: -0.02em; }
.page-sub { width: 100%; margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.eyebrow { font-family: var(--mono); font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 8px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; }
.panel h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.muted.small { font-size: 12px; margin: 10px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

/* ---------- PULSANTI & CONTROLLI ---------- */
.btn-primary {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--r);
  padding: 16px; font-weight: 700; font-size: 17px; text-decoration: none;
  transition: transform 0.12s, filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary small { font-weight: 500; font-size: 13px; opacity: 0.7; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary.sm { width: auto; display: inline-flex; flex-direction: row; padding: 8px 14px; border-radius: var(--r-sm); font-size: 14px; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 14px 18px; font-weight: 600; color: var(--text); text-decoration: none;
}
.btn-secondary:hover { border-color: #45455a; }
.btn-secondary.sm { padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; }
.btn-secondary .i { width: 16px; height: 16px; }
.icon-btn {
  flex: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel-2);
  display: grid; place-items: center; color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 600;
}
.icon-btn:hover { color: var(--text); }
.icon-btn .i { width: 18px; height: 18px; }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.playing { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.icon-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
#undo-btn:not(:disabled) { color: var(--warm); }
.link-btn { display: block; background: none; border: 0; padding: 0; margin-top: 10px; color: var(--muted); font-size: 13px; text-decoration: underline; }
.link-btn.inline { display: inline; margin: 0; font-size: inherit; }
.danger-btn { color: var(--hot) !important; margin-top: 12px; }

.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; background: none; border: 0; padding: 9px 8px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.seg button.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg.compact button { padding: 7px 14px; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 40%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line-2); background: var(--bg-2); padding: 7px 12px; border-radius: 99px;
  font-size: 14px; color: var(--text-2); white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.chip:hover { color: var(--text); }
.chip.on, .chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.chip .x { margin-left: 6px; opacity: 0.6; }
.pill { font-style: normal; font-family: var(--mono); font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 2px 6px; margin-left: 4px; }

.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.inline-form input {
  flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--r-sm); padding: 10px 12px; font: inherit; font-size: 15px;
}
.inline-form input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.toggle { display: flex; align-items: center; gap: 14px; cursor: pointer; margin-top: 20px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; width: 48px; height: 28px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-2); position: relative; transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: all 0.2s; }
.toggle input:checked + .switch { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .switch::after { left: 23px; background: var(--accent-ink); }
.toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle small { color: var(--muted); font-size: 13px; }

/* ---------- SCAVI: il colore segue la famiglia prevalente dei generi scelti ---------- */
body[data-family="hiphop"] {
  --accent: #45d9ff;
  --accent-ink: #04161c;
  --accent-soft: rgba(69, 217, 255, 0.13);
}
body[data-family="jazz"] {
  --accent: #ffc14d;
  --accent-ink: #1f1500;
  --accent-soft: rgba(255, 193, 77, 0.14);
}
.scavi-bar { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 8px; padding: 4px 16px 6px; scrollbar-width: none; justify-content: safe center; }
.scavi-bar::-webkit-scrollbar { display: none; }
.scavo-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap;
}
.scavo-chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scavo-chip.add { border-style: dashed; }
.scavo-edit { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.scavo-emoji { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 22px; }
#scavo-name { flex: 1; min-width: 0; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); border-radius: 12px; padding: 12px; font: inherit; font-family: var(--display); font-weight: 700; font-size: 18px; }
.scavo-starters { margin-bottom: 6px; }
.tag-family { border-top: 1px solid var(--line); padding: 8px 0; }
.tag-family summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; list-style: none; }
.tag-family summary::-webkit-details-marker { display: none; }
.tag-family summary::after { content: '▾'; float: right; color: var(--muted); }
.tag-family[open] summary::after { content: '▴'; }
.tag-family summary em { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--accent-ink); background: var(--accent); border-radius: 99px; padding: 0 7px; margin-left: 4px; }
.tag-family .chips { margin: 6px 0 4px; }
.own-tags { margin-top: 10px; }
.danger-link { display: block; margin: 16px 0 4px; color: var(--hot); }
.scavo-chip.manage { padding: 8px 12px; color: var(--muted); }
.scavi-bar .scavo-chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: pan-x; }

/* I tuoi scavi */
.scavi-list { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 8px; }
.sv-row { position: relative; border-radius: var(--r); overflow: hidden; }
.sv-bg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 18px;
  background: linear-gradient(90deg, rgba(255, 92, 57, 0.15), var(--hot)); color: #fff; font-weight: 700; font-size: 14px;
}
.sv-row.armed .sv-bg { background: var(--hot); }
.sv-card {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 4px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1); touch-action: pan-y; cursor: pointer;
}
.sv-card.swiping { transition: none; }
.sv-card.active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.sv-handle { flex: none; width: 34px; text-align: center; font-size: 20px; color: var(--muted); cursor: grab; touch-action: none; }
.sv-emoji { flex: none; font-size: 24px; }
.sv-ti { flex: 1; min-width: 0; }
.sv-ti b, .sv-ti small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-ti b { font-family: var(--display); font-weight: 700; font-size: 16px; }
.sv-ti small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.sv-on { flex: none; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.sv-del { flex: none; }
.sv-ghost .sv-card { opacity: 0.35; border-style: dashed; }
.sv-chosen .sv-card { box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8); transform: scale(1.02); }
.sv-undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--r); font-size: 14px; color: var(--muted); }
.sv-undo b { color: var(--text); }
.scavi-new { width: 100%; }
.toast-action { flex: none; margin-left: auto; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 9px; padding: 7px 12px; font-weight: 700; font-size: 13px; }
.comm-families { margin-bottom: 12px; }
.scene-switch { display: flex; gap: 6px; padding: 4px; margin: 0 auto 8px; width: fit-content; background: var(--bg-2); border: 1px solid var(--line); border-radius: 99px; }
.scene-switch button {
  display: flex; align-items: center; gap: 6px; background: none; border: 0; border-radius: 99px;
  padding: 8px 16px; color: var(--muted); font-weight: 600; font-size: 14px;
}
.scene-switch button .i { width: 18px; height: 18px; }
.scene-switch button.active { background: var(--accent); color: var(--accent-ink); }
.place-switch { margin: 0 auto 12px; }
.place-switch button { padding: 6px 14px; font-size: 13px; }
.place-switch button .i { width: 16px; height: 16px; }
.focus-results button > .i { width: 20px; height: 20px; margin: 0 8px; color: var(--accent); flex: none; }
.place-note { margin: 8px 0 0; }
body[data-family="hiphop"] .cta:not(.secondary) { box-shadow: 0 16px 40px -16px rgba(69, 217, 255, 0.5); }
body[data-family="jazz"] .cta:not(.secondary) { box-shadow: 0 16px 40px -16px rgba(255, 193, 77, 0.45); }

/* ---------- HOME ---------- */
.today { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 0 14px; }
.ring-wrap { position: relative; width: 168px; height: 168px; margin-bottom: 10px; }
.goal-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.goal-ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--panel-2); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.8s cubic-bezier(.2,.8,.2,1); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center b { font-family: var(--mono); font-size: 30px; letter-spacing: -0.02em; }
.ring-center span { font-size: 13px; color: var(--muted); }
.today-line { margin: 0; font-size: 14px; color: var(--muted); }

.cta {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: 0 16px 40px -16px rgba(198, 255, 61, 0.55); transition: transform 0.12s;
}
.cta:active { transform: scale(0.985); }
.cta .i { width: 28px; height: 28px; stroke-width: 2.2; }
.cta-text { display: flex; flex-direction: column; }
.cta-text b { font-size: 19px; }
.cta-text small { font-size: 13px; opacity: 0.75; font-weight: 500; }
.cta.secondary { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; margin-bottom: 16px; }
.cta.secondary .i { color: var(--hot); }
.cta.secondary small { color: var(--muted); opacity: 1; }
.cta:disabled { opacity: 0.5; cursor: not-allowed; }

.setup-summary {
  width: 100%; margin-top: 12px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px;
}
.setup-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.setup-chips span { font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.setup-meta { grid-column: 1; font-size: 13px; color: var(--muted); }
.setup-edit { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.setup-edit .i { width: 18px; height: 18px; }

/* ---------- ARTISTA / ETICHETTA ---------- */
.focus-picked { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: var(--r); }
.focus-picked img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--panel-2); flex: none; }
.focus-picked span { flex: 1; min-width: 0; }
.focus-picked b { display: block; }
.focus-picked small { display: block; color: var(--muted); font-size: 12px; }
.focus-results { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.focus-results button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.focus-results button:hover { border-color: var(--line-2); }
.focus-results img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--panel-2); flex: none; }
.focus-results b { display: block; font-size: 14px; }
.focus-results small { display: block; color: var(--muted); font-size: 12px; }
.focus-empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.chips.dimmed { opacity: 0.35; }

/* ---------- PANNELLI DAL BASSO ---------- */
.sheet {
  margin: auto auto 0; width: min(100vw, var(--col)); max-width: 100vw; max-height: 88vh; padding: 0;
  border: 1px solid var(--line-2); border-bottom: 0; border-radius: 24px 24px 0 0;
  background: var(--panel); color: var(--text); box-shadow: var(--shadow); overflow: auto;
}
.sheet[open] { animation: sheetUp 0.28s cubic-bezier(.2,.8,.2,1); }
.sheet::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 10px auto 0; }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 18px; }
.sheet-body { padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); }
.sheet-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 20px 0 10px; }
.sheet-body h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.intro .sheet-body { padding-top: 28px; }
.intro h2 { font-size: 30px; letter-spacing: -0.02em; margin-bottom: 20px; }
.intro h2 span { color: var(--accent); }
.intro-steps { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 14px; }
.intro-steps li { display: flex; gap: 14px; align-items: flex-start; }
.intro-steps b { display: block; font-size: 16px; margin-bottom: 2px; }
.intro-steps li > span:last-child { color: var(--muted); font-size: 14px; line-height: 1.45; }
.step-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }

/* ---------- SESSIONE (schermo intero) ---------- */
body.immersive .topbar, body.immersive .tabs { display: none; }
body.immersive main:not(.l-main) { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
#view-dig { position: relative; }
.dig-bg {
  position: fixed; inset: -80px; z-index: -1; background-size: cover; background-position: center;
  filter: blur(70px) saturate(1.4); opacity: 0.45; transition: opacity 0.6s;
}
.dig-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,11,15,0.35) 0%, rgba(11,11,15,0.85) 55%, var(--bg) 100%); }
.session-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.dots { flex: 1; display: flex; gap: 3px; }
.dots i { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,0.14); transition: background 0.3s; }
.dots i.pass { background: rgba(255,255,255,0.32); }
.dots i.maybe { background: var(--warm); }
.dots i.crate { background: var(--hot); }
.dots i.now { background: var(--text); }
.combo { font-family: var(--mono); font-size: 14px; color: var(--muted); min-width: 32px; text-align: center; transition: transform 0.2s; }
.combo.hot { color: var(--accent); }
.combo.bump { transform: scale(1.4); }

.loading { text-align: center; padding: 80px 0; color: var(--muted); }
.loading .logo-anim { width: 96px; height: 96px; margin: 0 auto 14px; display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { animation: cardIn 0.35s cubic-bezier(.2,.8,.2,1); }
.card.out-left { animation: outLeft 0.3s ease forwards; }
.card.out-right { animation: outRight 0.3s ease forwards; }
.card.out-up { animation: outUp 0.3s ease forwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes outLeft { to { opacity: 0; transform: translateX(-80px) rotate(-6deg); } }
@keyframes outRight { to { opacity: 0; transform: translateX(80px) rotate(6deg); } }
@keyframes outUp { to { opacity: 0; transform: translateY(-60px); } }

.art-wrap {
  position: relative; width: min(100%, 44vh); aspect-ratio: 1; margin: 0 auto; border-radius: var(--r-lg);
  overflow: hidden; background: var(--panel-2); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; will-change: transform;
}
.art-wrap.dragging { cursor: grabbing; }
.art-wrap.snap { transition: transform 0.25s cubic-bezier(.2,.8,.2,1); }
.art-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.blind-cover {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(circle at 50% 40%, #1d2410, #0d0d12 70%);
  color: var(--muted); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
}
.card.blind .blind-cover { display: flex; }
.card.revealed .blind-cover { animation: reveal 0.6s forwards; }
@keyframes reveal { to { opacity: 0; } }
.eq { display: flex; align-items: flex-end; gap: 6px; height: 60px; }
.eq i { width: 10px; background: var(--accent); border-radius: 3px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.2s; }
.eq i:nth-child(3) { animation-delay: -0.5s; }
.eq i:nth-child(4) { animation-delay: -0.1s; }
.eq i:nth-child(5) { animation-delay: -0.7s; }
.paused .eq i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }
.tag-pill {
  position: absolute; left: 12px; top: 12px; font-family: var(--mono); font-size: 11px; padding: 5px 8px; border-radius: 8px;
  background: rgba(11,11,15,0.7); backdrop-filter: blur(8px); color: var(--text);
}
.tag-pill:empty { display: none; }
.stamp {
  position: absolute; top: 24px; padding: 6px 12px; border: 3px solid currentColor; border-radius: 10px;
  font-weight: 800; font-size: 22px; letter-spacing: 0.06em; opacity: 0; pointer-events: none; background: rgba(11,11,15,0.35);
}
.stamp-crate { left: 20px; color: var(--accent); transform: rotate(-12deg); }
.stamp-pass { right: 20px; color: var(--hot); transform: rotate(12deg); }
.stamp-maybe { left: 50%; top: auto; bottom: 28px; color: var(--warm); transform: translateX(-50%); }
.swipe-hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); white-space: nowrap;
  font-size: 12px; padding: 6px 10px; border-radius: 99px; background: rgba(11,11,15,0.75); backdrop-filter: blur(8px); color: var(--text-2);
  animation: nudge 2.4s ease-in-out infinite;
}
@keyframes nudge { 0%, 100% { transform: translateX(-50%); } 50% { transform: translateX(calc(-50% + 6px)); } }

.info { margin: 16px 2px 10px; min-height: 64px; text-align: center; }
.info h3 { font-size: 21px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .artist { margin: 4px 0 0; font-size: 16px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .meta { margin: 4px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.blind:not(.revealed) .info h3,
.card.blind:not(.revealed) .info p { filter: blur(9px); user-select: none; }

.timeline { height: 6px; background: rgba(255,255,255,0.12); border-radius: 99px; cursor: pointer; position: relative; overflow: hidden; }
.timeline i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--text); border-radius: inherit; }
.times { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; }
.listened { color: var(--accent); }

.controls { display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: start; gap: 4px; margin-top: 12px; }
.transport { display: flex; align-items: center; gap: 6px; padding-top: 2px; }
.seek { position: relative; width: 38px; height: 38px; border: 0; background: transparent; color: var(--text-2); }
.seek small { position: absolute; font-size: 8px; font-weight: 700; font-family: var(--mono); top: 50%; left: 50%; transform: translate(-50%, -38%); }
.seek .i { width: 26px; height: 26px; stroke-width: 1.6; }
.play { position: relative; width: 76px; height: 76px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; padding: 0; }
.play::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--text); }
.play-ic { position: relative; width: 26px; height: 26px; color: var(--bg); }
.listen-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.listen-ring circle { fill: none; stroke-width: 4; }
.lr-bg { stroke: rgba(255,255,255,0.12); }
.lr-fg { stroke: var(--muted); stroke-linecap: round; stroke-dasharray: 257.6; stroke-dashoffset: 257.6; transition: stroke-dashoffset 0.4s linear, stroke 0.3s; }
.card.unlocked .lr-fg { stroke: var(--accent); }

.vote { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; }
.vote-ic {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-2); background: rgba(21,21,28,0.8); transition: transform 0.12s, background 0.2s, border-color 0.2s, opacity 0.2s;
}
.vote-ic .i { width: 24px; height: 24px; }
.vote:active .vote-ic { transform: scale(0.92); }
.vote-label { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.vote-label kbd { display: none; font-family: var(--mono); font-size: 10px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .vote-label kbd { display: inline; } }
.vote.pass .vote-ic { color: var(--text-2); }
.vote.maybe .vote-ic { color: var(--warm); }
.vote.crate .vote-ic { width: 64px; height: 64px; margin-top: -4px; color: var(--hot); border-color: var(--hot); }
.vote.maybe:not(.locked) .vote-ic { background: var(--warm-soft); border-color: var(--warm); }
.vote.crate:not(.locked) .vote-ic { background: var(--hot); color: #fff; box-shadow: 0 10px 30px -10px rgba(255, 92, 57, 0.7); }
.vote.locked .vote-ic { opacity: 0.45; }
.vote.locked .vote-label { color: var(--muted); }
.vote.shake .vote-ic { animation: shake 0.35s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.lock-hint { text-align: center; font-size: 13px; color: var(--muted); margin: 12px 0 0; min-height: 18px; }
.lock-hint b { color: var(--accent); font-weight: 600; }
.bc-link { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 8px; text-decoration: none; }
.bc-link .i { width: 14px; height: 14px; }
.bc-link:hover { color: var(--text); }
.card.blind:not(.revealed) .bc-link { visibility: hidden; }

.xp-float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.xp-float { position: absolute; font-family: var(--mono); font-weight: 600; font-size: 20px; color: var(--accent); text-shadow: 0 4px 20px rgba(0,0,0,0.6); animation: floatUp 1.1s ease-out forwards; }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -70px); } }

/* ---------- TRACCE DISCOGS (video YouTube) ---------- */
.yt-slot { position: absolute; inset: 0; background: #000; }
.yt-slot iframe, .yt-slot #yt-player { width: 100%; height: 100%; border: 0; display: block; }
.card.yt .art-wrap { cursor: default; touch-action: auto; }
.card.yt .tag-pill, .card.yt .stamp, .card.yt .swipe-hint, .card.yt #art { display: none; }

/* ---------- TEMPO & BPM ---------- */
.tempo { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.mt {
  flex: none; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent;
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--muted);
}
.mt.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.tempo input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }
.tempo-val { flex: none; min-width: 56px; background: none; border: 0; padding: 0; font-family: var(--mono); font-size: 12px; color: var(--text-2); text-align: right; }
.bpm-label { flex: none; min-width: 72px; text-align: right; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; }
.bpm-label small { display: block; font-size: 11px; font-weight: 400; color: var(--accent); }
.bpm-label.wait { color: var(--muted); font-weight: 400; }
.row-bpm { color: var(--text); font-weight: 600; font-family: var(--mono); font-size: 12px; }
.crate-item .ti b.row-bpm { display: inline; }
.tempo.off input, .tempo.off .mt, .tempo.off .tempo-val { opacity: 0.35; pointer-events: none; }

/* ---------- FINE SESSIONE ---------- */
.end-head { margin: 8px 0 20px; }
.end-head h1 { font-size: 38px; letter-spacing: -0.03em; }
.end-head p { color: var(--muted); line-height: 1.5; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.stat b { display: block; font-size: 21px; font-family: var(--mono); letter-spacing: -0.02em; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.hl b { color: var(--accent); }
.end-actions { display: grid; gap: 8px; }
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mini-list li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.mini-list img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.mini-list small { color: var(--muted); display: block; }

/* ---------- BORSA & LISTE ---------- */
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--warm-soft); border: 1px solid rgba(255, 197, 61, 0.35); color: var(--warm);
  border-radius: var(--r); padding: 8px 8px 8px 12px; margin-bottom: 10px; font-size: 13px;
}
.banner button { background: var(--warm); color: #1a1405; border: 0; border-radius: 9px; padding: 6px 10px; font-weight: 700; font-size: 13px; }
.crate-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 10px; }
.buy-summary { flex: 1 1 200px; margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.buy-summary b { color: var(--text); font-weight: 600; }
.toolbar-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 6px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.chip-group { display: flex; gap: 6px; flex: none; }
.chip-group + .chip-group { padding-left: 8px; border-left: 1px solid var(--line); }
.filter-row .chip { padding: 6px 12px; font-size: 13px; }

.crate-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.crate-item {
  display: grid; grid-template-columns: 56px 1fr; gap: 10px 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px;
}
.crate-item.bought { opacity: 0.6; }
.crate-item.bought:hover { opacity: 1; }
.crate-item img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.crate-item .ti { min-width: 0; }
.crate-item .ti b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crate-item .ti span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crate-item .art-mini { position: relative; width: 56px; height: 56px; }
.crate-item .art-mini img { width: 100%; height: 100%; }
.slot { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-2); background: none; color: var(--muted); }
.slot.on { background: var(--cool); border-color: var(--cool); color: #fff; }
.buy-row { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.buy {
  flex: 1; min-width: 0; height: 40px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px;
  background: var(--accent); color: var(--accent-ink); border-radius: 12px; text-decoration: none;
  font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden;
}
.buy small { font-weight: 500; opacity: 0.7; font-size: 12px; }
.bought .buy { background: var(--panel-2); color: var(--text); }
.rank { position: absolute; left: -6px; top: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: var(--text); color: var(--bg); font-family: var(--mono); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.rank.gold { background: var(--accent); color: var(--accent-ink); }
.votes-line { color: var(--hot) !important; font-weight: 600; }
.note { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 10px 10px 0; font-size: 14px; line-height: 1.4; }
.note small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }

.more { position: relative; flex: none; }
.more summary { list-style: none; cursor: pointer; }
.more summary::-webkit-details-marker { display: none; }
.more[open] summary { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.more-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 15; min-width: 240px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 6px; box-shadow: var(--shadow); display: grid;
}
.more-menu a, .more-menu button { display: block; text-align: left; background: none; border: 0; border-radius: 8px; padding: 10px; font-size: 14px; color: var(--text); text-decoration: none; }
.more-menu a:hover, .more-menu button:hover { background: var(--bg-2); }
.more-menu .danger { color: var(--hot); }

/* ---------- COMMUNITY ---------- */
.me-row { display: flex; align-items: center; gap: 12px; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--cool); color: #fff; font-weight: 700; font-size: 20px; text-transform: uppercase; }
.me-name { flex: 1; min-width: 0; }
.me-name small { display: block; font-size: 12px; color: var(--muted); }
.me-name b { display: block; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.me-stats div { background: var(--bg-2); border-radius: 10px; padding: 10px; }
.me-stats b { display: block; font-family: var(--mono); font-size: 20px; }
.me-stats span { font-size: 11px; color: var(--muted); }
#comm-tabs { margin-bottom: 12px; }
#scene-panel { margin-top: 20px; }
.h2-note { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.scene-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.scene-grid div { background: var(--bg-2); border-radius: 10px; padding: 10px 12px; }
.scene-grid b { display: block; font-family: var(--mono); font-size: 22px; }
.scene-grid span { font-size: 12px; color: var(--muted); }
.scene-grid em { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 6px; }
.spark-wrap { position: relative; margin-top: 14px; }
.spark-title { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 56px; border-bottom: 1px solid var(--line); }
.spark span { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; outline: none; }
.spark span i { display: block; width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.spark span.zero i { background: var(--line); }
.spark span:hover i, .spark span:focus-visible i { background: var(--text); }
.spark-tip { position: absolute; top: 0; transform: translate(-50%, -110%); pointer-events: none; white-space: nowrap; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 8px; font-family: var(--mono); font-size: 12px; box-shadow: var(--shadow); }

/* ---------- PROFILO ---------- */
.level-card { display: flex; gap: 16px; align-items: center; margin: 4px 0 16px; }
.level-card > div { flex: 1; }
.level-card h1 { font-size: 28px; letter-spacing: -0.02em; }
.level-card small { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.lvl-badge { display: grid; place-items: center; border-radius: 16px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-family: var(--mono); }
.lvl-badge.xl { width: 64px; height: 64px; font-size: 28px; }
.heat { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--panel-2); }
.heat i[data-l="1"] { background: rgba(198,255,61,0.25); }
.heat i[data-l="2"] { background: rgba(198,255,61,0.5); }
.heat i[data-l="3"] { background: rgba(198,255,61,0.75); }
.heat i[data-l="4"] { background: var(--accent); }
.heat i.today { outline: 1px solid var(--text); outline-offset: 1px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.badge { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; text-align: center; }
.badge .ic { font-size: 28px; display: block; margin-bottom: 6px; }
.badge b { font-size: 13px; display: block; }
.badge small { font-size: 11px; color: var(--muted); display: block; margin-top: 3px; line-height: 1.3; }
.badge.locked { opacity: 0.35; }
.badge.locked .ic { filter: grayscale(1); }
.badge.new { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 30px -8px var(--accent); }
.how summary { cursor: pointer; font-weight: 600; }
.how ul { color: var(--muted); line-height: 1.7; padding-left: 18px; margin: 10px 0 0; font-size: 14px; }
.how b { color: var(--accent); font-family: var(--mono); }
#rules-panel b { color: var(--text); font-family: var(--font); }
.backup h3 { font-size: 14px; margin: 18px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.code-box { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px dashed var(--accent); border-radius: 12px; padding: 12px; }
.code-box code { flex: 1; font-family: var(--mono); font-size: clamp(17px, 5vw, 22px); letter-spacing: 0.08em; color: var(--accent); }
.backup-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.backup-status { margin: 0; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.backup-status.err { color: var(--warm); }
.backup-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.file-btn { cursor: pointer; }
.dg-user { margin: 0 0 4px; }
.g-btn { min-height: 44px; margin: 12px 0 8px; }
.g-btn:empty::before { content: 'Carico il pulsante di Google…'; display: block; padding: 12px 0; font-size: 13px; color: var(--muted); }
#acct-inapp { margin: 12px 0 8px; }
#acct-name { overflow-wrap: anywhere; }
.dg-user b { color: var(--accent); }
.more-menu button:disabled { color: var(--muted); cursor: default; }

/* ---------- INSTALLA L'APP ---------- */
.install-card {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px;
  background: var(--panel); border: 1px solid rgba(198, 255, 61, 0.35); border-radius: var(--r-lg);
}
.install-card img { border-radius: 12px; flex: none; }
.install-text { flex: 1; min-width: 0; }
.install-text b { display: block; font-size: 15px; }
.install-text small { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.install-card .icon-btn { width: 32px; height: 32px; }
.install-entry { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.install-entry img { border-radius: 8px; flex: none; }
#install-sheet h2 { font-size: 24px; margin-bottom: 16px; }
.install-steps { margin: 0 0 20px; padding-left: 22px; display: grid; gap: 12px; color: var(--text-2); line-height: 1.5; }
.install-steps b { color: var(--text); }
.install-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- BARRA IN BASSO ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; gap: 4px;
  padding: 6px max(8px, calc((100vw - var(--col)) / 2)) calc(6px + env(safe-area-inset-bottom));
  background: rgba(13, 13, 18, 0.94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabs button {
  position: relative; flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; padding: 6px 4px; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600;
}
.tabs button .i { width: 22px; height: 22px; }
.tabs button.active { color: var(--text); }
.tabs button.active .i { color: var(--accent); }
.count { position: absolute; top: 2px; left: calc(50% + 6px); font-style: normal; font-family: var(--mono); font-size: 10px; background: var(--hot); color: #fff; border-radius: 99px; padding: 1px 5px; line-height: 1.4; }
.count:empty { display: none; }

/* ---------- LETTORE DELLA BORSA ---------- */
.pv-bar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 31;
  bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
  width: min(calc(100vw - 24px), calc(var(--col) - 16px));
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 8px 10px 6px; box-shadow: var(--shadow);
}
.pv-top { display: flex; align-items: center; gap: 6px; }
.pv-top img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--panel); flex: none; }
.pv-ti { flex: 1; min-width: 0; margin-left: 4px; }
.pv-ti b, .pv-ti small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-ti b { font-size: 14px; font-weight: 600; }
.pv-ti small { font-size: 12px; color: var(--muted); }
.pv-top .icon-btn { width: 36px; height: 36px; flex: none; }
.pv-top .icon-btn .i { width: 18px; height: 18px; }
.pv-play { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: grid; place-items: center; }
.pv-play .i { width: 18px; height: 18px; }
.pv-seek { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.pv-seek span { flex: none; min-width: 34px; }
.pv-seek span:last-child { text-align: right; }
#pv-range { flex: 1; min-width: 0; height: 22px; accent-color: var(--accent); background: none; }
body.has-pv main:not(.l-main) { padding-bottom: calc(var(--tabbar-h) + 124px + env(safe-area-inset-bottom)); }
body.has-pv .toasts { bottom: calc(var(--tabbar-h) + 104px + env(safe-area-inset-bottom)); }

/* ---------- MINI-PLAYER ---------- */
.mini-player {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 31;
  bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
  width: min(calc(100vw - 24px), calc(var(--col) - 16px)); display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 16px; padding: 8px; box-shadow: var(--shadow);
}
.mini-play { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: grid; place-items: center; }
.mini-play .i { width: 18px; height: 18px; }
.mini-info { flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 0; }
.mini-title { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-sub { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-cta { flex: none; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 14px; }

/* ---------- DIALOG SEGNALA ---------- */
.share-dialog { width: min(92vw, 440px); border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--panel); color: var(--text); padding: 20px; box-shadow: var(--shadow); }
.share-dialog::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); }
.share-track { display: flex; gap: 12px; align-items: center; margin: 4px 0 16px; }
.share-track img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--panel-2); }
.share-track b { display: block; }
.share-track span { display: block; color: var(--muted); font-size: 14px; }
.share-dialog label { font-size: 13px; font-weight: 600; }
.share-dialog label small { color: var(--muted); font-weight: 400; }
.share-dialog textarea { width: 100%; margin-top: 8px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--text); font: inherit; font-size: 15px; padding: 10px 12px; resize: vertical; }
.share-dialog textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.share-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- TOAST ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(92vw, 420px); }
body.has-mini .toasts { bottom: calc(var(--tabbar-h) + 84px + env(safe-area-inset-bottom)); }
body.immersive .toasts { bottom: calc(16px + env(safe-area-inset-bottom)); }
body.landing .toasts { bottom: calc(20px + env(safe-area-inset-bottom)); }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; font-size: 14px; animation: toastIn 0.3s cubic-bezier(.2,.8,.2,1); }
.toast.gold { border-color: var(--accent); }
.toast .ic { font-size: 22px; }
.toast small { display: block; color: var(--muted); font-size: 12px; }
.toast.out { animation: toastOut 0.3s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 400px) {
  .ring-wrap { width: 150px; height: 150px; }
  .vote-ic { width: 50px; height: 50px; }
  .vote.crate .vote-ic { width: 58px; height: 58px; }
  .play { width: 68px; height: 68px; }
}
@media (max-height: 720px) {
  .art-wrap { width: min(100%, 38vh); }
  .info { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Serie e missioni del giorno */
.streak-line { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.streak-line b { color: var(--hot); font-family: var(--mono); }
.streak-line.risk b { color: var(--warm); }
.quests { margin-top: 12px; }
.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.quest { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; }
.quest .q-ic { font-size: 20px; text-align: center; }
.quest b { display: block; font-size: 14px; font-weight: 500; }
.quest .q-bar { display: block; height: 4px; margin-top: 6px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.quest .q-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.3s; }
.quest .q-xp { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.quest.done b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.quest.done .q-xp { color: var(--accent); }
.heat i.frozen { outline: 1px dashed #7fd8ff; outline-offset: -2px; }
.card-btn { width: 100%; }
.card-preview { display: grid; place-items: center; margin: 12px 0; min-height: 120px; }
.card-preview img { width: min(260px, 70vw); aspect-ratio: 9 / 16; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-2); }
.card-preview img:not([src]) { display: none; }

/* Bandcamp Friday */
.bf-card {
  display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 12px 14px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(29, 160, 195, 0.22), rgba(29, 160, 195, 0.06)); border: 1px solid rgba(29, 160, 195, 0.55);
}
.bf-card.live { background: linear-gradient(135deg, rgba(29, 160, 195, 0.4), rgba(29, 160, 195, 0.12)); }
.bf-card > div { flex: 1; min-width: 0; }
.bf-card b { display: block; font-size: 15px; }
.bf-card small { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.bf-ic { font-size: 26px; }
.move-card { background: linear-gradient(135deg, rgba(198, 255, 61, 0.2), rgba(198, 255, 61, 0.05)); border-color: rgba(198, 255, 61, 0.5); }

/* Borsa condivisa */
.shared-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 14px; }
.shared-head .vavatar { width: 56px; height: 56px; }
.shared-head h1 { font-size: 26px; letter-spacing: -0.02em; line-height: 1.1; }
.shared-head small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.shared-actions { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.shared-actions .btn-primary, .shared-actions .btn-secondary { flex: 1; justify-content: center; }
.set-num { position: absolute; left: -6px; top: -6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; display: grid; place-items: center; }
.crate-share-done { margin: 12px 0; }
.crate-share-done code { display: block; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 14px; color: var(--accent); overflow-wrap: anywhere; margin-bottom: 8px; }
.shared-mine { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.shared-mine li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.shared-mine li span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shared-mine small { color: var(--muted); font-family: var(--mono); }

/* Amici e profili */
.me-public { margin-top: 12px; }
.who { background: none; border: 0; padding: 0; font: inherit; color: var(--text); font-weight: 600; cursor: pointer; }
.who:hover { color: var(--accent); }
.friends-line { color: var(--accent) !important; }
.crate-item .ti b.friends-line { display: inline; }
.friends-cta { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.friends-cta .cta { flex: 1; margin: 0; }
.list-title { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.digger-tags { margin: 0 0 6px; }
.digger-tags .chip { pointer-events: none; }
.tg-link { text-decoration: none; color: inherit; }
.tg-ic { font-size: 22px; width: 28px; text-align: center; }

/* Community: righe leggere */
.comm-item { grid-template-columns: 64px 1fr; }
.comm-item .art-mini { width: 64px; height: 64px; }
.comm-item .votes-line em { font-style: normal; font-weight: 400; color: var(--muted); }
.comm-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
.add-pill {
  height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--accent); background: var(--accent-soft);
  color: var(--accent); font-weight: 700; font-size: 14px; white-space: nowrap;
}
.add-pill:disabled { border-color: var(--line-2); background: none; color: var(--muted); cursor: default; }
.buy.buy-pill {
  flex: 0 1 auto; margin-left: auto; height: 40px; padding: 0 14px; border-radius: 99px;
  background: none; border: 1px solid var(--line-2); color: var(--text); font-weight: 600; font-size: 13px;
}
.buy.buy-pill:hover { border-color: var(--text); }

/* Borsa: ordinamento, analisi, stato vuoto */
.analyze-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px;
  border: 1px dashed var(--line-2); border-radius: var(--r); font-size: 13px; color: var(--muted);
}
.analyze-bar span { flex: 1; }
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 32px 16px; text-align: center; color: var(--muted); }
.empty-state p { margin: 0; max-width: 30ch; line-height: 1.5; }
.empty-art { width: 120px; height: 90px; fill: none; stroke: var(--line-2); stroke-width: 2; }
.empty-art .recs rect { fill: var(--panel-2); stroke: var(--accent); }

/* Scaletta */
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.set-actions .btn-primary { width: 100%; }
.set-empty { color: var(--muted); font-size: 14px; line-height: 1.5; }
.set-summary { display: grid; gap: 2px; margin: 16px 0 8px; }
.set-summary span { font-size: 13px; color: var(--muted); }
.set-curve { width: 100%; height: 70px; display: block; background: var(--bg-2); border-radius: 12px; border: 1px solid var(--line); }
.set-curve path { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.set-curve .target { stroke: var(--muted); stroke-dasharray: 4 4; }
.set-curve .actual { stroke: var(--accent); }
.set-curve circle { fill: var(--accent); }
.set-hint { margin: 8px 0 0; font-size: 12px; color: var(--warm); line-height: 1.45; }
.set-legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--muted); margin: 6px 0 10px; }
.set-legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--accent); margin-right: -8px; }
.set-legend i.target { border-top: 2px dashed var(--muted); }
.set-list { list-style: none; margin: 0; padding: 0; }
.set-row { display: grid; grid-template-columns: 44px 40px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.set-row img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--panel-2); }
.set-time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.set-ti { min-width: 0; }
.set-ti b, .set-ti small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-ti b { font-size: 14px; font-weight: 600; }
.set-ti small { font-size: 12px; color: var(--muted); }
.set-feat { font-family: var(--mono); font-size: 11px; color: var(--accent); text-align: right; white-space: nowrap; }
.set-tran { margin-left: 54px; padding: 1px 0; font-size: 11px; color: var(--muted); }
.set-tran.ok { color: var(--accent); }
.set-tran.warn { color: var(--warm); }

/* Marchio Digs: il disco che spunta dal cassone ("digging in the bins") */
.logo-mark .lg-bin, .logo-anim .lg-bin { stroke: var(--bg); }
.logo-mark .lg-handle, .logo-anim .lg-handle { fill: var(--bg); }
.logo-anim { color: var(--accent); overflow: visible; }
.logo-anim .lg-rec { transform-box: view-box; transform-origin: 50px 47px; animation: recRise 0.9s cubic-bezier(0.2, 0.9, 0.25, 1.25) both; }
.logo-anim .lg-shine { transform-box: view-box; transform-origin: 50px 47px; animation: spin 1.6s linear infinite; }
.loading .logo-anim .lg-rec { animation: recDig 1.3s ease-in-out infinite; } /* fruga: il disco entra ed esce dal cassone */
@keyframes recRise { from { transform: translateY(30px) scale(0.92); } to { transform: none; } }
@keyframes recDig { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(18px); } }
.intro .sheet-body { padding-top: 22px; }
.intro-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.intro-logo .logo-anim { width: 52px; height: 52px; }
.intro-logo .wordmark { font-size: 30px; }
.intro .lg-bin, .intro .lg-handle { stroke: var(--panel); }
.intro .lg-handle { fill: var(--panel); }

/* Avatar dei digger: un'etichetta di vinile generata dal nome */
.vavatar { flex: none; display: inline-block; vertical-align: -3px; border-radius: 50%; }
.avatar:has(.vavatar) { background: none; padding: 0; }
.votes-line .vavatar { margin: 0 3px 0 1px; }

.source-note { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--warm-soft); color: var(--warm); font-size: 13px; line-height: 1.4; }

/* Riduzione dello spazio (19/10) */
.chip-select { position: relative; display: inline-flex; align-items: center; gap: 4px; flex: none; padding-right: 26px !important; }
.chip-select select { appearance: none; -webkit-appearance: none; border: 0; background: none; color: inherit; font: inherit; padding: 0; outline: none; }
.chip-select::after { content: '▾'; position: absolute; right: 10px; font-size: 11px; color: var(--muted); pointer-events: none; }
.row-meta { display: flex !important; align-items: center; gap: 6px; }
.row-meta .slot { flex: none; }
.row-meta .row-txt { min-width: 0; flex: 1; }
.slot { font-size: 11px; padding: 1px 8px; }
.link-list { padding: 4px 12px; }
.link-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 0; background: none; border: 0;
  color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer;
}
.link-row + .link-row { border-top: 1px solid var(--line); }
.link-row[hidden] + .link-row { border-top: 0; }
.link-row > .i { width: 22px; height: 22px; color: var(--accent); flex: none; margin: 0 3px; }
.link-row img { border-radius: 7px; flex: none; }
.link-row > span:nth-of-type(1) { flex: 1; min-width: 0; }
.link-row b { display: block; font-size: 14px; font-weight: 600; }
.link-row small { display: block; font-size: 12px; color: var(--muted); }
.link-row > span:last-child { color: var(--accent); }
.badge-grid.compact { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; }
.badge.mini { padding: 8px 4px; font: inherit; color: inherit; cursor: pointer; }
.badge.mini .ic { font-size: 22px; margin-bottom: 2px; }
.badge.mini b { font-size: 10.5px; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.backup-more { margin-top: 12px; }
.backup-more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.backup-more[open] summary { margin-bottom: 10px; color: var(--text); }

/* Badge "Powered by Netlify" (iniettato da Netlify sul piano gratuito): copre la barra in basso.
   Netlify permette di toglierlo (Project configuration → General → Powered by Netlify badge). */
#nl-badge-frame { display: none !important; }
