/* Horizon Midi — interface claire, chaleureuse et responsive */
:root {
  --ink: #182033; --muted: #65708a; --bg: #f5f6fa; --card: #fff;
  --line: #e2e6ef; --line-strong: #ccd2df;
  --blue: #5b5be7; --blue-dark: #4242bc; --blue-soft: #eeeeff;
  --green: #1e9a6b; --green-soft: #e6f7f0;
  --red: #dc5066; --red-soft: #fff0f2;
  --gold: #e9a623; --gold-soft: #fff7df; --purple: #8b5cf6;
  --font-body: 'Baloo 2', system-ui, sans-serif;
  --radius: 20px; --radius-sm: 12px;
  --shadow: 0 12px 34px rgba(30,37,61,.08), 0 2px 8px rgba(30,37,61,.04);
  --shadow-hover: 0 18px 44px rgba(30,37,61,.13), 0 4px 10px rgba(30,37,61,.06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh; margin: 0; overflow-x: hidden;
  color: var(--ink); background: radial-gradient(circle at 8% 5%,rgba(91,91,231,.09),transparent 28rem),radial-gradient(circle at 92% 22%,rgba(30,154,107,.07),transparent 24rem),var(--bg);
  font: 500 16px/1.55 var(--font-body);
}
body.modal-open { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--ink); background: #d9d9ff; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 500; padding: 10px 14px; border-radius: 10px; color: #fff; background: var(--ink); transform: translateY(-150%); transition: transform .2s; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(91,91,231,.38); outline-offset: 3px; }

/* Navigation */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; padding: 12px max(24px,calc((100vw - 1180px)/2)); border-bottom: 1px solid rgba(214,219,231,.86); background: rgba(255,255,255,.88); box-shadow: 0 3px 16px rgba(30,37,61,.04); backdrop-filter: blur(18px); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; text-decoration: none; }
.logo strong { color: var(--blue); }
.logo-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--blue); box-shadow: 0 7px 16px rgba(91,91,231,.24); }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { padding: 9px 14px; border-radius: 10px; color: var(--muted); font-weight: 700; text-decoration: none; transition: color .18s,background .18s; }
.nav a:hover { color: var(--ink); background: #f1f2f7; }
.nav a.active { color: var(--blue-dark); background: var(--blue-soft); }
#app { width: min(1180px,calc(100% - 40px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 38px 0 72px; }
#app[aria-busy='true'] { opacity: .7; }
.footer { padding: 20px; color: var(--muted); font-size: .9rem; text-align: center; }
.cloud-container { display: none; }

/* Accueil */
.hero { position: relative; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(340px,.85fr); align-items: center; gap: clamp(38px,7vw,90px); padding: clamp(36px,6vw,76px) 0 clamp(54px,7vw,90px); }
.hero-copy { max-width: 670px; }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; padding: 6px 11px; border: 1px solid #dfe1ff; border-radius: 999px; color: var(--blue-dark); background: var(--blue-soft); font-size: .82rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.hero h1 { max-width: 720px; margin: 20px 0 18px; font-size: clamp(2.7rem,6vw,5.25rem); font-weight: 800; letter-spacing: -.055em; line-height: .96; }
.hero h1 span { color: var(--blue); }
.hero .tagline { max-width: 590px; margin: 0; color: var(--muted); font-size: clamp(1.05rem,1.8vw,1.22rem); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-preview { position: relative; padding: 22px; border: 1px solid rgba(255,255,255,.8); border-radius: 28px; background: rgba(255,255,255,.92); box-shadow: 0 28px 70px rgba(55,58,110,.15); transform: rotate(2deg); }
.hero-preview::before { content: ''; position: absolute; inset: -16px 22px 16px -18px; z-index: -1; border-radius: 30px; background: linear-gradient(145deg,#cbc9ff,#bdeedf); }
.preview-top, .preview-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preview-top { margin-bottom: 18px; font-size: 1.05rem; font-weight: 800; }
.preview-player { display: grid; grid-template-columns: 32px 38px minmax(0,1fr) auto; align-items: center; gap: 10px; margin-top: 9px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.preview-player.winner { border-color: #f4d98c; background: var(--gold-soft); }
.preview-rank { color: var(--muted); font-weight: 800; text-align: center; }
.preview-player strong { color: var(--blue); font-size: 1.15rem; }
.preview-foot { margin-top: 18px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 36px 0 16px; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.grid-rooms { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.room-card { display: flex; min-width: 0; flex-direction: column; gap: 13px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--card); box-shadow: var(--shadow); text-decoration: none; transition: transform .2s ease,border-color .2s,box-shadow .2s; }
.room-card:hover { border-color: #bdbdf5; box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.room-card .game-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: var(--blue-soft); font-size: 1.55rem; }
.room-card.flip7 .game-icon { background: #f3edff; }
.room-card h3 { margin: 0; overflow-wrap: anywhere; font-size: 1.15rem; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; }

/* Eléments génériques */
.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.pill, .stat-chip, .delta { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #f8f9fb; font-size: .78rem; font-weight: 800; line-height: 1.35; }
.pill.green, .stat-chip.green, .delta.good { color: #08754e; border-color: #c9eddf; background: var(--green-soft); }
.pill.blue, .stat-chip.blue { color: var(--blue-dark); border-color: #dcdcff; background: var(--blue-soft); }
.pill.red, .delta.bad { color: #b2374a; border-color: #ffd1d8; background: var(--red-soft); }
.pill.gold, .stat-chip.gold { color: #936004; border-color: #f5df9f; background: var(--gold-soft); }
.pill.purple { color: #6c3cce; border-color: #e3d7ff; background: #f3edff; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #23b77f; box-shadow: 0 0 0 4px rgba(35,183,127,.12); }
.av { display: inline-grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #f7f8fc; font-size: 1.1rem; }
.av, .user-avatar, .profile-avatar-preview, .boss-avatar { overflow: hidden; }
.av img, .user-avatar img, .profile-avatar-preview img, .boss-avatar img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.av.big { width: 50px; height: 50px; border-radius: 15px; font-size: 1.55rem; }
.av.huge { width: 74px; height: 74px; border-radius: 22px; font-size: 2.3rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 9px 16px; border: 1px solid transparent; border-radius: 11px; color: #fff; background: var(--blue); box-shadow: 0 7px 16px rgba(91,91,231,.2); font-weight: 800; line-height: 1.2; text-decoration: none; cursor: pointer; transition: transform .18s,background .18s,box-shadow .18s; }
.btn:hover:not(:disabled) { background: var(--blue-dark); box-shadow: 0 10px 22px rgba(91,91,231,.26); transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .46; box-shadow: none; cursor: not-allowed; }
.btn.green { background: var(--green); box-shadow: 0 7px 16px rgba(30,154,107,.2); }
.btn.green:hover:not(:disabled) { background: #147a54; }
.btn.red { background: var(--red); box-shadow: none; }
.btn.blue { background: var(--blue); }
.btn.ghost { color: var(--ink); border-color: var(--line-strong); background: #fff; box-shadow: none; }
.btn.ghost:hover:not(:disabled) { color: var(--blue-dark); border-color: #bdbdf5; background: var(--blue-soft); box-shadow: none; }
.btn.small { min-height: 36px; padding: 7px 11px; border-radius: 9px; font-size: .82rem; }
.btn.big { min-height: 52px; padding: 12px 21px; border-radius: 13px; font-size: 1rem; }
.btn.full { width: 100%; }
.empty { padding: 44px 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); background: rgba(255,255,255,.45); text-align: center; }
.empty .big-emoji { display: block; margin-bottom: 8px; font-size: 2.5rem; }

/* Salle */
.back-link { display: inline-flex; margin-bottom: 16px; color: var(--muted); font-weight: 700; text-decoration: none; }
.back-link:hover { color: var(--blue); }
.room-head { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.room-head h2 { flex: 1 1 100%; margin: 0 0 3px; font-size: clamp(1.6rem,3vw,2.25rem); line-height: 1.1; }
.code-chip { display: inline-flex; min-height: 38px; align-items: center; padding: 6px 12px; border: 1px dashed #aaaaf0; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); font-weight: 800; letter-spacing: .14em; cursor: pointer; }
.room-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr); gap: 22px; align-items: start; }
.spectator-note { display: flex; gap: 10px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #dcdcff; border-radius: 14px; color: var(--blue-dark); background: var(--blue-soft); font-weight: 700; }
.podium { display: flex; min-height: 220px; align-items: flex-end; justify-content: center; gap: 10px; margin-bottom: 18px; padding: 30px 16px 0; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg,#fff,#fafaff); box-shadow: var(--shadow); overflow: hidden; }
.podium .step { display: flex; width: 30%; max-width: 150px; flex-direction: column; align-items: center; gap: 6px; }
.podium .crown-holder { position: relative; }
.podium .crown { position: absolute; top: -25px; left: 50%; font-size: 1.55rem; transform: translateX(-50%); }
.podium .p-name { max-width: 100%; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.podium .p-score { color: var(--muted); font-size: .82rem; font-weight: 700; }
.podium .block { display: grid; width: 100%; height: 56px; place-items: center; border-radius: 12px 12px 0 0; color: #6a4210; background: #f0be5a; font-size: 1.35rem; font-weight: 800; }
.podium .p1 .block { height: 94px; color: #745007; background: #f8d578; }
.podium .p2 .block { height: 70px; color: #515b70; background: #dce0e9; }
.podium .p3 .block { background: #e9aa75; }
.ranking, .lb-list, .rounds-list { display: flex; flex-direction: column; gap: 10px; }
.rank-row, .lb-row { position: relative; display: flex; min-width: 0; align-items: center; gap: 11px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); box-shadow: 0 5px 18px rgba(30,37,61,.055); }
.rank-row.first, .lb-row.first { border-color: #f1dc9c; background: var(--gold-soft); }
.rank-badge { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--blue-dark); background: var(--blue-soft); font-weight: 800; }
.rank-badge.r2 { color: #515b70; background: #edf0f5; }
.rank-badge.r3 { color: #9a541b; background: #fff0e3; }
.r-name, .lb-name { min-width: 0; flex: 1; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.r-total { min-width: 42px; color: var(--blue-dark); font-size: 1.25rem; font-weight: 800; text-align: right; }
.delta { padding: 3px 7px; }
.kick { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; cursor: pointer; }
.kick:hover { color: #b2374a; border-color: #ffd1d8; background: var(--red-soft); }
.score-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 16px 0 18px; }
.score-grid:empty { display: none; }
.score-cell { display: grid; grid-template-columns: 36px minmax(0,1fr) 68px; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfc; }
.score-cell label { overflow: hidden; font-size: .86rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.score-input { width: 100%; min-width: 0; padding: 7px 5px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: #fff; font-weight: 800; text-align: center; }
.score-input:focus { border-color: var(--blue); outline: 3px solid rgba(91,91,231,.13); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.primary-action { flex: 1 0 100%; }
.round-item { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.round-item .rn { color: var(--blue-dark); font-weight: 800; }
.round-item .winner-chip { color: #936004; font-size: .8rem; font-weight: 800; }
.round-item .scores { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 5px; }
.round-item .scores span { padding: 2px 7px; border-radius: 7px; color: var(--muted); background: #fff; font-size: .78rem; }
.winner-banner { position: relative; margin-bottom: 20px; padding: 28px 20px; border: 1px solid #f0d588; border-radius: var(--radius); background: linear-gradient(135deg,#fff9e7,#fff1bd); text-align: center; }
.winner-banner .wc { font-size: 2.8rem; }
.winner-banner h2 { margin: 4px 0; font-size: 1.8rem; }
.winner-banner .sub { color: #785f2d; }

/* Classement général */
.throne { position: relative; margin: 20px 0 24px; padding: 38px 24px; border: 1px solid #f0d588; border-radius: 24px; background: linear-gradient(145deg,#fff9e7,#ffefb4); box-shadow: var(--shadow); text-align: center; overflow: hidden; }
.throne::after { content: ''; position: absolute; width: 220px; height: 220px; top: -120px; right: -70px; border-radius: 50%; background: rgba(255,255,255,.45); }
.crown-big { font-size: 3rem; }
.throne h2 { margin: 4px 0 10px; font-size: 2.1rem; }
.throne .stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.lb-stats { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }

/* Formulaires et modales */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: .9rem; font-weight: 800; }
.field input, .field select { width: 100%; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: #fff; }
.field input:focus, .field select:focus { border-color: var(--blue); outline: 3px solid rgba(91,91,231,.12); }
.radio-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.radio-cards label { display: flex; min-height: 48px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #fafbfc; cursor: pointer; }
.radio-cards input { position: absolute; opacity: 0; pointer-events: none; }
.radio-cards label:has(input:checked) { color: var(--blue-dark); border-color: #bfbff5; background: var(--blue-soft); box-shadow: inset 0 0 0 1px #bfbff5; }
.radio-cards label:has(input:focus-visible) { outline: 3px solid rgba(91,91,231,.25); outline-offset: 2px; }
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(20,26,42,.6); backdrop-filter: blur(8px); animation: fade-in .18s ease; }
.modal { position: relative; width: min(520px,100%); max-height: min(88vh,720px); padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 28px 80px rgba(11,16,29,.3); overflow: auto; animation: modal-in .22s ease-out; }
.modal h3 { margin: 0 48px 4px 0; font-size: 1.55rem; line-height: 1.2; }
.modal-intro { margin: 0 32px 20px 0; color: var(--muted); }
.modal .close-x { position: absolute; top: 16px; right: 16px; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #f7f8fa; cursor: pointer; }
.modal .close-x:hover { color: var(--ink); background: #eceef3; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.player-pick-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.player-pick { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; font-weight: 700; cursor: pointer; }
.player-pick:hover { border-color: #bfbff5; background: var(--blue-soft); }
.emoji-row { display: grid; grid-template-columns: repeat(8,1fr); gap: 6px; margin-bottom: 16px; }
.emoji-row button { display: grid; aspect-ratio: 1; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fafbfc; font-size: 1.15rem; cursor: pointer; }
.emoji-row button:hover, .emoji-row button.selected { border-color: #bfbff5; background: var(--blue-soft); }
#toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; max-width: min(380px,calc(100vw - 40px)); flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border: 1px solid #333b51; border-radius: 12px; color: #fff; background: var(--ink); box-shadow: 0 12px 35px rgba(18,24,39,.25); font-weight: 700; animation: toast-in .25s ease-out; }
.toast.error { border-color: #ed7082; background: #b93d51; }
#confetti { position: fixed; inset: 0; z-index: 9999; width: 100%; height: 100%; pointer-events: none; }
.shake { animation: shake .35s ease; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 48px; }
  .hero-copy { max-width: 760px; }
  .hero-preview { width: min(540px,88%); margin: 0 auto; }
  .grid-rooms { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .room-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .topbar { min-height: 66px; padding: 10px 14px; gap: 10px; }
  .logo-mark { width: 38px; height: 38px; }
  .logo > span:last-child { display: none; }
  .nav a { padding: 8px 10px; font-size: .86rem; }
  #app { width: min(100% - 28px,1180px); padding-top: 24px; }
  .hero { padding: 32px 0 58px; }
  .hero h1 { font-size: clamp(2.5rem,13vw,4rem); }
  .hero-preview { width: calc(100% - 12px); padding: 16px; transform: rotate(1deg); }
  .grid-rooms { grid-template-columns: 1fr; }
  .room-head { align-items: flex-start; }
  .room-head h2 { overflow-wrap: anywhere; }
  .score-grid { grid-template-columns: 1fr; }
  .lb-row { align-items: flex-start; flex-wrap: wrap; }
  .lb-name { padding-top: 5px; }
  .lb-stats { flex: 1 0 100%; justify-content: flex-start; padding-left: 45px; }
  .modal { padding: 22px 18px; border-radius: 18px; }
  .radio-cards { grid-template-columns: 1fr; }
  .emoji-row { grid-template-columns: repeat(6,1fr); }
  .actions-row .btn { flex: 1 1 100%; }
  #toast-root { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}
@media (max-width: 430px) {
  .nav a { font-size: 0; }
  .nav a::first-letter { font-size: 1rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .preview-player { grid-template-columns: 24px 36px minmax(0,1fr) auto; }
  .rank-row { gap: 8px; padding: 11px; }
  .rank-row .av { display: none; }
  .delta { font-size: .7rem; }
  .room-head .btn, .room-head .code-chip { flex: 1 1 auto; }
  .podium { min-height: 200px; padding-inline: 8px; }
  .podium .step { width: 32%; }
  .podium .p-name { font-size: .8rem; }
  .podium .p1 .block { height: 80px; }
  .podium .p2 .block { height: 60px; }
  .podium .p3 .block { height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================
   Mode cartoon : ludique, lisible et pensé pour l'interne
   ===================================================== */
:root {
  --ink: #29263c;
  --bg: #eef7ff;
  --line: #29263c;
  --line-strong: #29263c;
  --blue: #5965f2;
  --blue-dark: #3f46bd;
  --blue-soft: #e9eaff;
  --green: #38b878;
  --green-soft: #dcf8e9;
  --red: #f16070;
  --red-soft: #ffe4e8;
  --gold: #f4b942;
  --gold-soft: #fff2ba;
  --purple: #a66be8;
  --font-title: 'Luckiest Guy', 'Baloo 2', sans-serif;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-hover: 8px 8px 0 var(--ink);
}

body {
  background:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,.9) 0 3px, transparent 4px) 0 0 / 36px 36px,
    linear-gradient(180deg, #aedeff 0, #eaf7ff 38%, #fff9ed 100%);
  background-attachment: fixed;
}

.cloud-container { display: block; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.cloud { position: absolute; font-size: 3rem; opacity: .55; filter: drop-shadow(3px 3px 0 rgba(41,38,60,.12)); animation: cloud-float 28s linear infinite; }
.cloud:nth-child(1) { top: 12%; left: -12%; }
.cloud:nth-child(2) { top: 43%; left: -18%; font-size: 2.2rem; animation-duration: 38s; animation-delay: -12s; }
.cloud:nth-child(3) { top: 72%; left: -15%; font-size: 2.6rem; animation-duration: 44s; animation-delay: -25s; }

.topbar {
  min-height: 72px;
  border-bottom: 3px solid var(--ink);
  background: rgba(255,255,255,.94);
  box-shadow: 0 5px 0 var(--ink);
  backdrop-filter: blur(12px);
}
.logo { font-family: var(--font-title); font-size: 1.35rem; letter-spacing: .04em; transform: rotate(-1deg); }
.logo-mark { border: 3px solid var(--ink); border-radius: 14px; background: var(--gold); box-shadow: 3px 3px 0 var(--ink); transition: transform .2s; }
.logo:hover .logo-mark { transform: rotate(12deg) scale(1.08); }
.nav a { border: 2px solid transparent; font-weight: 800; }
.nav a:hover { border-color: var(--ink); background: #fff; box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px,-1px); }
.nav a.active { border-color: var(--ink); color: var(--ink); background: var(--gold-soft); box-shadow: 3px 3px 0 var(--ink); }

.hero {
  display: flex;
  min-height: 320px;
  align-items: center;
  justify-content: center;
  gap: clamp(22px,6vw,80px);
  padding: 52px 0 38px;
  text-align: center;
}
.hero-copy { max-width: 720px; }
.hero h1 { margin: 16px 0 10px; font-family: var(--font-title); font-size: clamp(3.3rem,9vw,6.5rem); font-weight: 400; letter-spacing: .035em; line-height: .9; text-shadow: 5px 5px 0 #fff, 8px 8px 0 rgba(41,38,60,.2); animation: title-wobble 3s ease-in-out infinite; }
.hero h1 span { color: var(--gold); -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 #ff875e; }
.hero .tagline { margin: 0 auto 24px; color: var(--ink); font-size: 1.18rem; font-weight: 700; }
.eyebrow { border: 2px solid var(--ink); color: var(--ink); background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.hero-doodle { font-size: clamp(3.5rem,8vw,6.5rem); filter: drop-shadow(5px 6px 0 rgba(41,38,60,.3)); }
.doodle-left { animation: doodle-left 2.8s ease-in-out infinite; }
.doodle-right { animation: doodle-right 2.4s ease-in-out infinite; }

.section-title { font-family: var(--font-title); font-weight: 400; letter-spacing: .04em; text-shadow: 3px 3px 0 #fff; }
.room-card, .card, .room-head, .podium, .rank-row, .lb-row, .throne {
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
}
.room-card { animation: card-pop .45s backwards cubic-bezier(.22,1.4,.5,1); }
.room-card:nth-child(2n) { animation-delay: .06s; }
.room-card:nth-child(3n) { animation-delay: .12s; }
.room-card:hover { border-color: var(--ink); box-shadow: var(--shadow-hover); transform: translate(-3px,-3px) rotate(-.6deg); }
.room-card:nth-child(even):hover { transform: translate(-3px,-3px) rotate(.6deg); }
.room-card .game-icon { border: 3px solid var(--ink); background: #83cbff; box-shadow: 3px 3px 0 var(--ink); transform: rotate(-4deg); }
.room-card.flip7 .game-icon { background: #d7b1ff; transform: rotate(4deg); }
.room-card h3 { font-family: var(--font-title); font-weight: 400; letter-spacing: .04em; }

.pill, .stat-chip, .delta { border: 2px solid var(--ink); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.live-dot { animation: live-bop 1.3s ease-in-out infinite; }
.av { border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }

.btn { border: 3px solid var(--ink); color: #fff; box-shadow: 5px 5px 0 var(--ink); }
.btn:hover:not(:disabled) { box-shadow: 7px 7px 0 var(--ink); transform: translate(-2px,-2px) rotate(-.5deg); }
.btn:active:not(:disabled) { box-shadow: 2px 2px 0 var(--ink); transform: translate(3px,3px); }
.btn.big { font-family: var(--font-title); font-size: 1.1rem; font-weight: 400; letter-spacing: .05em; animation: button-breathe 2s ease-in-out infinite; }
.btn.green, .btn.red, .btn.blue { border-color: var(--ink); }
.btn.ghost { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.empty { border: 3px dashed var(--ink); color: var(--ink); background: rgba(255,255,255,.56); }
.empty .big-emoji { animation: emoji-bob 2s ease-in-out infinite; }

.room-head { background: #fff; }
.room-head h2, .winner-banner h2, .throne h2 { font-family: var(--font-title); font-weight: 400; letter-spacing: .04em; }
.code-chip { border: 2px dashed var(--ink); color: var(--ink); background: var(--gold-soft); box-shadow: 3px 3px 0 var(--ink); }
.spectator-note { border: 3px solid var(--ink); color: var(--ink); background: #e9eaff; box-shadow: 4px 4px 0 var(--ink); }
.podium { background: linear-gradient(#fff,#f6f0ff); }
.podium .block { border: 3px solid var(--ink); border-bottom: 0; font-family: var(--font-title); font-weight: 400; }
.podium .crown { animation: crown-bob 1.7s ease-in-out infinite; }
.rank-row.first, .lb-row.first { border-color: var(--ink); }
.rank-badge { border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.score-cell, .round-item { border: 2px solid var(--ink); background: #fff; box-shadow: 3px 3px 0 var(--ink); }
.score-input { border: 2px solid var(--ink); }
.winner-banner { border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.throne { background: linear-gradient(145deg,#ffe88e,#ffc65e); }
.crown-big { display: inline-block; animation: trophy-bob 1.7s ease-in-out infinite; }

.field input, .field select, .radio-cards label { border: 2px solid var(--ink); }
.radio-cards label:has(input:checked) { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px,-1px); }
.modal { border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.modal h3 { font-family: var(--font-title); font-weight: 400; letter-spacing: .04em; }
.modal .close-x, .player-pick, .emoji-row button { border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.emoji-row button:hover, .emoji-row button.selected { transform: translateY(-2px) rotate(-5deg) scale(1.08); box-shadow: 4px 4px 0 var(--ink); }
.toast { border: 3px solid #fff; box-shadow: 5px 5px 0 var(--ink); }

@keyframes cloud-float { from { transform: translateX(-10vw); } to { transform: translateX(125vw); } }
@keyframes title-wobble { 0%,100% { transform: rotate(-1deg) translateY(0); } 50% { transform: rotate(1deg) translateY(-5px); } }
@keyframes doodle-left { 0%,100% { transform: rotate(-10deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-13px); } }
@keyframes doodle-right { 0%,100% { transform: rotate(8deg) scale(1); } 50% { transform: rotate(-7deg) scale(1.08); } }
@keyframes button-breathe { 0%,100% { scale: 1; } 50% { scale: 1.035; } }
@keyframes live-bop { 0%,100% { transform: scale(1); } 50% { transform: scale(1.4); } }
@keyframes emoji-bob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes crown-bob { 0%,100% { transform: translateX(-50%) rotate(-8deg) translateY(0); } 50% { transform: translateX(-50%) rotate(8deg) translateY(-5px); } }
@keyframes trophy-bob { 0%,100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-7px); } }
@keyframes card-pop { from { opacity: 0; transform: scale(.8) rotate(-2deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

@media (max-width: 680px) {
  .hero { min-height: 280px; gap: 8px; padding-top: 36px; }
  .hero-doodle { font-size: 2.5rem; }
  .hero h1 { font-size: clamp(3rem,16vw,4.8rem); }
  .topbar { box-shadow: 0 4px 0 var(--ink); }
}
@media (max-width: 430px) {
  .hero-doodle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* ========== CLASSEMENT : LE ROYAUME DU BIG BOSS ========== */
.boss-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 12px 0 22px;
  text-align: center;
}
.boss-title h1 {
  margin: 2px 0 0;
  font-family: var(--font-title);
  font-size: clamp(2.2rem,6vw,4.5rem);
  font-weight: 400;
  letter-spacing: .045em;
  line-height: 1;
  color: var(--ink);
  text-shadow: 4px 4px 0 #fff, 7px 7px 0 rgba(41,38,60,.14);
}
.boss-kicker {
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: #6b4200;
  background: var(--gold-soft);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.boss-title-spark {
  color: var(--gold);
  font-size: clamp(2rem,5vw,4rem);
  -webkit-text-stroke: 2px var(--ink);
  filter: drop-shadow(3px 3px 0 var(--ink));
  animation: boss-spark 1.8s ease-in-out infinite;
}
.boss-title-spark:last-child { animation-delay: -.9s; }

.boss-throne {
  isolation: isolate;
  min-height: 610px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin: 0 0 34px;
  padding: 42px 24px 28px;
  border-width: 4px;
  border-radius: 36px;
  background:
    radial-gradient(circle at 50% 37%, rgba(255,255,255,.95) 0 3%, transparent 28%),
    linear-gradient(155deg,#fff1a3 0%,#ffc44f 48%,#ef8b2c 100%);
  box-shadow: 10px 10px 0 var(--ink), inset 0 0 0 6px rgba(255,255,255,.28);
  overflow: hidden;
}
.boss-throne::before {
  content: '';
  position: absolute;
  inset: auto -5% -80px;
  z-index: -1;
  height: 220px;
  border-top: 4px solid var(--ink);
  border-radius: 50% 50% 0 0;
  background: repeating-linear-gradient(90deg,#d8334a 0 56px,#bd2038 56px 112px);
  box-shadow: inset 0 14px 0 rgba(255,255,255,.15);
}
.boss-throne::after {
  content: '✦  ·  ✦  ·  ✦';
  position: absolute;
  top: 28px;
  right: 34px;
  width: auto;
  height: auto;
  border-radius: 0;
  color: rgba(255,255,255,.8);
  background: none;
  font-size: 1.25rem;
  letter-spacing: .4em;
  animation: twinkle-line 2s ease-in-out infinite;
}
.royal-rays {
  position: absolute;
  inset: -46% -18% 20%;
  z-index: -2;
  opacity: .46;
  background: repeating-conic-gradient(from 0deg at 50% 50%,rgba(255,255,255,.82) 0deg 9deg,transparent 9deg 20deg);
  animation: royal-rays-spin 28s linear infinite;
}
.boss-ribbon {
  position: absolute;
  top: 28px;
  left: -48px;
  width: 190px;
  padding: 8px 0;
  border-block: 3px solid var(--ink);
  color: #fff;
  background: #d8334a;
  box-shadow: 0 4px 0 rgba(41,38,60,.25);
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-align: center;
  transform: rotate(-42deg);
}

.gold-throne {
  position: absolute;
  top: 112px;
  left: 50%;
  width: 310px;
  height: 360px;
  transform: translateX(-50%);
  filter: drop-shadow(8px 10px 0 rgba(41,38,60,.3));
  animation: throne-arrive .8s cubic-bezier(.2,1.5,.5,1) both;
}
.throne-back {
  position: absolute;
  inset: 24px 36px 80px;
  border: 5px solid var(--ink);
  border-radius: 46% 46% 28px 28px;
  background:
    radial-gradient(circle at 50% 23%,#fff2a8 0 5px,transparent 6px),
    linear-gradient(90deg,#e19a13,#ffe475 35%,#f4b927 70%,#c9790f);
  box-shadow: inset 0 0 0 8px #ffd95f, inset 0 -18px 0 rgba(148,77,4,.16);
}
.throne-back::before,
.throne-back::after {
  content: '';
  position: absolute;
  top: -30px;
  width: 54px;
  height: 80px;
  border: 5px solid var(--ink);
  border-radius: 50% 50% 12px 12px;
  background: linear-gradient(90deg,#f0aa1e,#ffe67c,#d88b10);
}
.throne-back::before { left: -30px; transform: rotate(-13deg); }
.throne-back::after { right: -30px; transform: rotate(13deg); }
.gem {
  position: absolute;
  top: 42px;
  left: 50%;
  color: #ef4365;
  font-size: 2rem;
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 0 0 12px #fff;
  transform: translateX(-50%) rotate(45deg);
  animation: gem-glow 1.4s ease-in-out infinite;
}
.throne-seat {
  position: absolute;
  left: 41px;
  right: 41px;
  bottom: 48px;
  height: 88px;
  border: 5px solid var(--ink);
  border-radius: 22px 22px 38px 38px;
  background: linear-gradient(#e33c58,#a51632);
  box-shadow: inset 0 10px 0 rgba(255,255,255,.18);
}
.throne-arm {
  position: absolute;
  bottom: 57px;
  width: 63px;
  height: 92px;
  border: 5px solid var(--ink);
  border-radius: 24px;
  background: linear-gradient(90deg,#da8d10,#ffe16c,#d2870d);
}
.arm-left { left: 0; transform: rotate(-8deg); }
.arm-right { right: 0; transform: rotate(8deg); }
.throne-crown {
  position: absolute;
  top: -34px;
  left: 50%;
  z-index: 2;
  font-size: 5.5rem;
  transform: translateX(-50%);
  filter: drop-shadow(4px 5px 0 var(--ink));
  animation: throne-crown-bop 2s ease-in-out infinite;
}

.boss-player {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 126px;
}
.boss-avatar {
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  border: 6px solid var(--ink);
  border-radius: 45% 45% 50% 50%;
  background: radial-gradient(circle at 40% 28%,#fff,#d9e7ff 70%);
  box-shadow: 7px 8px 0 rgba(41,38,60,.5), inset 0 -10px 0 rgba(91,101,242,.12);
  font-size: 4.6rem;
  animation: boss-avatar-bop 2.2s ease-in-out infinite;
}
.boss-label {
  margin-top: 13px;
  padding: 5px 16px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  color: #fff;
  background: #d8334a;
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-title);
  font-weight: 400;
  letter-spacing: .12em;
  transform: rotate(-2deg);
}
.boss-player h2 {
  max-width: min(600px,80vw);
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  font-size: clamp(2rem,5vw,3.4rem);
  text-shadow: 3px 3px 0 #fff;
}
.boss-subtitle { position: relative; z-index: 4; margin: 2px 0 0; padding: 2px 10px; border: 2px solid rgba(41,38,60,.72); border-radius: 999px; color: #4f3107; background: rgba(255,248,207,.82); font-weight: 800; line-height: 1.25; }
.boss-stats {
  position: relative;
  z-index: 3;
  width: min(760px,100%);
  display: grid !important;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px !important;
  margin: 0 !important;
}
.boss-stats .stat-chip {
  min-height: 68px;
  justify-content: center;
  flex-direction: column;
  padding: 8px 10px;
  border-width: 3px;
  border-radius: 15px;
  color: var(--ink);
  background: #fffdf5;
  font-size: .8rem;
  box-shadow: 4px 4px 0 var(--ink);
}
.boss-stats .stat-chip b { display: block; color: var(--ink); font-size: 1.15rem; }
.royal-float { position: absolute; z-index: 3; pointer-events: none; filter: drop-shadow(3px 4px 0 rgba(41,38,60,.35)); }
.coin { font-size: 2.9rem; animation: coin-float 3s ease-in-out infinite; }
.coin-one { top: 28%; left: 10%; }
.coin-two { top: 54%; right: 9%; animation-delay: -1.4s; }
.star { font-size: 2.5rem; animation: star-float 2.4s ease-in-out infinite; }
.star-one { top: 17%; right: 13%; }
.star-two { top: 54%; left: 12%; animation-delay: -1s; }

.challengers-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 40px 0 18px; text-align: center; }
.challengers-head h2 { margin: 0; font-family: var(--font-title); font-size: clamp(1.45rem,4vw,2.25rem); font-weight: 400; letter-spacing: .045em; text-shadow: 3px 3px 0 #fff; }
.challengers-head > span { font-size: 1.55rem; filter: drop-shadow(2px 2px 0 #fff); }
.boss-list { gap: 14px; }
.boss-challenger {
  min-height: 76px;
  border-width: 3px;
  box-shadow: 5px 5px 0 var(--ink);
  animation: challenger-slide .55s var(--row-delay) backwards cubic-bezier(.2,1.35,.5,1);
  transition: transform .2s,box-shadow .2s;
}
.boss-challenger:hover { transform: translate(-3px,-3px) rotate(-.3deg); box-shadow: 8px 8px 0 var(--ink); }
.boss-challenger:nth-child(even):hover { transform: translate(-3px,-3px) rotate(.3deg); }
.boss-challenger .rank-badge { width: 46px; height: 46px; font-family: var(--font-title); font-size: 1.2rem; font-weight: 400; }
.boss-challenger .av { width: 44px; height: 44px; font-size: 1.4rem; }
.boss-challenger .lb-person { display: flex; min-width: 130px; flex: 1 1 180px; flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.15; }
.boss-challenger .lb-name { display: block; width: 100%; overflow: hidden; font-size: 1.08rem; text-overflow: ellipsis; white-space: nowrap; }
.boss-challenger .lb-role { display: inline-flex; align-items: center; margin-top: 5px; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.82); box-shadow: 2px 2px 0 var(--ink); font-size: .64rem; font-weight: 900; letter-spacing: .055em; line-height: 1.25; text-transform: uppercase; }
.boss-challenger.role-flatterer { background: linear-gradient(100deg,#fff0a8,#ffc97a 54%,#ffb5c6); }
.boss-challenger.role-flatterer .rank-badge { color: #734b00; background: #ffd65d; }
.boss-challenger.role-flatterer .lb-role { color: #6d3900; background: #fff1aa; transform: rotate(-1deg); }
.boss-challenger.role-jester { background: linear-gradient(100deg,#f7eaff,#e6ccff); }
.boss-challenger.role-jester .lb-role { background: #ead5ff; }
.boss-challenger.role-guard { background: linear-gradient(100deg,#edf5ff,#d7e7f3); }
.boss-challenger.role-guard .lb-role { background: #dcecff; }
.boss-challenger.role-population { background: linear-gradient(100deg,#fff,#eaf8e5); }
.boss-challenger.role-population .lb-role { background: #ddf3d5; }
.boss-challenger.role-peasant { background: linear-gradient(100deg,#fff8e9,#ead5ac); }
.boss-challenger.role-peasant .lb-role { background: #f0ddb6; }
.boss-challenger.role-noble { background: linear-gradient(100deg,#fff7dc,#e5e5ff); }
.boss-challenger.role-noble .lb-role { background: #fff0ad; }

@keyframes boss-spark { 0%,100% { transform: scale(.8) rotate(0); } 50% { transform: scale(1.2) rotate(180deg); } }
@keyframes twinkle-line { 0%,100% { opacity: .45; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes royal-rays-spin { to { transform: rotate(360deg); } }
@keyframes throne-arrive { from { opacity: 0; transform: translateX(-50%) translateY(80px) scale(.75); } }
@keyframes gem-glow { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.5) drop-shadow(0 0 7px #fff); } }
@keyframes throne-crown-bop { 0%,100% { transform: translateX(-50%) rotate(-7deg) translateY(0); } 50% { transform: translateX(-50%) rotate(7deg) translateY(-9px); } }
@keyframes boss-avatar-bop { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes coin-float { 0%,100% { transform: translateY(0) rotate(-12deg); } 50% { transform: translateY(-18px) rotate(16deg); } }
@keyframes star-float { 0%,100% { transform: scale(.85) rotate(-8deg); } 50% { transform: scale(1.18) rotate(12deg); } }
@keyframes challenger-slide { from { opacity: 0; transform: translateX(-70px) rotate(-2deg); } }

@media (max-width: 760px) {
  .boss-title { gap: 10px; }
  .boss-title-spark { font-size: 1.8rem; }
  .boss-throne { min-height: 650px; padding-inline: 14px; border-radius: 25px; box-shadow: 7px 7px 0 var(--ink),inset 0 0 0 4px rgba(255,255,255,.28); }
  .gold-throne { top: 132px; width: 270px; transform: translateX(-50%) scale(.9); transform-origin: top center; }
  .boss-player { margin-bottom: 145px; }
  .boss-avatar { width: 112px; height: 112px; font-size: 4rem; }
  .boss-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .boss-stats .stat-chip { min-height: 60px; }
  .coin-one { left: 4%; }
  .coin-two { right: 3%; }
  .star-one { right: 5%; }
  .star-two { left: 5%; }
}
@media (max-width: 520px) {
  .boss-title-spark { display: none; }
  .boss-throne { min-height: 630px; }
  .boss-ribbon { top: 20px; left: -58px; }
  .boss-throne::after { right: 10px; font-size: .9rem; }
  .gold-throne { top: 135px; width: 250px; transform: translateX(-50%) scale(.82); }
  .boss-player { margin-bottom: 134px; }
  .boss-avatar { width: 100px; height: 100px; border-width: 5px; font-size: 3.6rem; }
  .boss-player h2 { font-size: 2rem; }
  .royal-float { opacity: .72; }
  .coin, .star { font-size: 2rem; }
  .boss-challenger { flex-wrap: wrap; }
  .boss-challenger .lb-person { min-width: 0; flex: 1; }
  .boss-challenger .lb-stats { padding-left: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  .boss-title-spark, .royal-rays, .gold-throne, .throne-crown, .boss-avatar, .royal-float, .boss-challenger { animation: none !important; }
}

/* ========== DERNIER DU CLASSEMENT : LE GRAND REJETÉ ========== */
.trash-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  margin: 48px 0 18px;
  text-align: center;
}
.trash-title > span { font-size: 1.8rem; animation: trash-fly 1.2s ease-in-out infinite alternate; }
.trash-title > span:last-child { animation-delay: -.6s; }
.trash-title h2 { margin: 2px 0 0; font-family: var(--font-title); font-size: clamp(1.7rem,4.5vw,2.7rem); font-weight: 400; letter-spacing: .05em; text-shadow: 3px 3px 0 #fff; }
.trash-kicker { display: inline-block; padding: 3px 11px; border: 2px solid var(--ink); border-radius: 999px; color: #fff; background: #617052; box-shadow: 3px 3px 0 var(--ink); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.trash-throne {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 520px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 28px;
  padding: 38px 24px 76px;
  border: 4px solid var(--ink);
  border-radius: 34px;
  background:
    radial-gradient(circle at 14% 20%,rgba(255,255,255,.16) 0 5px,transparent 6px),
    radial-gradient(circle at 80% 28%,rgba(255,255,255,.11) 0 7px,transparent 8px),
    linear-gradient(160deg,#84966e 0%,#54664c 48%,#354235 100%);
  box-shadow: 10px 10px 0 var(--ink),inset 0 0 0 6px rgba(255,255,255,.12);
  overflow: hidden;
}
.trash-throne::before { content: ''; position: absolute; inset: 0; z-index: -2; opacity: .22; background: repeating-linear-gradient(115deg,transparent 0 30px,#1d281e 31px 34px); }
.trash-throne::after { content: '☁  ☁  ☁'; position: absolute; top: 25px; color: rgba(31,39,31,.58); font-size: 2.8rem; letter-spacing: 1.4em; transform: translateX(.7em); }
.trash-ribbon { position: absolute; top: 25px; left: -51px; width: 205px; padding: 8px 0; border-block: 3px solid var(--ink); color: #f2e8c9; background: #403d37; box-shadow: 0 4px 0 rgba(0,0,0,.25); font-family: var(--font-title); letter-spacing: .1em; text-align: center; transform: rotate(-42deg); }
.trash-grave { position: absolute; top: 82px; left: 50%; width: 245px; height: 300px; border: 5px solid var(--ink); border-radius: 48% 48% 18px 18px; color: #34352f; background: linear-gradient(100deg,#858982,#c2c4b8 48%,#737970); box-shadow: 9px 10px 0 rgba(20,27,21,.42),inset 0 0 0 7px rgba(255,255,255,.14); transform: translateX(-50%) rotate(-1deg); }
.trash-grave::before, .trash-grave::after { content: ''; position: absolute; height: 9px; border: 3px solid var(--ink); border-radius: 50%; background: #535a51; transform: rotate(-24deg); }
.trash-grave::before { top: 93px; left: 20px; width: 46px; }
.trash-grave::after { right: 19px; bottom: 54px; width: 60px; transform: rotate(19deg); }
.trash-grave > span { position: absolute; top: 58px; left: 0; right: 0; font-family: var(--font-title); font-size: 2rem; letter-spacing: .1em; text-align: center; text-shadow: 2px 2px 0 rgba(255,255,255,.35); }
.trash-grave > small { position: absolute; top: 102px; left: 0; right: 0; font-weight: 900; letter-spacing: .15em; text-align: center; }
.trash-player { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; margin-bottom: 25px; }
.trash-avatar { display: grid; width: 112px; height: 112px; place-items: center; border: 6px solid var(--ink); border-radius: 50%; background: #d8ddcf; box-shadow: 7px 8px 0 rgba(24,29,24,.48),inset 0 -12px 0 rgba(76,96,68,.2); filter: saturate(.72); font-size: 4rem; animation: trash-avatar-wobble 2.4s ease-in-out infinite; overflow: hidden; }
.trash-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.trash-label { margin-top: 12px; padding: 5px 15px; border: 3px solid var(--ink); border-radius: 999px; color: #efe7c7; background: #4c4a3e; box-shadow: 3px 3px 0 var(--ink); font-family: var(--font-title); letter-spacing: .1em; transform: rotate(2deg); }
.trash-player h2 { margin: 8px 0 0; color: #f5f0df; font-family: var(--font-title); font-size: clamp(2rem,5vw,3.2rem); font-weight: 400; letter-spacing: .04em; text-shadow: 4px 4px 0 var(--ink); }
.trash-player p { margin: 2px 0 0; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 999px; color: #252a23; background: rgba(224,227,204,.82); font-weight: 800; text-align: center; }
.trash-stats { position: relative; z-index: 4; display: grid; width: min(760px,100%); grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.trash-stats > span { display: flex; min-height: 64px; flex-direction: column; align-items: center; justify-content: center; padding: 8px; border: 3px solid var(--ink); border-radius: 14px; color: #292d27; background: #d9ddca; box-shadow: 4px 4px 0 var(--ink); font-size: .78rem; font-weight: 800; text-align: center; }
.trash-stats b { font-size: 1.08rem; }
.trash-can { position: absolute; z-index: 2; bottom: 105px; font-size: 6.5rem; filter: grayscale(.25) drop-shadow(6px 7px 0 rgba(25,30,25,.45)); }
.can-left { left: 7%; transform: rotate(-12deg); }
.can-right { right: 7%; transform: rotate(11deg); }
.trash-rat { position: absolute; right: 20%; bottom: 47px; z-index: 5; font-size: 2.8rem; animation: rat-scurry 3.8s ease-in-out infinite; }
.trash-ground { position: absolute; right: 0; bottom: 0; left: 0; z-index: 3; min-height: 53px; padding: 9px 20px; border-top: 4px solid var(--ink); background: linear-gradient(#776548,#4c4232); box-shadow: inset 0 8px 0 rgba(255,255,255,.08); font-size: 1.8rem; letter-spacing: .35em; text-align: center; }
.trash-fly { position: absolute; z-index: 4; color: #1f251f; font-size: 1.4rem; animation: trash-fly 1.1s ease-in-out infinite alternate; }
.fly-one { top: 26%; left: 18%; transform: rotate(25deg); }
.fly-two { top: 19%; right: 18%; animation-delay: -.5s; transform: rotate(-25deg); }
@keyframes trash-avatar-wobble { 0%,100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(5px); } }
@keyframes trash-fly { from { transform: translate(-5px,-4px) rotate(-12deg); } to { transform: translate(7px,6px) rotate(15deg); } }
@keyframes rat-scurry { 0%,100% { transform: translateX(-18px) scaleX(1); } 48% { transform: translateX(25px) scaleX(1); } 52% { transform: translateX(25px) scaleX(-1); } 96% { transform: translateX(-18px) scaleX(-1); } }

@media (max-width: 680px) {
  .trash-throne { min-height: 555px; padding-inline: 13px; border-radius: 25px; box-shadow: 7px 7px 0 var(--ink),inset 0 0 0 4px rgba(255,255,255,.12); }
  .trash-grave { top: 92px; width: 220px; height: 285px; }
  .trash-avatar { width: 96px; height: 96px; font-size: 3.4rem; }
  .trash-player { margin-bottom: 35px; }
  .trash-player p { max-width: 280px; border-radius: 14px; }
  .trash-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .trash-can { bottom: 172px; font-size: 4.5rem; opacity: .82; }
  .can-left { left: 1%; }
  .can-right { right: 1%; }
  .trash-ground { font-size: 1.25rem; letter-spacing: .12em; }
}
@media (max-width: 430px) {
  .trash-title > span { display: none; }
  .trash-ribbon { top: 20px; left: -65px; }
  .trash-throne::after { font-size: 2rem; }
  .trash-can { font-size: 3.6rem; }
  .trash-player h2 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .trash-title > span, .trash-avatar, .trash-rat, .trash-fly { animation: none !important; }
}

/* ========== CONNEXION / PROFIL ========== */
.topbar-right, #user-menu { display: flex; align-items: center; gap: 9px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
  padding: 5px 10px 5px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  transition: transform .18s,box-shadow .18s;
}
.user-chip:hover { transform: translate(-2px,-2px) rotate(-1deg); box-shadow: 5px 5px 0 var(--ink); }
.user-avatar { display: grid; width: 31px; height: 31px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--gold-soft); }
.user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { display: grid; width: 37px; height: 37px; place-items: center; border: 2px solid var(--ink); border-radius: 10px; color: var(--ink); background: var(--red-soft); box-shadow: 3px 3px 0 var(--ink); font-size: 1.15rem; font-weight: 900; cursor: pointer; transition: transform .18s,box-shadow .18s; }
.logout-btn:hover { transform: translate(-2px,-2px) rotate(-8deg); box-shadow: 5px 5px 0 var(--ink); }

.auth-mode .topbar, .auth-mode .footer { display: none; }
.auth-mode #app { width: 100%; padding: 0; }
.auth-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  gap: clamp(20px,5vw,70px);
  padding: 42px 20px 56px;
  overflow: hidden;
}
.auth-page::before, .auth-page::after { content: ''; position: absolute; z-index: -1; width: 260px; height: 260px; border: 4px solid var(--ink); border-radius: 50%; opacity: .16; }
.auth-page::before { top: -110px; left: -80px; background: var(--gold); }
.auth-page::after { right: -90px; bottom: -120px; background: var(--purple); }
.auth-card {
  position: relative;
  width: min(500px,100%);
  padding: 28px 32px 26px;
  border: 4px solid var(--ink);
  border-radius: 30px;
  background: rgba(255,255,255,.96);
  box-shadow: 10px 10px 0 var(--ink);
  animation: auth-card-in .55s cubic-bezier(.2,1.4,.5,1) both;
}
.auth-card::after { content: ''; position: absolute; inset: 9px; z-index: -1; border: 2px dashed #c9c4de; border-radius: 20px; pointer-events: none; }
.auth-crown { position: absolute; top: -42px; left: 50%; font-size: 3.8rem; filter: drop-shadow(4px 4px 0 var(--ink)); transform: translateX(-50%) rotate(-5deg); animation: auth-crown 2s ease-in-out infinite; }
.auth-kicker { display: block; margin-top: 10px; color: var(--blue-dark); font-size: .77rem; font-weight: 800; letter-spacing: .1em; text-align: center; text-transform: uppercase; }
.auth-card h1 { margin: 3px 0; font-family: var(--font-title); font-size: clamp(2rem,5vw,2.55rem); font-weight: 400; letter-spacing: .045em; text-align: center; text-shadow: 3px 3px 0 #e6e3f5; }
.auth-card > p { margin: 0 auto 14px; color: var(--muted); font-weight: 700; text-align: center; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; padding: 5px; border: 2px solid var(--ink); border-radius: 14px; background: #f1f0f7; }
.auth-tabs button { min-height: 42px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 800; cursor: pointer; }
.auth-tabs button.active { border: 2px solid var(--ink); color: var(--ink); background: var(--gold-soft); box-shadow: 2px 2px 0 var(--ink); }
.auth-form .field { margin-bottom: 14px; }
.auth-form .field input { min-height: 49px; border-width: 3px; box-shadow: 3px 3px 0 var(--ink); font-weight: 700; }
.auth-form .field small { color: var(--muted); font-size: .76rem; }
.avatar-picker { margin: 0 0 15px; padding: 0; border: 0; }
.avatar-picker legend { margin-bottom: 7px; font-size: .9rem; font-weight: 800; }
.auth-avatars { display: grid; grid-template-columns: repeat(8,1fr); gap: 6px; }
.auth-avatars button { display: grid; width: 100%; aspect-ratio: 1; place-items: center; border: 2px solid var(--ink); border-radius: 10px; background: #fff; box-shadow: 2px 2px 0 var(--ink); font-size: 1.2rem; cursor: pointer; transition: transform .15s,background .15s; }
.auth-avatars button:hover { transform: translateY(-3px) rotate(-5deg); background: var(--blue-soft); }
.auth-avatars button.selected { background: var(--gold); transform: translateY(-3px) scale(1.08) rotate(4deg); box-shadow: 4px 4px 0 var(--ink); }
.auth-error { min-height: 24px; margin: -2px 0 8px; color: #b3263c; font-size: .86rem; font-weight: 800; text-align: center; }
.auth-submit { width: 100%; }
.auth-doodle { font-size: clamp(4rem,8vw,7rem); filter: drop-shadow(7px 8px 0 rgba(41,38,60,.3)); }
.auth-card-left { animation: auth-doodle-left 2.8s ease-in-out infinite; }
.auth-card-right { animation: auth-doodle-right 2.4s ease-in-out infinite; }

@keyframes auth-card-in { from { opacity: 0; transform: translateY(35px) scale(.88) rotate(-2deg); } }
@keyframes auth-crown { 0%,100% { transform: translateX(-50%) rotate(-7deg) translateY(0); } 50% { transform: translateX(-50%) rotate(7deg) translateY(-7px); } }
@keyframes auth-doodle-left { 0%,100% { transform: rotate(-12deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-15px); } }
@keyframes auth-doodle-right { 0%,100% { transform: rotate(10deg) scale(1); } 50% { transform: rotate(-8deg) scale(1.08); } }

@media (max-width: 860px) {
  .topbar-right { gap: 6px; }
  .user-name { display: none; }
  .user-chip { padding-right: 5px; }
  .auth-doodle { display: none; }
}
@media (max-width: 680px) {
  .topbar-right { flex: 1; justify-content: flex-end; }
  .user-chip { display: flex; }
  .auth-page { align-items: flex-start; padding: 66px 15px 38px; }
  .auth-card { padding: 28px 20px 22px; border-radius: 23px; box-shadow: 7px 7px 0 var(--ink); }
  .auth-avatars { grid-template-columns: repeat(8,1fr); gap: 4px; }
  .auth-avatars button { border-radius: 8px; font-size: 1rem; }
}

/* ========== ACCUEIL PUBLIC + SAISIE MOBILE ========== */
.guest-mode .nav { display: none; }
.guest-mode #app { padding-top: 28px; }
.guest-login, .guest-register { min-height: 40px; padding: 7px 13px; font-size: .88rem; }
.auth-modal-card { width: min(500px,100%); overflow: visible; }
.auth-modal-card #auth-dialog-content { max-height: calc(88vh - 56px); padding-top: 5px; overflow-y: auto; }
.auth-modal-card #auth-dialog-content > section > p { margin: 0 auto 14px; color: var(--muted); font-weight: 700; text-align: center; }

.score-cell { grid-template-columns: 36px minmax(0,1fr); min-width: 0; overflow: hidden; }
.score-cell .score-player-name { display: block; min-width: 0; overflow: hidden; font-size: .9rem; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.score-entry { display: grid; grid-column: 1 / -1; grid-template-columns: 58px minmax(0,1fr); gap: 7px; min-width: 0; }
.minus-ten {
  min-height: 39px;
  padding: 4px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  color: #a92e45;
  background: var(--red-soft);
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 900;
  cursor: pointer;
}
.minus-ten:active { box-shadow: none; transform: translate(2px,2px); }

/* ========== ROUE DU PREMIER JOUEUR ========== */
.starter-picker {
  display: grid;
  grid-template-columns: minmax(0,1fr) 238px;
  gap: 18px 24px;
  align-items: center;
  margin: 4px 0 24px;
  padding: 19px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: linear-gradient(135deg,#fff5bd,#e9eaff 62%,#dff9eb);
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
}
.starter-copy h3 { margin: 5px 0 2px; font-family: var(--font-title); font-size: 1.65rem; font-weight: 400; letter-spacing: .04em; }
.starter-copy p { margin: 0 0 11px; color: var(--muted); font-weight: 700; }
.starter-kicker { display: inline-block; padding: 3px 9px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; box-shadow: 2px 2px 0 var(--ink); font-size: .67rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.starter-players { display: flex; flex-wrap: wrap; gap: 6px; }
.starter-players > span { display: inline-flex; align-items: center; gap: 5px; max-width: 150px; padding: 3px 8px 3px 4px; border: 2px solid var(--ink); border-radius: 999px; background: rgba(255,255,255,.88); font-size: .72rem; font-weight: 800; }
.mini-avatar { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 50%; overflow: hidden; }
.mini-avatar img { width: 100%; height: 100%; object-fit: cover; }
.starter-wheel-zone { position: relative; width: 218px; height: 218px; margin: 8px auto; }
.wheel-pointer { position: absolute; top: -17px; left: 50%; z-index: 4; color: var(--ink); font-size: 2.2rem; line-height: 1; filter: drop-shadow(0 3px 0 #fff); transform: translateX(-50%); }
.starter-wheel { position: relative; width: 100%; height: 100%; border: 6px solid var(--ink); border-radius: 50%; box-shadow: 7px 7px 0 rgba(41,38,60,.35),inset 0 0 0 4px rgba(255,255,255,.55); }
.wheel-name { position: absolute; top: 50%; left: calc(50% - 35px); z-index: 2; width: 70px; overflow: hidden; font-size: .65rem; font-weight: 900; line-height: 1; text-align: center; text-overflow: ellipsis; text-shadow: 1px 1px 0 rgba(255,255,255,.9); white-space: nowrap; transform: rotate(var(--angle)) translateY(-78px) rotate(var(--counter)); transform-origin: 35px 0; }
.wheel-hub { position: absolute; top: 50%; left: 50%; z-index: 3; display: grid; width: 52px; height: 52px; place-items: center; border: 4px solid var(--ink); border-radius: 50%; background: #fff; box-shadow: 3px 3px 0 var(--ink); font-size: 1.5rem; transform: translate(-50%,-50%); }
.starter-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 3px; }
.starter-result { min-height: 45px; padding: 9px 13px; border: 2px dashed var(--ink); border-radius: 12px; background: rgba(255,255,255,.72); font-weight: 800; }
.starter-result strong { color: var(--blue-dark); font-size: 1.05rem; }
.starter-spin { flex: 0 0 auto; background: var(--purple); }

@media (max-width: 680px) {
  .guest-mode .topbar { gap: 6px; }
  .guest-login, .guest-register { padding: 6px 9px; font-size: .76rem; }
  .auth-modal-card { padding: 24px 18px 20px; }
  .score-cell { grid-template-columns: 36px minmax(0,1fr); }
  .starter-picker { grid-template-columns: 1fr; padding: 16px 12px; text-align: center; }
  .starter-players { justify-content: center; }
  .starter-wheel-zone { width: 210px; height: 210px; }
  .starter-controls { flex-direction: column; }
  .starter-result, .starter-spin { width: 100%; }
}
@media (max-width: 390px) {
  .guest-login, .guest-register { min-height: 37px; padding-inline: 7px; font-size: .7rem; }
  .score-cell { grid-template-columns: 32px minmax(0,1fr); }
  .score-entry { grid-template-columns: 54px minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .starter-wheel { transition-duration: .01ms !important; }
}
@media (max-width: 430px) {
  .auth-avatars { grid-template-columns: repeat(8,1fr); }
  .auth-card h1 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-crown, .auth-doodle { animation: none !important; }
}

/* ========== PAGE PROFIL ========== */
.profile-page { padding-bottom: 30px; }
.profile-heading { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0 28px; text-align: center; }
.profile-heading h1 { margin: 2px 0 0; font-family: var(--font-title); font-size: clamp(2.5rem,6vw,4.2rem); font-weight: 400; letter-spacing: .05em; line-height: 1; text-shadow: 4px 4px 0 #fff,7px 7px 0 rgba(41,38,60,.15); }
.profile-heading p { margin: 8px 0 0; color: var(--muted); font-weight: 700; }
.profile-kicker { display: inline-block; padding: 4px 11px; border: 2px solid var(--ink); border-radius: 999px; color: var(--blue-dark); background: var(--blue-soft); box-shadow: 3px 3px 0 var(--ink); font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.profile-heading-icon { color: var(--gold); font-size: 2.7rem; -webkit-text-stroke: 2px var(--ink); filter: drop-shadow(3px 3px 0 var(--ink)); animation: boss-spark 1.8s ease-in-out infinite; }
.profile-heading-icon:last-child { animation-delay: -.9s; }
.profile-layout { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(0,1.28fr); gap: 26px; align-items: start; }
.profile-preview { position: sticky; top: 104px; display: flex; min-height: 440px; flex-direction: column; align-items: center; justify-content: center; padding: 34px 24px; border: 4px solid var(--ink); border-radius: 32px; background: radial-gradient(circle at 50% 30%,#fff8b8 0 4%,transparent 35%),linear-gradient(145deg,#ffd95f,#ff9d52); box-shadow: 9px 9px 0 var(--ink),inset 0 0 0 6px rgba(255,255,255,.25); overflow: hidden; }
.profile-preview::before { content: ''; position: absolute; inset: -40%; opacity: .35; background: repeating-conic-gradient(from 0deg,rgba(255,255,255,.8) 0 9deg,transparent 9deg 21deg); animation: royal-rays-spin 30s linear infinite; }
.profile-preview::after { content: '★  ✦  ★'; position: absolute; bottom: 26px; color: rgba(255,255,255,.75); font-size: 1.4rem; letter-spacing: .5em; }
.profile-crown { position: relative; z-index: 2; margin-bottom: -18px; font-size: 4rem; filter: drop-shadow(4px 5px 0 var(--ink)); animation: trophy-bob 1.8s ease-in-out infinite; }
.profile-avatar-preview { position: relative; z-index: 1; display: grid; width: 142px; height: 142px; place-items: center; border: 6px solid var(--ink); border-radius: 50%; background: #fff; box-shadow: 7px 7px 0 rgba(41,38,60,.45),inset 0 -12px 0 var(--blue-soft); font-size: 5rem; transition: transform .2s; }
.profile-avatar-preview:hover { transform: rotate(6deg) scale(1.04); }
.profile-preview-label { position: relative; z-index: 1; margin-top: 20px; padding: 5px 15px; border: 3px solid var(--ink); border-radius: 999px; color: #fff; background: var(--red); box-shadow: 3px 3px 0 var(--ink); font-family: var(--font-title); letter-spacing: .1em; transform: rotate(-2deg); }
.profile-preview h2 { position: relative; z-index: 1; max-width: 100%; margin: 10px 0 4px; overflow-wrap: anywhere; font-family: var(--font-title); font-size: 2.2rem; font-weight: 400; letter-spacing: .04em; text-align: center; text-shadow: 3px 3px 0 #fff; }
.profile-mini-badges { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.profile-mini-badges span { padding: 4px 8px; border: 2px solid var(--ink); border-radius: 999px; background: rgba(255,255,255,.86); box-shadow: 2px 2px 0 var(--ink); font-size: .72rem; font-weight: 800; }
.profile-form { padding: 28px; }
.profile-form .section-title { margin: 0 0 20px; }
.profile-form .field input { min-height: 52px; border-width: 3px; box-shadow: 3px 3px 0 var(--ink); font-weight: 800; }
.profile-form .field small { color: var(--muted); font-size: .78rem; }
.profile-photo-upload { margin: 21px 0 10px; }
.profile-photo-upload > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.profile-photo-upload > label { display: flex; align-items: center; gap: 13px; padding: 13px 15px; border: 3px dashed var(--ink); border-radius: 15px; background: #f7f5ff; box-shadow: 4px 4px 0 var(--ink); cursor: pointer; transition: transform .18s,background .18s,box-shadow .18s; }
.profile-photo-upload > label:hover { background: var(--gold-soft); box-shadow: 6px 6px 0 var(--ink); transform: translate(-2px,-2px) rotate(-.3deg); }
.profile-photo-upload > input:focus-visible + label { outline: 3px solid rgba(91,91,231,.38); outline-offset: 3px; }
.photo-upload-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border: 2px solid var(--ink); border-radius: 13px; background: #fff; box-shadow: 2px 2px 0 var(--ink); font-size: 1.5rem; }
.profile-photo-upload label > span:last-child { display: flex; flex-direction: column; }
.profile-photo-upload label strong { font-size: .95rem; }
.profile-photo-upload label small { color: var(--muted); font-size: .74rem; font-weight: 700; }
.photo-upload-status { min-height: 21px; margin: 8px 2px 0; color: var(--green); font-size: .78rem; font-weight: 800; }
.profile-choice-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; color: var(--muted); font-size: .73rem; font-weight: 800; text-transform: uppercase; }
.profile-choice-divider::before, .profile-choice-divider::after { content: ''; height: 2px; flex: 1; background: #d5d1df; }
.profile-choice-divider span { flex: 0 0 auto; }
.profile-avatar-picker { margin-top: 22px; }
.profile-avatar-picker legend { font-size: 1rem; }
.profile-avatar-picker > p { margin: -4px 0 11px; color: var(--muted); font-size: .84rem; }
.profile-avatars { grid-template-columns: repeat(8,minmax(0,1fr)); }
.profile-error { min-height: 26px; margin-top: 10px; color: #b3263c; font-weight: 800; text-align: center; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.profile-actions .btn:first-child { flex: 1; }
.profile-danger { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 28px; padding: 22px 25px; border-color: #a92f45; background: linear-gradient(135deg,#fff8f9,var(--red-soft)); box-shadow: 6px 6px 0 #a92f45; }
.profile-danger h2 { margin: 3px 0 4px; font-family: var(--font-title); font-size: 1.55rem; font-weight: 400; letter-spacing: .03em; }
.profile-danger p { max-width: 650px; margin: 0; color: var(--muted); font-size: .86rem; font-weight: 700; }
.danger-kicker { color: #a92f45; font-size: .7rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.delete-account-modal { text-align: center; }
.delete-account-modal h3 { margin-top: 4px; }
.delete-account-modal > p { color: var(--muted); font-weight: 700; }
.delete-account-modal .field { text-align: left; }
.delete-warning-icon { font-size: 3.2rem; filter: drop-shadow(3px 3px 0 #ffd0d7); }

@media (max-width: 860px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-preview { position: relative; top: 0; min-height: 380px; }
}
@media (max-width: 580px) {
  .profile-heading-icon { display: none; }
  .profile-heading h1 { font-size: 2.7rem; }
  .profile-preview { min-height: 350px; border-radius: 24px; }
  .profile-avatar-preview { width: 120px; height: 120px; font-size: 4rem; }
  .profile-form { padding: 21px 17px; }
  .profile-avatars { grid-template-columns: repeat(6,minmax(0,1fr)); }
  .profile-actions .btn { flex: 1 1 100%; }
  .profile-danger { align-items: stretch; flex-direction: column; }
  .profile-danger .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-heading-icon, .profile-preview::before, .profile-crown { animation: none !important; }
}

/* ========== CRÉATION DE SALLE & PARTAGE SIMPLIFIÉS ========== */
.game-choice { gap: 14px; margin: 6px 0 10px; }
.game-choice label {
  min-height: 150px;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  border-width: 3px;
  border-radius: 20px;
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: .05em;
}
.game-choice label:first-child { background: #e9f5ff; }
.game-choice label:last-child { background: #f3e8ff; }
.game-choice label:has(input:checked) { color: var(--ink); background: var(--gold-soft); box-shadow: 7px 7px 0 var(--ink); transform: translate(-3px,-3px) rotate(-1deg); }
.game-choice label:last-child:has(input:checked) { transform: translate(-3px,-3px) rotate(1deg); }
.game-choice-icon { font-size: 3.5rem; filter: drop-shadow(3px 4px 0 rgba(41,38,60,.3)); transition: transform .2s; }
.game-choice label:hover .game-choice-icon, .game-choice label:has(input:checked) .game-choice-icon { transform: translateY(-5px) rotate(-7deg) scale(1.08); }
.game-choice label:last-child:hover .game-choice-icon, .game-choice label:last-child:has(input:checked) .game-choice-icon { transform: translateY(-5px) rotate(7deg) scale(1.08); }

.share-modal-content { display: flex; flex-direction: column; align-items: center; width: 100%; text-align: center; }
.share-qr { display: block; width: min(230px,70vw); height: auto; aspect-ratio: 1; padding: 8px; border: 3px solid var(--ink); border-radius: 20px; background: #fff; box-shadow: 6px 6px 0 var(--ink); }
.share-code { display: inline-flex; min-width: 190px; min-height: 54px; align-items: center; justify-content: center; margin: 20px auto 10px; padding: 8px 18px; border: 3px dashed var(--ink); border-radius: 13px; color: var(--ink); background: var(--gold-soft); box-shadow: 4px 4px 0 var(--ink); font-family: var(--font-title); font-size: 1.65rem; font-weight: 400; letter-spacing: .18em; line-height: 1; }
.share-url { width: min(100%,420px); margin: 2px auto 4px; overflow-wrap: anywhere; color: var(--muted); font-size: .8rem; font-weight: 700; }
.share-actions { justify-content: center; width: 100%; }
.share-actions .btn { min-width: 155px; }

@media (max-width: 520px) {
  .game-choice { grid-template-columns: 1fr 1fr; }
  .game-choice label { min-height: 125px; padding: 10px 6px; }
  .game-choice-icon { font-size: 2.8rem; }
  .share-actions .btn { flex: 1 1 100%; }
}

/* ========== TABLEAU DES SCORES DE LA ROOM ========== */
.scoreboard-shell {
  position: relative;
  padding: 18px;
  border: 4px solid var(--ink);
  border-radius: 25px;
  background: rgba(255,255,255,.94);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}
.scoreboard-shell::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -70px;
  width: 190px;
  height: 190px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--gold-soft);
  opacity: .45;
}
.scoreboard-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 3px dashed #b9b5c8;
}
.scoreboard-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.scoreboard-title > div { display: flex; min-width: 0; flex-direction: column; }
.scoreboard-title > div > span { font-family: var(--font-title); font-size: 1.35rem; font-weight: 400; letter-spacing: .045em; line-height: 1.1; }
.scoreboard-title small { color: var(--muted); font-weight: 700; }
.scoreboard-trophy { display: grid; width: 52px; height: 52px; flex: 0 0 auto; place-items: center; border: 3px solid var(--ink); border-radius: 15px; background: var(--gold); box-shadow: 4px 4px 0 var(--ink); font-size: 1.7rem; transform: rotate(-5deg); animation: trophy-bob 2.2s ease-in-out infinite; }
.scoreboard-rule { flex: 0 0 auto; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 999px; background: var(--blue-soft); box-shadow: 2px 2px 0 var(--ink); font-size: .75rem; font-weight: 800; }
.scoreboard-columns { display: grid; grid-template-columns: minmax(0,1fr) 78px 72px; gap: 8px; padding: 0 50px 7px 12px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.scoreboard-columns span:nth-child(2), .scoreboard-columns span:last-child { text-align: right; }
.scoreboard-list { position: relative; z-index: 1; gap: 12px; }
.scoreboard-row {
  min-height: 76px;
  padding: 12px 14px;
  border-width: 3px;
  border-color: var(--ink);
  border-radius: 16px;
  box-shadow: 5px 5px 0 var(--ink);
  animation: score-row-in .48s var(--score-delay) backwards cubic-bezier(.2,1.4,.5,1);
  transition: transform .2s,box-shadow .2s;
}
.scoreboard-row:hover { transform: translate(-2px,-2px); box-shadow: 7px 7px 0 var(--ink); }
.scoreboard-row.first {
  min-height: 88px;
  border-color: var(--ink);
  background: linear-gradient(100deg,#fff5bd,#ffd75e);
  box-shadow: 6px 6px 0 #ad7112,9px 9px 0 var(--ink);
}
.scoreboard-row.second { background: linear-gradient(100deg,#fff,#e8ebf1); }
.scoreboard-row.third { background: linear-gradient(100deg,#fff8f1,#f3c59d); }
.scoreboard-row .rank-badge { width: 44px; height: 44px; border-width: 3px; border-radius: 13px; font-family: var(--font-title); font-size: 1.25rem; font-weight: 400; }
.scoreboard-row.first .rank-badge { color: #684000; background: var(--gold); }
.scoreboard-row .av { width: 44px; height: 44px; border-width: 3px; border-radius: 13px; font-size: 1.4rem; }
.scoreboard-row .r-name { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; line-height: 1.1; white-space: normal; }
.scoreboard-row .r-name strong { max-width: 100%; overflow: hidden; font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.scoreboard-row .r-name small { margin-top: 4px; color: #8a5b08; font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.scoreboard-row .delta { min-width: 55px; justify-content: center; border-width: 2px; font-size: .78rem; }
.scoreboard-row .r-total { display: flex; min-width: 58px; flex-direction: column; align-items: flex-end; line-height: 1; }
.scoreboard-row .r-total strong { color: var(--blue-dark); font-family: var(--font-title); font-size: 1.65rem; font-weight: 400; }
.scoreboard-row.first .r-total strong { color: #805205; }
.scoreboard-row .r-total small { margin-top: 3px; color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.leader-crown { position: absolute; top: -19px; left: 14px; z-index: 2; font-size: 1.8rem; filter: drop-shadow(2px 3px 0 var(--ink)); animation: trophy-bob 1.8s ease-in-out infinite; }
.scoreboard-empty { position: relative; z-index: 1; border: 0; background: transparent; }

@keyframes score-row-in { from { opacity: 0; transform: translateX(-45px) rotate(-1deg); } }

@media (max-width: 580px) {
  .scoreboard-shell { padding: 13px; border-radius: 20px; box-shadow: 6px 6px 0 var(--ink); }
  .scoreboard-head { align-items: flex-start; flex-direction: column; }
  .scoreboard-rule { margin-left: 63px; }
  .scoreboard-columns { grid-template-columns: minmax(0,1fr) 56px 55px; padding-right: 7px; }
  .scoreboard-row { gap: 8px; padding: 11px 9px; }
  .scoreboard-row .av { display: grid; }
  .scoreboard-row .rank-badge { width: 38px; height: 38px; }
  .scoreboard-row .av { width: 38px; height: 38px; }
  .scoreboard-row .delta { min-width: 43px; padding-inline: 5px; }
  .scoreboard-row .r-total { min-width: 45px; margin-right: 35px; }
  .scoreboard-row .r-total strong { font-size: 1.35rem; }
  .scoreboard-row .kick { position: absolute; top: 50%; right: 7px; transform: translateY(-50%) scale(.78); }
  .scoreboard-row .kick:hover { transform: translateY(-50%) scale(.84) rotate(8deg); }
}
@media (max-width: 390px) {
  .scoreboard-row .av { display: none; }
  .scoreboard-columns { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scoreboard-trophy, .scoreboard-row, .leader-crown { animation: none !important; }
}

/* ========== PODIUM CARTOON DE LA ROOM ========== */
.podium {
  position: relative;
  display: block;
  min-height: 370px;
  margin-bottom: 22px;
  padding: 0;
  border: 4px solid var(--ink);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 33%,rgba(255,255,255,.94) 0 7%,transparent 34%),
    linear-gradient(145deg,#e8f6ff 0%,#f7eaff 58%,#fff4c9 100%);
  box-shadow: 8px 8px 0 var(--ink),inset 0 0 0 6px rgba(255,255,255,.45);
  overflow: hidden;
}
.podium::after {
  content: '●   ★   ●   ★   ●';
  position: absolute;
  top: 24px;
  right: 28px;
  color: rgba(89,101,242,.3);
  font-size: .7rem;
  letter-spacing: .45em;
}
.podium-rays { position: absolute; inset: -80% -35% 12%; opacity: .28; background: repeating-conic-gradient(from 0deg at 50% 50%,#fff 0 10deg,transparent 10deg 22deg); animation: royal-rays-spin 35s linear infinite; }
.podium-badge { position: absolute; top: 20px; left: 22px; z-index: 5; padding: 6px 15px; border: 3px solid var(--ink); border-radius: 999px; color: var(--ink); background: var(--gold-soft); box-shadow: 4px 4px 0 var(--ink); font-family: var(--font-title); font-size: .95rem; font-weight: 400; letter-spacing: .06em; transform: rotate(-2deg); white-space: nowrap; }
.podium-steps { position: absolute; right: 8%; bottom: 42px; left: 8%; z-index: 3; display: flex; height: 282px; align-items: flex-end; justify-content: center; gap: 12px; }
.podium .step { position: relative; display: flex; width: 30%; max-width: 180px; flex-direction: column; align-items: center; gap: 5px; }
.podium .step:empty { min-height: 1px; }
.podium .crown-holder { position: relative; z-index: 2; }
.podium .av.big { width: 60px; height: 60px; border: 4px solid var(--ink); border-radius: 18px; background: #fff; box-shadow: 5px 5px 0 rgba(41,38,60,.38); font-size: 2rem; }
.podium .p1 .av.big { width: 72px; height: 72px; border-radius: 22px; background: #fff9db; font-size: 2.4rem; }
.podium .crown { top: -37px; z-index: 3; font-size: 2.35rem; filter: drop-shadow(3px 4px 0 var(--ink)); }
.podium .p-name { position: relative; z-index: 2; max-width: 100%; padding: 2px 8px; overflow: hidden; color: var(--ink); background: rgba(255,255,255,.72); border-radius: 7px; font-size: 1rem; font-weight: 800; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.podium .p1 .p-name { font-family: var(--font-title); font-size: 1.15rem; font-weight: 400; letter-spacing: .04em; }
.podium .p-score { position: relative; z-index: 2; padding: 2px 8px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); background: #fff; box-shadow: 2px 2px 0 var(--ink); font-size: .75rem; font-weight: 800; }
.podium .block { position: relative; display: flex; width: 100%; height: 76px; align-items: center; justify-content: center; border: 4px solid var(--ink); border-bottom: 0; border-radius: 18px 18px 0 0; color: #6a4210; background: linear-gradient(100deg,#d88c4c,#f1bb83,#c97738); box-shadow: inset 0 8px 0 rgba(255,255,255,.25),6px 0 0 rgba(41,38,60,.14); font-family: var(--font-title); font-size: 2.1rem; font-weight: 400; overflow: hidden; }
.podium .block::before { content: ''; position: absolute; inset: 0; opacity: .18; background: repeating-linear-gradient(135deg,transparent 0 15px,#fff 15px 24px); }
.podium .p1 .block { height: 142px; color: #6d4700; background: linear-gradient(100deg,#e8a817,#ffe27b 45%,#e49a0c); box-shadow: inset 0 10px 0 rgba(255,255,255,.32),6px 0 0 rgba(41,38,60,.14); font-size: 2.7rem; }
.podium .p2 .block { height: 102px; color: #4f586d; background: linear-gradient(100deg,#aeb6c5,#eef1f6 48%,#9ea8b8); }
.podium .p3 .block { height: 78px; color: #743f18; background: linear-gradient(100deg,#bd6c35,#eda873 48%,#a95527); }
.podium-number { position: relative; z-index: 2; text-shadow: 2px 2px 0 rgba(255,255,255,.7); }
.podium-medal { position: absolute; right: 12px; bottom: 9px; z-index: 2; font-size: .8rem; opacity: .65; }
.podium-floor { position: absolute; right: -4%; bottom: 0; left: -4%; z-index: 4; height: 44px; border-top: 4px solid var(--ink); background: repeating-linear-gradient(90deg,#d72e49 0 55px,#b8203a 55px 110px); box-shadow: inset 0 8px 0 rgba(255,255,255,.18); }
.podium-spark { position: absolute; z-index: 2; color: var(--gold); font-size: 2.7rem; -webkit-text-stroke: 2px var(--ink); filter: drop-shadow(3px 3px 0 rgba(41,38,60,.3)); animation: boss-spark 2s ease-in-out infinite; }
.podium-spark.spark-left { top: 24%; left: 8%; }
.podium-spark.spark-right { top: 20%; right: 8%; animation-delay: -1s; }

@media (max-width: 580px) {
  .podium { min-height: 320px; border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); }
  .podium::after { display: none; }
  .podium-badge { top: 14px; left: 14px; padding: 5px 10px; font-size: .78rem; }
  .podium-steps { right: 3%; bottom: 34px; left: 3%; height: 238px; gap: 5px; }
  .podium .step { width: 33%; }
  .podium .av.big { width: 48px; height: 48px; border-radius: 14px; font-size: 1.55rem; }
  .podium .p1 .av.big { width: 58px; height: 58px; border-radius: 17px; font-size: 1.9rem; }
  .podium .crown { top: -31px; font-size: 1.9rem; }
  .podium .p-name { max-width: 94px; font-size: .78rem; }
  .podium .p1 .p-name { font-size: .9rem; }
  .podium .p-score { padding-inline: 6px; font-size: .66rem; }
  .podium .p1 .block { height: 115px; }
  .podium .p2 .block { height: 82px; }
  .podium .p3 .block { height: 62px; }
  .podium-floor { height: 36px; }
  .podium-spark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .podium-rays, .podium-spark { animation: none !important; }
}

/* =====================================================
   🎃 ÉDITION HALLOWEEN — même cartoon, en version hantée
   ===================================================== */
:root {
  --ink: #f1ecff;
  --muted: #ad9fd6;
  --bg: #0d0a16;
  --card: #1c1430;
  --line: var(--ink);
  --line-strong: var(--ink);
  --blue: #ff7a1a;
  --blue-dark: #d85e0a;
  --blue-soft: rgba(255,122,26,.16);
  --green: #43e07a;
  --green-soft: rgba(67,224,122,.14);
  --red: #ff3b52;
  --red-soft: rgba(255,59,82,.16);
  --gold: #ffb347;
  --gold-soft: rgba(255,179,71,.16);
  --purple: #b06df0;
  --font-spooky: 'Creepster', 'Luckiest Guy', sans-serif;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-hover: 8px 8px 0 var(--ink);
}

body {
  background:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,.05) 0 3px, transparent 4px) 0 0 / 36px 36px,
    radial-gradient(ellipse at 50% 100%, rgba(255,122,26,.12), transparent 60%),
    radial-gradient(circle at 85% 8%, rgba(176,109,240,.2), transparent 35%),
    linear-gradient(180deg, #0a0712 0%, #140d24 45%, #1c1130 100%);
  background-attachment: fixed;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 120%, rgba(255,122,26,.1), transparent 55%);
  animation: candle-flicker 5s ease-in-out infinite;
}
::selection { color: #fff; background: rgba(255,122,26,.4); }
:focus-visible { outline-color: rgba(255,122,26,.5); }

/* Titres les plus imposants : police de sorcière */
.hero h1, .boss-title h1, .boss-player h2, .trash-player h2,
.profile-heading h1, .auth-card h1, .winner-banner h2 {
  font-family: var(--font-spooky);
}

/* Lune, brume et ciel nocturne */
.moon {
  position: fixed;
  top: 6%;
  right: 7%;
  z-index: -1;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff8e2, #ffe9b0 55%, #caa968 100%);
  box-shadow: 0 0 60px 18px rgba(255,230,160,.35), 0 0 140px 50px rgba(255,180,80,.12);
  pointer-events: none;
}
.moon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 70%, rgba(130,100,50,.35) 0 10px, transparent 11px),
    radial-gradient(circle at 65% 35%, rgba(130,100,50,.3) 0 14px, transparent 15px),
    radial-gradient(circle at 60% 75%, rgba(130,100,50,.25) 0 7px, transparent 8px);
}
.fog-layer {
  position: fixed;
  left: -10%;
  right: -10%;
  bottom: 0;
  z-index: -1;
  height: 34vh;
  pointer-events: none;
  opacity: .55;
  background: linear-gradient(0deg, rgba(180,170,210,.22), transparent 85%);
  filter: blur(6px);
}
.fog-back { animation: fog-drift 50s linear infinite; }
.fog-front { height: 22vh; opacity: .4; animation: fog-drift 32s linear infinite reverse; }

/* Chauves-souris (ex-nuages) + esprits et citrouilles flottants */
.cloud { font-size: 2.2rem; opacity: .75; filter: drop-shadow(2px 3px 3px rgba(0,0,0,.5)); }
.spook-container { display: block; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.spook { position: absolute; bottom: 0; opacity: 0; filter: drop-shadow(0 0 10px rgba(176,109,240,.6)); animation: spook-rise linear infinite; }
.spook-ghost { left: 8%; font-size: 2.6rem; animation-duration: 22s; }
.spook-pumpkin { left: 78%; font-size: 2.1rem; animation-duration: 30s; animation-delay: -10s; }

/* Araignée qui descend du haut de la page de temps en temps */
.dangling-spider {
  position: fixed;
  top: 0;
  right: 9%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  animation: spider-drop 9s ease-in-out infinite;
}
.spider-thread { width: 1px; height: 60px; background: linear-gradient(rgba(241,236,255,.7), rgba(241,236,255,.1)); }
.spider-body { font-size: 1.5rem; filter: drop-shadow(2px 2px 2px rgba(0,0,0,.6)); animation: spider-sway 1.6s ease-in-out infinite; transform-origin: top center; }

/* Éclair occasionnel, discret (jamais plus d'un flash à la fois) */
.lightning-flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  background: rgba(200,180,255,.4);
  animation: lightning-strike 17s ease-in-out infinite;
}

/* Petit "screamer" tout doux, dans un coin, jamais sur le contenu */
.jumpscare {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transform: scale(.2);
  animation: jumpscare-pop 42s ease-in-out infinite;
}
.jumpscare-face { font-size: 3.2rem; filter: drop-shadow(0 0 14px rgba(176,109,240,.8)); }
.jumpscare-text {
  padding: 6px 12px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  color: #fff;
  background: var(--red);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--font-spooky);
  letter-spacing: .06em;
}

/* Lueur de citrouille sur le logo + flicker de la barre de navigation */
.logo-mark { animation: pumpkin-glow 2.4s ease-in-out infinite; }
.topbar { animation: haunted-flicker 6s steps(1) infinite; }
.btn.green:not(:disabled) { animation: slime-pulse 2.4s ease-in-out infinite; }

@keyframes candle-flicker { 0%, 100% { opacity: .7; } 25% { opacity: 1; } 50% { opacity: .55; } 75% { opacity: .9; } }
@keyframes fog-drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes spook-rise {
  0% { transform: translateY(10vh) translateX(0) rotate(-6deg); opacity: 0; }
  10% { opacity: .55; }
  50% { transform: translateY(-55vh) translateX(18px) rotate(6deg); }
  90% { opacity: .5; }
  100% { transform: translateY(-120vh) translateX(-10px) rotate(-6deg); opacity: 0; }
}
@keyframes spider-drop { 0%, 55% { transform: translateY(-70px); } 70%, 90% { transform: translateY(0); } 100% { transform: translateY(-70px); } }
@keyframes spider-sway { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes lightning-strike { 0%, 38%, 41%, 100% { opacity: 0; } 39% { opacity: .55; } 40% { opacity: .1; } }
@keyframes jumpscare-pop {
  0%, 92%, 100% { transform: scale(.2); opacity: 0; }
  93% { transform: scale(1.15) rotate(-4deg); opacity: 1; }
  94% { transform: scale(.95) rotate(3deg); opacity: 1; }
  96% { transform: scale(1) rotate(0); opacity: 1; }
  99% { transform: scale(.4); opacity: 0; }
}
@keyframes pumpkin-glow {
  0%, 100% { box-shadow: 3px 3px 0 var(--ink), 0 0 10px 2px rgba(255,122,26,.5); }
  50% { box-shadow: 3px 3px 0 var(--ink), 0 0 20px 6px rgba(255,159,46,.8); }
}
@keyframes haunted-flicker {
  0%, 92%, 100% { box-shadow: 0 5px 0 var(--ink); }
  93% { box-shadow: 0 5px 0 var(--ink), 0 0 30px 6px rgba(255,122,26,.25); }
  95% { box-shadow: 0 5px 0 var(--ink); }
  96% { box-shadow: 0 5px 0 var(--ink), 0 0 30px 6px rgba(176,109,240,.3); }
}
@keyframes slime-pulse { 0%, 100% { box-shadow: 5px 5px 0 var(--ink); } 50% { box-shadow: 5px 5px 0 var(--ink), 0 0 16px 4px rgba(67,224,122,.55); } }

/* Surfaces et dégradés clairs recolorés en version hantée */
.hero-preview, .preview-player, .btn.ghost, .kick, .score-input, .field input, .field select,
.modal, .player-pick, .nav a:hover, .eyebrow, .room-head, .auth-avatars button, .starter-kicker,
.user-chip, .profile-avatar-preview, .photo-upload-icon, .wheel-hub { background: var(--card); }
.topbar { background: rgba(14,9,24,.9); }
.empty { background: rgba(10,6,18,.5); }
.rank-badge.r2 { color: #d9d3f0; background: rgba(167,155,201,.18); }
.rank-badge.r3 { color: #ffb347; background: rgba(255,138,46,.18); }
.round-item .scores span { background: rgba(255,255,255,.06); }
.modal .close-x { background: #241a33; }
.modal-overlay { background: rgba(5,2,12,.75); }
.toast { background: #160f26; }
.score-cell, .round-item { background: #201732; }
.boss-stats .stat-chip { background: #1c1430; }
.boss-challenger .lb-role { background: rgba(10,6,18,.5); }
.auth-card { background: rgba(24,16,38,.96); }
.auth-card::after { border-color: rgba(255,255,255,.14); }
.auth-tabs { background: #241a33; }
.starter-players > span { background: rgba(20,14,32,.75); }
.starter-result { background: rgba(20,14,32,.72); }
.profile-mini-badges span { background: rgba(20,14,32,.75); }
.profile-photo-upload > label { background: #201732; }
.profile-choice-divider::before, .profile-choice-divider::after { background: rgba(255,255,255,.18); }
.profile-danger { background: linear-gradient(135deg,#2a0f14,var(--red-soft)); border-color: #ff4d66; box-shadow: 6px 6px 0 #ff4d66; }
.danger-kicker, .auth-error, .profile-error { color: #ff8a9b; }
.minus-ten { color: #ff8a9b; }
.game-choice label:first-child { background: #1a1430; }
.game-choice label:last-child { background: #241233; }
.share-qr { box-shadow: 0 0 0 4px var(--card), 6px 6px 0 var(--ink), 0 0 24px rgba(255,122,26,.5); }
.score-input:focus { outline: 3px solid rgba(255,122,26,.25); }
.field input:focus, .field select:focus { outline: 3px solid rgba(255,122,26,.22); }

/* Tableau des scores, podium, trône du boss et trône du rejeté */
.scoreboard-shell { background: rgba(20,14,32,.94); }
.scoreboard-row.first { background: linear-gradient(100deg,#3a2a12,#5c3e10); box-shadow: 6px 6px 0 #8a5a12,9px 9px 0 var(--ink); }
.scoreboard-row.second { background: linear-gradient(100deg,#201a30,#2c2440); }
.scoreboard-row.third { background: linear-gradient(100deg,#2c1f14,#4a3018); }
.scoreboard-row.first .r-total strong { color: #ffb347; }
.scoreboard-row .r-name small { color: #d79a4a; }

.podium {
  background:
    radial-gradient(circle at 50% 33%,rgba(176,109,240,.18) 0 7%,transparent 34%),
    linear-gradient(145deg,#1b1030 0%,#241540 58%,#2e1708 100%);
  box-shadow: 8px 8px 0 var(--ink),inset 0 0 0 6px rgba(255,255,255,.08);
}
.podium::after { color: rgba(255,179,71,.4); }
.podium-rays { opacity: .18; }
.podium .av.big, .podium .p-score { background: #1c1430; }
.podium .p1 .av.big { background: #2a2010; }
.podium .p-name { background: rgba(10,6,18,.65); }
.podium .block { color: #2a1708; background: linear-gradient(100deg,#b05a1e,#ff9d2e,#a04a16); box-shadow: inset 0 8px 0 rgba(255,255,255,.12),6px 0 0 rgba(0,0,0,.3); }
.podium .p1 .block { color: #3a2308; background: linear-gradient(100deg,#c97a0e,#ffcf5e 45%,#b56a0a); box-shadow: inset 0 10px 0 rgba(255,255,255,.18),6px 0 0 rgba(0,0,0,.3); }
.podium .p2 .block { color: #1c1f29; background: linear-gradient(100deg,#7b8294,#aab2c4 48%,#696f80); }
.podium .p3 .block { color: #2e1708; background: linear-gradient(100deg,#8a4d22,#c9803f 48%,#733c16); }
.podium-floor { box-shadow: inset 0 8px 0 rgba(255,255,255,.06); }

.boss-throne {
  background:
    radial-gradient(circle at 50% 37%, rgba(255,179,71,.18) 0 3%, transparent 28%),
    linear-gradient(155deg,#2a1240 0%,#5c1d46 48%,#ff7a1a 100%);
}
.royal-rays { background: repeating-conic-gradient(from 0deg at 50% 50%,rgba(176,109,240,.5) 0deg 9deg,transparent 9deg 20deg); }
.boss-throne::after { color: rgba(176,255,160,.85); }
.throne-back {
  background:
    radial-gradient(circle at 50% 23%,#5c2a6e 0 5px,transparent 6px),
    linear-gradient(90deg,#3a1030,#9b3fae 35%,#ff7a1a 70%,#2a0a20);
  box-shadow: inset 0 0 0 8px #6a2a7e, inset 0 -18px 0 rgba(0,0,0,.3);
}
.throne-back::before, .throne-back::after { background: linear-gradient(90deg,#6a2a7e,#b06df0,#ff7a1a); }
.gem { color: #39ff6a; text-shadow: 0 0 12px #39ff6a; }
.throne-arm { background: linear-gradient(90deg,#6a2a7e,#ff9d4a,#6a2a7e); }
.boss-avatar {
  background: radial-gradient(circle at 40% 28%,#2a1240,#140a1f 70%);
  box-shadow: 7px 8px 0 rgba(0,0,0,.6), inset 0 -10px 0 rgba(255,122,26,.18);
}

.boss-challenger.role-flatterer { background: linear-gradient(100deg,#3a2a12,#4a1f12 54%,#5c1d46); }
.boss-challenger.role-flatterer .rank-badge { color: #ffe0a8; background: #8a5a12; }
.boss-challenger.role-flatterer .lb-role { color: #ffd9a0; background: rgba(255,179,71,.18); }
.boss-challenger.role-jester { background: linear-gradient(100deg,#2a1240,#4a1f5c); }
.boss-challenger.role-jester .lb-role { background: rgba(176,109,240,.2); }
.boss-challenger.role-guard { background: linear-gradient(100deg,#0f2418,#1d3a28); }
.boss-challenger.role-guard .lb-role { background: rgba(57,224,122,.16); }
.boss-challenger.role-population { background: linear-gradient(100deg,#13131f,#1d3a28); }
.boss-challenger.role-population .lb-role { background: rgba(57,224,122,.12); }
.boss-challenger.role-peasant { background: linear-gradient(100deg,#2a1f14,#3a2a18); }
.boss-challenger.role-peasant .lb-role { background: rgba(255,179,71,.12); }
.boss-challenger.role-noble { background: linear-gradient(100deg,#2a1f0a,#241240); }
.boss-challenger.role-noble .lb-role { background: rgba(176,109,240,.18); }

.trash-throne {
  background:
    radial-gradient(circle at 14% 20%,rgba(255,255,255,.05) 0 5px,transparent 6px),
    radial-gradient(circle at 80% 28%,rgba(255,255,255,.04) 0 7px,transparent 8px),
    linear-gradient(160deg,#243018 0%,#1a2211 48%,#0d130a 100%);
}
.trash-grave {
  color: #d7ddc9;
  background: linear-gradient(100deg,#3a3d38,#5a5f55 48%,#2a2d27);
  box-shadow: 9px 10px 0 rgba(0,0,0,.5),inset 0 0 0 7px rgba(255,255,255,.08);
}
.trash-avatar { background: #232a1f; }
.trash-ground { background: linear-gradient(#3a2f1c,#1f1810); }
.trash-stats > span { color: #d7e0cf; background: #1d2317; }

.profile-preview {
  background:
    radial-gradient(circle at 50% 30%,#5c1d46 0 4%,transparent 35%),
    linear-gradient(145deg,#4a1f5c,#ff7a1a);
}
.starter-picker { background: linear-gradient(135deg,#2a1f0a,#241240 62%,#0f2418); }

/* Les ombres portées blanches des titres deviennent illisibles sur fond
   sombre (texte clair + ombre blanche = flou) : on les repasse en sombre. */
.hero h1 { text-shadow: 5px 5px 0 rgba(0,0,0,.65), 8px 8px 0 rgba(255,122,26,.3); }
.section-title { text-shadow: 3px 3px 0 rgba(0,0,0,.6); }
.boss-title h1 { text-shadow: 4px 4px 0 rgba(0,0,0,.65), 7px 7px 0 rgba(255,122,26,.25); }
.boss-player h2 { text-shadow: 3px 3px 0 rgba(0,0,0,.6); }
.challengers-head h2 { text-shadow: 3px 3px 0 rgba(0,0,0,.6); }
.trash-title h2 { text-shadow: 3px 3px 0 rgba(0,0,0,.6); }
.profile-heading h1 { text-shadow: 4px 4px 0 rgba(0,0,0,.65), 7px 7px 0 rgba(255,122,26,.25); }
.profile-preview h2 { text-shadow: 3px 3px 0 rgba(0,0,0,.55); }
.podium-number { text-shadow: 2px 2px 0 rgba(0,0,0,.5); }
.wheel-name { text-shadow: 1px 1px 0 rgba(0,0,0,.6); }
.room-head h2, .winner-banner h2, .throne h2 { text-shadow: 3px 3px 0 rgba(0,0,0,.55); }
.modal h3 { text-shadow: none; }
.auth-card h1 { text-shadow: 3px 3px 0 rgba(0,0,0,.6); }
.scoreboard-title > div > span { text-shadow: none; }
.starter-copy h3 { text-shadow: none; }
.profile-danger h2 { text-shadow: none; }

@media (max-width: 680px) {
  .moon { width: 80px; height: 80px; top: 4%; right: 5%; }
  .dangling-spider { right: 5%; }
  .jumpscare { right: 10px; bottom: 10px; }
  .jumpscare-face { font-size: 2.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lightning-flash, .jumpscare { display: none !important; }
}

/* =====================================================
   🎬 DÉCOR 3D (scène Horizon Moto) + INTRO ANIMÉE
   ===================================================== */
#scene3d { position: fixed; inset: 0; z-index: -3; display: block; width: 100%; height: 100%; pointer-events: none; }
#scene-dim {
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(10,6,18,.05), rgba(6,3,12,.6) 80%),
    linear-gradient(180deg, rgba(8,4,14,.25), rgba(8,4,14,.5));
  transition: opacity 1.2s ease;
}
.scene3d-on #scene-dim { opacity: 1; }
.scene3d-on .moon, .scene3d-on .fog-layer, .scene3d-on .cloud-container,
.scene3d-on .spook-container, .scene3d-on .lightning-flash { display: none; }

.topbar, #app, .footer { transition: opacity .9s ease; }
body.intro-playing .topbar, body.intro-playing #app, body.intro-playing .footer,
body.intro-playing .jumpscare, body.intro-playing .dangling-spider, body.intro-playing #scene-dim {
  visibility: hidden;
  opacity: 0 !important;
}

.replay-intro {
  margin-left: 8px;
  padding: 3px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
}
.replay-intro:hover { background: var(--blue-soft); }

#intro { position: fixed; inset: 0; z-index: 300; --u: min(1vw, 1.7778vh); overflow: hidden; color: #fff; transition: opacity .9s ease; }
#intro[hidden] { display: none; }
#intro.out { opacity: 0; pointer-events: none; }
.intro-layer { position: absolute; inset: 0; pointer-events: none; }
#intro-flash { opacity: 0; background: radial-gradient(ellipse at 50% 25%, rgba(255,50,70,.95), rgba(120,0,20,.55) 75%); mix-blend-mode: screen; }
#intro-bars::before, #intro-bars::after { content: ''; position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height 1.2s ease; }
#intro-bars::before { top: 0; }
#intro-bars::after { bottom: 0; }
#intro-bars.on::before, #intro-bars.on::after { height: 7%; }
.intro-wing { position: absolute; bottom: -8%; width: 46%; opacity: 0; pointer-events: none; filter: drop-shadow(0 0 calc(var(--u) * .7) rgba(255,30,50,.5)); }
.intro-wing svg { display: block; width: 100%; height: auto; }
#intro-wingL { left: -11%; transform-origin: 0% 55%; }
#intro-wingR { right: -11%; transform-origin: 100% 55%; }
#intro-wingR svg { transform: scaleX(-1); }
.intro-caption { position: absolute; top: 13%; left: 0; right: 0; opacity: 0; text-align: center; transform: translateY(calc(var(--u) * 1)); transition: opacity 1s ease, transform 1.4s ease; pointer-events: none; }
.intro-caption.show { opacity: 1; transform: none; }
.intro-caption small { display: block; color: #d8cfee; font-size: max(13px, calc(var(--u) * 1.35)); font-weight: 800; letter-spacing: .42em; text-transform: uppercase; text-shadow: 0 2px 8px #000; }
.intro-caption b { display: block; margin-top: calc(var(--u) * .5); font-family: var(--font-spooky); font-size: max(40px, calc(var(--u) * 5.4)); font-weight: 400; letter-spacing: .05em; text-shadow: 0 0 calc(var(--u) * 1.6) rgba(255,36,51,.85), 3px 3px 0 #000; }
#intro-endcard { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 16px 9vh; opacity: 0; text-align: center; background: linear-gradient(180deg, transparent 42%, rgba(4,0,8,.6) 60%, rgba(0,0,0,.92) 100%); transition: opacity 1.4s ease; }
#intro-endcard.show { opacity: 1; }
#intro-endcard .kicker { color: #ff9a4a; font-size: max(12px, calc(var(--u) * 1.25)); font-weight: 800; letter-spacing: .42em; text-transform: uppercase; text-shadow: 0 2px 6px #000; }
#intro-endcard h1 { margin: calc(var(--u) * .2) 0 0; font-family: var(--font-spooky); font-size: max(54px, calc(var(--u) * 11)); font-weight: 400; letter-spacing: .04em; line-height: .92; text-shadow: 0 0 calc(var(--u) * 2) rgba(255,36,51,.9), 4px 4px 0 #000; transform: scale(.55); transition: transform 1.5s cubic-bezier(.2,1.5,.4,1); }
#intro-endcard.show h1 { transform: scale(1); }
#intro-endcard h1 span { color: var(--blue); }
#intro-endcard .tag { margin: calc(var(--u) * .7) 0 0; font-size: max(15px, calc(var(--u) * 1.85)); font-weight: 800; text-shadow: 0 2px 6px #000; }
#intro-controls { position: absolute; top: calc(18px + 7vh); right: 18px; z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
#intro-controls button {
  padding: 8px 16px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  color: #fff;
  background: rgba(20,10,30,.8);
  box-shadow: 4px 4px 0 var(--ink);
  font: 800 1rem var(--font-body);
  cursor: pointer;
  transition: transform .15s, background .15s;
}
#intro-controls button:hover { background: var(--blue); transform: translate(-2px,-2px); }
#intro-skip { background: var(--blue) !important; }
#intro-fade { background: #000; opacity: 0; transition: opacity .35s ease; }
#intro-fade.on { opacity: 1; }
@media (max-width: 680px) {
  #intro-controls { top: auto; right: 10px; bottom: calc(10px + 7vh); left: 10px; }
  #intro-endcard { padding-bottom: 22vh; }
  .intro-caption { top: 18%; }
  #intro-controls button { flex: 1; padding: 8px 10px; font-size: .9rem; }
}

/* =====================================================
   🔦 LISIBILITÉ : contrastes revus pour le fond sombre
   ===================================================== */
:root { --blue-dark: #ffa15c; }
.skip-link { color: #fff; background: #120a1f; border: 2px solid var(--ink); }

.pill, .stat-chip, .delta { color: var(--ink); background: rgba(14,9,24,.88); }
.pill.green, .stat-chip.green, .delta.good { color: #7cf2a8; border-color: var(--ink); background: rgba(24,84,52,.6); }
.pill.blue, .stat-chip.blue { color: #ffb27a; border-color: var(--ink); background: rgba(130,50,10,.55); }
.pill.red, .delta.bad { color: #ff9eab; border-color: var(--ink); background: rgba(125,18,38,.6); }
.pill.gold, .stat-chip.gold { color: #ffd88a; border-color: var(--ink); background: rgba(120,78,8,.6); }
.pill.purple { color: #dcbcff; border-color: var(--ink); background: rgba(84,36,132,.6); }
.boss-stats .stat-chip[class] { background: #1c1430; }
.boss-kicker { color: #ffd88a; background: rgba(120,78,8,.75); }
.round-item .winner-chip { color: #ffd88a; }
.scoreboard-row .r-name small { color: #ffc27a; }

.btn { background: #c2410c; }
.btn:hover:not(:disabled) { background: #a3370a; }
.btn.blue { background: #c2410c; }
.btn.green { background: #15803d; }
.btn.green:hover:not(:disabled) { background: #116a33; }
.btn.red { background: #c81e3a; }
.btn.red:hover:not(:disabled) { background: #a8172f; }
.starter-spin { background: #7e3fc4; }
.profile-preview-label, .jumpscare-text { background: #c81e3a; }
#intro-skip { background: #c2410c !important; }
#intro-controls button:hover { background: #a3370a; }

.spectator-note { color: var(--ink); background: rgba(130,50,10,.45); }
.radio-cards label { color: var(--ink); background: var(--card); }
.radio-cards label:has(input:checked) { color: var(--ink); background: var(--gold-soft); }

.hero .tagline, .footer, .back-link, .challengers-head h2,
.profile-heading p, .scoreboard-title small {
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(0,0,0,.85);
}
.footer, .back-link { color: #d4cbec; }
.btn:disabled { opacity: 1; color: #a99fc4; background: #2e2840 !important; box-shadow: 3px 3px 0 #4a4360; }
.round-item .scores span { color: #d4cbec; }
.trash-grave > span, .trash-grave > small { color: #f4f0e2; text-shadow: 2px 2px 0 #000; }
.trash-grave > small { display: none; }

/* =====================================================
   🛒 BOUTIQUE, PASSE DE COMBAT, BOOSTERS & ALBUM
   ===================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Barre du haut : 5 onglets + cagnotte */
.nav a { position: relative; white-space: nowrap; }
.nav-badge { display: inline-grid; min-width: 20px; height: 20px; margin-left: 5px; padding: 0 5px; place-items: center; border: 2px solid var(--ink); border-radius: 999px; color: #1a1205; background: var(--gold); font-size: .72rem; font-weight: 800; line-height: 1; vertical-align: 1px; }
.nav-badge[hidden] { display: none; }
.coin-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); background: var(--card); box-shadow: 3px 3px 0 var(--ink); font-weight: 800; text-decoration: none; white-space: nowrap; transition: transform .18s, box-shadow .18s; }
.coin-chip b { color: var(--gold); font-variant-numeric: tabular-nums; }
.coin-chip:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); }
@media (max-width: 1180px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-right { display: contents; }
  #user-menu { margin-left: auto; }
  .nav { order: 3; flex: 1 0 100%; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 430px) {
  .nav { justify-content: space-between; }
  .nav a { padding: 8px 12px; }
  .nav a .nav-badge { font-size: .68rem; }
  .coin-chip { padding: 5px 9px; }
}

/* En-têtes et onglets communs */
.eco-head { margin: 8px 0 22px; text-align: center; }
.eco-kicker { display: inline-block; padding: 3px 12px; border: 2px solid var(--ink); border-radius: 999px; color: #ffd88a; background: rgba(120,78,8,.75); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.eco-head h1 { margin: 10px 0 6px; font-family: var(--font-spooky); font-size: clamp(2.4rem,7vw,4rem); font-weight: 400; letter-spacing: .04em; line-height: 1; text-shadow: 4px 4px 0 rgba(0,0,0,.6); }
.eco-head p { max-width: 620px; margin: 0 auto; color: var(--ink); font-weight: 700; text-shadow: 0 1px 2px #000, 0 0 10px rgba(0,0,0,.85); }
.eco-tabs, .eco-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 20px; }
.eco-tabs a, .eco-filters button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 12px; color: var(--ink); background: var(--card); box-shadow: 3px 3px 0 var(--ink); font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.eco-tabs a:hover, .eco-filters button:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.eco-tabs a.active, .eco-filters button.active { color: #1a1205; background: var(--gold); }
.eco-filters button small { opacity: .75; font-size: .75rem; }
.actions-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn.gold-btn { color: #1a1205; background: var(--gold); }
.btn.gold-btn:hover:not(:disabled) { background: #ffc766; }
.xp-bar { position: relative; height: 18px; overflow: hidden; border: 2px solid var(--ink); border-radius: 999px; background: rgba(0,0,0,.45); }
.xp-bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--blue), var(--gold)); box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); transition: width .6s ease; }

/* ---------- Boosters ---------- */
.booster-stage { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 26px 18px 30px; overflow: hidden; }
.booster-counter { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; text-align: center; }
.booster-counter b { color: var(--gold); }
.booster-dots { display: flex; gap: 6px; }
.booster-dots i { width: 18px; height: 24px; border: 2px solid var(--ink); border-radius: 5px; background: rgba(255,255,255,.08); }
.booster-dots i.full { background: linear-gradient(160deg, var(--pack-a, #ff7a1a), var(--pack-b, #b8360a)); box-shadow: 2px 2px 0 var(--ink); }
.booster-table { display: grid; min-height: 330px; width: 100%; place-items: center; }
.booster-open { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 0; border: 0; color: var(--ink); background: none; font: inherit; cursor: pointer; }
.booster-open:disabled { cursor: not-allowed; filter: grayscale(.85) brightness(.7); }
.booster-open:not(:disabled):hover .booster-pack { transform: translateY(-8px) rotate(-3deg) scale(1.03); }
.booster-cta { padding: 8px 18px; border: 3px solid var(--ink); border-radius: 13px; color: #fff; background: var(--btn, #c2410c); box-shadow: 4px 4px 0 var(--ink); font-family: var(--font-title); font-size: 1.15rem; letter-spacing: .05em; }
.booster-open:disabled .booster-cta { background: #2e2840; }

.booster-pack {
  --pack-a: #ff8a2a; --pack-b: #b8360a; --pack-ink: #fff3e0;
  --pack-pattern: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 10px, transparent 10px 20px);
  position: relative; display: flex; width: 170px; height: 240px; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 3px solid var(--ink); border-radius: 16px;
  color: var(--pack-ink); background: var(--pack-pattern), linear-gradient(160deg, var(--pack-a), var(--pack-b));
  box-shadow: 7px 7px 0 var(--ink), inset 0 0 0 6px rgba(255,255,255,.12);
  transition: transform .25s ease; animation: pack-float 3s ease-in-out infinite;
}
.booster-pack::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.35) 45%, transparent 60%); background-size: 250% 100%; animation: pack-shine 3.2s linear infinite; pointer-events: none; }
.pack-crimp { position: absolute; left: -3px; right: -3px; height: 16px; border: 3px solid var(--ink); background: repeating-linear-gradient(90deg, rgba(0,0,0,.25) 0 6px, transparent 6px 12px), var(--pack-b); }
.pack-crimp.top { top: -3px; border-radius: 16px 16px 4px 4px; }
.pack-crimp.bottom { bottom: -3px; border-radius: 4px 4px 16px 16px; }
.pack-logo { font-family: var(--font-title); font-size: 1.5rem; line-height: 1; text-align: center; text-shadow: 3px 3px 0 rgba(0,0,0,.45); }
.pack-logo b { font-size: 2.1rem; font-weight: 400; }
.pack-sub { padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); background: rgba(0,0,0,.5); font-size: .8rem; font-weight: 800; }
.booster-open.shaking .booster-pack { animation: pack-shake .12s linear infinite; }
.pack-torn { position: absolute; opacity: 0; pointer-events: none; }
.pack-torn .booster-pack { animation: pack-burst .5s ease-out forwards; }

/* Dos de booster (skins « dos de cartes ») */
body[data-cardback="cardback-potion"] :is(.booster-pack, .card-back, .booster-dots i.full), .skin-preview[data-cardback-preview="cardback-potion"] .booster-pack { --pack-a: #4fe07a; --pack-b: #146b35; --pack-ink: #eaffef; --pack-pattern: radial-gradient(circle at 30% 30%, rgba(255,255,255,.25) 0 6px, transparent 7px) 0 0 / 34px 34px, radial-gradient(circle at 70% 70%, rgba(255,255,255,.15) 0 4px, transparent 5px) 0 0 / 26px 26px; }
body[data-cardback="cardback-cosmic"] :is(.booster-pack, .card-back, .booster-dots i.full), .skin-preview[data-cardback-preview="cardback-cosmic"] .booster-pack { --pack-a: #3b2a8f; --pack-b: #0b0624; --pack-ink: #e9e2ff; --pack-pattern: radial-gradient(circle, #fff 0 1px, transparent 2px) 0 0 / 22px 22px, radial-gradient(circle, rgba(255,255,255,.6) 0 1px, transparent 2px) 11px 7px / 30px 30px; }
body[data-cardback="cardback-gold"] :is(.booster-pack, .card-back, .booster-dots i.full), .skin-preview[data-cardback-preview="cardback-gold"] .booster-pack { --pack-a: #ffe28a; --pack-b: #b07a12; --pack-ink: #3a2400; --pack-pattern: repeating-linear-gradient(45deg, rgba(255,255,255,.22) 0 4px, transparent 4px 14px); }
body[data-cardback="cardback-pixel"] :is(.booster-pack, .card-back, .booster-dots i.full), .skin-preview[data-cardback-preview="cardback-pixel"] .booster-pack { --pack-a: #ff3fb4; --pack-b: #2b1bd6; --pack-ink: #fff; --pack-pattern: conic-gradient(rgba(0,0,0,.22) 25%, transparent 0 50%, rgba(0,0,0,.22) 0 75%, transparent 0) 0 0 / 16px 16px; }
.skin-preview[data-cardback-preview="cardback-classic"] .booster-pack { --pack-a: #ff8a2a; --pack-b: #b8360a; --pack-ink: #fff3e0; --pack-pattern: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 10px, transparent 10px 20px); }

/* Révélation des cartes */
.reveal-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; perspective: 1200px; }
.flip-card { width: 190px; height: 280px; padding: 0; border: 0; background: none; cursor: pointer; animation: card-deal .45s ease-out backwards; }
.flip-card:nth-child(2) { animation-delay: .1s; }
.flip-card:nth-child(3) { animation-delay: .2s; }
.flip-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3,1.4,.5,1); }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-back, .flip-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-front { transform: rotateY(180deg); }
.flip-front .tcard { width: 100%; height: 100%; }
.card-back {
  --pack-a: #ff8a2a; --pack-b: #b8360a; --pack-ink: #fff3e0;
  --pack-pattern: repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 10px, transparent 10px 20px);
  display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 16px;
  background: var(--pack-pattern), linear-gradient(160deg, var(--pack-a), var(--pack-b));
  box-shadow: 6px 6px 0 var(--ink), inset 0 0 0 8px rgba(255,255,255,.1);
}
.card-back span { display: grid; width: 70px; height: 70px; place-items: center; border: 3px solid var(--ink); border-radius: 50%; color: var(--pack-ink); background: rgba(0,0,0,.35); font-family: var(--font-title); font-size: 2.4rem; }
.booster-summary { display: flex; flex-direction: column; align-items: center; gap: 14px; min-height: 10px; }
.summary-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.odds-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.odds-chip { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 2px solid var(--ink); border-left: 8px solid var(--rarity, var(--ink)); border-radius: 12px; background: var(--card); box-shadow: 3px 3px 0 var(--ink); font-weight: 800; font-size: 1.2rem; }
.odds-chip b { font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: var(--rarity, var(--ink)); }
.odds-chip small { color: var(--muted); font-size: .78rem; }
.odds-chip.holo { --rarity: #ff8af0; }

/* ---------- Cartes à collectionner ---------- */
.rarity-nulle { --rarity: #9a93ad; --rarity-bg: linear-gradient(170deg, #3a3546, #1d1a24); }
.rarity-commune { --rarity: #6fd08c; --rarity-bg: linear-gradient(170deg, #1f4a33, #11261b); }
.rarity-rare { --rarity: #5aa9ff; --rarity-bg: linear-gradient(170deg, #1d3d72, #0f1d38); }
.rarity-epique { --rarity: #c27bff; --rarity-bg: linear-gradient(170deg, #4b2380, #200e3a); }
.rarity-legendaire { --rarity: #ffc94a; --rarity-bg: linear-gradient(170deg, #7a4f05, #2e1c02); }
.tcard { position: relative; display: flex; min-height: 280px; flex-direction: column; gap: 6px; padding: 10px; overflow: hidden; border: 3px solid var(--ink); border-radius: 16px; color: #fff; background: var(--rarity-bg); box-shadow: 6px 6px 0 var(--ink), inset 0 0 0 3px var(--rarity); text-align: center; }
.tcard-rarity { align-self: center; padding: 1px 10px; border: 2px solid var(--ink); border-radius: 999px; color: #120a1f; background: var(--rarity); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tcard-art { display: grid; height: 120px; flex: 0 0 auto; place-items: center; overflow: hidden; border: 2px solid var(--ink); border-radius: 10px; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.22), rgba(0,0,0,.25)); font-size: 4rem; line-height: 1; }
.tcard-art { position: relative; }
.tcard-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tcard-art img.fit-contain { padding: 6px; object-fit: contain; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.45)); }
.tcard-credit { position: absolute; right: 0; bottom: 0; left: 0; padding: 1px 5px; overflow: hidden; color: #f1ecff; background: rgba(0,0,0,.62); font-size: .56rem; font-weight: 700; line-height: 1.4; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.card-source { color: var(--blue-dark); font-size: .82rem; font-weight: 700; }
.tcard-name { font-family: var(--font-title); font-size: 1.05rem; line-height: 1.1; letter-spacing: .03em; text-shadow: 2px 2px 0 rgba(0,0,0,.5); }
.tcard-desc { display: -webkit-box; margin: 0; overflow: hidden; color: #e8e2f5; font-size: .8rem; font-weight: 600; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; }
.card-zoom .tcard-desc { -webkit-line-clamp: unset; line-clamp: none; }
.tcard-meta { margin-top: auto; color: #d9d3f0; font-size: .74rem; font-weight: 700; }
.tcard-new { position: absolute; top: 8px; right: -30px; z-index: 2; width: 120px; padding: 2px 0; color: #120a1f; background: #43e07a; font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; transform: rotate(35deg); box-shadow: 0 2px 0 var(--ink); }
.tcard-coins { margin-top: auto; align-self: center; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; color: #ffd88a; background: rgba(0,0,0,.55); font-size: .75rem; font-weight: 800; }
.rarity-legendaire.tcard { animation: legend-glow 2.2s ease-in-out infinite; }
.tcard.holo::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: linear-gradient(115deg, rgba(255,0,128,.28), rgba(255,200,0,.24), rgba(0,255,170,.24), rgba(0,140,255,.28), rgba(200,0,255,.28)); background-size: 300% 300%; mix-blend-mode: color-dodge; animation: holo-shift 4s ease-in-out infinite; pointer-events: none; }
.tcard.locked { color: var(--muted); background: repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 8px, transparent 8px 16px), #120c1e; box-shadow: 4px 4px 0 var(--ink), inset 0 0 0 3px rgba(255,255,255,.08); opacity: .8; }
.tcard.locked .tcard-art { color: rgba(255,255,255,.25); font-family: var(--font-title); }
.tcard.locked .tcard-rarity { opacity: .65; }

/* ---------- Album ---------- */
.album-progress { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.album-progress-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.15rem; }
.album-progress small { color: var(--muted); font-weight: 700; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.album-card { padding: 0; border: 0; background: none; text-align: inherit; cursor: zoom-in; transition: transform .18s; }
.album-card:hover { transform: translateY(-4px) rotate(-1deg); }
.album-card .tcard, .album-grid > .tcard { height: 100%; }
.empty code { padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.1); font-size: .85em; }
.modal.card-modal { width: min(360px, 100%); text-align: center; }
.card-zoom { width: min(260px, 100%); margin: 26px auto 14px; }
.card-zoom .tcard { min-height: 380px; }
.card-zoom .tcard-art { height: 190px; font-size: 6rem; }
.card-zoom-meta { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ---------- Boutique ---------- */
.treasury { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; }
.treasury-coin { display: grid; width: 86px; height: 86px; flex: 0 0 auto; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1b8, var(--gold) 55%, #9a6408); box-shadow: 5px 5px 0 var(--ink); font-size: 2.6rem; animation: coin-spin 4s ease-in-out infinite; }
.treasury-amount { display: block; margin: 4px 0 8px; color: var(--gold); font-family: var(--font-title); font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 400; line-height: 1; text-shadow: 3px 3px 0 rgba(0,0,0,.5); }
.treasury-amount small { color: var(--ink); font-family: var(--font-body); font-size: 1rem; font-weight: 800; text-shadow: none; }
.treasury-earn { display: flex; flex-wrap: wrap; gap: 6px; }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.skin-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--card); box-shadow: 5px 5px 0 var(--ink); }
.skin-card.equipped { box-shadow: 5px 5px 0 var(--green), 8px 8px 0 var(--ink); }
.skin-card h3 { margin: 6px 0 0; font-size: 1.15rem; }
.skin-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.35; }
.skin-owner { color: var(--gold); font-weight: 700; }
.skin-action { display: flex; margin-top: auto; padding-top: 8px; }
.skin-action .btn { width: 100%; }
.skin-preview { display: grid; height: 130px; place-items: center; overflow: hidden; border: 2px solid var(--ink); border-radius: 14px; background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.12), rgba(0,0,0,.3)); }
.crown-preview span { font-size: 4rem; filter: drop-shadow(3px 4px 0 rgba(0,0,0,.45)); animation: emoji-bob 2.4s ease-in-out infinite; }
.frame-preview .av.big { width: 76px; height: 76px; border-radius: 50%; font-size: 2.4rem; }
.cardback-preview .booster-pack { width: 76px; height: 108px; gap: 4px; border-radius: 10px; box-shadow: 4px 4px 0 var(--ink); }
.cardback-preview .pack-logo { font-size: .7rem; }
.cardback-preview .pack-logo b { font-size: .95rem; }
.cardback-preview .pack-sub { display: none; }
.cardback-preview .pack-crimp { height: 9px; }
.theme-swatch span { display: grid; width: 64px; height: 64px; place-items: center; border: 3px solid var(--ink); border-radius: 18px; background: rgba(0,0,0,.35); font-size: 2.1rem; box-shadow: 3px 3px 0 var(--ink); }
.theme-swatch.theme-halloween { background: radial-gradient(circle at 80% 20%, #f4e7b0 0 12px, transparent 13px), linear-gradient(180deg, #140d24, #3a1c0a); }
.theme-swatch.theme-foret { background: radial-gradient(circle at 20% 30%, #c8ff7a 0 3px, transparent 4px) 0 0 / 30px 30px, linear-gradient(180deg, #0b2615, #1f4d1c); }
.theme-swatch.theme-abysses { background: radial-gradient(circle at 30% 70%, rgba(130,230,255,.6) 0 4px, transparent 5px) 0 0 / 34px 34px, linear-gradient(180deg, #06243d, #020b16); }
.theme-swatch.theme-neon { background: linear-gradient(transparent 92%, rgba(255,47,208,.7) 0) 0 0 / 100% 18px, linear-gradient(90deg, transparent 92%, rgba(0,240,255,.7) 0) 0 0 / 18px 100%, #0a0618; }
.theme-swatch.theme-noel { background: radial-gradient(circle, #fff 0 2px, transparent 3px) 0 0 / 22px 22px, linear-gradient(180deg, #0e2a46, #8c1c26); }
.theme-swatch.theme-cosmos { background: radial-gradient(circle, #fff 0 1px, transparent 2px) 0 0 / 18px 18px, radial-gradient(circle at 70% 30%, #a66bff, transparent 55%), #080314; }
.theme-swatch.theme-royal { background: repeating-linear-gradient(90deg, rgba(255,215,0,.18) 0 8px, transparent 8px 22px), linear-gradient(180deg, #5c0f24, #2a1a0a); }
.buy-preview { margin: 0 0 18px; }
.eco-log { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 6px 18px; list-style: none; }
.eco-log li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,.18); }
.eco-log li:last-child { border-bottom: 0; }
.eco-log .log-label { flex: 1 1 260px; font-weight: 700; }
.eco-log time { color: var(--muted); font-size: .82rem; font-weight: 700; }

/* ---------- Cadres d'avatar ---------- */
:is(.av, .user-avatar, .boss-avatar, .trash-avatar, .profile-avatar-preview).frame-gold { border-color: #ffd700 !important; box-shadow: 0 0 0 3px #8a5a00, 0 0 14px 3px rgba(255,215,0,.7) !important; }
:is(.av, .user-avatar, .boss-avatar, .trash-avatar, .profile-avatar-preview).frame-ice { border-color: #bdf3ff !important; box-shadow: 0 0 0 3px #3aa0c8, 0 0 16px 4px rgba(150,230,255,.75) !important; }
:is(.av, .user-avatar, .boss-avatar, .trash-avatar, .profile-avatar-preview).frame-neon { border-color: #00f0ff !important; animation: frame-neon 1.6s steps(1) infinite; }
:is(.av, .user-avatar, .boss-avatar, .trash-avatar, .profile-avatar-preview).frame-flames { border-color: #ff7a1a !important; animation: frame-flames 1s ease-in-out infinite alternate; }
:is(.av, .user-avatar, .boss-avatar, .trash-avatar, .profile-avatar-preview).frame-slime { border-color: #43e07a !important; box-shadow: 0 0 0 3px #146b35, 0 6px 0 1px #43e07a, 0 0 14px 3px rgba(67,224,122,.6) !important; }
:is(.av, .user-avatar, .boss-avatar, .trash-avatar, .profile-avatar-preview).frame-rainbow { border-color: transparent !important; animation: frame-rainbow 2.4s linear infinite; }

/* ---------- Passe de combat ---------- */
.pass-status { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(220px, 280px); align-items: center; gap: 22px; margin-bottom: 20px; }
.pass-level { display: flex; align-items: center; gap: 10px; font-weight: 800; line-height: 1.1; }
.pass-level small { color: var(--muted); }
.pass-level-number { display: grid; width: 84px; height: 84px; place-items: center; border: 3px solid var(--ink); border-radius: 22px; color: #1a1205; background: linear-gradient(160deg, #ffe08a, var(--gold)); box-shadow: 5px 5px 0 var(--ink); font-family: var(--font-title); font-size: 2.6rem; }
.pass-progress { display: flex; flex-direction: column; gap: 10px; }
.pass-progress-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.pass-premium { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 3px dashed var(--gold); border-radius: 16px; background: rgba(120,78,8,.25); }
.pass-premium small { color: var(--muted); font-weight: 700; line-height: 1.35; }
.pass-premium.active { border-style: solid; background: linear-gradient(135deg, rgba(255,201,74,.25), rgba(120,78,8,.35)); }
.pass-premium.active strong { color: var(--gold); }
.pass-track-wrap { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; padding: 16px; }
.pass-track-labels { display: grid; grid-template-rows: 34px 120px 120px; gap: 10px; font-family: var(--font-title); font-size: .95rem; letter-spacing: .04em; }
.pass-track-labels span { display: flex; align-items: center; }
.pass-track-labels span:last-child { color: var(--gold); }
.pass-track { display: flex; gap: 10px; overflow-x: auto; padding: 2px 4px 14px; scroll-behavior: smooth; scrollbar-color: var(--blue) transparent; }
.pass-tier { display: grid; flex: 0 0 112px; grid-template-rows: 34px 120px 120px; gap: 10px; }
.tier-number { display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 10px; color: var(--muted); background: rgba(0,0,0,.35); font-weight: 800; }
.pass-tier.reached .tier-number { color: #1a1205; background: var(--gold); }
.pass-tier.next .tier-number { color: var(--ink); background: var(--blue); animation: emoji-bob 2s ease-in-out infinite; }
.pass-reward { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); box-shadow: 3px 3px 0 var(--ink); text-align: center; }
.pass-reward.premium { background: linear-gradient(160deg, rgba(255,201,74,.18), rgba(120,78,8,.3)), var(--card); }
.pass-reward.is-skin { border-color: var(--purple); box-shadow: 3px 3px 0 var(--purple); }
.pass-reward.locked { filter: grayscale(.7); opacity: .6; }
.pass-reward.claimed { opacity: .55; }
.reward-icon { font-size: 2rem; line-height: 1; }
.reward-label { font-size: .78rem; font-weight: 800; line-height: 1.15; }
.reward-check, .reward-lock { position: absolute; top: -9px; right: -9px; display: grid; width: 26px; height: 26px; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--green); color: #08240f; font-size: .8rem; font-weight: 800; }
.reward-lock { background: #2e2840; }

@media (max-width: 860px) {
  .pass-status { grid-template-columns: auto minmax(0, 1fr); }
  .pass-premium { grid-column: 1 / -1; }
}
@media (max-width: 580px) {
  .treasury { flex-direction: column; text-align: center; }
  .treasury-earn { justify-content: center; }
  .pass-status { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .pass-progress { width: 100%; }
  .pass-track-wrap { grid-template-columns: 1fr; }
  .pass-track-labels { display: none; }
  .flip-card { width: min(46vw, 170px); height: min(68vw, 252px); }
  .reveal-row { gap: 12px; }
  .tcard { min-height: 0; padding: 8px; }
  .tcard-art { height: 92px; font-size: 3rem; }
  .tcard-desc { font-size: .72rem; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .skin-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .booster-pack { width: 150px; height: 212px; }
}

@keyframes pack-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes pack-shine { from { background-position: 150% 0; } to { background-position: -150% 0; } }
@keyframes pack-shake { 0% { transform: rotate(-4deg) translateX(-3px); } 50% { transform: rotate(4deg) translateX(3px); } 100% { transform: rotate(-4deg) translateX(-3px); } }
@keyframes pack-burst { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.6) rotate(8deg); filter: blur(4px); } }
@keyframes card-deal { from { opacity: 0; transform: translateY(60px) scale(.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes holo-shift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes legend-glow { 0%, 100% { box-shadow: 6px 6px 0 var(--ink), inset 0 0 0 3px var(--rarity), 0 0 0 rgba(255,201,74,0); } 50% { box-shadow: 6px 6px 0 var(--ink), inset 0 0 0 3px var(--rarity), 0 0 26px 6px rgba(255,201,74,.55); } }
@keyframes coin-spin { 0%, 100% { transform: rotateY(0); } 50% { transform: rotateY(180deg); } }
@keyframes frame-neon { 0%, 100% { box-shadow: 0 0 0 3px #ff2fd0, 0 0 16px 4px rgba(0,240,255,.8); } 50% { box-shadow: 0 0 0 3px #00f0ff, 0 0 16px 4px rgba(255,47,208,.8); } }
@keyframes frame-flames { from { box-shadow: 0 0 0 3px #c2410c, 0 -4px 12px 3px rgba(255,122,26,.8); } to { box-shadow: 0 0 0 3px #ffb347, 0 -8px 20px 6px rgba(255,59,0,.85); } }
@keyframes frame-rainbow { 0% { box-shadow: 0 0 0 4px #ff3b52, 0 0 14px 3px #ff3b52; } 20% { box-shadow: 0 0 0 4px #ffb347, 0 0 14px 3px #ffb347; } 40% { box-shadow: 0 0 0 4px #ffe600, 0 0 14px 3px #ffe600; } 60% { box-shadow: 0 0 0 4px #43e07a, 0 0 14px 3px #43e07a; } 80% { box-shadow: 0 0 0 4px #5aa9ff, 0 0 14px 3px #5aa9ff; } 100% { box-shadow: 0 0 0 4px #c27bff, 0 0 14px 3px #c27bff; } }

/* =====================================================
   🎨 THÈMES DU SITE (skins « thème »)
   ===================================================== */
.theme-decor { display: none; }
body[data-skin-theme]:not([data-skin-theme="theme-halloween"]) :is(.moon, .fog-layer, .cloud-container, .spook-container, .dangling-spider, .jumpscare, .lightning-flash) { display: none !important; }
body[data-skin-theme]:not([data-skin-theme="theme-halloween"]) #scene-dim { opacity: 1; background: var(--theme-veil); }
body[data-skin-theme]:not([data-skin-theme="theme-halloween"]) .topbar { background: var(--topbar-bg); }
body[data-skin-theme]:not([data-skin-theme="theme-halloween"]) .theme-decor { position: fixed; inset: 0; z-index: -1; display: block; overflow: hidden; pointer-events: none; }
.theme-decor span { position: absolute; bottom: -10vh; left: calc(var(--i) * 17% + 3%); font-size: calc(1.4rem + (var(--i) * .25rem)); color: var(--blue); opacity: .45; animation: spook-rise calc(22s + var(--i) * 4s) linear infinite; animation-delay: calc(var(--i) * -5s); filter: drop-shadow(0 0 8px currentColor); }
body[data-skin-theme]:not([data-skin-theme="theme-halloween"])::before { background: var(--theme-glow); }

body[data-skin-theme="theme-foret"] {
  --ink: #effbe9; --muted: #a8c9a0; --bg: #07130c; --card: #12261a; --line: #effbe9; --line-strong: #effbe9;
  --blue: #6fcf4b; --blue-dark: #9be27c; --blue-soft: rgba(111,207,75,.16); --gold: #e6d36b; --gold-soft: rgba(230,211,107,.16); --purple: #4fc3a1;
  --shadow: 5px 5px 0 #effbe9; --shadow-hover: 8px 8px 0 #effbe9;
  --topbar-bg: rgba(7,22,12,.92);
  --theme-veil: linear-gradient(180deg, rgba(6,24,12,.78), rgba(4,14,8,.9));
  --theme-glow: radial-gradient(ellipse at 50% 120%, rgba(160,255,120,.14), transparent 60%);
  background: radial-gradient(circle at 15% 15%, rgba(200,255,120,.08) 0 2px, transparent 3px) 0 0 / 40px 40px, linear-gradient(180deg, #061109, #0d2414 55%, #133019);
}
body[data-skin-theme="theme-abysses"] {
  --ink: #e6f6ff; --muted: #8fb6cc; --bg: #04101c; --card: #0d2236; --line: #e6f6ff; --line-strong: #e6f6ff;
  --blue: #22c3e6; --blue-dark: #6fe0f7; --blue-soft: rgba(34,195,230,.16); --gold: #ffd166; --gold-soft: rgba(255,209,102,.16); --purple: #6c8cff;
  --shadow: 5px 5px 0 #e6f6ff; --shadow-hover: 8px 8px 0 #e6f6ff;
  --topbar-bg: rgba(3,14,26,.92);
  --theme-veil: linear-gradient(180deg, rgba(4,28,48,.8), rgba(2,10,20,.92));
  --theme-glow: radial-gradient(ellipse at 50% -10%, rgba(80,200,255,.18), transparent 60%);
  background: linear-gradient(180deg, #06243d, #041627 50%, #020b16);
}
body[data-skin-theme="theme-neon"] {
  --ink: #f6f0ff; --muted: #b6a6e0; --bg: #0a0618; --card: #170d2e; --line: #f6f0ff; --line-strong: #f6f0ff;
  --blue: #ff2fd0; --blue-dark: #ff7be3; --blue-soft: rgba(255,47,208,.16); --gold: #ffe600; --gold-soft: rgba(255,230,0,.14); --purple: #00f0ff; --green: #39ff88;
  --shadow: 5px 5px 0 #00f0ff; --shadow-hover: 8px 8px 0 #ff2fd0;
  --topbar-bg: rgba(10,6,24,.92);
  --theme-veil: linear-gradient(180deg, rgba(10,4,26,.82), rgba(6,2,16,.92));
  --theme-glow: linear-gradient(transparent 96%, rgba(255,47,208,.18) 0) 0 0 / 100% 46px, linear-gradient(90deg, transparent 96%, rgba(0,240,255,.14) 0) 0 0 / 46px 100%;
  background: radial-gradient(ellipse at 50% 110%, rgba(255,47,208,.25), transparent 60%), #0a0618;
}
body[data-skin-theme="theme-noel"] {
  --ink: #fdf7f0; --muted: #c3b8b0; --bg: #0b1420; --card: #172536; --line: #fdf7f0; --line-strong: #fdf7f0;
  --blue: #e63946; --blue-dark: #ff7a84; --blue-soft: rgba(230,57,70,.16); --gold: #f6c453; --gold-soft: rgba(246,196,83,.16); --purple: #3ccf7a; --green: #3ccf7a;
  --shadow: 5px 5px 0 #fdf7f0; --shadow-hover: 8px 8px 0 #fdf7f0;
  --topbar-bg: rgba(10,18,30,.92);
  --theme-veil: linear-gradient(180deg, rgba(10,24,42,.8), rgba(30,8,12,.88));
  --theme-glow: radial-gradient(circle, rgba(255,255,255,.5) 0 1.5px, transparent 2.5px) 0 0 / 60px 60px;
  background: linear-gradient(180deg, #0e2a46, #0b1420 60%, #2a0d12);
}
body[data-skin-theme="theme-noel"] .theme-decor span { color: #fff; }
body[data-skin-theme="theme-cosmos"] {
  --ink: #f1eaff; --muted: #b0a2d8; --bg: #080314; --card: #1a0f33; --line: #f1eaff; --line-strong: #f1eaff;
  --blue: #a66bff; --blue-dark: #c9a3ff; --blue-soft: rgba(166,107,255,.18); --gold: #ffd27a; --gold-soft: rgba(255,210,122,.16); --purple: #ff7ad9;
  --shadow: 5px 5px 0 #f1eaff; --shadow-hover: 8px 8px 0 #f1eaff;
  --topbar-bg: rgba(10,4,22,.92);
  --theme-veil: radial-gradient(ellipse at 70% 20%, rgba(166,107,255,.25), transparent 50%), linear-gradient(180deg, rgba(8,3,20,.82), rgba(4,1,10,.94));
  --theme-glow: radial-gradient(circle, rgba(255,255,255,.7) 0 1px, transparent 2px) 0 0 / 38px 38px;
  background: #080314;
}
body[data-skin-theme="theme-royal"] {
  --ink: #fff6e0; --muted: #d6bf94; --bg: #140b04; --card: #2a1a0a; --line: #fff6e0; --line-strong: #fff6e0;
  --blue: #d4a017; --blue-dark: #ffd34d; --blue-soft: rgba(212,160,23,.18); --gold: #ffd700; --gold-soft: rgba(255,215,0,.16); --purple: #c2185b;
  --shadow: 5px 5px 0 #ffd700; --shadow-hover: 8px 8px 0 #ffd700;
  --topbar-bg: rgba(40,10,20,.92);
  --theme-veil: linear-gradient(180deg, rgba(60,8,24,.8), rgba(20,10,4,.92));
  --theme-glow: repeating-linear-gradient(90deg, rgba(255,215,0,.05) 0 2px, transparent 2px 60px);
  background: linear-gradient(180deg, #3a0816, #140b04);
}
body[data-skin-theme]:not([data-skin-theme="theme-halloween"]) .btn:not(.ghost):not(.green):not(.red):not(.gold-btn):not(:disabled) { background: var(--btn); }
body[data-skin-theme]:not([data-skin-theme="theme-halloween"]) .btn:not(.ghost):not(.green):not(.red):not(.gold-btn):hover:not(:disabled) { filter: brightness(1.15); }
body[data-skin-theme="theme-foret"] { --btn: #2f7d32; }
body[data-skin-theme="theme-abysses"] { --btn: #0b7192; }
body[data-skin-theme="theme-neon"] { --btn: #b3138f; }
body[data-skin-theme="theme-noel"] { --btn: #b5121b; }
body[data-skin-theme="theme-cosmos"] { --btn: #6a32cc; }
body[data-skin-theme="theme-royal"] { --btn: #8a1538; }

/* ---------- Recharges Stripe ---------- */
.offers { margin-bottom: 10px; }
.offers-off, .offers-legal { margin: 0 0 12px; color: var(--muted); font-size: .88rem; font-weight: 700; text-shadow: 0 1px 2px #000; }
.offers-legal { margin-top: 14px; font-size: .78rem; }
.offers-group { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 18px 0 12px; font-size: 1.1rem; }
.offers-group small { color: var(--muted); font-size: .85rem; font-weight: 700; }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.offer-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 16px 16px; border: 3px solid var(--ink); border-radius: var(--radius); background: var(--card); box-shadow: 5px 5px 0 var(--ink); text-align: center; }
.offer-card h3 { margin: 4px 0 0; font-family: var(--font-title); font-size: 1.3rem; font-weight: 400; letter-spacing: .03em; }
.offer-card p { margin: 0; color: var(--muted); font-size: .85rem; font-weight: 700; }
.offer-card small { margin-bottom: 8px; color: var(--gold); font-weight: 800; }
.offer-card .btn { width: 100%; margin-top: auto; }
.offer-icon { font-size: 2.6rem; line-height: 1; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.4)); }
.offer-badge { position: absolute; top: -12px; right: 12px; padding: 2px 10px; border: 2px solid var(--ink); border-radius: 999px; color: #1a1205; background: var(--gold); font-size: .72rem; font-weight: 800; text-transform: uppercase; box-shadow: 2px 2px 0 var(--ink); }
.offer-card.troll { border-style: dashed; background: repeating-linear-gradient(135deg, rgba(255,215,0,.08) 0 12px, transparent 12px 24px), var(--card); animation: troll-shine 2.5s ease-in-out infinite; }
.offer-card.troll .offer-badge { color: #fff; background: var(--red); }
.gen-filters { justify-content: flex-start; margin-top: -4px; }
.gen-filters button { padding: 5px 11px; font-size: .85rem; }
.modal.troll-modal { overflow: visible; text-align: center; }
.troll-icon { display: block; font-size: 4rem; animation: emoji-bob 1.6s ease-in-out infinite; }
.troll-list { margin: 0 auto 18px; padding: 0; list-style: none; font-weight: 700; line-height: 1.9; }
.troll-actions #troll-yes { transition: transform .25s cubic-bezier(.3,1.6,.5,1); }
@keyframes troll-shine { 0%, 100% { box-shadow: 5px 5px 0 var(--ink); } 50% { box-shadow: 5px 5px 0 var(--ink), 0 0 22px 4px rgba(255,215,0,.45); } }

/* ---------- Pages légales ---------- */
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 10px; font-size: .85rem; }
.footer-legal a { color: #d4cbec; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.footer-legal a:hover { color: var(--gold); }
.auth-legal { margin: 12px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.4; text-align: center; }
.auth-legal a, .legal-page a { color: var(--blue-dark); font-weight: 700; }
.legal-page { max-width: 900px; margin: 0 auto; padding: clamp(18px, 4vw, 36px); line-height: 1.6; }
.legal-page h1 { margin: 6px 0 4px; font-family: var(--font-title); font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 400; letter-spacing: .03em; }
.legal-page h2 { margin: 26px 0 8px; font-size: 1.2rem; }
.legal-page p, .legal-page li { color: var(--ink); }
.legal-page ul, .legal-page ol { padding-left: 22px; }
.legal-page li { margin-bottom: 6px; }
.legal-nav { justify-content: flex-start; margin-bottom: 18px; }
.legal-nav a { font-size: .85rem; }
.legal-updated { margin: 0 0 18px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.legal-lead { padding: 12px 16px; border-left: 5px solid var(--gold); border-radius: 8px; background: rgba(255,179,71,.1); font-weight: 600; }
.legal-todo { padding: 0 5px; border-radius: 5px; color: #1a1205; background: var(--gold); font-weight: 800; }
.legal-table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: .88rem; }
.legal-table th, .legal-table td { padding: 8px 10px; border: 1px solid rgba(255,255,255,.18); text-align: left; vertical-align: top; }
.legal-table th { background: rgba(255,255,255,.06); }
@media (max-width: 680px) {
  .legal-table { display: block; overflow-x: auto; }
}
.consent-form { display: flex; flex-direction: column; gap: 12px; }
.consent-check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 12px; background: rgba(255,255,255,.04); font-size: .9rem; line-height: 1.4; cursor: pointer; }
.consent-check input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--gold); }
.consent-check a, .offers-legal a { color: var(--blue-dark); font-weight: 700; }
.consent-note { margin: 0; color: var(--muted); font-size: .85rem; font-weight: 700; }
.profile-data { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; }
.profile-data h2 { margin: 4px 0; }
.profile-data p { margin: 0; color: var(--muted); }
.profile-data a { color: var(--blue-dark); font-weight: 700; }
