:root {
  --bg: #12081f;
  --bg-2: #1b0f2e;
  --card: rgba(255, 255, 255, 0.055);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #f6f0ff;
  --muted: #a797c2;
  --pink: #ff3d8b;
  --violet: #8a3ffc;
  --grad: linear-gradient(135deg, var(--pink) 0%, #c238e6 50%, var(--violet) 100%);
  --good: #3ee0a1;
  --bad: #ff5c7a;
  --radius: 18px;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: radial-gradient(120% 80% at 50% -10%, #2a1147 0%, var(--bg) 60%);
  overflow-x: hidden;
}

.glow {
  position: fixed;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}
.glow-a { background: var(--pink); top: -30vmax; left: -25vmax; }
.glow-b { background: var(--violet); bottom: -30vmax; right: -25vmax; }

.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 0.95rem; }

main {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: screen-in 0.35s ease;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

h1, h2 { margin: 0; }
h2 { font-size: 1.1rem; font-weight: 800; }
.title { font-size: 1.6rem; font-weight: 900; }
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

/* ------------------------------------------------------------ Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(18, 8, 31, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}
.topbar-code { font-size: 0.85rem; color: var(--muted); }
.topbar-code strong { color: var(--text); letter-spacing: 0.12em; font-size: 1rem; }
.topbar-round { flex: 1; min-width: 0; font-size: 0.85rem; color: var(--muted); text-align: center; }

.timer { position: relative; flex: none; width: 48px; height: 48px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4; }
.timer-track { stroke: rgba(255, 255, 255, 0.1); }
.timer-bar {
  stroke: var(--pink);
  stroke-linecap: round;
  stroke-dasharray: 119.38;
  transition: stroke 0.3s;
}
.timer span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.timer.danger .timer-bar { stroke: var(--bad); }
.timer.danger { animation: pulse 1s ease-in-out infinite; }
.timer.danger span { color: var(--bad); }
@keyframes pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
  50% { transform: scale(1.12); filter: drop-shadow(0 0 10px rgba(255, 92, 122, 0.8)); }
}

/* ------------------------------------------------------------ Accueil */
.brand { text-align: center; padding: 28px 0 8px; }
.brand h1 {
  font-size: clamp(2rem, 9.5vw, 3rem);
  overflow-wrap: anywhere;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.brand h1 span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tagline { color: var(--muted); margin: 10px 0 0; }
.brand-disc {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--bg) 0 9%, transparent 10%),
    radial-gradient(circle, transparent 0 30%, rgba(0,0,0,0.25) 31% 32%, transparent 33% 45%, rgba(0,0,0,0.25) 46% 47%, transparent 48%),
    var(--grad);
  box-shadow: 0 10px 40px rgba(255, 61, 139, 0.45);
  animation: spin 6s linear infinite;
}

/* ------------------------------------------------------------ Composants */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; }

.label { font-weight: 600; font-size: 0.9rem; color: var(--muted); }

.input {
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 61, 139, 0.2); }
.input::placeholder { color: #6f5f8c; }
.input-code { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 800; text-align: center; }

.row { display: flex; gap: 10px; }
.row .input { flex: 1; }

.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--grad); box-shadow: 0 8px 28px rgba(194, 56, 230, 0.35); }
.btn-ghost { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--card-border); }
.btn-small { padding: 10px 14px; font-size: 0.9rem; }
.btn-link { background: none; color: var(--muted); font-weight: 600; font-size: 0.9rem; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--card-border); }

.error { color: var(--bad); margin: 0; min-height: 1.2em; font-size: 0.92rem; }

