:root {
  --bg: #0b0b0e;
  --surface: #15151a;
  --surface-2: #1d1d24;
  --line: #2a2a33;
  --text: #f4f2ee;
  --muted: #8e8d98;
  --accent: #e8ff47;
  --accent-ink: #0b0b0e;
  --good: #3dff9a;
  --bad: #ff4d6d;
  --gold: #ffc83d;
  --gold-2: #ff9f1c;
  --radius: 18px;
  --display: 'Anton', 'Impact', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before { /* grain discret */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
img { display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Barre du haut / navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(20px, calc((100vw - 1040px) / 2));
  background: rgba(11, 11, 14, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 24px; letter-spacing: .02em; }
.logo b { color: var(--accent); font-weight: 400; }
.logo-eq { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.logo-eq i { width: 4px; background: var(--accent); border-radius: 2px; animation: eq 1.1s ease-in-out infinite; }
.logo-eq i:nth-child(1) { height: 40%; animation-delay: -.2s; }
.logo-eq i:nth-child(2) { height: 100%; animation-delay: -.5s; }
.logo-eq i:nth-child(3) { height: 65%; animation-delay: -.8s; }
.logo-eq i:nth-child(4) { height: 30%; animation-delay: -.35s; }
@keyframes eq { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
.logo-eq i { transform-origin: bottom; }

.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px; color: var(--muted); font-weight: 700; font-size: 14px;
  transition: color .15s, background .15s;
}
.nav a svg { width: 18px; height: 18px; fill: currentColor; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--accent-ink); background: var(--accent); }
.nav .dot { position: absolute; top: 6px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--bg); }
.nav-avatar { display: none; width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin: -2px 0; }
.nav a.has-avatar svg { display: none; }
.nav a.has-avatar .nav-avatar { display: block; }
.nav a.active .nav-avatar { box-shadow: 0 0 0 2px var(--accent-ink); }

@media (max-width: 720px) {
  /* backdrop-filter crée un bloc conteneur : la nav « fixed » resterait collée à l'en-tête */
  .topbar { padding: 10px 16px; backdrop-filter: none; background: var(--bg); }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    justify-content: space-around; gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(17, 17, 21, .94); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .nav a { flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 11px; border-radius: 14px; flex: 1; }
  .nav a.active { background: transparent; color: var(--accent); }
  .nav a svg { width: 22px; height: 22px; }
  .nav .dot { right: calc(50% - 18px); }
  .nav a.has-avatar .nav-avatar { width: 24px; height: 24px; margin: -1px 0; }
  .nav a.active .nav-avatar { box-shadow: 0 0 0 2px var(--accent); }
  .app { padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
  body.playing .nav { display: none; }
}

/* ---------- Mise en page ---------- */
.app { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 24px 20px 64px; }
.page-enter { animation: pageIn .28s ease-out; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }

h1, h2, h3 { margin: 0; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: .01em; line-height: .95; text-transform: uppercase; }
.h-xl { font-size: clamp(44px, 9vw, 92px); }
.h-lg { font-size: clamp(34px, 6vw, 56px); }
.h-md { font-size: 26px; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-family: var(--display); font-weight: 400; font-size: 26px; text-transform: uppercase; letter-spacing: .02em; }
.count { color: var(--muted); font-weight: 700; font-size: 13px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-2 > .card + .card { margin-top: 0; }
@media (max-width: 820px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Boutons / champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); font-weight: 800; font-size: 14px; letter-spacing: .01em;
  transition: transform .12s, background .15s, border-color .15s, opacity .15s; white-space: nowrap;
}
.btn:hover { border-color: #3b3b46; background: #24242c; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #f1ff7a; border-color: #f1ff7a; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-xl { padding: 18px 34px; font-size: 18px; font-family: var(--display); font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

.input {
  width: 100%; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #5f5e68; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 255, 71, .15); }
.field { display: flex; gap: 10px; }
.field .input { flex: 1; }
.label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
.search {
  position: relative;
}
.search svg { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: var(--muted); }
.search .input { padding-left: 44px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
  font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap;
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Paliers de badges : 700 bronze, 800 argent, 900 or, 1000 légende ---------- */
.tier-700 { --t1: #f6c08f; --t2: #a35f2c; --tglow: rgba(214, 133, 66, .45); --tink: #2a1405; --tring: linear-gradient(135deg, #f6c08f, #a35f2c); }
.tier-800 { --t1: #ffffff; --t2: #8d97a7; --tglow: rgba(215, 225, 240, .38); --tink: #14171c; --tring: linear-gradient(135deg, #ffffff, #8d97a7); }
.tier-900 { --t1: #ffd866; --t2: #ff9f1c; --tglow: rgba(255, 200, 61, .5); --tink: #1a1200; --tring: linear-gradient(135deg, #ffd866, #ff9f1c); }
.tier-1000 {
  --t1: #ffc83d; --t2: #ff6bd6; --tglow: rgba(255, 170, 120, .55); --tink: #1a1200;
  --tring: conic-gradient(from 210deg, #ffc83d, #e8ff47, #3dffd0, #7aa2ff, #ff6bd6, #ffc83d);
}

/* ---------- Pseudo + badge ---------- */
.uname { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; min-width: 0; }
.uname > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-mini {
  position: relative; flex: none; width: 22px; height: 22px; border-radius: 50%;
  padding: 2px; background: var(--tring, linear-gradient(135deg, var(--gold), var(--gold-2)));
  box-shadow: 0 0 10px var(--tglow, rgba(255, 200, 61, .45));
}
.badge-mini img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--bg); }
.badge-mini.lg { width: 34px; height: 34px; padding: 3px; }
.badge-count { font-size: 11px; font-weight: 800; color: var(--gold); }

/* Médaille ronde (page artiste, profil) */
.medal-wrap { position: relative; display: inline-block; }
.medal {
  display: block; width: 64px; height: 64px; border-radius: 50%; padding: 3px;
  background: var(--tring, linear-gradient(135deg, var(--gold), var(--gold-2)));
  box-shadow: 0 6px 22px var(--tglow, rgba(255, 159, 28, .28));
}
.medal img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); background: var(--surface-2); }
.medal.lg { width: 84px; height: 84px; padding: 4px; }
.medal.locked { filter: grayscale(1) brightness(.4); box-shadow: none; }
.medal-wrap .lock { position: absolute; inset: 0; display: grid; place-items: center; }
.medal-wrap .lock svg { width: 22px; height: 22px; fill: rgba(255, 255, 255, .8); }
.medal-wrap .feat { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; border: 3px solid var(--bg); }
.medal-wrap .feat svg { width: 12px; height: 12px; fill: currentColor; }

.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--display); font-size: 18px; color: #0b0b0e;
}
img.avatar { object-fit: cover; background: var(--surface-2); }
.avatar.xl { width: 88px; height: 88px; font-size: 42px; }
.avatar-box { position: relative; flex: none; }
.avatar-edit {
  position: absolute; right: -4px; bottom: -4px; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: 3px solid var(--bg);
  transition: transform .12s;
}
.avatar-edit:hover { transform: scale(1.08); }
.avatar-edit svg { width: 16px; height: 16px; fill: currentColor; }
.avatar-box.busy .avatar { opacity: .35; }
.avatar-box.busy::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%; border: 3px solid var(--accent); border-right-color: transparent; animation: spin .7s linear infinite;
}
.avatar-actions { display: flex; gap: 14px; margin-top: 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }

/* ---------- Accueil ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 26px; }
.hero p { margin: 12px 0 0; color: var(--muted); font-size: 16px; max-width: 520px; }
.hero .rules { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.rule { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }
.rule b { color: var(--accent); }
@media (max-width: 720px) { .hero { grid-template-columns: 1fr; } }

.toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; position: sticky; top: 61px; z-index: 5; padding: 12px 0; background: linear-gradient(var(--bg) 70%, transparent); }
@media (max-width: 720px) { .toolbar { top: 55px; } }

.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
@media (max-width: 480px) { .artist-grid { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; } }
.artist-card { position: relative; display: block; min-width: 0; }
.artist-card .pic {
  position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2);
  transition: transform .2s;
}
.artist-card .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.artist-card:hover .pic img { transform: scale(1.06); }
.artist-card .pic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0, 0, 0, .55)); }
.artist-card .play {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s;
}
.artist-card .play svg { width: 18px; height: 18px; fill: currentColor; margin-left: 2px; }
.artist-card:hover .play { opacity: 1; transform: none; }
.artist-card .name { margin-top: 9px; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-card .meta { font-size: 12px; color: var(--muted); font-weight: 600; }
.artist-card .score-tag {
  position: absolute; left: 8px; top: 8px; z-index: 2; padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 800; background: rgba(11, 11, 14, .78); backdrop-filter: blur(6px);
}
.artist-card .crown {
  position: absolute; left: 8px; top: 8px; z-index: 2; padding: 3px 9px 3px 7px; border-radius: 999px;
  display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: #1a1200;
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); box-shadow: 0 4px 14px rgba(255, 159, 28, .35);
}
.crown svg { width: 13px; height: 13px; fill: currentColor; }
.artist-card .score-tag[class*="tier-"] { background: var(--tring); color: var(--tink); box-shadow: 0 4px 14px var(--tglow); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Page artiste ---------- */
.artist-hero { position: relative; border-radius: 26px; overflow: hidden; padding: 30px; min-height: 300px; display: flex; align-items: flex-end; isolation: isolate; }
.artist-hero .bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 25%; filter: saturate(1.1); }
.artist-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(11, 11, 14, .1), rgba(11, 11, 14, .55) 50%, rgba(11, 11, 14, .96)); }
.artist-hero .inner { width: 100%; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.artist-hero .facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.artist-hero .facts span { padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, .1); backdrop-filter: blur(8px); font-size: 13px; font-weight: 700; }
@media (max-width: 720px) { .artist-hero { padding: 22px; min-height: 340px; } .artist-hero .btn-xl { width: 100%; } }

