/* 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-name { font-size: 1.12rem; }

@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-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; }
}

/* ========== 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: none; }
  .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; }
}
@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; }
}
