@font-face { font-family: 'Satellite'; src: url('../fonts/Satellite.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Lemon'; src: url('../fonts/Lemon.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'Poppins'; src: url('../fonts/PoppinsBold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Archivo Black'; src: url('../fonts/ArchivoBlack.ttf') format('truetype'); font-display: swap; }

:root {
  --violet: #7b4fa6;
  --violet-dark: #4b2f6b;
  --glass: rgba(255,255,255,.28);
  --glass-strong: rgba(255,255,255,.42);
  --text: #fff;
  --muted: rgba(255,255,255,.75);
  --blue: #1fb4e6; --red: #e5242b; --orange: #f39200; --green: #6cc01f;
  --ok: #33c25a; --ko: #e5394b;
  --radius: 999px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: #3d2b52 url('../img/ui/bg.jpg') center / cover fixed no-repeat;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: #ffe27a; }
.hidden { display: none !important; }
.thin { font-family: 'Satellite', system-ui, sans-serif; font-weight: normal; letter-spacing: .02em; }

/* ---------- splash ---------- */
.splash { cursor: pointer; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; }
.splash-logo { width: clamp(120px, min(48vw, 30vh), 300px); height: auto; aspect-ratio: 1; border-radius: 22%; box-shadow: 0 10px 40px rgba(0,0,0,.35); animation: pop .6s ease-out; }
.brand { font-family: 'Archivo Black', system-ui, sans-serif; font-size: 2.4rem; margin-top: .6rem; letter-spacing: .01em; }
/* Titre « Battle Quiz » : dégradé or */
.brand, .topbar .title span { background: linear-gradient(180deg, #fff 0%, #ffe27a 55%, #f39200 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 #4b2f6b) drop-shadow(0 5px 8px rgba(0,0,0,.35)); }
.topbar .title span { filter: drop-shadow(0 2px 0 #4b2f6b) drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.splash .brand { font-size: clamp(2.3rem, min(13vw, 7.5vh), 5.2rem); margin-top: clamp(.6rem, 2vh, 1.4rem); line-height: 1.1; }
.quote { font-style: italic; color: var(--muted); max-width: min(88vw, 36rem); min-height: 3em; font-size: clamp(1rem, min(5.3vw, 2.9vh), 1.8rem); line-height: 1.4; animation: fadein 1s ease-out .3s both; }
.quote .author { display: block; margin-top: .5em; font-style: normal; font-size: .85em; opacity: .85; }
.splash .skip { margin-top: clamp(2.2rem, 6vh, 4.5rem); font-size: clamp(1.05rem, min(5.6vw, 3.1vh), 1.9rem); font-weight: 600; color: #fff; animation: pulse 1.6s ease-in-out 1s infinite both; }
@keyframes pulse { 0%,100% { opacity: .45 } 50% { opacity: 1 } }
@keyframes fadein { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
@keyframes pop { from { transform: scale(.6); opacity: 0 } to { transform: scale(1); opacity: 1 } }

/* ---------- en-tête ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 4px;
  padding: calc(6px + var(--safe-top)) 8px 6px; background: rgba(123,79,166,.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.topbar .title { display: flex; align-items: center; justify-content: center; gap: 10px; font-family: 'Archivo Black', system-ui, sans-serif; font-size: 1.55rem; cursor: pointer; user-select: none; }
.topbar .title img { height: 30px; }
.iconbtn { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; border-radius: 12px; position: relative; padding: 0; }
.iconbtn:active { background: rgba(255,255,255,.15); }
.burger, .burger::before, .burger::after { content: ''; display: block; width: 26px; height: 3px; background: #fff; border-radius: 2px; position: relative; }
.burger::before { position: absolute; top: -8px; } .burger::after { position: absolute; top: 8px; }
.rankbadge { position: relative; width: 40px; height: 40px; }
.rankbadge img { width: 40px; height: 40px; }
.rankbadge span { position: absolute; top: 3px; left: 0; right: 0; text-align: center; font-weight: 700; font-size: .78rem; color: var(--violet-dark); background: #e7dcf0; width: 26px; height: 26px; line-height: 26px; border-radius: 50%; margin: auto; }
.dot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ko); color: #fff; font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }

/* ---------- menu latéral ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(82vw, 320px); z-index: 41; background: linear-gradient(180deg, #6d4596, #3e2758); transform: translateX(-105%); transition: transform .25s ease; padding: calc(16px + var(--safe-top)) 0 calc(16px + var(--safe-bottom)); overflow-y: auto; box-shadow: 4px 0 30px rgba(0,0,0,.4); }
.drawer.open { transform: none; } .drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer .who { display: flex; align-items: center; gap: 12px; padding: 0 18px 16px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 8px; }
.drawer .who img { width: 56px; height: 56px; border-radius: 50%; background: #fff; }
.drawer .who b { display: block; font-size: 1.1rem; } .drawer .who small { color: var(--muted); }
.drawer a.item { display: flex; align-items: center; justify-content: space-between; padding: 13px 22px; color: #fff; text-decoration: none; font-size: 1.05rem; }
.drawer a.item:active, .drawer a.item.active { background: rgba(255,255,255,.12); }
.drawer a.item .dot { position: static; }

/* ---------- pages ---------- */
main.page { padding: 18px 16px calc(28px + var(--safe-bottom)); max-width: 560px; margin: 0 auto; }
h1.pt { font-family: 'Poppins', system-ui, sans-serif; font-weight: 700; font-size: 1.85rem; line-height: 1.2; text-shadow: 0 2px 0 rgba(75,47,107,.8), 0 4px 10px rgba(0,0,0,.3); text-align: center; margin: 6px 0 16px; }
h2 { font-family: 'Poppins', system-ui, sans-serif; font-size: 1.1rem; font-weight: 700; text-shadow: 0 2px 0 rgba(75,47,107,.6); margin: 22px 4px 10px; color: #fff; opacity: .95; }
p.lead { text-align: center; color: var(--muted); margin-top: -6px; }
.muted { color: var(--muted); } .center { text-align: center; } .small { font-size: .85rem; }

/* gros boutons arrondis (comme l'appli d'origine) */
.pill {
  display: flex; align-items: center; gap: 16px; width: 100%;
  border: 0; border-radius: var(--radius); background: var(--glass); padding: 8px 22px 8px 8px; margin: 0 0 18px;
  box-shadow: 0 4px 18px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.25);
  cursor: pointer; text-decoration: none; color: #fff; transition: transform .08s, background .2s;
}
.pill:active { transform: scale(.98); background: var(--glass-strong); }
.pill .ico { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 50%; background: rgba(255,255,255,.85); display: grid; place-items: center; }
.pill .ico img { max-width: 56px; max-height: 50px; }
.pill .ico.emoji { font-size: 2.3rem; }
.pill .lbl { flex: 1; text-align: center; font-family: 'Poppins', system-ui, sans-serif; font-weight: 700; font-size: 1.45rem; line-height: 1.15; text-shadow: 0 2px 0 rgba(75,47,107,.8), 0 4px 10px rgba(0,0,0,.3); }
.pill .badge { background: var(--ko); border-radius: 12px; padding: 2px 9px; font-weight: 700; font-size: .85rem; }
@media (max-width: 370px) { .pill .ico { width: 66px; height: 66px; } .pill .lbl { font-size: 1.2rem; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius); padding: 13px 22px; min-height: 48px;
  background: #fff; color: var(--violet-dark); font-weight: 700; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.15); transition: transform .08s, opacity .2s;
}
.btn:active { transform: scale(.97); } .btn[disabled] { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; } .btn.ghost { background: var(--glass); color: #fff; box-shadow: none; }
.btn.green { background: var(--ok); color: #fff; } .btn.blue { background: var(--blue); color: #fff; } .btn.red { background: var(--ko); color: #fff; }
.btn.small { padding: 7px 14px; min-height: 36px; font-size: .9rem; }
.row { display: flex; gap: 10px; align-items: center; } .row > * { flex: 1; } .row.tight > * { flex: 0 0 auto; }
.stack > * + * { margin-top: 12px; }

.card { background: rgba(255,255,255,.18); border-radius: 22px; padding: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.card + .card { margin-top: 12px; }

/* formulaires */
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: .9rem; margin: 0 0 6px 14px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 0; border-radius: 18px; padding: 14px 18px; background: rgba(255,255,255,.88); color: #2b1d3b; font-size: 1rem; outline: none;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { box-shadow: 0 0 0 3px rgba(255,226,122,.7); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 4px; font-size: .92rem; }
.check input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--ok); margin-top: 1px; }
.err { background: rgba(229,57,75,.9); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.linkbtn { background: none; border: 0; color: #ffe27a; text-decoration: underline; cursor: pointer; padding: 6px; }

/* listes */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: rgba(255,255,255,.16); border-radius: 18px; margin-bottom: 8px; }
.list li.me { background: rgba(255,226,122,.35); }
.list .grow { flex: 1; min-width: 0; } .list .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av { width: 46px; height: 46px; border-radius: 50%; background: #fff; flex: 0 0 auto; object-fit: contain; }
.av.sm { width: 34px; height: 34px; } .av.lg { width: 84px; height: 84px; }
.online { width: 10px; height: 10px; border-radius: 50%; background: #3ddc6b; display: inline-block; margin-left: 6px; }
.rk { width: 34px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.pts { font-weight: 700; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 18px; }
.tag { font-size: .75rem; padding: 3px 9px; border-radius: 10px; background: rgba(255,255,255,.25); white-space: nowrap; }
.tag.go { background: var(--ok); } .tag.wait { background: rgba(0,0,0,.2); }

.tabs { display: flex; background: rgba(255,255,255,.18); border-radius: var(--radius); padding: 4px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.tabs button.on { background: #fff; color: var(--violet-dark); }

/* ---------- partie ---------- */
.theme-chip { display: inline-block; padding: 6px 14px; border-radius: 14px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.rounds { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.rounds i { width: 34px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.25); }
.rounds i.done { background: #fff; } .rounds i.cur { background: #ffe27a; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-grid button { border: 0; border-radius: 18px; padding: 16px 10px; color: #fff; font-weight: 700; cursor: pointer; min-height: 64px; text-shadow: 0 1px 2px rgba(0,0,0,.35); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.theme-grid button:active { transform: scale(.97); }
.theme-grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-family: 'Poppins', system-ui, sans-serif; font-size: 1.02rem; line-height: 1.15; }
.theme-grid button .ti { font-size: 2rem; line-height: 1; text-shadow: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }

.q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.timer { height: 12px; border-radius: 6px; background: rgba(255,255,255,.25); overflow: hidden; margin-bottom: 18px; }
.timer > div { height: 100%; width: 100%; background: linear-gradient(90deg, #6cc01f, #f3c200, #e5242b); background-size: 300% 100%; transform-origin: left; }
.q-text { background: rgba(255,255,255,.9); color: #2b1d3b; border-radius: 22px; padding: 22px 18px; font-size: 1.2rem; font-weight: 600; text-align: center; min-height: 120px; display: grid; place-items: center; margin-bottom: 18px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.q-author { font-size: .78rem; color: var(--muted); text-align: center; margin: -10px 0 12px; }
.answers { display: grid; gap: 12px; }
.ans { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: var(--radius); padding: 8px 18px 8px 8px; min-height: 60px; background: var(--glass); cursor: pointer; text-align: left; font-size: 1.05rem; font-weight: 600; transition: background .2s, transform .08s, opacity .2s; }
.ans:active { transform: scale(.985); }
.ans .letter { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; color: #fff; }
.ans:nth-child(1) .letter { background: var(--blue); } .ans:nth-child(2) .letter { background: var(--red); }
.ans:nth-child(3) .letter { background: var(--orange); } .ans:nth-child(4) .letter { background: var(--green); }
.ans.good { background: var(--ok); } .ans.bad { background: var(--ko); }
.ans.gone { opacity: .25; pointer-events: none; }
.ans.hint { box-shadow: 0 0 0 4px #ffe27a; }
.answers.locked .ans { pointer-events: none; }
.powers { display: flex; gap: 12px; justify-content: center; margin-top: 18px; }
.power { border: 0; border-radius: var(--radius); background: var(--glass); padding: 6px 16px 6px 6px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.power img { width: 40px; height: 40px; background: rgba(255,255,255,.9); border-radius: 50%; padding: 4px; }
.power[disabled] { opacity: .4; pointer-events: none; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 10px 0 18px; min-height: 210px; }
.podium .p { flex: 1; max-width: 120px; text-align: center; }
.podium .p .av { width: 64px; height: 64px; border: 3px solid #fff; }
.podium .p .name { font-weight: 700; font-size: .9rem; margin: 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .step { border-radius: 14px 14px 0 0; background: rgba(255,255,255,.3); display: grid; place-items: start center; padding-top: 6px; font-weight: 800; font-size: 1.4rem; }
.podium .p1 .step { height: 110px; background: rgba(255,215,64,.65); } .podium .p2 .step { height: 80px; background: rgba(220,220,230,.55); } .podium .p3 .step { height: 56px; background: rgba(205,127,50,.6); }
.podium .medal { height: 34px; }
.punch { text-align: center; font-size: 1.05rem; margin: 6px 0; }

/* chat */
.chat { margin-top: 18px; }
.chat .msgs { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px; }
.chat .m { max-width: 80%; padding: 8px 12px; border-radius: 16px; background: rgba(255,255,255,.85); color: #2b1d3b; align-self: flex-start; word-wrap: break-word; }
.chat .m b { display: block; font-size: .75rem; color: var(--violet); }
.chat .m.mine { align-self: flex-end; background: #ffe27a; }
.chat form { display: flex; gap: 8px; margin-top: 8px; }
.chat form .input { padding: 11px 16px; }

/* avatars / boutique */
.av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
.av-grid button { position: relative; border: 3px solid transparent; border-radius: 50%; background: #fff; padding: 4px; aspect-ratio: 1; cursor: pointer; }
.av-grid button img { width: 100%; height: 100%; object-fit: contain; }
.av-grid button.sel { border-color: #ffe27a; box-shadow: 0 0 0 3px var(--violet); }
.av-grid button.lock img { filter: grayscale(1) opacity(.5); }
.av-grid button.lock::after { content: '🔒'; position: absolute; bottom: -2px; right: -2px; font-size: 1rem; }
.coins { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 1.3rem; }
.shop-item { display: flex; align-items: center; gap: 14px; }
.shop-item .grow { flex: 1; }

/* toast & modale */
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px); background: rgba(30,20,45,.95); color: #fff; padding: 12px 20px; border-radius: 16px; z-index: 100; opacity: 0; transition: all .25s; max-width: 90vw; text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal { background: linear-gradient(180deg, #7b4fa6, #4b2f6b); border-radius: 24px; padding: 22px; width: min(420px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal h3 { margin: 0 0 10px; }

.spinner { width: 36px; height: 36px; border: 4px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg) } }
.install-hint { font-size: .85rem; }
.legal { font-size: .95rem; line-height: 1.5; }
.legal h2 { margin-top: 18px; }

.row .btn { white-space: nowrap; }

.topbar .right { display: flex; justify-content: flex-end; align-items: center; }
.topbar .left { display: flex; align-items: center; gap: 2px; min-width: 0; }
.coinpill { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 7px 0 5px; border: 0; border-radius: 15px; background: rgba(0,0,0,.22); color: #fff; font-size: .85rem; cursor: pointer; white-space: nowrap; }

.coinpill:active { background: rgba(0,0,0,.35); }
@media (max-width: 400px) { .topbar .title { font-size: 1.3rem; gap: 6px; } .coinpill { font-size: .8rem; } .topbar .title img { height: 26px; } .topbar { padding-left: 4px; padding-right: 4px; } }
.topbar .bell { font-size: 1.35rem; line-height: 1; filter: grayscale(.2); }
@media (max-width: 370px) { .topbar { grid-template-columns: 80px 1fr 84px; } .topbar .title { font-size: 1.5rem; gap: 6px; } }

/* messagerie privée */
.dm-msgs { display: flex; flex-direction: column; gap: 6px; padding-bottom: 90px; }
.dm { max-width: 80%; align-self: flex-start; background: rgba(255,255,255,.88); color: #2b1d3b; padding: 8px 12px; border-radius: 16px 16px 16px 4px; word-wrap: break-word; white-space: pre-wrap; cursor: pointer; }
.dm small { display: block; font-size: .7rem; opacity: .6; text-align: right; margin-top: 2px; }
.dm.mine { align-self: flex-end; background: #ffe27a; border-radius: 16px 16px 4px 16px; cursor: default; }
.dm-form { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px calc(10px + var(--safe-bottom)); background: rgba(75,47,107,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 15; max-width: 560px; margin: 0 auto; }
.dm-form .input { resize: none; }

/* ---------- présentation (visible sous l'écran d'accueil, masquée une fois en jeu) ---------- */
.about { max-width: 40rem; margin: 0 auto; padding: 1rem 1.4rem calc(2.5rem + var(--safe-bottom)); line-height: 1.55; }
.about h1 { font-size: 1.45rem; margin: 0 0 .6rem; }
.about h2 { font-size: 1.15rem; margin: 1.6rem 0 .4rem; }
.about p, .about li { color: var(--muted); }
.about strong { color: #fff; }
.about ul { padding-left: 1.2rem; }
.about-cta { text-align: center; margin-top: 1.8rem; }
.about-foot { text-align: center; font-size: .85rem; margin-top: 1.6rem; }
body.started .about { display: none; }
img.coin { width: 1.1em; height: 1.1em; vertical-align: -0.2em; display: inline-block; }
.coinpill img.coin { width: 20px; height: 20px; vertical-align: middle; }

/* ---------- flash de gain en fin de partie ---------- */
.gain-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20,8,35,.72); display: grid; place-items: center; padding: 1.5rem; overflow: hidden; animation: fadein .25s ease-out both; }
.gain-overlay.out { opacity: 0; transition: opacity .3s; }
.gain-card { position: relative; z-index: 2; width: min(340px, 100%); text-align: center; padding: 1.6rem 1.4rem 1.3rem; border-radius: 28px; overflow: hidden;
  background: linear-gradient(160deg, #8d5cc0, #4b2f6b); box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.25); animation: gainpop .55s cubic-bezier(.2,1.6,.4,1) both; }
.gain-rays { position: absolute; left: 50%; top: 118px; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: 0; opacity: .35; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255,226,122,.55) 0 10deg, transparent 10deg 24deg); border-radius: 50%; animation: spin 14s linear infinite; }
.gain-card > *:not(.gain-rays) { position: relative; z-index: 1; }
.gain-title { font-family: 'Poppins', system-ui, sans-serif; font-weight: 700; text-shadow: 0 2px 0 rgba(75,47,107,.8); font-size: 2rem; }
.gain-coin { margin: .5rem 0 .2rem; }
.gain-coin img.coin.big { width: 96px; height: 96px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); animation: coinflip 1.2s ease-out .2s both; }
.gain-total { font-size: 1.1rem; margin-bottom: .6rem; }
.gain-num { font-size: 3rem; font-weight: 800; color: #ffe27a; text-shadow: 0 3px 0 #b86f00, 0 6px 16px rgba(0,0,0,.35); }
.gain-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: .55rem .9rem; margin-top: .45rem; border-radius: 14px; background: rgba(255,255,255,.14); animation: fadein .4s ease-out 1.1s both; }
.gain-line.win { background: rgba(255,210,63,.28); animation-delay: 1.3s; }
.gain-line b { white-space: nowrap; }
.gain-overlay .confetti, .gain-overlay img.coin.rain { position: absolute; z-index: 1; top: -30px; pointer-events: none; animation-name: fall; animation-timing-function: linear; animation-fill-mode: both; animation-iteration-count: 1; }
.gain-overlay .confetti { width: 9px; height: 14px; border-radius: 2px; }
.gain-overlay img.coin.rain { width: 22px; height: 22px; }
@keyframes gainpop { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes coinflip { 0% { transform: scale(.2) rotateY(0); opacity: 0 } 40% { opacity: 1 } 100% { transform: scale(1) rotateY(720deg); opacity: 1 } }
@keyframes fall { 0% { transform: translateY(0) rotate(0); opacity: 1 } 85% { opacity: 1 } 100% { transform: translateY(110vh) rotate(540deg); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .gain-rays, .gain-overlay .confetti, .gain-overlay img.coin.rain { display: none; } .gain-coin img.coin.big { animation: none; } }

/* ---------- partie aléatoire ---------- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 6px 0 14px; }
.stepper-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #fff; color: var(--violet-dark); font-size: 1.9rem; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.stepper-btn:active { transform: scale(.94); }
.stepper-num { font-size: 2.4rem; }
.waiting-card { position: relative; overflow: hidden; padding-top: 1.4rem; }
.waiting-card h2 { margin: .4em 0 .2em; }
.big-count { font-size: 1.8rem; color: #ffe27a; }
.radar { width: 74px; height: 74px; margin: 0 auto; border-radius: 50%; position: relative; background: radial-gradient(circle, #ffe27a 0 9px, transparent 10px); }
.radar::before, .radar::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid #ffe27a; animation: ping 2s ease-out infinite; }
.radar::after { animation-delay: 1s; }
@keyframes ping { from { transform: scale(.2); opacity: 1 } to { transform: scale(1.15); opacity: 0 } }
@media (prefers-reduced-motion: reduce) { .radar::before, .radar::after { animation: none; opacity: .5; } }
.nudge { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; background: #fff; color: var(--violet-dark); border-radius: 14px; padding: 6px 10px; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.18); }
.nudge span { font-size: 1.3rem; line-height: 1; } .nudge small { font-size: .68rem; font-weight: 700; }
.nudge:not(:disabled) span { animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
.nudge.sent { opacity: .55; } .nudge:disabled { cursor: default; }
@keyframes ring { 0%, 80%, 100% { transform: rotate(0) } 84% { transform: rotate(16deg) } 88% { transform: rotate(-14deg) } 92% { transform: rotate(10deg) } 96% { transform: rotate(-6deg) } }

/* ---------- écran de démarrage d'origine (2015) ---------- */
.splash { justify-content: space-evenly; padding: calc(1rem + var(--safe-top)) .8rem calc(1rem + var(--safe-bottom)); overflow: hidden; }
.old-title .l1, .old-title .l2, .old-slogan, .old-tribe { font-family: 'Lemon', 'Archivo Black', system-ui, sans-serif; color: #ffe62e; position: relative; z-index: 0; white-space: pre-line;
  -webkit-text-stroke: .04em #ffe62e; text-shadow: 0 -.02em 0 #fff8b0; }
/* contour violet épais + halo magenta, dessiné derrière les lettres jaunes */
.old-title .l1::before, .old-title .l2::before, .old-slogan::before, .old-tribe::before { content: attr(data-t); position: absolute; inset: 0; z-index: -1;
  color: #6d1a96; -webkit-text-fill-color: #6d1a96; -webkit-text-stroke: .27em #6d1a96;
  text-shadow: 0 0 0 transparent; filter: drop-shadow(0 0 .05em #ef2cc4) drop-shadow(0 0 .05em #ef2cc4) drop-shadow(0 .09em .12em rgba(0,0,0,.4)); }
.old-slogan::before, .old-tribe::before { -webkit-text-stroke-width: .32em; }
.old-title { display: flex; flex-direction: column; line-height: .92; transform: rotate(-5deg); margin-top: .2em; animation: pop .6s ease-out; }
.old-title .l1 { font-size: clamp(3.6rem, min(23vw, 11.5vh), 8.5rem); align-self: flex-start; margin-left: -.35em; }
.old-title .l2 { font-size: clamp(4.6rem, min(30vw, 15vh), 11rem); align-self: flex-end; margin-right: -.4em; margin-top: -.15em; }
.old-slogan { white-space: pre; font-size: clamp(1rem, min(6.5vw, 3.6vh), 3rem); line-height: 1.2; text-align: center; transform: rotate(-2deg); }
.old-animals { display: flex; justify-content: center; gap: 0; width: 118vw; max-width: 960px; margin: .2em 0; }
.old-animals img { width: calc(min(118vw, 960px) / 11); max-width: 88px; height: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); animation: fadein .5s ease-out both; }
.old-animals img:nth-child(odd) { animation-delay: .15s; } .old-animals img:nth-child(3n) { animation-delay: .3s; }
.splash .quote { font-family: 'Satellite', system-ui, sans-serif; font-style: normal; color: #fff; letter-spacing: .02em; font-size: clamp(1.1rem, min(6.2vw, 3.3vh), 2.2rem); margin: .2em 0; }
.splash .quote .author { font-family: 'Satellite', system-ui, sans-serif; }
.old-tribe { font-size: clamp(1.1rem, min(6.6vw, 3.5vh), 2.6rem); }
.splash .skip { margin-top: 0; }
.gain-solo-emoji { font-size: 4.6rem; line-height: 1; margin: .4rem 0 .2rem; animation: hop 1.2s ease-in-out .3s infinite; }
.gain-joke { font-weight: 700; font-size: 1.1rem; margin: .2em 0 .6em; }
@keyframes hop { 0%, 100% { transform: translateY(0) } 30% { transform: translateY(-14px) rotate(-6deg) } 55% { transform: translateY(0) } }

/* Même police que les 5 boutons de l'accueil (Poppins Bold) pour les titres, boutons et noms des sous-menus */
.btn { font-family: 'Poppins', system-ui, sans-serif; font-weight: 700; letter-spacing: .01em; }
.btn.green, .btn.blue, .btn.red, .btn.ghost { text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.list li b { font-family: 'Poppins', system-ui, sans-serif; font-weight: 700; text-shadow: 0 1px 0 rgba(75,47,107,.6); }
.q-head .snd { background: rgba(255,255,255,.18); border: 0; border-radius: 50%; width: 36px; height: 36px; font-size: 1.05rem; cursor: pointer; flex: 0 0 auto; }
.list li.quit { opacity: .7; }
.podium .p.quit { opacity: .75; } .podium .p.quit .step { background: rgba(255,255,255,.18); }
.podium .medal.door { display: inline-block; font-size: 2.2rem; line-height: 1; }
.list li.notif-new { background: linear-gradient(135deg, #ffd84d, #f5b301); color: #4b2f6b; box-shadow: 0 4px 14px rgba(245,179,1,.35); }
.list li.notif-new .muted { color: #6b4a00; opacity: 1; font-weight: 600; }
.list li .new-dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: var(--ko, #e53935); box-shadow: 0 0 0 3px rgba(255,255,255,.7); }
.pill .badge.green { background: #2fbf58; }
.pill .badge.hidden { display: none; }
.dm-btn { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 0; padding: 0; background: none; cursor: pointer; margin-right: 4px; display: inline-grid; place-items: center; }
.chat-ico { width: 42px; height: 42px; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); }
.chat-ico.menu { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.25em; filter: none; }
input.pick { -webkit-appearance: none; appearance: none; flex: 0 0 auto; width: 28px; height: 28px; margin: 0; border: 3px solid #e53935; border-radius: 8px; background: #fff; cursor: pointer; display: grid; place-items: center; }
input.pick:checked { background: #1ab7ea; border-color: #e53935; }
input.pick:checked::after { content: '✓'; color: #fff; font-weight: 800; font-size: 18px; line-height: 1; }
.drawer .who img.coin { width: 1.1em; height: 1.1em; border-radius: 0; background: none; vertical-align: -0.2em; }
.pill { position: relative; }
.pill .badge.wait { position: absolute; left: 74px; top: 8px; background: #fff; color: #4b2f6b; padding: 2px 5px; border: 2px solid #e53935; box-shadow: 0 2px 6px rgba(0,0,0,.25); animation: hourglass 2s ease-in-out infinite; }
@keyframes hourglass { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