.mystats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .v { font-family: var(--display); font-size: 34px; line-height: 1; }
.stat .k { margin-top: 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat.gold { border-color: rgba(255, 200, 61, .4); background: linear-gradient(135deg, rgba(255, 200, 61, .14), rgba(255, 159, 28, .05)); }
.stat.gold .v { color: var(--gold); }
.mystats.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .mystats { grid-template-columns: repeat(2, 1fr); } .mystats .stat:last-child { grid-column: span 2; } .mystats.four { grid-template-columns: repeat(2, 1fr); } .mystats.four .stat:last-child { grid-column: auto; } }

.board { display: flex; flex-direction: column; }
.board-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.board-row:last-child { border-bottom: 0; }
.board-row .rk { font-family: var(--display); font-size: 20px; color: var(--muted); text-align: center; }
.board-row.top1 .rk { color: var(--gold); }
.board-row.top2 .rk { color: #d7dbe4; }
.board-row.top3 .rk { color: #e29a62; }
.board-row.me { background: rgba(232, 255, 71, .06); border-radius: 12px; }
.board-row .sc { text-align: right; font-family: var(--display); font-size: 22px; line-height: 1; }
.board-row .sc small { display: block; font-family: var(--body); font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 3px; }
.board-row .sc.perfect { color: var(--gold); }
/* Les 4 badges d'un artiste */
.ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.rung {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0;
  padding: 14px 6px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg);
  text-align: center; transition: border-color .15s, transform .15s;
}
.rung .medal-wrap { width: 100%; max-width: 78px; }
.rung .medal { width: 100%; height: auto; aspect-ratio: 1; padding: 4px; }
.rung .nm { margin-top: 7px; font-weight: 800; font-size: 14px; color: var(--t1); }
.rung .sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.rung.locked { cursor: default; }
.rung.locked .nm { color: var(--muted); }
.rung.got:hover { border-color: var(--t2); transform: translateY(-2px); }
.rung.on { border-color: var(--accent); background: rgba(232, 255, 71, .05); }
.ladder-hint { margin: 14px 0 0; font-size: 13px; font-weight: 600; }
.ladder-album { margin: 4px 0 0; font-size: 12px; font-weight: 600; }
.ladder-album b { color: var(--text); }
@media (max-width: 520px) { .rung { padding: 12px 4px 10px; } .rung .sub { font-size: 11px; } }

.tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.tabs button { padding: 7px 14px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 13px; }
.tabs button.on { background: var(--surface-2); color: var(--text); }

/* ---------- Jeu ---------- */
body.playing .topbar { display: none; }
.game { max-width: 620px; margin: 0 auto; min-height: calc(100vh - 48px); display: flex; flex-direction: column; }
.game-top { display: flex; align-items: center; gap: 12px; }
.game-top .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.game-top .who img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.game-top .who b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-top .who small { color: var(--muted); font-weight: 700; font-size: 12px; }
.game-score { margin-left: auto; text-align: right; }
.vol + .game-score { margin-left: 6px; }
.icon-btn.off { color: var(--muted); }

/* Volume */
.vol { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.vol input[type="range"] { -webkit-appearance: none; appearance: none; width: 96px; height: 24px; margin: 0; background: transparent; cursor: pointer; }
.vol input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--accent) var(--v, 100%), var(--surface-2) var(--v, 100%)); }
.vol input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; border: 0; background: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.vol input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--surface-2); }
.vol input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.vol input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; border: 0; background: var(--text); }
.vol input[type="range"].off::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--muted) var(--v, 100%), var(--surface-2) var(--v, 100%)); }
.vol input[type="range"].off::-moz-range-progress { background: var(--muted); }
@media (max-width: 440px) { .vol { gap: 4px; } .vol input[type="range"] { width: 62px; } .game-top { gap: 8px; } }

