/* Chiffres plus lisibles : dans la police Pixelify Sans, le 5 ressemble à un S.
   On remplace uniquement les chiffres 0-9 par ceux de Press Start 2P. */
@font-face {
  font-family: "LGF Chiffres"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(https://fonts.gstatic.com/s/pressstart2p/v16/e3t4euO8T-267oIAQAu6jDQyK0nS.ttf) format("truetype");
  unicode-range: U+0030-0039; size-adjust: 78%; ascent-override: 92%;
}
:root {
  --bg1: #2a1250;
  --bg2: #5a1d7a;
  --card: #ffffff;
  --ink: #23173d;
  --muted: #7a6c96;
  --pink: #e63946;
  --yellow: #ffbe0b;
  --green: #2fbf71;
  --blue: #1fa6a0;
  --red: #ff5d5d;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Fredoka", system-ui, sans-serif;
  color: var(--ink);
  background: #2a0a14;
  overscroll-behavior: none;
  /* pas de délai de 300 ms au toucher sur téléphone, pas de zoom au double appui */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* fond rayé du chapiteau : couche fixe à part (bien plus fluide que background-attachment: fixed sur téléphone) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(45, 8, 22, .55), rgba(30, 6, 18, .85)),
    repeating-linear-gradient(90deg, #c1121f 0 46px, #f6e7c8 46px 92px);
  transform: translateZ(0);
}
button, a, input, select, label { touch-action: manipulation; }
/* Lambrequin de chapiteau en haut de l'écran */
#bg {
  position: fixed; top: 0; left: 0; right: 0; height: 30px; pointer-events: none; z-index: 30;
  background:
    radial-gradient(circle at 23px 0, #e63946 22px, transparent 23px) 0 0 / 92px 30px repeat-x,
    radial-gradient(circle at 69px 0, #ffbe0b 22px, transparent 23px) 0 0 / 92px 30px repeat-x;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.35));
}
#app { position: relative; max-width: 760px; margin: 0 auto; padding: 38px 14px 40px; min-height: 100%; }
#app.wide { max-width: 1100px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
button { font: inherit; cursor: pointer; border: 0; }
input { font: inherit; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.white { color: #fff; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.mt { margin-top: 12px; }
.big { font-size: 1.35rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 16px; font-weight: 700; font-size: 1.1rem;
  background: var(--pink); color: #fff; box-shadow: 0 5px 0 #9d1d28; transition: transform .06s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #9d1d28; }
.btn.alt { background: var(--blue); box-shadow: 0 5px 0 #13706b; }
.btn.yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 5px 0 #c48f00; }
.btn.ghost { background: #f6ecd6; color: var(--ink); box-shadow: 0 5px 0 #d8c39a; }
.btn.green { background: var(--green); box-shadow: 0 5px 0 #1d8a50; }
.btn.small { padding: 8px 14px; font-size: .95rem; border-radius: 12px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }

.field {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 3px solid #e3dbf3; font-size: 1.15rem;
  outline: none; background: #faf8ff; color: var(--ink);
}
.field:focus { border-color: var(--pink); }
.code-field { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 700; }

/* --- Accueil --- */
.logo { text-align: center; color: #fff; padding: 26px 0 18px; }
.logo h1 { font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 700; text-shadow: 0 5px 0 rgba(0,0,0,.25); letter-spacing: .5px; }
.logo h1 span { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.logo p { margin: 6px 0 0; opacity: .85; font-size: 1.1rem; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.avatars { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatars button { font-size: 1.7rem; background: #f3eefc; border-radius: 12px; padding: 6px 0; border: 3px solid transparent; }
.avatars button.on { border-color: var(--pink); background: #ffe6ef; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 14px 0; }
.sep::before, .sep::after { content: ""; flex: 1; height: 2px; background: #eee6f8; }

/* --- Barre du haut --- */
.top { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 12px; min-height: 44px; }
.top .title { font-weight: 700; font-size: 1.15rem; }
.top .sub { opacity: .8; font-size: .9rem; }
.pill { background: rgba(255,255,255,.16); border-radius: 999px; padding: 6px 12px; font-weight: 600; }
.timer { font-variant-numeric: tabular-nums; background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 12px; font-weight: 700; min-width: 58px; text-align: center; }
.timer.hurry { background: var(--red); color: #fff; animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.bar { height: 8px; background: rgba(255,255,255,.18); border-radius: 99px; overflow: hidden; margin: -4px 0 12px; }
.bar > i { display: block; height: 100%; background: var(--yellow); width: 100%; transition: width .25s linear; }

/* --- Joueurs --- */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pl { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: #f6f2fd; border-left: 6px solid var(--c); font-weight: 600; min-width: 0; }
.pl .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl.off { opacity: .45; }
.pl.me { background: #fff3c4; }
.pl .crown { margin-left: auto; }
.av { display: inline-block; width: 40px; height: 40px; border-radius: 50%; background: #fdf6ff; border: 3px solid var(--c); flex: none; overflow: hidden; }
.av svg, .clown-mini svg, .clown-preview svg { display: block; width: 100%; height: 100%; }
.av.s { width: 28px; height: 28px; border-width: 2px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 3px; border-radius: 999px; background: #f3eefc; font-weight: 600; font-size: .9rem; margin: 2px; }
.crown { font-size: .9rem; }
.code-big { font-size: 3rem; letter-spacing: .25em; font-weight: 700; color: var(--pink); text-align: center; margin: 4px 0; }

/* --- Intro --- */
.intro { text-align: center; color: #fff; padding-top: 10px; }
.intro .emo { font-size: 6rem; animation: pop .6s cubic-bezier(.3,1.6,.5,1) both, bob 2.4s 0.6s ease-in-out infinite; }
.intro h2 { font-size: 2.3rem; margin: 6px 0 14px; text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.intro .card { color: var(--ink); text-align: left; font-size: 1.1rem; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* --- Quiz --- */
.q { font-size: 1.35rem; font-weight: 600; text-align: center; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { min-height: 84px; border-radius: 18px; color: #fff; font-weight: 700; font-size: 1.1rem; padding: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.opt:nth-child(1) { background: #ff5d73; } .opt:nth-child(2) { background: #4c8dff; }
.opt:nth-child(3) { background: #f5a623; } .opt:nth-child(4) { background: #2fbf7a; }
.opt.dim { opacity: .35; }
.opt.picked { outline: 5px solid #fff; outline-offset: -5px; }
.opt.good { opacity: 1; outline: 5px solid #fff; outline-offset: -5px; animation: pulse .5s 2 alternate; }
.opt .who { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; }
.status { text-align: center; color: #fff; font-weight: 600; margin: 12px 0; }
.result-banner { text-align: center; font-size: 1.6rem; font-weight: 700; color: #fff; margin: 10px 0; text-shadow: 0 3px 0 rgba(0,0,0,.25); }

/* --- Dessin --- */
.wordbar { text-align: center; font-size: 1.5rem; font-weight: 700; letter-spacing: .12em; color: #fff; margin-bottom: 10px; }
.wordbar.found { color: var(--green); }
.canvas-wrap { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); position: relative; max-width: calc((100vh - 240px) * 4 / 3); min-width: min(100%, 300px); margin: 0 auto; }
.canvas-wrap canvas { display: block; width: 100%; height: auto; touch-action: none; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; justify-content: center; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.sw.on { outline: 3px solid var(--yellow); }
.sz { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; }
.sz.on { outline: 3px solid var(--yellow); }
.sz i { display: block; background: #222; border-radius: 50%; }
.draw-layout { display: grid; gap: 12px; }
@media (min-width: 900px) { .draw-layout { grid-template-columns: 1fr 300px; } }
.feed { height: 170px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; font-size: .95rem; }
@media (min-width: 900px) { .feed { height: 360px; } }
.feed div { padding: 4px 8px; border-radius: 10px; background: #f6f2fd; }
.feed .ok { background: #dcfbe9; color: #0d7a45; font-weight: 700; }
.choices { display: grid; gap: 10px; }

/* --- Bluff --- */
.prompt { font-size: 1.35rem; font-weight: 600; text-align: center; line-height: 1.4; }
.prompt b { display: inline-block; min-width: 90px; border-bottom: 4px solid var(--pink); color: var(--pink); }
.vote-list { display: grid; gap: 10px; }
.vote-list .btn { justify-content: flex-start; text-align: left; }
.rev { border-radius: 16px; padding: 12px 14px; background: #f6f2fd; margin-bottom: 8px; }
.rev.truth { background: #dcfbe9; outline: 3px solid var(--green); }
.rev .t { font-weight: 700; font-size: 1.15rem; }

/* --- Tribunal --- */
.cands { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.cand { background: #fff; border-radius: 18px; padding: 12px 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); }
.cand .av { width: 64px; height: 64px; }
.cand.picked { outline: 5px solid var(--yellow); }
.hbar { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.hbar .track { flex: 1; height: 26px; background: #eee6f8; border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--c); border-radius: 99px; transition: width .6s; }
.hbar.win .track { outline: 3px solid var(--yellow); }
.hbar.win { font-weight: 700; }

/* --- Réflexes --- */
.zone { height: min(62vh, 480px); border-radius: 26px; display: grid; place-items: center; text-align: center; color: #fff; font-size: 2.4rem; font-weight: 700; box-shadow: var(--shadow); user-select: none; -webkit-user-select: none; touch-action: manipulation; padding: 20px; }
.zone.wait { background: #e8434f; }
.zone.go { background: #22c46e; animation: pulse .25s infinite alternate; }
.zone.done { background: #7a5bd8; animation: none; }
.zone small { display: block; font-size: 1.1rem; font-weight: 500; opacity: .9; margin-top: 8px; }
.mash-btn { width: min(70vw, 300px); height: min(70vw, 300px); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8db0, var(--pink)); color: #fff; font-size: 2.2rem; font-weight: 700; box-shadow: 0 12px 0 #b0225a; margin: 10px auto; display: grid; place-items: center; user-select: none; touch-action: manipulation; }
.mash-btn:active { transform: translateY(8px); box-shadow: 0 4px 0 #b0225a; }
.count-big { font-size: 5rem; font-weight: 700; color: #fff; text-align: center; text-shadow: 0 5px 0 rgba(0,0,0,.25); }

/* --- Pièces --- */
.arena-wrap { position: relative; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); touch-action: none; }
.arena-wrap canvas { display: block; width: 100%; height: auto; touch-action: none; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 3rem; font-weight: 700; text-shadow: 0 4px 0 rgba(0,0,0,.35); pointer-events: none; background: rgba(30,10,60,.25); }
.hud { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }

/* --- Résultats / podium --- */
.res-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: #f6f2fd; margin-bottom: 6px; animation: slide .4s both; }
.res-row .rk { width: 30px; font-weight: 700; font-size: 1.2rem; text-align: center; }
.res-row .n { flex: 1; font-weight: 600; }
.plus { background: var(--yellow); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 700; }
.plus.zero { background: #e9e3f5; color: var(--muted); }
.tot { font-weight: 700; min-width: 52px; text-align: right; }
@keyframes slide { from { opacity: 0; transform: translateX(-20px); } }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 20px 0 6px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; font-weight: 700; width: 30%; max-width: 160px; }
.pod .av { width: 72px; height: 72px; }
.pod .blk { width: 100%; border-radius: 14px 14px 0 0; display: grid; place-items: center; font-size: 2rem; color: #fff; box-shadow: var(--shadow); }
.pod .nm { text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Divers --- */
#banner { position: fixed; top: 0; left: 0; right: 0; background: var(--red); color: #fff; text-align: center; padding: 8px; font-weight: 600; z-index: 50; }
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 600; text-align: center; animation: pop .25s both; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.confetti { position: fixed; top: -20px; width: 10px; height: 16px; z-index: 40; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.spect { text-align: center; color: #fff; font-size: 1.3rem; padding: 30px 10px; }
.spect .e { font-size: 4rem; }

/* --- Comptes & clowns --- */
.acc { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 4px; border-radius: 50%; background: var(--blue); color: #fff; font-size: .65rem; vertical-align: middle; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #f3eefc; padding: 5px; border-radius: 16px; }
.tab { padding: 10px 4px; border-radius: 12px; background: transparent; font-weight: 600; color: var(--muted); }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 2px 0 #d9cff0; }
.clown-mini { width: 86px; height: 86px; border-radius: 50%; background: #f3eefc; overflow: hidden; flex: none; }
.clown-mini.s { width: 58px; height: 58px; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-weight: 600; font-size: .95rem; }
.modal { position: fixed; inset: 0; background: rgba(20, 6, 40, .7); z-index: 70; display: grid; place-items: start center; overflow-y: auto; padding: 16px 12px; }
.modal-card { width: min(100%, 520px); margin: 0; }
.clown-preview { width: 150px; height: 210px; margin: 6px auto 10px; border-radius: 24px; background: radial-gradient(circle, #fff, #efe6fb); overflow: hidden; box-shadow: inset 0 0 0 4px #e3d8f6; }
.part { padding: 10px 0; border-top: 2px solid #f1ebfa; }
.part-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.picker { position: relative; width: 44px; height: 30px; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 0 0 2px #d9cff0; cursor: pointer; overflow: hidden; }
.picker::after { content: "🎨"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; pointer-events: none; }
.picker input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.sws { display: flex; flex-wrap: wrap; gap: 6px; }
.sw2 { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #0002; }
.sw2.on { outline: 3px solid var(--pink); outline-offset: 2px; }

/* ================= Thème fête foraine ================= */
.card { background: #fffaf0; border: 3px solid var(--yellow); box-shadow: 0 6px 0 rgba(90, 10, 25, .55); }
.logo h1, .intro h2, .code-big, .result-banner, .marquee, .secret b, .role-big { font-family: "Bungee", "Fredoka", sans-serif; font-weight: 400; }
.logo h1 { color: var(--yellow); text-shadow: 0 4px 0 #9d1d28, 0 0 22px rgba(255, 190, 11, .45); letter-spacing: 1px; }
.logo.small { padding: 4px 0 10px; }
.logo.small h1 { font-size: 1.9rem; }
.marquee { display: inline-block; background: var(--pink); color: #fff; padding: 4px 16px; border-radius: 8px; border: 2px dashed #ffe08a; font-size: .85rem; margin-bottom: 8px; transform: rotate(-2deg); }
.bulbs { height: 14px; margin: 10px auto 6px; max-width: 420px;
  background: radial-gradient(circle, #fff7c2 0 3px, var(--yellow) 4px 5px, transparent 6px) 0 0 / 26px 14px repeat-x;
  animation: chase .6s steps(1) infinite; filter: drop-shadow(0 0 6px rgba(255, 200, 40, .8)); }
@keyframes chase { 50% { background-position: 13px 0; } }
.top { background: rgba(40, 8, 20, .65); padding: 6px 10px; border-radius: 16px; border: 2px solid rgba(255, 190, 11, .5); }
.bar { background: rgba(0, 0, 0, .35); }
.code-big { color: var(--pink); letter-spacing: .18em; }
.ticket { border-style: dashed; border-width: 4px; }
.intro h2 { color: var(--yellow); text-shadow: 0 4px 0 #9d1d28; }
.result-banner { color: var(--yellow); text-shadow: 0 3px 0 #9d1d28; font-size: 1.4rem; }
.field { background: #fffdf7; border-color: #ecdcb8; }
.tabs { background: #f6ecd6; }
.tab.on { box-shadow: 0 2px 0 #d8c39a; }
.pl, .res-row, .rev, .feed div, .chip { background: #f8efdc; }
.pl.me { background: #fff1b8; }
.pl .st { color: #9d1d28; font-size: .9rem; }

/* Choix du jeu */
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.game { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px 12px; border-radius: 18px;
  background: #fff; border: 3px solid #f0d9a8; box-shadow: 0 5px 0 #d8c39a; color: var(--ink); text-align: center; transition: transform .1s; }
.game:hover:not(:disabled) { transform: translateY(-3px) rotate(-1deg); border-color: var(--pink); }
.game:disabled { cursor: default; }
.game .ge { font-size: 2.4rem; }
.game b { font-size: 1.05rem; }
.game small { color: var(--muted); line-height: 1.2; }
.game.locked { opacity: .5; }
.game.last { border-color: var(--yellow); }
.game .need { font-style: normal; font-size: .75rem; color: var(--pink); font-weight: 600; }

/* Réactions pendant le dessin */
.emo-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.emote { position: absolute; bottom: -10px; display: flex; flex-direction: column; align-items: center; animation: rise 2.2s ease-out forwards; }
.emote span { font-size: 2.8rem; filter: drop-shadow(0 3px 3px rgba(0,0,0,.25)); }
.emote small { background: rgba(0,0,0,.55); color: #fff; border-radius: 8px; padding: 0 6px; font-weight: 600; font-size: .75rem; }
.emote.lol span { animation: shake .25s 6; }
@keyframes rise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-40px) scale(1.1); } 100% { transform: translateY(-420px) scale(1); opacity: 0; } }
@keyframes shake { 50% { transform: rotate(14deg); } }
.emo-bar { display: flex; justify-content: center; gap: 14px; margin-top: 10px; }
.emo-bar button { width: 60px; height: 60px; border-radius: 50%; background: #fffaf0; border: 3px solid var(--yellow); font-size: 1.9rem; box-shadow: 0 4px 0 rgba(90,10,25,.5); }
.emo-bar button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(90,10,25,.5); }
.choices { grid-template-columns: 1fr 1fr; }

/* Undercover */
.secret { background: #2b0f1e; color: #fff; border: 3px dashed var(--yellow); border-radius: 18px; padding: 14px; text-align: center; font-size: 1.15rem; margin-bottom: 12px; }
.secret b { display: block; color: var(--yellow); font-size: 1.7rem; margin-top: 4px; }
.secret.white b { display: inline; font-size: 1.15rem; }
.uc-row { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: #f8efdc; margin-bottom: 6px; flex-wrap: wrap; }
.uc-row .n { font-weight: 600; min-width: 90px; }
.uc-row .clues { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.uc-row.out { opacity: .55; }
.uc-row.out .n { text-decoration: line-through; }
.uc-row.speaking { outline: 3px solid var(--pink); background: #ffe3e3; }
.clue { background: #fff; border: 2px solid #ecdcb8; border-radius: 999px; padding: 2px 10px; font-weight: 600; }
.role { font-size: .85rem; font-weight: 700; }
.role-big { display: inline-block; margin: 8px 0; padding: 8px 18px; border-radius: 999px; font-size: 1.3rem; color: #fff; background: #555; }
.role-big.civ { background: var(--blue); }
.role-big.uc { background: var(--pink); }
.role-big.white { background: #222; }

[hidden] { display: none !important; }

/* ================= Lobby : champ de foire ================= */
#app.world { max-width: 1100px; padding-bottom: 10px; }
.hud { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: nowrap; }
@media (max-width: 420px) { .hud-btn { width: 38px; height: 38px; font-size: 1.05rem; } .hud-chip { padding: 5px 9px; font-size: .9rem; } }
.hud-chip { background: #fffaf0; border: 3px solid var(--yellow); border-radius: 999px; padding: 6px 12px; font-weight: 700; color: var(--ink); font-size: 1rem; }
.ticket-chip { border-style: dashed; color: var(--pink); letter-spacing: .08em; font-family: "Bungee", "Fredoka", sans-serif; font-weight: 400; }
.hud-chip.gold { color: #8a5a00; background: #fff3c4; }
.hud-btn { width: 44px; height: 44px; border-radius: 50%; background: #fffaf0; border: 3px solid var(--yellow); font-size: 1.3rem; box-shadow: 0 3px 0 rgba(90,10,25,.5); }
.world-wrap { position: relative; border-radius: 20px; overflow: hidden; border: 4px solid var(--yellow); box-shadow: 0 6px 0 rgba(90,10,25,.55); }
.world-wrap canvas { display: block; width: 100%; touch-action: none; }
.world-tip { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(20,6,30,.75); color: #fff; padding: 6px 12px; border-radius: 12px; font-size: .9rem; white-space: nowrap; pointer-events: none; }
.action-bar { min-height: 64px; padding-top: 10px; }
.action-bar .btn { animation: pop .25s both; font-size: 1.2rem; }

/* ================= Casino ================= */
.casino { background: #0b5a32; border-color: var(--yellow); color: #fff; }
.casino h2 { color: var(--yellow); }
.casino .muted { color: #cfe8d8; }
.bets, .rtypes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.chipbet { border-radius: 999px; padding: 7px 12px; background: #fff; color: var(--ink); font-weight: 700; border: 3px dashed #c9a227; }
.chipbet.on { background: var(--yellow); border-style: solid; border-color: #fff; }
.cmsg { min-height: 30px; text-align: center; font-weight: 700; font-size: 1.2rem; margin-top: 10px; }
.cmsg.good { color: var(--yellow); }
.cmsg.bad { color: #ffb3b3; }
.small-print { font-size: .8rem; text-align: center; }
.paytable { font-size: .85rem; }
.reels { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.reel { width: 80px; height: 90px; display: grid; place-items: center; font-size: 3rem; background: #fff; border-radius: 14px; border: 4px solid #c1121f; }
.reel.spin { filter: blur(1px); }
.rball { width: 110px; height: 110px; margin: 12px auto 0; border-radius: 50%; display: grid; place-items: center; font-size: 2.6rem; font-weight: 700; background: #333; color: #fff; border: 6px solid var(--yellow); }
.rball.red { background: #c1121f; } .rball.black { background: #111; } .rball.green { background: #2fbf71; }
.wheel-wrap { position: relative; width: 280px; margin: 10px auto 0; }
.wheel-wrap canvas { display: block; width: 100%; }
.wheel-pin { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); color: var(--yellow); font-size: 2rem; text-shadow: 0 2px 0 #000; }
.bj { background: #0a4a29; border-radius: 16px; padding: 12px; margin-top: 10px; }
.hand { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pcard { width: 46px; height: 64px; background: #fff; color: #111; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; box-shadow: 0 3px 0 #0005; }
.pcard.redc { color: #c1121f; }
.pcard.back { background: repeating-linear-gradient(45deg, #c1121f 0 6px, #e63946 6px 12px); }

/* ================= Coop ================= */
.coop-wrap { position: relative; border-radius: 18px; overflow: hidden; border: 4px solid var(--yellow); }
.coop-wrap canvas { display: block; width: 100%; touch-action: none; }
.coop-msg { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 700; text-shadow: 0 2px 0 #000; pointer-events: none; text-align: center; }
.coop-ctrl { display: flex; gap: 12px; margin-top: 10px; user-select: none; -webkit-user-select: none; }
.coop-ctrl.desk { display: none; }
.pad { width: 74px; height: 74px; border-radius: 50%; background: #fffaf0; border: 4px solid var(--yellow); font-size: 2rem; box-shadow: 0 4px 0 rgba(90,10,25,.6); touch-action: none; }
.pad.jump { width: 90px; height: 90px; background: var(--pink); color: #fff; }

/* ================================================================
   STYLE PIXEL 16 BITS (remplace les styles arrondis ci-dessus)
   ================================================================ */
:root { --px: #140c1c; --cream: #fdf0d5; }
body { font-family: "LGF Chiffres", "Pixelify Sans", "Fredoka", monospace; font-size: 17px; -webkit-font-smoothing: none; }
* { border-radius: 0 !important; }
img.pix, canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
h1, h2, .logo h1, .intro h2, .code-big, .result-banner, .marquee, .secret b, .role-big, .ticket-chip, .top .title, .timer, .sv, .rar, .q {
  font-family: "Press Start 2P", monospace; font-weight: 400; letter-spacing: 0; }
h2 { font-size: .95rem; line-height: 1.6; }
h3 { font-weight: 700; font-size: 1.1rem; }
.logo h1 { font-size: clamp(1.3rem, 6vw, 2.3rem); line-height: 1.5; text-shadow: 4px 4px 0 #9d1d28, -2px -2px 0 var(--px); }
.logo.small h1 { font-size: 1rem; }
.logo .pe.big { display: block; margin: 0 auto 6px; }
.marquee { border: 3px solid var(--px); font-size: .6rem; padding: 6px 10px; transform: none; }
.card { background: var(--cream); border: 4px solid var(--px); box-shadow: 6px 6px 0 rgba(20,12,28,.75), inset 0 0 0 3px #ffbe0b; }
.btn { border: 4px solid var(--px); font-weight: 700; font-family: "LGF Chiffres", "Pixelify Sans", monospace; letter-spacing: .02em;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.28), inset 4px 4px 0 rgba(255,255,255,.28), 4px 4px 0 var(--px); }
.btn:active { transform: translate(3px, 3px); box-shadow: inset -4px -4px 0 rgba(0,0,0,.28), inset 4px 4px 0 rgba(255,255,255,.28), 1px 1px 0 var(--px); }
.btn.alt, .btn.green, .btn.yellow, .btn.ghost { box-shadow: inset -4px -4px 0 rgba(0,0,0,.22), inset 4px 4px 0 rgba(255,255,255,.3), 4px 4px 0 var(--px); }
.field { border: 4px solid var(--px); background: #fffaf0; font-family: inherit; }
.field:focus { border-color: var(--pink); }
.av { background: var(--c); border: 3px solid var(--px); }
.av img { width: 100%; height: 100%; display: block; }
.clown-mini { background: #bfe6ff; border: 3px solid var(--px); }
.clown-mini img { width: 100%; height: 100%; display: block; }
.clown-preview { width: 172px; height: 210px; background: #bfe6ff; border: 4px solid var(--px); box-shadow: none; }
.clown-preview img { display: block; height: 100%; margin: 0 auto; }
.top { background: #2b0f1e; border: 3px solid var(--px); box-shadow: 4px 4px 0 rgba(0,0,0,.5); }
.top .title { font-size: .7rem; line-height: 1.6; }
.top .sub { font-size: .9rem; }
.timer { border: 3px solid var(--px); font-size: .6rem; padding: 8px 8px; }
.bar { border: 3px solid var(--px); height: 14px; background: #2b0f1e; }
.bar > i { background: repeating-linear-gradient(90deg, #ffbe0b 0 8px, #ff9f1c 8px 16px); transition: width .2s steps(4); }
.bulbs { height: 8px; background: linear-gradient(90deg, #fff07a 0 8px, transparent 8px) 0 0 / 24px 8px repeat-x; filter: drop-shadow(0 0 4px rgba(255,220,60,.9)); animation: chase .6s steps(1) infinite; }
@keyframes chase { 50% { background-position: 12px 0; } }
.hud-chip, .hud-btn { border: 3px solid var(--px); box-shadow: 3px 3px 0 var(--px); }
.ticket-chip { font-size: .6rem; padding: 9px 10px; }
.world-wrap, .coop-wrap, .arena-wrap, .canvas-wrap { border: 4px solid var(--px); box-shadow: 6px 6px 0 rgba(0,0,0,.55); background: #2a0a14; }
.world-wrap canvas, .coop-wrap canvas { width: auto; }
.coop-wrap canvas { width: 100%; }
.world-tip, .toast { font-family: "LGF Chiffres", "Pixelify Sans", monospace; border: 3px solid #ffbe0b; }
.game { border: 4px solid var(--px); box-shadow: 4px 4px 0 var(--px); }
.game.last { box-shadow: 4px 4px 0 var(--px), inset 0 0 0 3px #ffbe0b; }
.opt { border: 4px solid var(--px); box-shadow: 4px 4px 0 var(--px), inset -4px -4px 0 rgba(0,0,0,.25); }
.pl, .res-row, .uc-row, .rev { border: 2px solid #e2cfa5; }
.chip { border: 2px solid var(--px); }
.chip .av.s { border-width: 2px; }
.pe { width: 24px; height: 24px; vertical-align: middle; }
.pe.big { width: 48px; height: 48px; }
.pe.huge { width: 112px; height: 112px; }
.intro .emo { font-size: 1rem; }
.reel img { width: 56px; height: 56px; }
.sw, .sw2, .sz, .pad, .emo-bar button, .chipbet, .picker { border-radius: 0 !important; }
.pad, .emo-bar button { border: 4px solid var(--px); }
.cand { border: 4px solid var(--px); box-shadow: 4px 4px 0 var(--px); }
.mash-btn { border: 6px solid var(--px); box-shadow: 0 10px 0 var(--px); background: var(--pink); font-family: "Press Start 2P", monospace; font-size: 1.2rem; }
.zone { border: 6px solid var(--px); font-family: "Press Start 2P", monospace; font-size: 1.3rem; line-height: 1.6; }
.zone small { font-family: "LGF Chiffres", "Pixelify Sans", monospace; }
.count-big { font-family: "Press Start 2P", monospace; font-size: 3rem; }
.overlay { font-family: "Press Start 2P", monospace; font-size: 1.6rem; }
.secret { border: 4px dashed #ffbe0b; }
.secret b { font-size: 1.1rem; }
.code-big { font-size: 1.8rem; letter-spacing: .15em; }
.emote span { font-size: 2.6rem; }
.tabs.two { grid-template-columns: 1fr 1fr; margin-top: 10px; }
.plus { border: 2px solid var(--px); }
.plus.gold { background: #fff3c4; margin-left: 4px; }
.reveal-card .clown-mini, .row .clown-mini { flex: none; }
/* garde-robe */
.wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; margin-top: 8px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; background: #fff; border: 3px solid var(--px); font: 600 .72rem "LGF Chiffres", "Pixelify Sans", monospace; color: var(--ink); text-align: center; line-height: 1.1; }
.wd img { width: 100%; aspect-ratio: 18 / 17; background: #bfe6ff; }
.wd.on { outline: 4px solid var(--pink); outline-offset: -1px; }
.wd.r2 { border-color: #2f6bff; } .wd.r3 { border-color: #e0a300; background: #fff6d6; }
.wd.locked { background: #2b0f1e; color: #cfc3ea; }
.wd .q { font-size: 1.3rem; padding: 12px 0; color: #ffbe0b; }
/* machine à boules */
.gacha { background: #2b0f1e; color: #fff; }
.gacha h2 { color: #ffbe0b; }
.gacha .muted { color: #cfc3ea; }
.gacha-cv { display: block; width: 192px; height: 256px; margin: 8px auto; }
.gres:empty { display: none; }
.reveal { display: flex; align-items: center; gap: 14px; padding: 10px; margin: 8px 0; background: #fdf0d5; color: var(--ink); border: 4px solid var(--px); animation: pop .3s both; }
.reveal.r3 { box-shadow: 0 0 0 4px #ffbe0b, 0 0 30px #ffbe0b; }
.reveal img { width: 72px; height: 88px; background: #bfe6ff; border: 3px solid var(--px); }
.rar { font-size: .6rem; margin-bottom: 4px; }
/* statistiques */
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.stat { background: #fff; border: 3px solid var(--px); padding: 8px; text-align: center; }
.sv { font-size: .95rem; line-height: 1.6; }
.sl { font-weight: 700; }
.ss { font-size: .8rem; color: var(--muted); }
.stable { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: .95rem; }
.stable th, .stable td { padding: 5px 4px; border-bottom: 2px solid #e2cfa5; text-align: center; }
.stable th:first-child, .stable td:first-child { text-align: left; }

/* ================================================================
   MENUS — fenêtres façon RPG 16 bits
   ================================================================ */
/* Cadre de fenêtre : bord sombre, liseré doré, intérieur crème */
.card {
  background: var(--cream);
  border: 4px solid var(--px);
  box-shadow: inset 0 0 0 3px #ffbe0b, inset 0 0 0 6px #e8c98a, 6px 6px 0 rgba(20,12,28,.75);
  padding: 20px 18px 18px;
}
/* Barre de titre des fenêtres (cartes .win et toutes les fenêtres modales) */
.win-h, .modal-card > .row:first-child {
  margin: -20px -18px 16px; padding: 10px 14px;
  background: repeating-linear-gradient(90deg, #c1121f 0 16px, #a50f1b 16px 32px);
  border-bottom: 4px solid var(--px);
  box-shadow: inset 0 3px 0 #ff6b7a, inset 0 -3px 0 #7a0f1c;
  color: #fff; font-family: "Press Start 2P", monospace; font-size: .72rem; line-height: 1.6;
  text-shadow: 2px 2px 0 var(--px);
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
}
.modal-card > .row:first-child h2 { font-size: .72rem; color: #fff; margin: 0; text-shadow: 2px 2px 0 var(--px); }
.modal-card > .row:first-child .muted { color: #ffd6d6; }
.modal-card > .row:first-child .clown-mini { width: 44px; height: 44px; border-color: #fff; }
.modal-card > .row:first-child [data-x] {
  width: 34px; height: 34px; padding: 0; flex: none; background: #fdf0d5; color: var(--px);
  font-family: "Press Start 2P", monospace; font-size: .7rem; box-shadow: inset -3px -3px 0 rgba(0,0,0,.2), 3px 3px 0 var(--px);
}
.modal-card > .row:first-child .hud-chip { padding: 4px 8px; font-size: .9rem; box-shadow: 2px 2px 0 var(--px); }
.casino > .row:first-child { background: repeating-linear-gradient(90deg, #0b6b3a 0 16px, #095a31 16px 32px); box-shadow: inset 0 3px 0 #2fbf71, inset 0 -3px 0 #063d21; }
.gacha > .row:first-child { background: repeating-linear-gradient(90deg, #5e2786 0 16px, #4b1d6b 16px 32px); box-shadow: inset 0 3px 0 #8e4fc0, inset 0 -3px 0 #2b0f40; }
.casino, .gacha { box-shadow: inset 0 0 0 3px #ffbe0b, 6px 6px 0 rgba(0,0,0,.6); }
.casino > .row:first-child h2, .gacha > .row:first-child h2 { color: #ffbe0b; }

/* Fenêtres modales : fond tramé + apparition par paliers */
.modal { background: rgba(20,6,30,.72); background-image: radial-gradient(rgba(0,0,0,.35) 1px, transparent 1.5px); background-size: 4px 4px; padding: 24px 12px; }
.modal-card { animation: winIn .22s steps(4) both; }
@keyframes winIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Boutons plus « jeu vidéo » */
.btn { min-height: 48px; padding: 12px 18px; gap: 10px; text-shadow: 2px 2px 0 rgba(0,0,0,.35); }
.btn.ghost, .btn.yellow { text-shadow: none; }
.btn.small { min-height: 38px; padding: 7px 12px; }
.btn .pe { width: 22px; height: 22px; flex: none; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:focus-visible, .field:focus-visible, .game:focus-visible { outline: 4px solid #ffbe0b; outline-offset: 2px; }
.big-btn { min-height: 62px; font-size: 1.25rem; }
.menu-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.menu-row .btn:not(.small) { flex: 1 1 140px; }

/* Onglets façon intercalaires */
.tabs { background: transparent; padding: 0; gap: 4px; border-bottom: 4px solid var(--px); }
.tab { border: 4px solid var(--px); border-bottom: 0; background: #e8d3a6; color: #6b5a7a; padding: 10px 4px 8px; font-weight: 700; margin-bottom: -1px; }
.tab.on { background: #fffaf0; color: var(--ink); box-shadow: inset 0 3px 0 #ffbe0b; position: relative; top: 1px; }

/* Champs de saisie */
.field { padding: 13px 14px; box-shadow: inset 3px 3px 0 rgba(0,0,0,.08); }
.field::placeholder { color: #a596b8; }
.code-field { font-family: "Press Start 2P", monospace; font-size: 1rem; letter-spacing: .35em; }
.sep { font-weight: 600; }
.sep::before, .sep::after { height: 4px; background: repeating-linear-gradient(90deg, #d6bf8e 0 6px, transparent 6px 10px); }

/* Accueil */
.logo { padding: 34px 0 14px; }
.logo p { font-size: 1.05rem; text-shadow: 2px 2px 0 var(--px); }
.member { display: flex; gap: 14px; align-items: stretch; }
.stage { width: 96px; flex: none; background: linear-gradient(#8fd3ff 0 70%, #6fbf5e 70%); border: 4px solid var(--px); display: grid; place-items: end center; padding-bottom: 4px; }
.stage img { width: 76px; height: 93px; }
.stage.small { width: 64px; height: 76px; }
.stage.small img { width: 50px; height: 61px; }
.member-info { flex: 1; min-width: 0; }
.mname { font-family: "Press Start 2P", monospace; font-size: .85rem; line-height: 1.6; overflow-wrap: anywhere; }
.mcos { color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.mstats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mstats span { display: grid; grid-template-columns: 22px 1fr; column-gap: 6px; align-items: center; background: #fff; border: 3px solid var(--px); padding: 4px 6px; }
.mstats .pe { grid-row: span 2; width: 22px; height: 22px; }
.mstats b { font-size: 1rem; line-height: 1; }
.mstats i { font-style: normal; font-size: .75rem; color: var(--muted); line-height: 1.1; }
.invite-ticket { background: #fff3c4; border: 3px dashed var(--px); padding: 10px; text-align: center; font-weight: 600; margin-bottom: 12px; }

/* Barre du haut des jeux */
.top { padding: 8px 12px; background: repeating-linear-gradient(90deg, #2b0f1e 0 16px, #321326 16px 32px); box-shadow: inset 0 0 0 2px #ffbe0b55, 4px 4px 0 rgba(0,0,0,.5); }

/* HUD du lobby */
.hud { background: #2b0f1e; border: 4px solid var(--px); padding: 6px; box-shadow: inset 0 0 0 2px #ffbe0b66, 4px 4px 0 rgba(0,0,0,.5); }
.hud-btn { background: #fdf0d5; box-shadow: inset -3px -3px 0 rgba(0,0,0,.18), 3px 3px 0 var(--px); }
.hud-btn:active { transform: translate(2px, 2px); box-shadow: inset -3px -3px 0 rgba(0,0,0,.18), 1px 1px 0 var(--px); }
.action-bar .btn { min-height: 58px; animation: pulseBtn 1s steps(2) infinite; }
@keyframes pulseBtn { 50% { filter: brightness(1.15); } }

/* Borne de jeux : cartes avec bandeau de couleur */
.games { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.game { padding: 0 8px 12px; background: #fff; overflow: hidden; gap: 4px; transition: transform .08s steps(2); }
.game .ge { display: block; width: calc(100% + 16px); margin: 0 -8px 4px; padding: 10px 0 6px; background: var(--gc, #e63946); border-bottom: 4px solid var(--px); }
.game .ge .pe.big { width: 56px; height: 56px; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.35)); }
.game b { font-family: "Press Start 2P", monospace; font-size: .62rem; line-height: 1.6; }
.game small { font-size: .85rem; }
.game .need { display: inline-block; margin-top: 4px; background: #efe6d2; border: 2px solid var(--px); padding: 1px 6px; color: var(--ink); font-size: .75rem; }
.game .need.bad { background: #ffd6d6; color: #a50f1b; }
.game .lastb { font-style: normal; font-size: .7rem; font-weight: 700; color: #8a5a00; }
.game:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--px); border-color: var(--px); }
.game.locked { opacity: .55; filter: grayscale(.6); }
.g-coop { --gc: #2fbf71; } .g-draw { --gc: #ff7a1a; } .g-undercover { --gc: #3a3a5a; } .g-quiz { --gc: #ff4f8b; } .g-bluff { --gc: #7b3fe4; }
.g-tribunal { --gc: #8d5524; } .g-reflex { --gc: #e63946; } .g-mash { --gc: #1fa6a0; } .g-coins { --gc: #ffbe0b; }

/* Listes et classements */
.res-row { background: #fff; border: 3px solid var(--px); box-shadow: 3px 3px 0 rgba(20,12,28,.25); margin-bottom: 8px; }
.res-row:nth-child(even) { background: #fbf4e4; }
.res-row .rk { font-family: "Press Start 2P", monospace; font-size: .7rem; }
.pl { background: #fff; border: 3px solid var(--px); border-left: 8px solid var(--c); }
.pl.me { background: #fff3c4; }

/* Podium pixel */
.pix-podium { margin: 8px 0 14px; gap: 6px; }
.pix-podium .pod img { width: 54px; height: 66px; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.4)); }
.pix-podium .pod.p1 img { width: 72px; height: 88px; }
.pix-podium .nm { font-family: "Press Start 2P", monospace; font-size: .55rem; text-shadow: 2px 2px 0 var(--px); }
.pix-podium .blk { border: 4px solid var(--px); box-shadow: inset 0 4px 0 rgba(255,255,255,.35); font-family: "Press Start 2P", monospace; font-size: 1.2rem; color: var(--px); }
.pix-podium .p1 .blk { height: 90px; background: #ffbe0b; }
.pix-podium .p2 .blk { height: 64px; background: #cfd8e3; }
.pix-podium .p3 .blk { height: 46px; background: #d9894e; }

/* Statistiques */
.stat { box-shadow: 3px 3px 0 rgba(20,12,28,.25); }
.stat:nth-child(4n+1) { background: #fff3c4; } .stat:nth-child(4n+2) { background: #e6f7ff; } .stat:nth-child(4n+3) { background: #ffe8ef; } .stat:nth-child(4n) { background: #e8f8ee; }
.pbar { position: relative; height: 28px; margin-top: 10px; background: #2b0f1e; border: 3px solid var(--px); }
.pbar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, #ff4f8b 0 8px, #e63946 8px 16px); }
.pbar span { position: relative; display: grid; place-items: center; height: 100%; color: #fff; font-weight: 700; text-shadow: 2px 2px 0 var(--px); }
.stable { border: 3px solid var(--px); background: #fff; }
.stable th { background: #2b0f1e; color: #ffbe0b; font-family: "Press Start 2P", monospace; font-size: .5rem; padding: 8px 4px; }
.stable tr:nth-child(odd) td { background: #fbf4e4; }

/* Atelier du clown */
.part { border-top: 3px dashed #e2cfa5; }
.part-h b { font-weight: 700; }
.sw2 { width: 28px; height: 28px; border: 3px solid var(--px); }
.sw2.on { outline: 3px solid var(--pink); outline-offset: 1px; }
.picker { border: 3px solid var(--px); box-shadow: 2px 2px 0 var(--px); }
.clown-preview { background: linear-gradient(#8fd3ff 0 72%, #6fbf5e 72%); }

/* Casino : jetons */
.chipbet { border: 3px solid var(--px); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #c9a227, 2px 2px 0 var(--px); padding: 8px 12px; }
.chipbet.on { box-shadow: inset 0 0 0 3px var(--yellow), inset 0 0 0 5px #fff, 2px 2px 0 var(--px); }
.reel { border: 4px solid var(--px); box-shadow: inset 0 -6px 0 rgba(0,0,0,.12); }
.cmsg { font-family: "Press Start 2P", monospace; font-size: .7rem; line-height: 1.7; }

/* Toasts */
.toast { background: #2b0f1e; box-shadow: 4px 4px 0 rgba(0,0,0,.5); }

@media (max-width: 420px) {
  .member { flex-direction: column; align-items: center; text-align: center; }
  .stage { width: 110px; height: 120px; }
  .mstats { width: 100%; text-align: left; }
  .games { grid-template-columns: 1fr 1fr; }
}
/* correctifs fenêtres foncées et classements sur mobile */
.card.casino { background: #0b5a32; color: #fff; }
.card.gacha { background: #2b0f1e; color: #fff; }
.casino .bj { border: 3px solid var(--px); }
.res-row { flex-wrap: wrap; row-gap: 6px; }
.res-row .n { flex: 1 1 120px; min-width: 0; overflow-wrap: anywhere; }
.res-row .plus { white-space: nowrap; padding: 3px 8px; font-size: .9rem; }
.res-row .n .muted { display: block; font-size: .85rem; }
.res-row { flex-wrap: nowrap; }
.badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.badges .plus.gold { margin-left: 0; }

/* ================= La Nuit du Chapiteau ================= */
.g-nuit { --gc: #5a0f1f; }
.nuit-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; background: #140c1c; border: 4px solid var(--px); padding: 6px 8px; color: #fff; font-weight: 700; box-shadow: inset 0 0 0 2px #5a0f1f; }
.nuit-top .nz { font-family: "Press Start 2P", monospace; font-size: .6rem; color: #ffbe0b; flex: 1 1 100%; }
.nuit-top .nnight { color: #ff6b7a; animation: pulseBtn .8s steps(2) infinite; }
.nuit-top .hp { position: relative; flex: 1; min-width: 110px; height: 20px; background: #2b0f1e; border: 2px solid #fff; }
.nuit-top .hp i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, #2fbf71 0 6px, #22a35e 6px 12px); }
.nuit-top .hp b { position: relative; display: grid; place-items: center; height: 100%; font-size: .8rem; text-shadow: 1px 1px 0 #000; }
.world-wrap.nuit { background: #0b0610; }
.nuit-banner { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); font-family: "Press Start 2P", monospace; font-size: .6rem; color: #ff6b7a; text-shadow: 2px 2px 0 #000; pointer-events: none; white-space: nowrap; }
.nuit-banner.on { animation: pulseBtn .6s steps(2) infinite; }
.nuit-hud { display: grid; gap: 8px; margin-top: 10px; }
.role { border: 4px solid var(--px); padding: 8px 10px; font-weight: 600; box-shadow: 4px 4px 0 rgba(0,0,0,.5); }
.role.inno { background: #e6f7ff; }
.role.inf { background: #3a0a14; color: #fff; }
.role.inf b { color: #ff6b7a; }
.blood { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .9rem; }
.blood i { width: 16px; height: 20px; border: 3px solid #fff; background: #2b0f1e; }
.blood i.on { background: #ff1f3d; }
.nstate { margin-top: 6px; padding: 8px; border: 4px solid var(--px); font-weight: 700; text-align: center; }
.nstate.good { background: #2fbf71; color: #fff; }
.nstate.bad { background: #c1121f; color: #fff; animation: pulseBtn 1s steps(2) infinite; }
.nuit-acts { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.nuit-acts .btn { flex: 1 1 160px; }
.big-red { background: #8a0f1f; box-shadow: inset -4px -4px 0 rgba(0,0,0,.3), inset 4px 4px 0 rgba(255,255,255,.2), 4px 4px 0 var(--px); animation: pulseBtn .5s steps(2) infinite; }
.chest-prog { flex: 1 1 100%; background: #fff3c4; border: 3px solid var(--px); padding: 6px 10px; font-weight: 600; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot { min-height: 64px; background: #fdf0d5; border: 4px solid var(--px); box-shadow: inset -3px -3px 0 rgba(0,0,0,.15), 3px 3px 0 var(--px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 600 .75rem "LGF Chiffres", "Pixelify Sans", monospace; color: var(--ink); padding: 4px; }
.slot .pe { width: 28px; height: 28px; }
.slot.empty { background: #2b0f1e; opacity: .6; }
.nuit-log { background: rgba(20,12,28,.85); border: 3px solid var(--px); color: #fff; padding: 6px 10px; font-size: .9rem; min-height: 30px; }
.nuit-log div:last-child { color: #ffbe0b; }
.cand b { font-size: .85rem; color: var(--pink); }

/* ================= Le tableau ================= */
.modal.gallery { background: rgba(10,4,14,.88); }
.painting-wrap { position: relative; width: min(100%, 460px); margin: 0 auto; animation: winIn .3s steps(5) both; }
.paint-x { position: absolute; top: -6px; right: -6px; z-index: 2; }
.frame { padding: 18px; background: linear-gradient(135deg, #fff1a8, #d9a400 30%, #fff1a8 50%, #b88600 75%, #ffe27a);
  border: 4px solid var(--px); box-shadow: inset 0 0 0 4px #8a5a00, inset 0 0 0 9px #ffe27a, 0 0 40px rgba(255,200,60,.45), 8px 8px 0 rgba(0,0,0,.6); }
.frame-in { border: 4px solid #6b4400; box-shadow: inset 0 0 18px rgba(0,0,0,.5); background: #1b1b1b; }
.frame-in img { display: block; width: 100%; height: auto; image-rendering: auto; }
.plaque { margin: 14px auto 0; width: max-content; max-width: 100%; text-align: center; padding: 8px 18px; background: linear-gradient(#ffe27a, #d9a400); border: 3px solid var(--px); box-shadow: 4px 4px 0 rgba(0,0,0,.5); color: #3a2400; }
.plaque b { display: block; font-family: "Press Start 2P", monospace; font-size: .7rem; line-height: 1.7; }
.plaque span { font-size: .85rem; font-style: italic; }
.eulogy { margin-top: 14px; }
.eulogy p { margin: 0; font-size: 1.05rem; line-height: 1.55; text-align: center; }
.modal.gallery .painting-wrap { width: min(calc(100vw - 32px), 460px); box-sizing: border-box; }
.frame { padding: 12px; }
.frame-in img { max-height: 62vh; width: auto; max-width: 100%; margin: 0 auto; }
.paint-x { top: -10px; right: -10px; }
.frame { width: fit-content; max-width: 100%; margin: 0 auto; box-sizing: border-box; }
.frame-in { width: fit-content; max-width: 100%; }
.botb { display: inline-block; margin-left: 5px; padding: 1px 4px; background: #5a5f69; color: #fff; border: 2px solid var(--px); font-family: "Press Start 2P", monospace; font-size: .45rem; vertical-align: middle; }
.bot-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.bot-bar .muted { font-size: .85rem; }
.rmbot { margin-left: auto; width: 28px; height: 28px; background: #ffd6d6; border: 3px solid var(--px); font-weight: 700; color: #a50f1b; flex: none; }
.pl .crown + .rmbot, .pl .st + .rmbot { margin-left: 6px; }
.code-field { text-transform: uppercase; }

/* ===== Borne de jeux compacte ===== */
.modal[data-panel=games] .games { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.modal[data-panel=games] .game { display: grid; grid-template-columns: 44px 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 8px; row-gap: 2px;
  padding: 0 8px 0 0; min-height: 52px; text-align: left; box-shadow: 3px 3px 0 var(--px); border-width: 3px; }
.modal[data-panel=games] .game .ge { grid-row: 1 / 3; grid-column: 1; width: 44px; height: 100%; margin: 0; padding: 0; display: grid; place-items: center; border-bottom: 0; border-right: 3px solid var(--px); }
.modal[data-panel=games] .game .ge .pe.big { width: 32px; height: 32px; }
.modal[data-panel=games] .game b { grid-column: 2; grid-row: 1; font-size: .55rem; line-height: 1.4; align-self: end; padding-top: 6px; }
.modal[data-panel=games] .game small { grid-column: 2 / 4; grid-row: 2; font-size: .75rem; line-height: 1.15; align-self: start; padding-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.modal[data-panel=games] .game .need { grid-column: 3; grid-row: 1; margin: 6px 0 0; padding: 0 4px; font-size: .65rem; align-self: end; }
.modal[data-panel=games] .game .lastb { position: absolute; top: -2px; right: 4px; font-size: .55rem; background: #ffbe0b; border: 2px solid var(--px); padding: 0 3px; color: var(--ink); }
.modal[data-panel=games] .game.last { box-shadow: 3px 3px 0 var(--px), inset 0 0 0 2px #ffbe0b; }
.modal[data-panel=games] .game:hover:not(:disabled) { box-shadow: 4px 4px 0 var(--px); }
.modal[data-panel=games] .bot-bar { margin-top: 8px; }
@media (max-width: 600px) { .modal[data-panel=games] .games { grid-template-columns: 1fr 1fr; gap: 6px; }
  .modal[data-panel=games] .game { grid-template-columns: 36px 1fr; min-height: 46px; }
  .modal[data-panel=games] .game .ge { width: 36px; } .modal[data-panel=games] .game .ge .pe.big { width: 26px; height: 26px; }
  .modal[data-panel=games] .game b { font-size: .5rem; }
  .modal[data-panel=games] .game small { grid-column: 2; }
  .modal[data-panel=games] .game .need { grid-column: 2; grid-row: 3; justify-self: start; margin: 0 0 5px; font-size: .6rem; } }
.g-coins { --gc: #3d7bd9; }
@media (max-width: 600px) { .modal[data-panel=games] .game small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .68rem; padding-bottom: 0; margin-bottom: 2px; max-height: 2.3em; overflow: hidden; } }

/* ===== Paramètres ===== */
.gear { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; font-size: 1.05rem; cursor: pointer;
  background: #ffbe0b; border: 3px solid var(--px); box-shadow: 2px 2px 0 var(--px); }
.gear:active { transform: translate(2px, 2px); box-shadow: none; }
.gear.floating { position: fixed; top: 8px; right: 8px; z-index: 40; }
.settings-card { max-width: 420px; }
.set-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; }
.set-row.vol { margin-top: 6px; }
.set-row.vol input[type=range] { flex: 1; accent-color: #e63946; height: 24px; cursor: pointer; }
.set-row .btn.small { min-width: 40px; }
.vnum { font-family: "Press Start 2P", monospace; font-size: .7rem; min-width: 3.2em; text-align: right; }
.set-sep { height: 0; border-top: 3px dashed #d9c9a8; margin: 16px 0 12px; }
.btn.danger { background: #e63946; color: #fff; }
.muted.small { font-size: .8rem; margin-top: 8px; }

/* ===== Chiffres des jeux plus lisibles ===== */
.timer, .count-big, .vnum, .hud-chip.gold, .chipbet, .stable td, .res-row b, .need, .st { font-variant-numeric: tabular-nums; }
.timer { font-family: "Press Start 2P", monospace; font-size: .8rem; letter-spacing: 0; }
.chipbet { font-family: "Press Start 2P", monospace !important; font-size: .62rem !important; letter-spacing: 0; }
.ntop-wrap { position: relative; }
.ntop-wrap .nuit-top { padding-right: 46px; }
.ntop-gear { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; font-size: .9rem; }

/* ===== Tchat & émotes du champ de foire ===== */
.bubbles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bub { position: absolute; left: 0; top: 0; will-change: transform; background: #fffaf0; color: #140c1c; border: 3px solid #140c1c;
  box-shadow: 3px 3px 0 rgba(0,0,0,.35); transition: opacity .3s; }
.bub::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -6px; border: 6px solid transparent; border-top-color: #140c1c; border-bottom: 0; }
.bub.say { max-width: 190px; padding: 4px 8px; font-size: .85rem; line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; text-align: center; }
.bub.emo { padding: 3px; animation: emo-pop .35s steps(4); }
.bub.emo .emo-pe { width: 32px; height: 32px; display: block; }
.bub.fade { opacity: 0; }
@keyframes emo-pop { from { scale: .2; } 60% { scale: 1.25; } to { scale: 1; } }
.chatlog { position: absolute; left: 8px; bottom: 58px; max-width: min(70%, 360px); display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.chatlog .cl { background: rgba(20,12,28,.78); color: #fff; padding: 3px 8px; font-size: .85rem; line-height: 1.3; border-left: 3px solid #ffbe0b; overflow-wrap: anywhere; }
.chatlog .cl b { text-shadow: 1px 1px 0 #000; }
.chatlog.open { pointer-events: auto; max-height: 55%; overflow-y: auto; }
.chatlog.open .cl { background: rgba(20,12,28,.9); }
.chatbar { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; z-index: 3; }
.chatbar input { flex: 1; min-width: 0; font: inherit; font-size: 1rem; padding: 8px 10px; background: #fffaf0; color: #140c1c; border: 3px solid #140c1c; box-shadow: 3px 3px 0 rgba(0,0,0,.4); outline: none; }
.chatbar input:focus { border-color: #ffbe0b; }
.chat-fab { position: absolute; left: 8px; bottom: 8px; width: 44px; height: 44px; z-index: 2; font-size: 1.3rem; display: grid; place-items: center; padding: 0;
  background: #ffbe0b; border: 3px solid #140c1c; box-shadow: 3px 3px 0 rgba(0,0,0,.45); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.chat-fab:active { transform: translate(2px, 2px); box-shadow: none; }
.ewheel { position: absolute; width: 0; height: 0; z-index: 4; }
.ewheel::before { content: ""; position: absolute; left: -104px; top: -104px; width: 208px; height: 208px; border-radius: 50%; background: rgba(20,12,28,.55); border: 3px solid #ffbe0b; }
.ew { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: #fffaf0; border: 3px solid #140c1c; box-shadow: 2px 2px 0 rgba(0,0,0,.4); transition: transform .06s steps(2); }
.ew .pe { width: 30px; height: 30px; }
.ew.on { background: #ffbe0b; transform: scale(1.22); z-index: 1; }
.ew-mid { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); width: 86px; text-align: center; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.2; text-shadow: 1px 1px 0 #000; pointer-events: none; }
.chat-fab[hidden] { display: none; }

/* ===== Clownettes : coffre & wallet ===== */
img.mk { image-rendering: pixelated; display: block; }
.chest-card { max-width: 400px; }
.chest-cv { display: block; width: 200px; height: 170px; margin: 4px auto; image-rendering: pixelated; }
.chest-card .clock { font-family: "Press Start 2P", monospace; font-size: .75rem; }
.chres:empty { display: none; }
.mk-reveal { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0 auto 8px; padding: 10px; max-width: 220px; background: #fffaf0;
  border: 4px solid var(--rc, #ffbe0b); box-shadow: 4px 4px 0 var(--px), 0 0 0 3px var(--px); animation: mk-in .6s steps(6); }
.mk-reveal img { width: 128px; height: 128px; border: 3px solid var(--px); }
.mk-reveal b { font-family: "Press Start 2P", monospace; font-size: .62rem; margin-top: 4px; }
.mk-reveal .rar, .wl-detail .rar { color: var(--rc); font-weight: 700; text-shadow: 1px 1px 0 rgba(0,0,0,.25); }
.mk-reveal small { color: var(--muted); }
@keyframes mk-in { from { transform: translateY(40px) scale(.3); opacity: 0; } 70% { transform: translateY(-6px) scale(1.08); opacity: 1; } to { transform: none; } }
.wallet-card { max-width: 640px; }
.wl-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.wl-sum > div { background: #2b0f1e; color: #fff; border: 3px solid var(--px); padding: 8px; text-align: center; }
.wl-sum b { font-family: "Press Start 2P", monospace; font-size: .9rem; color: #ffbe0b; }
.wl-sum small { display: block; font-size: .75rem; opacity: .85; margin-top: 4px; }
.wl-filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.wl-filters .chipbet { padding: 4px 8px; font-size: .8rem; }
.wl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 6px; max-height: 46vh; overflow-y: auto; padding: 4px; margin-top: 8px; background: #efe6d2; border: 3px solid var(--px); }
.wl-cell { position: relative; display: flex; flex-direction: column; align-items: center; padding: 3px; background: #fffaf0; border: 3px solid var(--rc); cursor: pointer; font: inherit; }
.wl-cell img { width: 100%; height: auto; aspect-ratio: 1; }
.wl-cell span { font-size: .65rem; font-weight: 700; color: var(--ink); }
.wl-cell.locked { cursor: default; background: #d9cfbd; border-color: color-mix(in srgb, var(--rc) 45%, #8a8070); }
.wl-cell.locked i { display: grid; place-items: center; width: 100%; aspect-ratio: 1; font-style: normal; font-family: "Press Start 2P", monospace; font-size: 1.1rem; color: #8a8070; background: #c9bea8; }
.wl-cell:hover:not(.locked) { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--px); }
.wl-detail { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 8px; background: #fffaf0; border: 4px solid var(--rc); }
.wl-detail img { width: 128px; height: 128px; flex: none; border: 3px solid var(--px); }
.wl-detail b { display: block; font-family: "Press Start 2P", monospace; font-size: .55rem; line-height: 1.6; }
.wl-detail table { margin-top: 4px; font-size: .8rem; border-collapse: collapse; }
.wl-detail td { padding: 1px 6px 1px 0; }
.wl-detail td:first-child { color: var(--muted); }
.plus.gold small { font-size: .7em; opacity: .85; }
@media (max-width: 480px) { .wl-detail img { width: 96px; height: 96px; } }
.wallet-card, .chest-card { max-height: calc(100dvh - 24px); overflow-y: auto; }
.wl-grid { max-height: 36vh; }
.wl-cell.secret { border-color: #ff2fa0; background: repeating-linear-gradient(45deg, #ffe0f1 0 6px, #f3d6ff 6px 12px); }
.wl-cell.secret i { background: transparent; color: #ff2fa0; font-size: 1.4rem; }
/* ===== Clownette secrète : scintillement continu ===== */
.mk-secret { position: relative; display: inline-block; line-height: 0; overflow: hidden; animation: mk-halo 2.4s steps(12) infinite; }
.mk-secret img { position: relative; }
.wl-cell .mk-secret { display: block; width: 100%; }
.mk-reveal .mk-secret, .wl-detail .mk-secret { border: 3px solid var(--px); flex: none; }
.mk-reveal .mk-secret img, .wl-detail .mk-secret img { border: 0; }
.mk-shine { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.75) 47%, rgba(255,240,170,.5) 52%, transparent 60%);
  background-size: 300% 300%; animation: mk-sweep 2.2s steps(18) infinite; }
.mk-spark { position: absolute; width: 24%; aspect-ratio: 1; margin: -12% 0 0 -12%; pointer-events: none; background: #fff;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 3px #ffe066) drop-shadow(0 0 1px #ff2fa0); animation: mk-twinkle 2.2s steps(7) infinite; transform: scale(0); }
.mk-spark:nth-of-type(2n) { background: #fff3a8; }
.mk-spark:nth-of-type(3n) { background: #ffd1f0; }
@keyframes mk-sweep { 0% { background-position: 120% 0; } 55%, 100% { background-position: -40% 0; } }
@keyframes mk-twinkle { 0%, 50%, 100% { transform: scale(0) rotate(0); opacity: 0; }  62% { transform: scale(1.1) rotate(20deg); opacity: 1; } 76% { transform: scale(.55) rotate(45deg); opacity: .9; } }
@keyframes mk-halo { 0%, 100% { box-shadow: 0 0 0 2px #ff2fa0, 0 0 10px 2px #ff2fa0aa; } 33% { box-shadow: 0 0 0 2px #ffd23f, 0 0 10px 2px #ffd23faa; } 66% { box-shadow: 0 0 0 2px #3dc6ff, 0 0 10px 2px #3dc6ffaa; } }
.wl-cell:has(.mk-secret) { border-color: #ff2fa0; background: repeating-linear-gradient(45deg, #ffe0f1 0 6px, #f3d6ff 6px 12px); }
@media (prefers-reduced-motion: reduce) { .mk-secret, .mk-shine, .mk-spark { animation: none; } .mk-spark { display: none; } }

/* ===== Familiers ===== */
.btn.mb { margin-bottom: 8px; }
.egg-bonus { display: flex; gap: 10px; align-items: center; margin: 8px 0; padding: 8px; background: #fff3d6; border: 3px solid var(--px); text-align: left; font-size: .9rem; }
.egg-mini { width: 42px; height: 48px; image-rendering: pixelated; flex: none; }
.eggbar { display: block; height: 8px; margin: 4px 0; background: #e8dcc0; border: 2px solid var(--px); }
.eggbar > i { display: block; height: 100%; background: #2fbf71; }
.hatch-card { max-width: 380px; text-align: center; }
.hatch-cv { display: block; width: 240px; height: 200px; margin: 0 auto; image-rendering: pixelated; }
.rar-chip { display: inline-block; padding: 2px 8px; border: 2px solid var(--px); background: #fffaf0; color: var(--rc); font-weight: 700; }
.pets-card { max-width: 640px; max-height: calc(100dvh - 24px); overflow-y: auto; }
.pet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; }
.pet-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; background: #fffaf0; border: 3px solid var(--rc); text-align: center; }
.pet-cell img { width: 80px; height: 72px; }
.pet-cell b { font-size: .9rem; overflow-wrap: anywhere; }
.pet-cell small { font-size: .72rem; color: var(--muted); }
.pet-cell.on { background: #fff3c4; box-shadow: inset 0 0 0 3px #ffbe0b; }
.pet-cell.locked { background: #d9cfbd; border-color: color-mix(in srgb, var(--rc) 45%, #8a8070); min-height: 120px; justify-content: center; }
.pet-cell.locked i { font-style: normal; font-family: "Press Start 2P", monospace; font-size: 1.2rem; color: #8a8070; }
.pet-btns { display: flex; gap: 4px; margin-top: 4px; }
.pet-rn { display: flex; gap: 4px; width: 100%; }
.pet-rn input { min-width: 0; flex: 1; padding: 4px 6px; font-size: .85rem; }
.nuit-top .ammo { background: #2b0f1e; border: 2px solid #ffbe0b; padding: 0 6px; font-family: "Press Start 2P", monospace; font-size: .6rem; }
.vote-row { display: flex; align-items: center; gap: 6px; padding: 6px; margin-top: 6px; background: #fffaf0; border: 3px solid var(--px); flex-wrap: wrap; }
.vote-row .av, .vote-row img { width: 32px; height: 32px; }
/* ===== Quiz : drapeaux ===== */
.flag-wrap { display: flex; justify-content: center; margin: 4px 0 10px; }
.flag-wrap .flag { width: min(240px, 62vw); aspect-ratio: 3 / 2; height: auto; display: block; border: 4px solid var(--px); box-shadow: 4px 4px 0 rgba(0,0,0,.35); background: #fff; animation: flag-wave 2.4s ease-in-out infinite; transform-origin: left center; }
@keyframes flag-wave { 0%, 100% { transform: skewY(0deg); } 50% { transform: skewY(-2deg); } }
@media (prefers-reduced-motion: reduce) { .flag-wrap .flag { animation: none; } }
/* ===== Titres ===== */
.ttl-tag { position: absolute; left: 0; top: 0; white-space: nowrap; font: 600 10px/1 "Pixelify Sans", sans-serif; color: #ffe3b0; text-shadow: 1px 1px 0 #140c1c, -1px 0 0 #140c1c, 0 -1px 0 #140c1c, 1px 0 0 #140c1c; letter-spacing: .02em; pointer-events: none; }
.titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ttl { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 6px 8px; background: #fffaf0; border: 3px solid var(--px); cursor: pointer; font: inherit; }
.ttl b { font-size: .85rem; }
.ttl small { font-size: .7rem; color: var(--muted); }
.ttl.sel { background: #ffbe0b; box-shadow: inset 0 0 0 2px #fff; }
.ttl.locked { background: #e2d8c4; cursor: default; opacity: .75; }
/* ===== Danse, statue ===== */
.dance-fab { left: 58px; }
.dance-fab.on { background: #ff4f8b; animation: dance-pulse .6s steps(2) infinite; }
@keyframes dance-pulse { 50% { transform: translateY(-3px); } }
.chatlog { bottom: 58px; }
.legend-top { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.legend-top li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #fffaf0; border: 3px solid var(--px); }
.legend-top li.gold { background: #fff3c4; box-shadow: inset 0 0 0 2px #ffbe0b; }
.legend-top li svg { width: 34px; height: 34px; }
.legend-top .rk { width: 26px; text-align: center; font-family: "Press Start 2P", monospace; font-size: .7rem; }
/* ===== Course de chenilles ===== */
.g-chenilles { --gc: #6fbf5a; } .g-funambule { --gc: #c1121f; } .g-patate { --gc: #ff7a1a; }
.chen-wrap canvas, .funa-wrap canvas { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.chen-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin: 8px 0; }
.chen-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; background: #fffaf0; border: 3px solid var(--px); cursor: pointer; font: inherit; }
.chen-card i { width: 26px; height: 10px; background: var(--cc); border: 2px solid var(--px); border-radius: 6px; }
.chen-card .odds { font-family: "Press Start 2P", monospace; font-size: .7rem; color: #c1121f; }
.chen-card small { font-size: .7rem; color: var(--muted); }
.chen-card.on { background: #fff3c4; box-shadow: inset 0 0 0 3px var(--cc); }
.chen-amt, .chen-sab, .pt-throw { justify-content: center; flex-wrap: wrap; gap: 6px; display: flex; margin: 6px 0; }
.chen-gains { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0; }
.chen-gains span { background: #2fbf71; color: #fff; padding: 2px 8px; border: 2px solid var(--px); font-weight: 700; }
.chen-rank { display: flex; flex-direction: column; gap: 4px; max-width: 420px; margin: 8px auto; }
.chen-rank div { display: flex; align-items: center; gap: 8px; background: #fffaf0; border: 3px solid var(--px); padding: 4px 8px; }
.chen-rank div.me { background: #fff3c4; }
.chen-rank b { flex: 1; }
/* ===== Funambule ===== */
.funa-wrap { position: relative; }
.funa-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.big-btn { font-size: 1.2rem; padding: 18px 8px; user-select: none; -webkit-user-select: none; touch-action: none; }
/* ===== Patate chaude ===== */
.pt-ring { position: relative; width: min(100%, 420px); aspect-ratio: 1; margin: 6px auto; background: radial-gradient(circle, #3a1a2e 0 55%, transparent 56%); }
.pt-ring.lit { animation: pt-shake .15s steps(2) infinite; }
.pt-p { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; text-shadow: 1px 1px 0 #000; font-size: .8rem; }
.pt-p .av { width: 46px; height: 46px; }
.pt-p.me b { color: #ffd23f; }
.pt-p.out { filter: grayscale(1); opacity: .5; }
.pt-p.out i { position: absolute; top: -6px; font-style: normal; font-size: 1.4rem; }
.pt-p.hold .av { box-shadow: 0 0 0 3px #ff7a1a; }
.pt-bomb { position: absolute; top: -18px; right: -14px; font-size: 1.6rem; animation: pt-shake .3s steps(2) infinite; }
.pt-bomb.lit { animation-duration: .1s; filter: drop-shadow(0 0 6px #ff1f3d); }
.pt-bomb.boom { font-size: 2.6rem; animation: none; }
.pt-q .q { white-space: pre-line; }
@keyframes pt-shake { 0% { transform: translate(-1px, 0) rotate(-6deg); } 100% { transform: translate(1px, 0) rotate(6deg); } }
p.bad { color: #ff6b7a; font-weight: 700; }
.fun-panel { color: #fff; text-shadow: 1px 1px 0 #140c1c; }
.fun-panel .status, .fun-panel p { color: #fff; }
.fun-panel .chen-card, .fun-panel .chen-rank div, .fun-panel .card { color: var(--ink); text-shadow: none; }
.fun-panel .muted { color: #e8d9ff; }
/* ===== Tamponneuses ===== */
.g-tampon { --gc: #18c5d8; }
.tb-wrap { position: relative; max-width: min(100%, calc(100dvh - 300px)); margin: 0 auto; }
.tb-wrap canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.tb-hud { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; margin-bottom: 8px; }
.tb-side { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; background: #2b0f1e; color: #fff; border: 3px solid var(--px); }
.tb-side.me { border-color: #ffbe0b; }
.tb-side .who { display: flex; align-items: center; gap: 3px; font-size: .7rem; flex-wrap: wrap; justify-content: center; }
.tb-side .pts { font-family: "Press Start 2P", monospace; font-size: 1.1rem; color: #ffbe0b; }
.tb-side small { font-size: .6rem; opacity: .7; }
.tb-side.out { opacity: .45; filter: grayscale(1); }
.funa-btns:has(#td) { grid-template-columns: 1fr 1.3fr 1fr; }
/* pièce d'or en pixel art */
img.coin { width: 1.1em; height: 1.1em; vertical-align: -0.18em; image-rendering: pixelated; display: inline-block; }
.hud-chip.gold img.coin { width: 18px; height: 18px; vertical-align: -3px; }
.hud-chip.gold { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
/* buisson en feu */
.bush-tip { position: absolute; left: 0; top: 0; width: max-content; translate: -50% -100%; transform-origin: 50% 100%; z-index: 2; max-width: 220px; padding: 6px 10px; background: #fffaf0; color: #140c1c; border: 3px solid #140c1c; box-shadow: 3px 3px 0 rgba(0,0,0,.35); font-weight: 700; font-size: .9rem; text-align: center; pointer-events: none; animation: emo-pop .35s steps(4); }
.bush-tip::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -6px; border: 6px solid transparent; border-top-color: #140c1c; border-bottom: 0; }
/* ===== 1, 2, 3 Soleil ===== */
.g-soleil { --gc: #ffbe0b; }
.sol-wrap { position: relative; max-width: min(100%, calc((100dvh - 250px) * 0.667)); margin: 0 auto; transition: box-shadow .1s; }
.sol-wrap canvas { width: 100%; height: auto; display: block; image-rendering: pixelated; }
.sol-wrap.red { box-shadow: 0 0 0 4px #ff1f3d, 6px 6px 0 rgba(0,0,0,.55); }
.sol-banner { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); padding: 6px 12px; background: #fffaf0; color: #140c1c; border: 3px solid #140c1c; font-family: "Press Start 2P", monospace; font-size: .8rem; white-space: nowrap; pointer-events: none; }
.sol-banner:empty { display: none; }
.sol-banner.red { background: #ff1f3d; color: #fff; font-size: 1.1rem; animation: emo-pop .3s steps(3); }
.sol-btns { display: grid; grid-template-columns: 1fr; margin-top: 10px; }

/* jeux invités (Une Autre Porte, Flip 6 7) */
#app.ext { max-width: 1200px; padding: 8px 8px 0; min-height: 0; }
#app.ext .top { margin-bottom: 6px; }
.ext-wrap { height: calc(100dvh - 78px); border: 3px solid #2a1840; border-radius: 14px; overflow: hidden; background: #0d0718; box-shadow: 0 6px 0 #00000055; }
.ext-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

/* familiers brillants */
.mkw { position: relative; display: inline-block; }
.pet-cell.shiny { background: linear-gradient(135deg, #7ff6ff1f, #ffffff10 45%, #7ff6ff26); box-shadow: 0 0 0 2px #7ff6ff88 inset, 0 0 14px #7ff6ff55; }
.pet-cell.shiny .mk { animation: shinyGlow 1.4s ease-in-out infinite alternate; }
@keyframes shinyGlow { from { filter: drop-shadow(0 0 2px #7ff6ff) drop-shadow(0 0 5px #7ff6ffaa) brightness(1.05); } to { filter: drop-shadow(0 0 5px #ffffff) drop-shadow(0 0 12px #7ff6ff) brightness(1.2); } }
.spk { position: absolute; font-style: normal; color: #fff; text-shadow: 0 0 6px #7ff6ff; pointer-events: none; animation: spk 1.6s ease-in-out infinite; font-size: 14px; }
.spk.s1 { top: -4px; left: 2px; } .spk.s2 { top: 30%; right: -6px; animation-delay: .5s; font-size: 11px; } .spk.s3 { bottom: 0; left: -4px; animation-delay: 1s; }
@keyframes spk { 0%, 100% { opacity: 0; transform: scale(.4) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
.shiny-txt { color: #0a9db3; text-shadow: 0 0 6px #7ff6ffcc; font-weight: 700; }
.shiny-wow { font-size: 1.15rem; font-weight: 800; color: #0a9db3; text-shadow: 0 0 8px #7ff6ff, 0 0 2px #fff; animation: shinyWow .9s ease-in-out infinite alternate; }
@keyframes shinyWow { from { transform: scale(1); } to { transform: scale(1.06); color: #12c4dc; } }
.shiny-chip { box-shadow: 0 0 10px #7ff6ff88; color: #0a9db3 !important; font-weight: 700; }


/* Le Bal des Pantins */
.pt-role { background: #fff8e8; border: 3px solid #2a1840; border-radius: 12px; padding: 8px 12px; margin: 0 auto 8px; max-width: 1100px; font-size: .95rem; }
.pt-role .muted { opacity: .7; }
.pt-wrap { cursor: crosshair; touch-action: none; }
.pt-bar { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 8px auto; max-width: 1100px; flex-wrap: wrap; }
.pt-mis { flex: 1; min-width: 240px; }
.pt-prog { position: relative; height: 26px; background: #2a1840; border-radius: 13px; overflow: hidden; border: 3px solid #140c1c; }
.pt-prog i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #ffd23f, #ff9f1c); transition: width .4s; }
.pt-prog span { position: relative; display: block; text-align: center; line-height: 20px; color: #fff; font-weight: 800; font-size: .85rem; text-shadow: 0 1px 0 #000; }
.pt-ammo { color: #fff; font-size: .85rem; text-align: center; margin-top: 4px; }
.pt-act { font-size: 1.05rem; padding: 12px 18px; user-select: none; -webkit-user-select: none; touch-action: none; }
.pt-act.on { filter: brightness(1.2); transform: scale(.96); }
.pt-end { background: #fff8e8; border: 3px solid #140c1c; border-radius: 14px; padding: 14px 20px; font-weight: 900; font-size: 1.4rem; text-align: center; color: #2a1840; }
.pt-end small { display: block; font-size: .9rem; font-weight: 600; opacity: .75; margin-top: 4px; }

/* récompenses du jour */
.modal-card.daily-card { width: min(100%, 720px); }
.dl-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; padding: 6px 2px 12px; max-height: 60vh; overflow-y: auto; }
.dl-card { position: relative; background: linear-gradient(180deg, #4aa3f0, #2f74c8); border: 3px solid #14284a; border-radius: 12px; color: #fff; text-align: center; padding: 6px 6px 8px; box-shadow: 0 3px 0 #14284a; }
.dl-card.big { background: linear-gradient(180deg, #c86bf0, #8a2fc8); border-color: #3a1450; }
.dl-day { font-weight: 900; font-size: .95rem; text-shadow: 0 1px 0 #0006; }
.dl-ic { height: 40px; display: grid; place-items: center; margin: 4px 0; }
.dl-lab { font-size: .72rem; font-weight: 700; line-height: 1.15; min-height: 2.3em; }
.dl-card.done { filter: saturate(.3) brightness(.85); }
.dl-ok { position: absolute; top: 4px; right: 6px; background: #2fb14e; border-radius: 50%; width: 20px; height: 20px; line-height: 20px; font-size: .8rem; border: 2px solid #fff; }
.dl-card.cur { outline: 3px solid #ffd23f; outline-offset: 2px; }
.dl-card.can { animation: dlPulse 1s ease-in-out infinite alternate; }
@keyframes dlPulse { from { transform: translateY(0); } to { transform: translateY(-4px); box-shadow: 0 7px 0 #14284a, 0 0 18px #ffd23f; } }
.dl-got { background: #fff8e8; border: 3px solid #ffd23f; border-radius: 12px; padding: 10px; margin: 6px 0 10px; }

.wd.r4 { border-color: #ff4f8b; background: #ffe6f0; }
.wd-sec { grid-column: 1 / -1; margin: 10px 0 2px; font-weight: 900; color: #c2185b; }

/* jeu du jour */
.modal[data-panel=games] .game.daily { box-shadow: 0 0 0 3px #ffd23f, 0 0 16px #ffd23f; background: #fffbe6; }
.modal[data-panel=games] .game .dailyp { color: #b07a00; font-weight: 800; }
/* la fête qui grandit */
.modal-card.fete-card { width: min(100%, 560px); }
.fete-list { display: grid; gap: 6px; margin: 10px 0; }
.fete-l { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 3px solid #14284a33; border-radius: 10px; background: #f3f0ff; }
.fete-l > div { flex: 1; } .fete-l small { display: block; color: #5a5470; }
.fete-l.ok { background: #e7f9ec; border-color: #2fb14e; } .fete-l.next { border-color: #ffd23f; background: #fffbe6; }
.fete-l .fa { font-weight: 900; color: #8a5a00; } .fete-l.ok .fa { color: #2fb14e; }
/* événement saisonnier */
.modal-card.season-card { width: min(100%, 560px); }
.season-top { display: flex; gap: 12px; align-items: center; margin: 8px 0 12px; }
.season-top small { display: block; color: #5a5470; margin: 2px 0 6px; }
.season-pic { width: 84px; height: 84px; border: 3px solid #ff4f8b; border-radius: 12px; background: #ffe6f0; }
.season-boxes { display: flex; flex-wrap: wrap; gap: 4px; }
.season-boxes .sb { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid #14284a; border-radius: 6px; background: #fff; font-weight: 900; font-size: .75rem; }
.season-boxes .sb.ok { background: #ffd23f; }

/* Cache-Cache Bric-à-Brac */
.bk-wrap canvas { image-rendering: pixelated; }
.overlay.bk-blind { background: #140c1c; }
.bk-hp i { background: linear-gradient(90deg, #2fbf71, #8be36b) !important; }

/* distributeur de boissons */
.drink-hud { position: absolute; left: 8px; top: 8px; z-index: 3; background: rgba(20,12,28,.82); color: #fff; border: 2px solid #5fd3ff; padding: 3px 8px; font-size: .8rem; font-weight: 800; pointer-events: none; }
.modal-card.vend-card { width: min(100%, 620px); background: #1b1b22; color: #fff; }
.vend { display: flex; gap: 10px; background: linear-gradient(180deg, #2a2a33, #16161c); border: 4px solid #0a0a0f; border-radius: 10px; padding: 10px; box-shadow: inset 0 0 0 2px #3a3a44; }
.vend-glass { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px; border-radius: 6px; background: linear-gradient(135deg, #0d1a26 0%, #13283a 45%, #0d1a26 100%); border: 3px solid #4a4a55; box-shadow: inset 0 0 18px #5fd3ff33; }
.vend-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px 3px; background: transparent; border: 0; border-bottom: 3px solid #4a4a55; cursor: pointer; color: #fff; }
.vend-slot.on { background: #5fd3ff22; outline: 2px solid #ffd23f; }
.vend-slot .tag { font-size: .62rem; font-weight: 900; background: #0a0a0f; padding: 0 4px; border: 1px solid #4a4a55; }
.can { --c: #e63946; width: 34px; height: 48px; display: grid; place-items: center; border: 2px solid #140c1c; border-radius: 6px 6px 4px 4px; position: relative;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 60%, #000) 0%, var(--c) 30%, color-mix(in srgb, var(--c) 55%, #fff) 45%, var(--c) 60%, color-mix(in srgb, var(--c) 65%, #000) 100%); }
.can::before { content: ""; position: absolute; top: -4px; left: 3px; right: 3px; height: 4px; background: #c9ced6; border: 2px solid #140c1c; border-bottom: 0; border-radius: 3px 3px 0 0; }
.can img { width: 22px; height: 22px; }
.vend-panel { width: 168px; display: flex; flex-direction: column; gap: 8px; }
.vend-lcd { min-height: 92px; background: #0b3d2e; color: #7dffb0; font-family: "Press Start 2P", monospace; font-size: .5rem; line-height: 1.6; padding: 8px; border: 3px solid #0a0a0f; box-shadow: inset 0 0 10px #000; text-shadow: 0 0 4px #7dffb0; }
.vend-lcd b { color: #c9ffd9; }
.vend-drop { margin-top: 6px; font: inherit; font-size: .5rem; background: #e63946; color: #fff; border: 2px solid #0a0a0f; padding: 3px 5px; cursor: pointer; }
.vend-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.vend-keys button { font-family: "Press Start 2P", monospace; font-size: .48rem; padding: 6px 0; background: #c9ced6; color: #140c1c; border: 2px solid #0a0a0f; border-radius: 4px; box-shadow: 0 2px 0 #0a0a0f; cursor: pointer; }
.vend-keys button:active { transform: translateY(2px); box-shadow: none; }
.vend-coin { text-align: center; font-size: .6rem; font-weight: 900; color: #ffd23f; border: 2px dashed #ffd23f55; padding: 4px; }
.vend-tray { margin: 10px auto 4px; width: 70%; min-height: 70px; background: #0a0a0f; border: 4px solid #3a3a44; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #c9ced6; font-weight: 800; overflow: hidden; }
.vend-tray .can.drop { cursor: pointer; animation: vend-drop .5s cubic-bezier(.5, 0, 1, 1); }
@keyframes vend-drop { from { transform: translateY(-90px) rotate(-20deg); } 70% { transform: translateY(4px) rotate(8deg); } to { transform: none; } }
@media (max-width: 560px) { .vend { flex-direction: column; } .vend-panel { width: auto; } }

/* boîte à idées */
.modal-card.idea-card { width: min(100%, 560px); }
.idea-card textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px; border: 3px solid #140c1c; border-radius: 10px; resize: vertical; margin: 6px 0; }
#ideaList { max-height: 65vh; overflow-y: auto; display: grid; gap: 8px; }
.idea-item { background: #fffbe6; border: 3px solid #14284a33; border-radius: 10px; padding: 8px 10px; }
.idea-item p { margin: 6px 0 0; white-space: normal; overflow-wrap: anywhere; }

/* L'Escalator */
.esc-wrap { position: relative; max-width: min(100%, 760px); margin: 0 auto; }
.esc-wrap canvas { width: 100%; image-rendering: pixelated; display: block; border: 4px solid #140c1c; border-radius: 10px; }
.esc-info { margin: 6px 0; font-weight: 800; }
.esc-pad { display: flex; justify-content: center; gap: 10px; margin: 8px 0; }
.esc-pad .pad { width: 70px; height: 70px; font-size: 1.6rem; }
.esc-pad.desk .pad { width: 54px; height: 54px; font-size: 1.2rem; opacity: .8; }