/* ------------------------------------------------------------ Lobby */
.big-code {
  font-size: clamp(3.2rem, 18vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  text-align: center;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
#screen-lobby .eyebrow:first-child { text-align: center; margin-top: 12px; }
.invite { display: flex; gap: 8px; }
.invite .input { font-size: 0.85rem; padding: 10px 12px; color: var(--muted); }

.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.player-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  animation: screen-in 0.3s ease;
}
.avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: #fff;
}
.player-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.tag-host { background: rgba(255, 61, 139, 0.18); color: #ff9cc4; }

/* ------------------------------------------------------------ Pick */
.search { position: relative; }
.search .input { padding-right: 46px; }
.spinner {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--pink);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
}
.track.is-picked { border-color: var(--pink); background: rgba(255, 61, 139, 0.1); }
.track img { flex: none; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #2a1a40; }
.track-meta { flex: 1; min-width: 0; }
.track-meta .t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta .a { color: var(--muted); font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn.playing { background: var(--grad); border-color: transparent; }
.pick-btn { padding: 10px 14px; font-size: 0.88rem; border-radius: 12px; }

.my-pick {
  padding: 12px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 61, 139, 0.22), rgba(138, 63, 252, 0.22));
  border: 1px solid rgba(255, 61, 139, 0.45);
  display: flex;
  align-items: center;
  gap: 12px;
}
.my-pick img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }
.my-pick .eyebrow { color: #ffb3d1; }

.chips-wrap { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.25s;
}
.chip .avatar { width: 22px; height: 22px; font-size: 0.7rem; }
.chip.done { color: var(--text); border-color: rgba(62, 224, 161, 0.5); background: rgba(62, 224, 161, 0.12); }
.chip .count { font-variant-numeric: tabular-nums; opacity: 0.8; }
.chip.done .count { color: var(--good); opacity: 1; }

/* ------------------------------------------------------------ Guess */
.vinyl-wrap { display: grid; place-items: center; padding: 8px 0; }
.vinyl {
  position: relative;
  width: min(68vw, 280px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 14px;
  background:
    repeating-radial-gradient(circle, #111 0 2px, #1c1c1c 2px 4px);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05), 0 20px 60px rgba(255, 61, 139, 0.35), 0 0 80px rgba(138, 63, 252, 0.3);
  animation: spin 8s linear infinite;
  animation-play-state: paused;
}
.vinyl.playing { animation-play-state: running; }
.vinyl img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: #2a1a40; }
.vinyl::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14%;
  height: 14%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15);
}

.track-info { text-align: center; }
.track-title { font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.track-artist { color: var(--muted); margin-top: 2px; }

.vote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.vote-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  transition: all 0.15s;
}
.vote-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-btn:active { transform: scale(0.97); }
.vote-btn:disabled { cursor: default; }
.vote-btn:disabled:not(.selected) { opacity: 0.4; }
.vote-btn:disabled:active { transform: none; }
.vote-btn.selected { border-color: var(--pink); background: rgba(255, 61, 139, 0.18); box-shadow: 0 0 24px rgba(255, 61, 139, 0.3); }

.notice {
  text-align: center;
  padding: 22px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px dashed rgba(255, 61, 139, 0.5);
}
.notice strong { display: block; font-size: 1.3rem; font-weight: 900; }
.notice span { color: var(--muted); }

/* ------------------------------------------------------------ Reveal */
.reveal-head { display: flex; align-items: center; gap: 14px; }
.reveal-cover { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.reveal-head .track-title { font-size: 1.1rem; }
.reveal-owner {
  text-align: center;
  padding: 20px 16px;
  border-radius: var(--radius);
  background: var(--grad);
  box-shadow: 0 12px 40px rgba(194, 56, 230, 0.4);
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.reveal-owner small { display: block; font-weight: 600; opacity: 0.85; }
.reveal-owner strong { display: block; font-size: 1.8rem; font-weight: 900; overflow-wrap: anywhere; }
.reveal-owner em { font-style: normal; font-weight: 700; }
@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.vote-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.vote-list li { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.vote-list .who { font-weight: 700; }
.vote-list .arrow { color: var(--muted); }
.vote-list .ok { color: var(--good); font-weight: 800; margin-left: auto; white-space: nowrap; }
.vote-list .ko { color: var(--bad); font-weight: 800; margin-left: auto; white-space: nowrap; }

.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ranking li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.ranking li.me { outline: 1px solid rgba(255, 61, 139, 0.6); }
.rank { width: 26px; text-align: center; font-weight: 900; color: var(--muted); }
.score { font-weight: 900; font-variant-numeric: tabular-nums; }
.gain { color: var(--good); font-weight: 800; font-size: 0.85rem; animation: pop 0.5s ease; }

.ranking-final li { padding: 14px; }
.ranking-final li:nth-child(1) { background: linear-gradient(135deg, rgba(255, 196, 61, 0.25), rgba(255, 61, 139, 0.2)); }
.ranking-final li:nth-child(1) .rank { color: #ffc43d; font-size: 1.3rem; }
.ranking-final li:nth-child(2) .rank { color: #d9d2e9; }
.ranking-final li:nth-child(3) .rank { color: #e0a070; }
.ranking-final li:nth-child(2), .ranking-final li:nth-child(3) { background: rgba(255, 255, 255, 0.08); }

/* ------------------------------------------------------------ Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: #2b1846;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ Icônes */
.icon-btn svg { width: 18px; height: 18px; display: block; }
.icon-btn-small { width: 36px; height: 36px; }
.icon-btn:focus-visible, .btn:focus-visible, .vote-btn:focus-visible, .rules-fab:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

/* ------------------------------------------------------------ Volume */
.volume { position: relative; flex: none; }
.volume.muted-vol #volumeWaves { opacity: 0.25; }
.volume-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 220px;
  padding: 14px;
  border-radius: 14px;
  background: #241338;
  border: 1px solid var(--card-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.volume-pop .label { display: flex; justify-content: space-between; }
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink) 0 var(--fill, 50%), rgba(255, 255, 255, 0.15) var(--fill, 50%));
  outline: none;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* ------------------------------------------------------------ Réglages de la partie */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-row p { margin: 2px 0 0; }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper output { min-width: 32px; text-align: center; font-size: 1.4rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.stepper .icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper .icon-btn { font-size: 1.3rem; font-weight: 800; }

/* ------------------------------------------------------------ Mes choix */
.my-picks { display: flex; flex-direction: column; gap: 8px; }
.pick-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 61, 139, 0.2), rgba(138, 63, 252, 0.2));
  border: 1px solid rgba(255, 61, 139, 0.45);
}
.pick-slot img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; }
.pick-slot.empty {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: var(--muted);
  min-height: 66px;
  padding-left: 16px;
  font-weight: 600;
}
.slot-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
}

/* ------------------------------------------------------------ Délibération */
.deliberate {
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255, 196, 61, 0.1);
  border: 1px solid rgba(255, 196, 61, 0.45);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: pop 0.4s ease;
}
.deliberate strong { font-size: 1.15rem; font-weight: 900; color: #ffd57a; }
.deliberate span { color: var(--muted); font-size: 0.92rem; }
.tally { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tally li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 0.9rem; font-weight: 600; }
.tally .bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.tally .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffc43d, var(--pink)); border-radius: inherit; transition: width 0.3s; }