/* Cover floutée de l'album en fond pendant la partie */
.game-bg {
  position: fixed; inset: -80px; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center; filter: blur(50px) saturate(1.4);
  opacity: 0; transition: opacity .6s;
}
.game-bg.on { opacity: .3; }
.game-score .v { font-family: var(--display); font-size: 30px; line-height: 1; }
.game-score small { display: block; font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: .06em; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); flex: none; }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

.progress { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin: 18px 0 0; }
.progress i { height: 6px; border-radius: 3px; background: var(--surface-2); transition: background .3s; }
.progress i.cur { background: var(--text); animation: pulse 1s ease-in-out infinite; }
.progress i.ok { background: var(--good); }
.progress i.ko { background: var(--bad); }
.progress i.perfect { background: var(--accent); }
@keyframes pulse { 50% { opacity: .45; } }

.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 26px 0 18px; }
.timer { position: relative; width: 210px; height: 210px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .track { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.timer .bar { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; transition: stroke .3s; }
.timer.warn .bar { stroke: var(--gold-2); }
.timer.danger .bar { stroke: var(--bad); }
.timer .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer .secs { font-family: var(--display); font-size: 74px; line-height: 1; font-variant-numeric: tabular-nums; }
.timer .pot { margin-top: 4px; font-size: 13px; font-weight: 800; color: var(--accent); letter-spacing: .04em; }
.eqbars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 26px; margin-top: 18px; }
.eqbars i { width: 5px; height: 100%; border-radius: 3px; background: var(--muted); transform-origin: bottom; transform: scaleY(.2); }
.eqbars.on i { background: var(--accent); animation: eq .9s ease-in-out infinite; }
.eqbars.on i:nth-child(2n) { animation-duration: .7s; }
.eqbars.on i:nth-child(3n) { animation-duration: 1.15s; }
.eqbars.on i:nth-child(5n) { animation-duration: .8s; animation-delay: -.3s; }

/* Chrono, puis cover de l'album à la réponse */
.disc { position: relative; width: 210px; height: 210px; }
.disc .timer { transition: opacity .2s, transform .3s; }
.disc .cover {
  position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: var(--surface-2);
  border: 3px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  opacity: 0; transform: scale(.6) rotate(-6deg); pointer-events: none;
  transition: opacity .2s, transform .45s cubic-bezier(.2, 1.3, .4, 1), border-color .2s;
}
.disc .cover img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.disc .cover img.ready { opacity: 1; }
.disc.flip .timer { opacity: 0; transform: scale(.85); }
.disc.flip .cover { opacity: 1; transform: none; }
.disc .cover.ok { border-color: var(--good); box-shadow: 0 18px 50px rgba(61, 255, 154, .22); }
.disc .cover.perfect { border-color: var(--accent); box-shadow: 0 18px 50px rgba(232, 255, 71, .25); }
.disc .cover.ko { border-color: var(--bad); box-shadow: 0 18px 50px rgba(255, 77, 109, .2); }

.reveal { min-height: 64px; margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 12px; text-align: center; opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
.reveal .a .alb::after { content: ' · '; }
.reveal.show { opacity: 1; transform: none; }
.reveal img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.reveal .t { font-weight: 800; font-size: 16px; }
.reveal .a { color: var(--muted); font-size: 13px; font-weight: 600; }
.reveal .pts { font-family: var(--display); font-size: 34px; margin-left: 8px; }
.reveal .pts.ok { color: var(--good); }
.reveal .pts.ko { color: var(--bad); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .choices { grid-template-columns: 1fr; } }
.choice {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 64px;
  padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface);
  text-align: left; font-weight: 800; font-size: 16px; line-height: 1.2;
  transition: transform .1s, border-color .15s, background .15s, opacity .2s;
}
.choice { padding: 10px 14px 10px 10px; min-height: 80px; }
.choice .cvw { position: relative; flex: none; width: 60px; height: 60px; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.choice .cv { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.choice .cv.on { opacity: 1; }
.choice .k { position: absolute; right: 3px; bottom: 3px; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: rgba(11, 11, 14, .8); color: var(--text); font-size: 11px; }
.choice:hover:not(:disabled) { border-color: var(--text); }
.choice:active:not(:disabled) { transform: scale(.98); }
.choice:disabled { cursor: default; }
.choice.dim { opacity: .35; }
.choice.good { border-color: var(--good); background: rgba(61, 255, 154, .12); }
.choice.good .k { background: var(--good); color: #062; }
.choice.bad { border-color: var(--bad); background: rgba(255, 77, 109, .12); animation: shake .35s; }
.choice.bad .k { background: var(--bad); color: #fff; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.choices.hidden-choices .choice { visibility: hidden; }

.overlay-center { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(11, 11, 14, .86); backdrop-filter: blur(6px); }
.countdown { font-family: var(--display); font-size: 180px; line-height: 1; color: var(--accent); animation: pop .9s ease-out both; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: .9; } }
.loading-box { text-align: center; width: min(360px, 86vw); }
.loading-box .bar { margin-top: 16px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.loading-box .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }

/* ---------- Fin de partie ---------- */
.result { text-align: center; padding-top: 10px; }
.result .big { font-family: var(--display); font-size: clamp(110px, 26vw, 180px); line-height: .9; font-variant-numeric: tabular-nums; }
.result .big.perfect { background: linear-gradient(135deg, var(--gold), var(--gold-2) 60%, #fff3c4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result .out { font-family: var(--display); font-size: 30px; color: var(--muted); }
.result .verdict { margin-top: 10px; font-family: var(--display); font-size: 30px; text-transform: uppercase; letter-spacing: .03em; }
.result .pills { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.result .pills span { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 800; }
.result .pills .hot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.result .pills .tier-pill { background: var(--tring); color: var(--tink); border-color: transparent; }
.result .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.recap { margin-top: 30px; text-align: left; }
.recap-row { display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.recap-row .n { color: var(--muted); font-weight: 800; font-size: 13px; text-align: center; }
.recap-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.recap-row .t { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap-row .a { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap-row .p { font-family: var(--display); font-size: 22px; text-align: right; }
.recap-row .p small { display: block; font-family: var(--body); font-size: 11px; color: var(--muted); font-weight: 700; }
.recap-row .p.ok { color: var(--good); }
.recap-row .p.ko { color: var(--bad); }

.badge-unlock { text-align: center; padding: 30px; max-width: 440px; }
.badge-unlock .medal-big {
  width: 190px; height: 190px; margin: 0 auto; border-radius: 50%; padding: 8px;
  background: var(--tring, conic-gradient(from 0deg, var(--gold), var(--gold-2), #fff3c4, var(--gold), var(--gold-2), var(--gold)));
  box-shadow: 0 0 60px var(--tglow, rgba(255, 200, 61, .55)); animation: medal .9s cubic-bezier(.2, 1.4, .4, 1) both, spin 8s linear infinite .9s;
}
.badge-unlock .medal-big img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); animation: spin 8s linear infinite reverse .9s; }
@keyframes medal { from { transform: scale(0) rotate(-120deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.badge-unlock .tier-name {
  display: inline-block; margin-top: 22px; padding: 5px 12px; border-radius: 999px;
  background: var(--tring); color: var(--tink); font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
}
.badge-unlock h2 { margin-top: 12px; font-family: var(--display); font-weight: 400; font-size: 40px; text-transform: uppercase; color: var(--t1, var(--gold)); line-height: 1; }
.badge-unlock p { color: var(--muted); margin: 10px 0 22px; }
.badge-unlock .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Amis / profil ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.feed-row .art { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.feed-row .sc { font-family: var(--display); font-size: 22px; }
.feed-row .sc.perfect { color: var(--gold); }
.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 10; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.suggest-list button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 14px; border: 0; background: transparent; text-align: left; }
.suggest-list button:hover { background: #2a2a33; }

.profile-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-head .who { flex: 1 1 200px; min-width: 0; }
.profile-head .uname { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 7vw, 52px); text-transform: none; letter-spacing: .01em; gap: 12px; }
.equipped { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 18px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.equipped .grow { flex: 1; min-width: 0; }
.equipped .sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 20px 12px; }
.badge-tile { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; background: none; border: 0; padding: 0; }
.badge-tile .medal { transition: transform .15s; }
.badge-tile .nm { max-width: 100%; margin-top: 8px; font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-tile .tl { font-size: 11px; font-weight: 800; color: var(--t1); }
.badge-tile .pips { display: flex; gap: 4px; margin-top: 5px; }
.badge-tile .pips i { width: 7px; height: 7px; border-radius: 50%; background: var(--surface-2); }
.badge-tile .pips i.got { background: var(--tring); }
button.badge-tile:hover .medal { transform: translateY(-2px); }

/* ---------- Auth ---------- */
.auth { min-height: calc(100vh - 80px); display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; gap: 24px; min-height: auto; padding-top: 10px; } }
.auth .pitch .logo { font-size: 30px; margin-bottom: 26px; }
.auth .pitch p { color: var(--muted); font-size: 17px; max-width: 460px; }
.auth .steps { margin-top: 22px; display: grid; gap: 10px; }
.auth .steps div { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.auth .steps b { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); font-family: var(--display); font-weight: 400; font-size: 17px; }
.auth form .btn { width: 100%; margin-top: 18px; }
.err { color: var(--bad); font-weight: 700; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- Import ---------- */
.import-result { margin-top: 16px; }
.mini-artists { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mini-artist { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 700; }
.mini-artist img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(420px, 92vw); }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); animation: pageIn .2s ease-out; }
.toast.error { border-color: rgba(255, 77, 109, .5); }
.toast.success { border-color: rgba(61, 255, 154, .4); }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