/* ------------------------------------------------------------ Règles */
.rules-fab {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 15;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--grad);
  color: #fff;
  font: inherit;
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(194, 56, 230, 0.45);
  transition: transform 0.15s;
}
.rules-fab:active { transform: scale(0.94); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 3, 15, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: screen-in 0.2s ease;
}
.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px;
  border-radius: 22px;
  background: #1d0f30;
  border: 1px solid var(--card-border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rules { margin: 0; padding: 0 0 0 1.3em; display: flex; flex-direction: column; gap: 12px; line-height: 1.45; }
.rules li::marker { color: var(--pink); font-weight: 900; }
.rules strong { color: var(--text); }
.rules li { color: #d7cbe9; }

@media (min-width: 560px) {
  .modal { align-items: center; }
}

@media (min-width: 560px) {
  main { padding-top: 28px; }
  .vote-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}
#homeStatus:empty { display: none; }

/* ------------------------------------------------------------ Tuto (tuto.html) */
.tuto main { display: flex; flex-direction: column; gap: 28px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.tuto a:not(.btn) { color: #ff9cc4; text-underline-offset: 3px; }
.tuto .btn { display: inline-flex; justify-content: center; text-decoration: none; }
.tuto-head { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding-top: 8px; }
.tuto-head .btn { align-self: flex-start; }
.tuto-head h1 { font-size: clamp(2rem, 9vw, 2.8rem); font-weight: 900; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tuto-head h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tuto-head .tagline { margin: 0; }

.tuto-toc ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.tuto-toc li::marker { color: var(--pink); font-weight: 900; }

.tuto-section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 16px; }
.tuto-section > p, .phase p, .steps p, .role p, .faq p { margin: 0; line-height: 1.5; color: #d7cbe9; }
.tuto-section strong { color: var(--text); }
.tuto-section .title { display: flex; align-items: center; gap: 12px; font-size: 1.35rem; }
.step-num {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--grad);
  font-size: 1.05rem;
  box-shadow: 0 6px 20px rgba(194, 56, 230, 0.35);
}

.role-grid { display: grid; gap: 12px; }
@media (min-width: 560px) { .role-grid { grid-template-columns: 1fr 1fr; } }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
}
.steps .btn { align-self: flex-start; }

/* Aperçus d'écrans : décoratifs, non cliquables. */
.mock { pointer-events: none; user-select: none; }
.mock.card { gap: 10px; }
.mock .input, .mock .btn { display: block; }
.mock .btn { text-align: center; align-self: stretch; }
.mock .row .input { flex: 1; }
.mock-lobby { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.mock-lobby .eyebrow { text-align: center; }
.mock-lobby .big-code { font-size: 3rem; }
.mock-lobby .invite .input { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock-smartscreen {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 6px;
  background: #0f5ea8;
  color: #fff;
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.mock-smartscreen strong { font-size: 1.05rem; font-weight: 600; }
.mock-link { text-decoration: underline; font-size: 0.9rem; }
.mock-winbtn { align-self: flex-end; padding: 6px 16px; border: 1px solid rgba(255, 255, 255, 0.8); font-size: 0.9rem; }

.tip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(138, 63, 252, 0.12);
  border: 1px solid rgba(138, 63, 252, 0.4);
  line-height: 1.5;
}
.tip span { color: #d7cbe9; }
.tip-warn { background: rgba(255, 196, 61, 0.1); border-color: rgba(255, 196, 61, 0.45); }
.tip-warn strong { color: #ffd57a; }

.phase .eyebrow { color: #ff9cc4; }
.points { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; color: #d7cbe9; }

.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { padding: 0; gap: 0; }
.faq summary { padding: 16px 18px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--pink); font-weight: 900; font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: '-'; }
.faq details p { padding: 0 18px 16px; }

.tuto-foot { display: flex; justify-content: center; }
.tuto-foot .btn { min-width: 200px; }

/* ------------------------------------------------------------ Lien vers le tuto dans le jeu */
.home-help { text-align: center; margin: 0; }
.home-help a, .rules-more a { color: #ff9cc4; font-weight: 600; text-underline-offset: 3px; }
.rules-more { margin: 16px 0 0; text-align: center; }
#guessBody > .eyebrow { margin-bottom: 10px; }

/* ------------------------------------------------------------ Modes de jeu */
.settings > h2 { margin-bottom: -2px; }
.modes { display: grid; gap: 8px; }
@media (min-width: 560px) { .modes { grid-template-columns: 1fr 1fr; } }
.mode-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mode-card strong { font-size: 1rem; font-weight: 800; }
.mode-card span { color: var(--muted); font-size: 0.85rem; line-height: 1.35; }
.mode-card.selected { border-color: var(--pink); background: rgba(255, 61, 139, 0.14); }
.mode-card:disabled { cursor: default; }
.mode-card:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

.select {
  width: auto;
  max-width: 60%;
  padding: 10px 12px;
  font-size: 0.92rem;
  cursor: pointer;
}
.select option { background: #1d0f30; color: var(--text); }
.setting-value { text-align: right; font-weight: 800; }

.theme-banner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 61, 139, 0.18), rgba(138, 63, 252, 0.18));
  border: 1px solid rgba(255, 61, 139, 0.4);
}
.theme-banner span { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; font-weight: 800; color: #ffb3d1; }
.theme-banner strong { font-size: 1.1rem; font-weight: 900; overflow-wrap: anywhere; }

/* Blind test progressif */
.stages { display: flex; flex-direction: column; gap: 8px; }
.stage-list { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.stage-list li {
  min-width: 44px;
  padding: 6px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--muted);
}
.stage-list li.past { opacity: 0.4; }
.stage-list li.current { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(194, 56, 230, 0.4); }
.stages .muted { margin: 0; font-size: 0.85rem; }

/* Pochette cachée du blind test */
.vinyl.mystery::after { display: none; }
.vinyl-mystery {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #12081f 0 26%, transparent 27%), var(--grad);
  font-size: clamp(3rem, 16vw, 5rem);
  font-weight: 900;
  color: #fff;
}

/* Réponse tapée */
.answer { display: flex; flex-direction: column; gap: 10px; }
.found-row { display: flex; justify-content: center; gap: 8px; }
.found-tag {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--muted);
}
.found-tag.on { color: var(--text); background: rgba(62, 224, 161, 0.15); border-color: rgba(62, 224, 161, 0.55); }
.answer .input:disabled { opacity: 0.6; }
.answer-feedback { margin: 0; min-height: 1.3em; text-align: center; font-weight: 700; }
.answer-feedback.good { color: var(--good); }
.answer-feedback.bad { color: var(--bad); }
.answer.shake .row { animation: shake 0.35s ease; }
@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.quiz-progress { justify-content: center; }
.mini {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.mini.on { background: var(--good); color: #0b2a1f; }
.chip .mini:first-of-type { margin-left: 2px; }

/* Thème : signalement hors thème */
.offtheme-btn { align-self: center; margin-top: 12px; display: block; margin-left: auto; margin-right: auto; }
.offtheme-btn.active { background: rgba(255, 92, 122, 0.18); border-color: rgba(255, 92, 122, 0.6); color: #ffc2cd; }
.offtheme-line { font-size: 0.9rem; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--card-border); }
.offtheme-line.penalized { color: #ffc2cd; }
.gain.loss { color: var(--bad); }
.vote-list .parts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.vote-list .parts .ok { margin-left: 0; }

/* Règles : liste des modes */
.rules-subtitle { margin: 18px 0 8px; font-size: 1rem; font-weight: 800; }
.modes-list { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; color: #d7cbe9; line-height: 1.45; }
.modes-list strong { color: var(--text); }
.tuto .mode-title { margin: 10px 0 -4px; font-size: 1.1rem; font-weight: 900; color: #ff9cc4; }
.tuto .mock .mode-card { cursor: default; }
.tuto .mock .found-row { justify-content: flex-start; }

/* ======================================================================
   Interface animée : ambiance, annonces, podium
   ====================================================================== */

/* Fond vivant */
.glow { animation: drift 18s ease-in-out infinite alternate; }
.glow-b { animation-duration: 23s; animation-direction: alternate-reverse; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(7vmax, 5vmax) scale(1.15); }
}

/* Score personnel dans la barre du haut */
.my-score {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--card-border);
}
.my-score span { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.my-score strong { font-weight: 900; font-variant-numeric: tabular-nums; }
.my-score.bump { animation: bump 0.6s ease; }
@keyframes bump {
  30% { transform: scale(1.2); border-color: rgba(62, 224, 161, 0.7); box-shadow: 0 0 22px rgba(62, 224, 161, 0.5); }
}
@media (max-width: 420px) { .topbar-round { display: none; } }

/* Égaliseur sous le vinyle (décoratif, suit la lecture) */
.eq { display: flex; justify-content: center; align-items: flex-end; gap: 4px; height: 30px; margin-top: -4px; }
.eq span {
  width: 5px;
  height: 18%;
  border-radius: 3px;
  background: var(--grad);
  opacity: 0.3;
  transition: height 0.4s, opacity 0.4s;
}
.eq.playing span {
  opacity: 1;
  animation: eq var(--s, 0.8s) ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}
@keyframes eq {
  0% { height: 14%; }
  45% { height: 100%; }
  100% { height: 32%; }
}

/* Dernières secondes : le bord de l'écran pulse en rouge */
.hurry-vignette {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 150px rgba(255, 61, 90, 0.5);
  transition: opacity 0.4s;
}
body.hurry .hurry-vignette { opacity: 1; animation: hurry 1s ease-in-out infinite; }
@keyframes hurry { 50% { opacity: 0.35; } }

/* Annonces plein écran (nouvelle manche, nouveau son, délibération) */
.splash {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
}
.splash::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at center, rgba(18, 8, 31, 0.9) 0 35%, rgba(18, 8, 31, 0) 70%);
}
.splash small {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffb3d1;
}
.splash strong {
  padding: 0 16px;
  font-size: clamp(2.6rem, 13vw, 4.8rem);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 30px rgba(194, 56, 230, 0.55));
}
.splash.show { animation: splash 1.45s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes splash {
  0% { opacity: 0; transform: scale(0.6); }
  18% { opacity: 1; transform: scale(1.06); }
  30% { transform: scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.12); }
}

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 45; pointer-events: none; }

/* Lobby */
.big-code { cursor: pointer; transition: transform 0.15s; }
.big-code:active { transform: scale(0.96); }
#startBtn.ready:not(:disabled) { animation: ready 1.8s ease-in-out infinite; }
@keyframes ready {
  50% { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(255, 61, 139, 0.7); }
}
.player-list li .avatar { animation: hop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes hop { from { transform: scale(0); } }
.mode-card { transition: border-color 0.15s, background 0.15s, transform 0.15s; }
.mode-card:not(:disabled):hover { transform: translateY(-2px); border-color: rgba(255, 61, 139, 0.5); }
.mode-card.selected { box-shadow: 0 8px 26px rgba(255, 61, 139, 0.25); }

/* Vote : tampon "Verrouillé" */
.vote-btn { position: relative; }
.vote-btn:not(:disabled):hover { transform: translateY(-2px); border-color: rgba(255, 61, 139, 0.5); }
.vote-btn.selected::after {
  content: "Verrouillé";
  position: absolute;
  top: -10px;
  right: -6px;
  padding: 2px 7px;
  border: 2px solid #ff9cc4;
  border-radius: 6px;
  background: #1d0f30;
  color: #ff9cc4;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(8deg);
  animation: stamp 0.35s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes stamp { from { opacity: 0; transform: rotate(8deg) scale(2.4); } }

/* Réponse trouvée */
.answer.success .row .input { border-color: var(--good); box-shadow: 0 0 0 3px rgba(62, 224, 161, 0.25); }
.found-tag.on { animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }

/* Reveal : la carte se retourne */
.flip { perspective: 1000px; }
.flip-inner {
  position: relative;
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.3, 1.25, 0.5, 1);
}
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  border-radius: var(--radius);
  background: #241338;
  border: 1px solid var(--card-border);
}
.flip-front small { font-weight: 600; color: var(--muted); }
.flip-front strong { font-size: 2.2rem; font-weight: 900; color: #ff9cc4; animation: pulse 1s ease-in-out infinite; }
.flip-back { transform: rotateY(180deg); }
.flip-back.reveal-owner { animation: none; }

.vote-list li { animation: slide-in 0.4s ease both; animation-delay: calc(var(--i, 0) * 80ms + 0.7s); }
@keyframes slide-in { from { opacity: 0; transform: translateX(-14px); } }
.ranking li.climbed { box-shadow: inset 0 0 0 1px rgba(62, 224, 161, 0.55); }

/* ------------------------------------------------------------ Fin de manche : podium */
#screen-end {
  --t3: 0.4s;
  --t2: 1.2s;
  --t1: 2.2s;
  --t-title: 3s;
  --t-loser: 3.5s;
  --t-rest: 3.9s;
}
.end-head { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.end-head .eyebrow { margin: 0; }
.end-title { margin: 0; font-size: clamp(1.8rem, 8.5vw, 2.5rem); font-weight: 900; line-height: 1.1; overflow-wrap: anywhere; }
.end-title span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.podium-wrap { position: relative; padding-top: 28px; }
.spotlight {
  position: absolute;
  left: 50%;
  top: -40px;
  width: 260px;
  height: 380px;
  transform: translateX(-50%);
  background: conic-gradient(from 180deg at 50% 0%, transparent 158deg, rgba(255, 214, 120, 0.22) 172deg, rgba(255, 214, 120, 0.3) 180deg, rgba(255, 214, 120, 0.22) 188deg, transparent 202deg);
  filter: blur(4px);
  pointer-events: none;
  opacity: 0;
}
.podium {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  max-width: 440px;
  margin: 0 auto;
  transform: perspective(900px) rotateX(9deg);
  transform-origin: bottom center;
}
.podium-spot { display: flex; flex-direction: column; align-items: center; gap: 28px; min-width: 0; }
.place-1 { --d: var(--t1); }
.place-2 { --d: var(--t2); }
.place-3 { --d: var(--t3); }
.podium-player { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; max-width: 100%; text-align: center; }
.podium-player .avatar { width: 52px; height: 52px; font-size: 1.3rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.place-1 .podium-player .avatar { width: 68px; height: 68px; font-size: 1.7rem; box-shadow: 0 0 0 3px #ffc43d, 0 0 30px rgba(255, 196, 61, 0.55); }
.podium-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 0.95rem; }
.podium-score { font-weight: 900; font-variant-numeric: tabular-nums; color: #ffd57a; }
.place-2 .podium-score { color: #e3dcf2; }
.place-3 .podium-score { color: #f0b38a; }
.crown { width: 38px; height: 26px; margin-bottom: -4px; color: #ffc43d; filter: drop-shadow(0 2px 8px rgba(255, 196, 61, 0.7)); }

/* Marche : face avant, face supérieure en perspective, reflet latéral */
.podium-block {
  position: relative;
  width: 100%;
  height: var(--h);
  display: grid;
  place-items: center;
  border-radius: 4px 4px 0 0;
  font-size: 2.2rem;
  font-weight: 900;
  transform-origin: bottom center;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}
.podium-block::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
  background: inherit;
  filter: brightness(1.35);
  clip-path: polygon(9% 0, 91% 0, 100% 100%, 0 100%);
}
.podium-block::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), transparent 28%, transparent 72%, rgba(0, 0, 0, 0.28));
}
.podium-block span { position: relative; z-index: 1; }
.place-1 .podium-block { --h: 150px; background: linear-gradient(180deg, #ffd166, #d98e14); color: #4a2a00; }
.place-2 .podium-block { --h: 108px; background: linear-gradient(180deg, #ece6f8, #9b90b8); color: #2a2240; }
.place-3 .podium-block { --h: 76px; background: linear-gradient(180deg, #f3a874, #b25c27); color: #3a1a05; }

.loser-badge {
  display: inline-block;
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 92, 122, 0.5);
  background: rgba(255, 92, 122, 0.18);
  color: #ffc2cd;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ranking-rest li.is-loser { box-shadow: inset 0 0 0 1px rgba(255, 92, 122, 0.45); }
#replayBtn { align-self: center; }

/* Séquence d'annonce, déclenchée par la classe end-show */
.end-show .end-title,
.end-show #replayBtn { animation: fade-up 0.6s ease both; animation-delay: var(--t-title); }
.end-show .podium-block { animation: rise 0.75s cubic-bezier(0.2, 1.2, 0.4, 1) both; animation-delay: var(--d); }
.end-show .podium-player { animation: drop 0.6s cubic-bezier(0.2, 1.4, 0.4, 1) both; animation-delay: calc(var(--d) + 0.45s); }
.end-show .spotlight { animation: spotlight 4s ease-in-out both; animation-delay: var(--t1); }
.end-show .place-1 .podium-player .avatar { animation: winner 1.8s ease-in-out infinite; animation-delay: calc(var(--t1) + 1.1s); }
.end-show .is-loser .loser-badge { animation: drop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) both; animation-delay: var(--t-loser); }
.end-show .podium-spot.is-loser .avatar { animation: sad 1.1s ease both; animation-delay: var(--t-loser); }
.end-show .ranking-rest li { animation: slide-in 0.45s ease both; animation-delay: calc(var(--t-rest) + var(--i, 0) * 90ms); }
.end-show .ranking-rest li.is-loser .avatar { animation: sad 1.1s ease both; animation-delay: calc(var(--t-rest) + 0.5s); }

@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes rise { from { transform: scaleY(0); } }
@keyframes drop { from { opacity: 0; transform: translateY(-46px) scale(0.6); } }
@keyframes winner {
  50% { transform: translateY(-4px) scale(1.05); box-shadow: 0 0 0 3px #ffc43d, 0 0 46px rgba(255, 196, 61, 0.85); }
}
@keyframes sad {
  25% { transform: rotate(-14deg); }
  50% { transform: rotate(10deg); }
  100% { transform: translateY(5px) rotate(-8deg); filter: grayscale(0.8) brightness(0.8); }
}
@keyframes spotlight {
  0% { opacity: 0; transform: translateX(-50%) rotate(-12deg); }
  25% { opacity: 1; }
  60% { transform: translateX(-50%) rotate(6deg); }
  100% { opacity: 0.75; transform: translateX(-50%) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-delay: 0s !important; transition-delay: 0s !important; }
  .splash { display: none; }
}

/* ======================================================================
   Photos de profil
   ====================================================================== */
.avatar-img { overflow: hidden; background: #2a1a40; }
.avatar-img img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* Accueil : photo de profil au-dessus du pseudo */
.profile-pick {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 61, 139, 0.45);
  background: rgba(255, 61, 139, 0.06);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.profile-pick:hover { background: rgba(255, 61, 139, 0.12); border-color: rgba(255, 61, 139, 0.7); }
.profile-pick:active { transform: scale(0.98); }
.profile-preview .avatar { width: 56px; height: 56px; font-size: 1.4rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.profile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-text strong { font-weight: 800; }
.profile-text span { color: var(--muted); font-size: 0.85rem; }
.profile-edit {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--grad);
  font-size: 0.82rem;
  font-weight: 800;
}

/* Fenêtre de choix */
.avatar-card { display: flex; flex-direction: column; gap: 14px; }
.avatar-card .modal-head { margin-bottom: 0; }
.avatar-current { display: grid; place-items: center; }
.avatar-current .avatar { width: 88px; height: 88px; font-size: 2.2rem; box-shadow: 0 0 0 3px rgba(255, 61, 139, 0.6), 0 10px 30px rgba(0, 0, 0, 0.4); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); }
.tab {
  padding: 9px 4px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}
.tab.on { background: var(--grad); color: #fff; }
.tab-panel { display: flex; flex-direction: column; gap: 12px; }
.tab-panel p { margin: 0; }
.small { font-size: 0.78rem; }
.small a { color: #ff9cc4; }

.style-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.style-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.style-chip.on { color: var(--text); border-color: var(--pink); background: rgba(255, 61, 139, 0.15); }

.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.preset {
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  background: #2a1a40;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.preset img { width: 100%; height: 100%; display: block; object-fit: cover; }
.preset:hover { transform: scale(1.06); border-color: rgba(255, 61, 139, 0.6); }
.preset.on { border-color: var(--pink); box-shadow: 0 0 18px rgba(255, 61, 139, 0.5); }
#presetShuffle { align-self: center; }

.choice-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.choice-preview img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); image-rendering: auto; }
.choice-preview .avatar { width: 96px; height: 96px; font-size: 2.4rem; }
.upload-btn { align-self: center; cursor: pointer; }

/* Lobby : bouton "Ma photo" dans l'en-tête des joueurs */
.card-head { align-items: center; gap: 10px; }
.card-head h2 .muted { font-weight: 600; font-size: 0.85rem; margin-left: 4px; }
