:root {
  --ink: #2b2135;
  --muted: #7d6f8f;
  --card: linear-gradient(180deg, rgba(255, 255, 255, .97), rgba(246, 240, 255, .93));
  --pink: #ff6b9d;
  --violet: #845ef7;
  --shadow: 0 2px 0 rgba(255, 255, 255, .5) inset, 0 14px 38px rgba(60, 20, 90, .28), 0 0 0 1px rgba(132, 94, 247, .14);
  --font: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  --title: 'Lilita One', 'Fredoka', sans-serif;
  --display: 'NSMB', 'Lilita One', 'Fredoka', sans-serif;
}
/* « Neue Super Mario Bros. » par Rurr (rurr.itch.io) : réservée aux gros titres */
@font-face { font-family: 'NSMB'; src: url('../fonts/neue-super-mario-bros.ttf') format('truetype'); font-display: swap; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #8f7cff; }
::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-thumb { background: rgba(132, 94, 247, .5); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
body { font-family: var(--font); color: var(--ink); user-select: none; -webkit-font-smoothing: antialiased; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#ui, #overlay { position: fixed; inset: 0; pointer-events: none; }
#ui > *, #overlay > * { pointer-events: auto; }
#overlay { z-index: 40; }
h1, h2, h3 { margin: 0 0 .4em; font-family: var(--title); font-weight: 400; letter-spacing: .5px; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.grow { flex: 1; }
.ico { width: 1.25em; height: 1.25em; vertical-align: -0.28em; flex-shrink: 0; }
.ico.big { width: 54px; height: 54px; }
kbd { font: 600 .72em var(--font); background: #fff; color: var(--ink); border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 8px; padding: 0 7px; margin: 0 2px; display: inline-block; line-height: 1.5; vertical-align: middle; }
kbd.wide { padding: 0 18px; }
.keys { white-space: nowrap; }
code { background: #fff; padding: 3px 9px; border-radius: 9px; border: 2px solid #e5dbff; font-size: .95em; user-select: all; }
.portrait { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ───── Boutons ───── */
.btn {
  border: 3px solid var(--ink); border-radius: 18px; padding: 9px 18px; cursor: pointer;
  font: 600 16px var(--font); color: var(--ink); background: linear-gradient(#fff, #eee8f8);
  box-shadow: 0 5px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -4px 0 rgba(43, 33, 53, .08); transition: transform .08s, box-shadow .08s, filter .1s; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, .75), inset 0 -4px 0 rgba(43, 33, 53, .08), 0 10px 18px rgba(43, 33, 53, .18); filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink), inset 0 2px 0 rgba(255, 255, 255, .5); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(#ffe066, #ffa94d); }
.btn.orange { background: linear-gradient(#ffc078, #ff922b); }
.btn.violet { background: linear-gradient(#d0bfff, #9775fa); }
.btn.ghost { background: linear-gradient(#fff, #f1f3f5); }
.btn.item { background: linear-gradient(#fff9db, #ffec99); }
.btn.big { font-size: 19px; padding: 12px 24px; border-radius: 22px; }
.btn.wide { width: 100%; justify-content: center; }
.btn .price { display: inline-flex; align-items: center; gap: 2px; background: rgba(255, 255, 255, .7); border-radius: 9px; padding: 0 6px; }
.pulse { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.icon-btn { border: 3px solid var(--ink); background: linear-gradient(#fff 0%, #f6f1ff 55%, #e9defe 100%); border-radius: 15px; width: 48px; height: 48px; cursor: pointer; padding: 0; box-shadow: 0 4px 0 var(--ink), inset 0 2px 0 #fff, 0 8px 16px rgba(43, 33, 53, .18); display: inline-flex; align-items: center; justify-content: center; transition: transform .1s, box-shadow .1s; }
/* petite touche dans le coin d'un bouton-icône (clavier ou manette selon le dernier utilisé) */
.icon-btn { position: relative; }
.tool-key { position: absolute; right: -7px; bottom: -7px; display: inline-flex; pointer-events: none; line-height: 1; }
.tool-key kbd { font-size: 11px; margin: 0; padding: 0 4px; line-height: 1.4; }
.tool-key kbd.pb { min-width: 1.5em; padding: 0 3px; }
.tool-key.pad-only { display: none; }
body.pad .tool-key.pad-only { display: inline-flex; }
body.touch .tool-key { display: none !important; }
.icon-btn .ico { width: 30px; height: 30px; transition: transform .35s cubic-bezier(.2, 1.4, .4, 1); }
.icon-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink), inset 0 2px 0 #fff, 0 10px 18px rgba(43, 33, 53, .22); }
.icon-btn[data-tool=settings]:hover .ico { transform: rotate(60deg); }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink), inset 0 2px 0 #fff; }
.mini-btn { border: 2px solid var(--ink); background: #ffe3e3; border-radius: 9px; cursor: pointer; font: 600 13px var(--font); padding: 1px 7px; }
.row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.card { background: var(--card); border: 3px solid rgba(255, 255, 255, .95); border-radius: 26px; padding: 20px; box-shadow: var(--shadow); backdrop-filter: blur(10px) saturate(1.2); }
.card h2 { color: var(--violet); }
.pill { background: #f3d9fa; border-radius: 999px; padding: 2px 10px; font: 600 .55em var(--font); vertical-align: middle; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 3px solid var(--c, #ddd); border-radius: 999px; padding: 3px 12px 3px 3px; font-weight: 600; }
.chip .portrait { width: 32px; height: 32px; border-radius: 50%; background: var(--c); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.corner-tools { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 5; }
/* 3 colonnes : vide | info de tour | boutons ; les deux colonnes du bord ont la même largeur, la bulle reste au milieu */
.board-top { position: absolute; top: 14px; left: 50%; translate: -50% 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px; z-index: 5; }
.board-top > .round-box, .board-top > .corner-tools { position: static; translate: none; }
.board-top > .round-box { grid-column: 2; }
.board-top > .corner-tools { grid-column: 3; justify-self: start; margin-top: 2px; }
@media (max-width: 1250px) { .board-top .corner-tools .icon-btn { width: 38px; height: 38px; } }

/* ───── Chargement ───── */
#loading { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #ffd6ec, #8f7cff); transition: opacity .5s; }
#loading.hidden { opacity: 0; pointer-events: none; }
.loader { text-align: center; color: #fff; font-size: 20px; }
.loader-star { width: 90px; height: 90px; margin: 0 auto 10px; background: #ffd43b; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#offline { display: none; position: fixed; top: 12px; left: 50%; translate: -50% 0; background: #ffe066; border: 3px solid var(--ink); padding: 6px 18px; border-radius: 999px; font-weight: 700; z-index: 120; }
body.offline #offline { display: block; }

/* ───── Logo ───── */
.logo { font-family: var(--title); font-size: 54px; line-height: 1; color: #fff; text-align: center; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
.logo span { color: #ffd43b; margin-left: 10px; }
#loading .logo { font-size: 64px; }

/* ───── Salon ───── */
.lobby { position: absolute; inset: 0; pointer-events: none !important; }
.lobby > * { pointer-events: auto; }
.lobby-left { position: absolute; left: 22px; top: 22px; width: 490px; max-height: calc(100vh - 44px); overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.lobby-right { position: absolute; right: 22px; top: 80px; width: 340px; max-height: calc(100vh - 170px); overflow: auto; }
.text-in { width: 100%; font: 600 19px var(--font); padding: 12px 16px; border-radius: 16px; border: 3px solid var(--ink); outline: none; color: var(--ink); user-select: text; background: #fff; box-shadow: inset 0 3px 0 rgba(43, 33, 53, .08); }
.text-in:focus { border-color: var(--violet); box-shadow: 0 0 0 4px #e5dbff; }
.lobby-left > * { flex-shrink: 0; }
.chars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 10px; }
.char { position: relative; border: 3px solid var(--ink); border-radius: 18px; background: linear-gradient(#fff, #f6f0ff); box-shadow: 0 4px 0 var(--ink); padding: 4px 4px 6px; cursor: pointer; transition: transform .12s; font: 600 13px var(--font); color: var(--ink); }
.char .portrait { height: auto; aspect-ratio: 1; border-radius: 13px; background: radial-gradient(circle at 50% 30%, #fff 0%, color-mix(in srgb, var(--c) 45%, #fff) 45%, var(--c) 100%); box-shadow: inset 0 -6px 12px rgba(43, 33, 53, .15); }
.char-name { display: block; position: relative; margin-top: 4px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-owner { position: absolute; left: 4px; right: 4px; top: 38%; font-size: 11px; background: rgba(43, 33, 53, .85); color: #fff; border-radius: 8px; padding: 2px; display: none; }
.char:hover { transform: translateY(-3px) rotate(-2deg); }
.char.sel { border-color: var(--c); box-shadow: 0 0 0 4px var(--c), 0 8px 20px rgba(0, 0, 0, .2); transform: scale(1.05); }
.char.taken { filter: grayscale(.85); opacity: .65; cursor: not-allowed; transform: none; }
.char.taken .char-owner { display: block; }
.plist { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.plist li { display: flex; align-items: center; gap: 9px; background: #fff; border: 3px solid var(--c); border-radius: 16px; padding: 4px 10px 4px 4px; font-size: 17px; }
.plist li .portrait { width: 42px; height: 42px; border-radius: 12px; background: var(--c); flex-shrink: 0; }
.plist li b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.plist li.off { opacity: .45; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; background: #f8f0fc; border-radius: 8px; padding: 1px 6px; }
.tag.me { background: #fff3bf; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; font-size: 16px; font-weight: 500; }
.field select { font: 600 15px var(--font); padding: 6px 30px 6px 11px; border-radius: 12px; border: 2px solid var(--ink); color: var(--ink); cursor: pointer; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%232b2135' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 11px; box-shadow: 0 3px 0 var(--ink); }
.field.check { justify-content: flex-start; }
.field.check input { width: 20px; height: 20px; accent-color: var(--pink); }
.field input[type=range] { width: 170px; accent-color: var(--pink); appearance: none; height: 12px; border-radius: 99px; border: 2px solid var(--ink); background: linear-gradient(90deg, #ffd6ec, #e5dbff); cursor: pointer; }
.field input[type=range]::-webkit-slider-thumb { appearance: none; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ff8fc7 60%, #e64980); border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.field input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ff8fc7 60%, #e64980); border: 2px solid var(--ink); }
#hostBox .btn:first-child { width: 100%; justify-content: center; }
.share { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; background: rgba(255, 255, 255, .88); border: 3px solid #fff; padding: 8px 16px; border-radius: 16px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: 94vw; box-shadow: var(--shadow); }
.share small { color: var(--muted); margin-left: 4px; }
.lnk { display: inline-flex; align-items: center; white-space: nowrap; }

/* ───── HUD du plateau ───── */
.hud { position: absolute; inset: 0; pointer-events: none !important; }
.hud > * { pointer-events: auto; }
.panels { position: absolute; inset: 0; pointer-events: none !important; }
.pp { position: absolute; width: 268px; display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; border-radius: 24px; border: 4px solid #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 85%, #fff), var(--c)); box-shadow: 0 6px 0 rgba(43, 33, 53, .35), var(--shadow); color: #fff; transition: transform .25s; pointer-events: auto; }
.pp.tl { top: 14px; left: 14px; } .pp.tr { top: 14px; right: 14px; }
.pp.bl { bottom: 14px; left: 14px; } .pp.br { bottom: 14px; right: 14px; }
.pp.ml { top: 44%; left: 14px; } .pp.mr { top: 44%; right: 14px; }
.pp.active { transform: scale(1.07); animation: glow 1.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 6px 0 rgba(43, 33, 53, .35), 0 0 28px 6px #fff8; } }
.pp.off { filter: grayscale(.7); opacity: .7; }
.pp-por { width: 66px; height: 66px; border-radius: 50%; background: #fff; border: 3px solid #fff; overflow: hidden; flex-shrink: 0; box-shadow: inset 0 -6px 0 #0001; }
.pp-body { flex: 1; min-width: 0; }
.pp-name { font-family: var(--title); font-size: 19px; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; overflow-wrap: anywhere; }
.pp-stats { display: flex; gap: 8px; margin-top: 2px; }
.pp-stats > span { display: inline-flex; align-items: center; gap: 3px; background: rgba(255, 255, 255, .92); color: var(--ink); border-radius: 12px; padding: 1px 8px 1px 4px; font-family: var(--title); font-size: 19px; }
.pp-stats .ico { width: 22px; height: 22px; }
.pp-stats .bump { animation: bump .3s; }
@keyframes bump { 40% { transform: scale(1.3); } }
.pp-items { display: flex; gap: 2px; margin-top: 3px; min-height: 4px; }
.pp-items .ico { width: 22px; height: 22px; background: #fff; border-radius: 7px; padding: 1px; }
.pp-rank { position: absolute; top: -12px; right: -10px; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--title); font-size: 15px; background: #fff; color: var(--ink); border: 3px solid var(--ink); }
.pp-rank[data-r="1"] { background: #ffd43b; } .pp-rank[data-r="2"] { background: #dee2e6; } .pp-rank[data-r="3"] { background: #f0b27a; }
.round-box { position: absolute; top: 14px; left: 50%; translate: -50% 0; text-align: center; }
.round-txt { font-family: var(--display); font-size: 26px; color: #fff; background: linear-gradient(#845ef7, #5f3dc4); border: 4px solid #fff; border-radius: 999px; padding: 3px 22px; box-shadow: 0 5px 0 rgba(43, 33, 53, .4); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; }
.round-sub { margin-top: 6px; font-weight: 700; color: #fff; -webkit-text-stroke: 4px #d9480f; paint-order: stroke fill; font-size: 17px; animation: pulse 1s infinite; }
.actions { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; max-width: calc(100vw - 600px); min-width: 300px; display: flex; justify-content: center; }
.act-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; background: var(--card); padding: 12px 18px; border: 4px solid #fff; border-radius: 26px; box-shadow: var(--shadow); animation: popin .3s; }
.your-turn { font-family: var(--title); font-size: 22px; color: var(--pink); -webkit-text-stroke: 3px #fff; paint-order: stroke fill; display: inline-flex; align-items: center; gap: 6px; }
.wait-bubble { display: flex; align-items: center; gap: 10px; background: var(--card); border: 4px solid var(--c); border-radius: 999px; padding: 4px 18px 4px 4px; font-size: 18px; box-shadow: var(--shadow); animation: popin .3s; }
.wait-bubble .portrait { width: 44px; height: 44px; border-radius: 50%; background: var(--c); }
@keyframes popin { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.jlabels { position: absolute; inset: 0; pointer-events: none !important; }
.jlabel { position: absolute; translate: -50% -100%; font-family: var(--title); font-size: 18px; color: #fff; padding: 4px 12px; border-radius: 12px; border: 3px solid #fff; white-space: nowrap; }
.jlabel.a { background: #ff922b; } .jlabel.b { background: #845ef7; }

/* ───── Bannière, dialogue, toast ───── */
.banner { position: fixed; left: -10vw; right: -10vw; top: 36%; padding: 14px 0 12px; background: repeating-linear-gradient(-45deg, var(--c), var(--c) 30px, color-mix(in srgb, var(--c) 82%, #fff) 30px, color-mix(in srgb, var(--c) 82%, #fff) 60px); border-top: 6px solid #fff; border-bottom: 6px solid #fff; transform: rotate(-3deg); text-align: center; animation: bannerIn .45s cubic-bezier(.2, 1.4, .4, 1); box-shadow: 0 10px 40px rgba(0, 0, 0, .25); pointer-events: none !important; display: flex; align-items: center; justify-content: center; gap: 20px; }
.banner.out { animation: bannerOut .5s ease-in forwards; }
.banner-txt { font-family: var(--display); font-size: 46px; color: #fff; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; }
.banner-sub { order: -1; }
.banner-por { width: 96px; height: 96px; border-radius: 50%; background: #fff; border: 5px solid var(--ink); }
@keyframes bannerIn { from { transform: translateX(-110%) rotate(-3deg); } to { transform: translateX(0) rotate(-3deg); } }
@keyframes bannerOut { to { transform: translateX(110%) rotate(-3deg); } }
.dialog { position: fixed; left: 50%; bottom: 128px; transform: translate(-50%, 30px) scale(.9); opacity: 0; display: flex; gap: 14px; align-items: center; background: #fff; border: 4px solid var(--ink); border-radius: 24px; padding: 12px 22px 12px 14px; max-width: min(620px, 92vw); box-shadow: 0 8px 0 rgba(43, 33, 53, .3), var(--shadow); transition: opacity .25s, transform .3s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none !important; cursor: pointer; }
.dialog.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto !important; }
.dialog.big { bottom: auto; top: 50%; transform: translate(-50%, -50%) scale(.8); flex-direction: column; text-align: center; gap: 10px; padding: 26px 40px; max-width: min(760px, 92vw); border-width: 6px; z-index: 95; }
.dialog.big.show { transform: translate(-50%, -50%) scale(1); }
.dialog.big .dlg-ico .ico { width: 96px; height: 96px; }
.dialog.big .dlg-title { font-size: 38px; }
.dialog.big .dlg-text { font-size: 28px; font-weight: 600; }
.dlg-ico .ico { width: 54px; height: 54px; }
.dlg-title { font-family: var(--title); font-size: 23px; color: var(--violet); }
.dlg-text { font-size: 17px; font-weight: 500; }
.toast { position: fixed; left: 50%; top: 18px; translate: -50% 0; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 8px 18px; font-weight: 600; animation: popin .3s; z-index: 90; }

/* ───── Mini-jeux ───── */
/* !important : ces calques plein écran peuvent être enfants directs de #ui, dont la règle « > * » les rendrait opaques aux clics */
.mg-layer, .mg-over { position: absolute; inset: 0; pointer-events: none !important; }
.mg-over > *, .mg-layer > * { pointer-events: auto; }
.mg-over { display: flex; align-items: center; justify-content: center; }
/* Rideau de théâtre (lancement d'un mini-jeu) : se ferme sur le plateau, reste fermé pendant la roulette, s'ouvre à la présentation.
   Que des transform (compositeur) ; caché (visibility) une fois ouvert pour ne rien coûter pendant le jeu */
.mg-curtain { position: absolute; inset: 0; z-index: 20; overflow: hidden; pointer-events: none !important; }
.mg-curtain.off { visibility: hidden; transition: visibility 0s .8s; }
.mg-curtain i { position: absolute; top: 0; bottom: 0; width: 51%; will-change: transform; transition: transform .75s cubic-bezier(.55, 0, .25, 1);
  background: linear-gradient(rgba(40, 0, 15, .4), transparent 18%, transparent 72%, rgba(40, 0, 15, .5)), repeating-linear-gradient(90deg, #7a0c24 0, #b81e40 3%, #e0405f 5%, #b81e40 7%, #7a0c24 10%); }
.mg-curtain .l { left: 0; transform-origin: 0 50%; transform: translateX(0) scaleX(1); border-right: 5px solid #ffd43b; }
.mg-curtain .r { right: 0; transform-origin: 100% 50%; transform: translateX(0) scaleX(1); border-left: 5px solid #ffd43b; }
.mg-curtain.off .l { transform: translateX(-100%) scaleX(.35); }
.mg-curtain.off .r { transform: translateX(100%) scaleX(.35); }
.mg-curtain b { position: absolute; top: 0; left: 0; right: 0; height: clamp(34px, 9vh, 80px); z-index: 1; transition: transform .6s ease; border-bottom: 5px solid #ffd43b; box-shadow: 0 6px 14px rgba(40, 0, 15, .45);
  background: linear-gradient(rgba(40, 0, 15, .35), transparent), repeating-linear-gradient(90deg, #8d0f2a 0, #c92a4a 4%, #8d0f2a 8%); }
.mg-curtain b::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 20px; margin-top: 5px; background: radial-gradient(circle at 50% 0, #a8173a 0 15px, #ffd43b 16px 19px, transparent 20px) 0 0 / 44px 20px repeat-x; }
.mg-curtain.off b { transform: translateY(calc(-100% - 40px)); }
.mg-over { z-index: 21; }
.mg-hud { position: absolute; top: 12px; left: 50%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none !important; }
.mg-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mg-chip { display: flex; align-items: center; gap: 6px; background: var(--card); border: 3px solid var(--c); border-radius: 999px; padding: 3px 12px 3px 3px; font-weight: 600; box-shadow: 0 4px 12px rgba(0, 0, 0, .12); }
.mg-chip .portrait { width: 34px; height: 34px; border-radius: 50%; background: var(--c); }
.mg-chip b { font-family: var(--title); font-size: 18px; min-width: 24px; text-align: right; }
.mg-chip.me { box-shadow: 0 0 0 3px #ffd43b, 0 4px 12px rgba(0, 0, 0, .12); }
.mg-chip.out { opacity: .5; filter: grayscale(.8); }
.mg-timer { font-family: var(--title); font-size: 34px; color: #fff; background: var(--ink); border: 4px solid #fff; border-radius: 999px; min-width: 70px; text-align: center; padding: 0 14px; }
.mg-timer.hurry { background: #e03131; animation: pulse .5s infinite; }
.roulette { text-align: center; }
.rl-title { font-family: var(--display); font-size: 60px; color: #ffd43b; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; animation: rlTitle 1.4s ease-in-out infinite; }
/* Le titre se balance d'un côté puis de l'autre en rebondissant (au lieu de pencher toujours à gauche) */
@keyframes rlTitle { 0%, 100% { transform: rotate(-5deg) scale(1); } 25% { transform: translateY(-6px) rotate(0) scale(1.08); } 50% { transform: rotate(5deg) scale(1); } 75% { transform: translateY(-6px) rotate(0) scale(1.08); } }
.rl-window { margin: 16px auto 0; width: 560px; height: 70px; overflow: hidden; background: #fff; border: 5px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 rgba(43, 33, 53, .4); }
.rl-reel { transition: transform 3.6s cubic-bezier(.12, .8, .2, 1); }
.rl-item { height: 70px; line-height: 70px; font-family: var(--title); font-size: 36px; color: var(--violet); }
.intro { width: min(620px, 94vw); text-align: center; animation: popin .35s; }
.intro-kicker { font-family: var(--title); color: var(--pink); font-size: 18px; text-transform: uppercase; letter-spacing: 2px; }
.intro h2 { font-size: 46px; color: var(--violet); -webkit-text-stroke: 2px #fff; paint-order: stroke fill; }
.intro-desc { font-size: 18px; font-weight: 500; margin: 6px 0 14px; }
.controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; align-items: center; }
.ctl { display: flex; align-items: center; gap: 10px; background: #f8f0fc; border-radius: 14px; padding: 6px 14px; font-weight: 600; }
.ready-row { display: flex; gap: 8px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.ready-chip { position: relative; width: 52px; height: 52px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); opacity: .55; }
.ready-chip.ok { opacity: 1; }
.ready-chip .portrait { border-radius: 50%; }
.ready-chip .ico { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; }
.count, .go, .finish { font-family: var(--display); font-size: 150px; color: #fff; -webkit-text-stroke: 12px var(--ink); paint-order: stroke fill; text-shadow: 0 12px 0 rgba(43, 33, 53, .4); pointer-events: none !important; }
.count.pop { animation: countPop .9s ease-out; }
@keyframes countPop { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }
.go { color: #ffd43b; animation: countPop .8s ease-out; }
.finish { font-size: 120px; color: #ff6b9d; animation: countPop .7s ease-out; }
.results { width: min(620px, 94vw); display: flex; flex-direction: column; gap: 8px; animation: popin .4s; margin-top: 34vh; }
.results h2 { text-align: center; font-size: 34px; color: var(--violet); margin: 0; }
.results .btn { align-self: center; }
.res-row { display: flex; align-items: center; gap: 10px; background: #fff; border: 3px solid var(--c); border-radius: 18px; padding: 5px 14px 5px 6px; font-size: 18px; }
.res-row .portrait { width: 44px; height: 44px; border-radius: 12px; background: var(--c); flex-shrink: 0; }
.res-row.r1 { background: linear-gradient(90deg, #fff9db, #fff); }
.medal { font-family: var(--title); font-size: 22px; width: 44px; text-align: center; }
.r1 .medal { color: #f08c00; }
.reward { display: inline-flex; align-items: center; gap: 3px; font-family: var(--title); color: #2b8a3e; font-size: 20px; }
.stat { display: inline-flex; align-items: center; gap: 3px; font-family: var(--title); font-size: 20px; }
.sprint-keys { position: absolute; bottom: 40px; left: 50%; translate: -50% 0; display: flex; gap: 30px; }
.sk { width: 120px; height: 110px; border: 5px solid var(--ink); border-radius: 26px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--title); font-size: 54px; box-shadow: 0 8px 0 var(--ink); transition: transform .05s; }
.sk small { font: 600 13px var(--font); color: var(--muted); }
.sk.next { background: #ffe066; }
.sk.hit { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.dance-wrap { position: absolute; right: 4vw; top: 50%; translate: 0 -50%; }
.dance-cv { width: 420px; height: 520px; display: block; }
.dance-combo { position: absolute; left: 0; right: 0; bottom: -46px; text-align: center; font-family: var(--title); font-size: 34px; color: #ffd43b; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; }
.duel-big { position: absolute; top: 24%; left: 50%; translate: -50% 0; font-family: var(--title); font-size: 72px; color: #fff; -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; pointer-events: none !important; white-space: nowrap; }
.duel-big.st-go { color: #ff6b6b; font-size: 130px; animation: countPop .5s ease-out; }
.duel-big.st-end { font-size: 44px; }

.bj-big { position: absolute; top: 118px; left: 50%; translate: -50% 0; font-family: var(--title); font-size: 40px; color: #fff; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; pointer-events: none !important; white-space: nowrap; }
.bj-actions { position: absolute; left: 50%; bottom: 26px; translate: -50% 0; display: flex; gap: 14px; align-items: center; background: var(--card); padding: 12px 18px; border: 4px solid #fff; border-radius: 26px; box-shadow: var(--shadow); animation: popin .25s; }
.bj-total { font-family: var(--title); font-size: 38px; min-width: 64px; text-align: center; color: var(--violet); }

.gal-cross { position: absolute; left: 0; top: 0; width: 58px; height: 58px; margin: -29px 0 0 -29px; pointer-events: none !important; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); will-change: transform; }
.gal-cross svg { width: 100%; height: 100%; display: block; }
.gal-cross.cool svg { animation: galKick .29s ease-out; }
@keyframes galKick { 0% { transform: scale(1.35) rotate(12deg); opacity: .6; } 100% { transform: scale(1); opacity: 1; } }
body.gal-aim, body.gal-aim #gl { cursor: none; }

.mash-hint { position: absolute; left: 50%; bottom: 30px; translate: -50% 0; font: 400 30px var(--title); color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; background: linear-gradient(#ff8fc7, #e64980); border: 4px solid #fff; border-radius: 26px; padding: 10px 26px; box-shadow: 0 7px 0 var(--ink), var(--shadow); cursor: pointer; display: flex; align-items: center; gap: 12px; animation: mashPulse .5s ease-in-out infinite; }
.mash-hint kbd { font-size: 18px; -webkit-text-stroke: 0; }
.mash-hint.hit { animation: mashHit .12s ease-out; }
@keyframes mashPulse { 50% { transform: scale(1.06); } }
@keyframes mashHit { 50% { transform: scale(.92); } }
.tug-bar { position: absolute; left: 50%; bottom: 112px; translate: -50% 0; display: flex; align-items: center; gap: 12px; width: min(760px, 94vw); }
.tug-side { display: flex; align-items: center; gap: 6px; font-family: var(--title); font-size: 18px; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; white-space: nowrap; }
.tug-side .portrait { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; background: var(--a); }
.tug-side.r .portrait { background: var(--b); }
.tug-track { position: relative; flex: 1; height: 26px; border: 4px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--b); box-shadow: 0 4px 0 var(--ink); }
.tug-fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--a) var(--p, 50%), transparent var(--p, 50%)); }
.tug-mark { position: absolute; top: -4px; bottom: -4px; width: 8px; margin-left: -4px; background: #fff; border: 2px solid var(--ink); border-radius: 4px; }
.tug-track::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .7); }
.intro.tb { border-color: #ffd43b; box-shadow: 0 0 0 4px #ffd43b, var(--shadow); }
.intro.tb .intro-kicker { color: #e8590c; font-size: 24px; }
.tag.tb { background: #fff3bf; color: #e8590c; }

/* ───── Fin ───── */
.end { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 22px 16px; overflow: auto; }
.end-title { font-family: var(--display); font-size: 48px; color: #ffd43b; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; transform: rotate(-3deg); }
.bonus { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.bonus-card { width: 240px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; opacity: 0; animation: popin .5s forwards; }
.bonus-win { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.final { width: min(460px, 94vw); display: flex; flex-direction: column; gap: 8px; opacity: 0; animation: popin .5s forwards; position: absolute; right: 22px; bottom: 22px; }
.bonus-card { width: 210px; padding: 12px; }
@media (max-width: 1100px) { .final { position: static; margin-top: auto; } }
.end-act { text-align: center; margin-top: 6px; }

/* ───── Réglages ───── */
.modal { position: fixed; inset: 0; z-index: 110; background: radial-gradient(circle at 50% 40%, rgba(132, 94, 247, .25), rgba(30, 18, 50, .6)); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; }
.modal .card { width: min(440px, 92vw); animation: popin .25s; }
.settings h2 { text-align: center; font-size: 30px; }
.settings .field { background: #f6f0ff; border: 2px solid #ece2ff; border-radius: 14px; padding: 8px 12px; margin: 8px 0; }
.settings .row { margin-top: 14px; }
.settings .credits { margin: 8px 0; padding: 8px 12px; border-radius: 14px; background: #f6f0ff; border: 2px solid #ece2ff; font-size: 14px; }
.settings .credits summary { cursor: pointer; font-weight: 700; }
.settings .credits ul { margin: 6px 0; padding-left: 18px; }
.settings .credits small { opacity: .7; }

@media (max-width: 1100px) {
  .lobby-left { width: 410px; }
  .lobby-right { width: 300px; }
  .pp { width: 220px; }
  .pp-por { width: 52px; height: 52px; }
  .actions { max-width: 92vw; bottom: 130px; }
  .banner-txt { font-size: 44px; }
}

/* Choix de la langue (salon) */
.lang-switch { align-self: flex-end; display: inline-flex; background: rgba(132, 94, 247, .12); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: -8px; }
.lang-switch button { border: 0; background: transparent; font: inherit; font-family: var(--title); font-size: 14px; color: var(--muted); padding: 3px 12px; border-radius: 999px; cursor: pointer; }
.lang-switch button.on { background: var(--violet); color: #fff; }

/* Chrono déporté sur le côté (ex. Blackjack : il cachait le score du joueur du milieu) */
.mg-hud.side-timer .mg-timer { position: fixed; top: 76px; right: 16px; }
.intro h2 .ico.big { width: 46px; height: 46px; vertical-align: -6px; margin: 0 8px; }
.ico.flip { transform: scaleX(-1); }

/* Vote du morceau (Miku Dance Party) */
.vote-title { font-family: var(--title); font-size: 22px; color: var(--pink); margin-top: 4px; }
.vote-row { display: flex; gap: 14px; justify-content: center; margin: 10px 0 4px; }
.vote-card { flex: 1; max-width: 250px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px 10px; border: 4px solid var(--ink); border-radius: 22px; background: linear-gradient(#e6fcf5, #c3fae8); box-shadow: 0 5px 0 var(--ink); cursor: pointer; font: inherit; color: var(--ink); transition: transform .1s; }
.vote-card:hover:not(:disabled) { transform: translateY(-3px); }
.vote-card b { font-family: var(--title); font-weight: 400; font-size: 21px; color: #0ca678; }
.vote-card small { color: var(--muted); font-weight: 600; }
.vote-card.mine { background: linear-gradient(#fff3bf, #ffe066); box-shadow: 0 0 0 4px #39c5bb, 0 5px 0 var(--ink); }
.vote-card.won { animation: pulse .6s infinite; }
.vote-key { position: absolute; top: -14px; left: 50%; translate: -50% 0; }
.voters { display: flex; gap: 3px; min-height: 34px; flex-wrap: wrap; justify-content: center; }
.voter { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 2px solid #fff; overflow: hidden; animation: popin .25s; }
.vote-won { position: absolute; top: 22%; left: 50%; translate: -50% 0; font-family: var(--title); font-size: 40px; color: #39c5bb; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; white-space: nowrap; animation: popin .4s; }

/* Ordre de jeu (dés au début de la partie) */
.order-box { position: absolute; bottom: 22px; left: 50%; translate: -50% 0; width: min(420px, 92vw); display: flex; flex-direction: column; gap: 6px; align-items: stretch; animation: popin .3s; }
.order-title { font-family: var(--title); font-size: 24px; color: var(--violet); text-align: center; display: flex; gap: 8px; justify-content: center; align-items: center; }
.order-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 3px solid var(--c); border-radius: 16px; padding: 3px 10px 3px 4px; font-size: 17px; }
.order-row .portrait { width: 36px; height: 36px; border-radius: 10px; background: var(--c); flex-shrink: 0; }
.order-row b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.order-row.wait { opacity: .75; animation: pulse 1s infinite; }
.order-rolls { display: flex; gap: 4px; }
.order-rolls i { font: 400 18px var(--title); min-width: 30px; text-align: center; background: var(--c); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; border-radius: 9px; padding: 0 6px; }
.order-rolls i:not(:last-child) { opacity: .45; }
.order-hint { text-align: center; min-height: 10px; }

/* Vote du plateau */
.mapvote { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none !important; }
.mv-card { pointer-events: auto; width: min(760px, 94vw); text-align: center; animation: popin .35s; }
.mv-card h2 { font-size: 36px; display: flex; gap: 10px; justify-content: center; align-items: center; }
.mv-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 14px 0 8px; }
.mv-map { width: 230px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 12px 10px; border: 4px solid var(--ink); border-radius: 24px; background: linear-gradient(#e7f5ff, #c5f6fa); box-shadow: 0 6px 0 var(--ink); cursor: pointer; font: inherit; color: var(--ink); transition: transform .1s; }
.mv-map:hover:not(:disabled) { transform: translateY(-3px); }
.mv-map:disabled { cursor: default; }
.mv-map b { font-family: var(--title); font-weight: 400; font-size: 24px; color: #1971c2; }
.mv-map small { color: var(--muted); font-weight: 600; }
.mv-map.mine { background: linear-gradient(#fff3bf, #ffe066); box-shadow: 0 0 0 4px var(--pink), 0 6px 0 var(--ink); }
.mv-map.won { animation: pulse .6s infinite; box-shadow: 0 0 0 5px #ffd43b, 0 6px 0 var(--ink); }
.mv-thumb { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #8ce99a 0 45%, #f6e0a4 46% 54%, #74c0fc 55%); border: 4px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0, 0, 0, .15); }

/* Grande finale */
.end .bonus { transition: opacity .5s, transform .5s; }
.end .bonus.gone { opacity: 0; transform: translateY(-30px); pointer-events: none; }
.end-title { animation: rlTitle 2.4s ease-in-out infinite; }
.reveal-cap { position: absolute; left: 50%; bottom: 7vh; translate: -50% 0; display: flex; align-items: center; gap: 14px; pointer-events: none; opacity: 0; }
.reveal-cap.pop { animation: capPop .5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.reveal-cap.gone { animation: none; opacity: 0; transition: opacity .4s; }
.reveal-cap .portrait { width: 84px; height: 84px; border-radius: 50%; background: #fff; border: 5px solid var(--ink); }
.rc-rank { font-family: var(--display); font-size: 64px; color: #ffd43b; -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; }
.rc-name { font-family: var(--display); font-size: 56px; color: var(--c); -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; white-space: nowrap; }
@keyframes capPop { from { opacity: 0; transform: scale(.5) rotate(-6deg); } to { opacity: 1; transform: scale(1) rotate(0); } }

/* Métropaw : prix de l'étoile, flash info, fiche d'un commerce, choix proposés par le plateau */
.city-hud { position: absolute; top: 104px; transition: top .2s; left: 50%; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none !important; }
.ch-star, .ch-news { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .94); border: 3px solid #fff; border-radius: 999px; padding: 3px 14px 3px 8px; box-shadow: var(--shadow); font-weight: 700; color: var(--ink); font-size: 15px; white-space: nowrap; }
.ch-star:empty { display: none; }
.ch-star .ico, .ch-news .ico { width: 22px; height: 22px; }
.ch-star b { font-family: var(--title); font-weight: 400; font-size: 19px; }
.ch-star span { color: var(--muted); }
.ch-star em { font-style: normal; color: #2b8a3e; }
.ch-news { background: linear-gradient(#fff3bf, #ffe066); border-color: #fab005; }
.city-card { position: absolute; right: 14px; top: 112px; width: 300px; padding: 12px 14px; border-radius: 22px; animation: popin .25s; font-size: 14px; }
.cc-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 4px solid var(--c); }
.cc-head .ico { width: 42px; height: 42px; flex: none; }
.cc-head b { display: block; font-family: var(--title); font-weight: 400; font-size: 20px; }
.cc-head small { color: var(--muted); font-weight: 600; }
.cc-x { margin-left: auto; align-self: flex-start; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0 0 2px; box-sizing: border-box; border-radius: 50%; border: 3px solid var(--ink); background: #fff; font: 700 18px var(--font); line-height: 1; cursor: pointer; }
.cc-owner { margin: 8px 0 4px; font-weight: 700; }
.cc-row { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; line-height: 1.3; }
.cc-row .ico { width: 20px; height: 20px; flex: none; }
.cc-tag { flex: none; font-size: 11px; font-weight: 800; text-transform: uppercase; padding: 2px 7px; border-radius: 8px; color: #fff; margin-top: 1px; }
.cc-tag.v { background: #fa5252; } .cc-tag.o { background: #40c057; }
.city-props { position: absolute; left: 50%; top: 150px; translate: -50% 0; z-index: 6; width: min(940px, calc(100vw - 580px)); min-width: min(560px, 96vw); max-height: calc(100vh - 340px); display: flex; flex-direction: column; padding: 12px 14px; border-radius: 22px; animation: popin .25s; font-size: 14px; }
.pm-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; }
.pm-head b { display: inline-flex; align-items: center; gap: 8px; font-family: var(--title); font-weight: 400; font-size: 21px; }
.pm-head b .ico { width: 30px; height: 30px; }
.pm-head span { color: var(--muted); }
.pm-head .cc-x { margin-left: auto; }
.pm-body { overflow: auto; padding-right: 6px; }
.pm-sec h3 { margin: 10px 0 6px; padding-bottom: 3px; border-bottom: 4px solid var(--c); font-family: var(--title); font-weight: 400; font-size: 17px; }
.pm-sec h3 small { font: 700 13px var(--font); color: var(--muted); }
.pm-none { color: var(--muted); font-weight: 600; padding: 4px 0 6px; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.pm-card { background: #fff; border: 3px solid var(--c); border-radius: 16px; padding: 7px 10px 8px; }
.pm-top { display: flex; align-items: center; gap: 8px; }
.pm-top .ico { width: 34px; height: 34px; flex: none; }
.pm-top b { display: block; font-family: var(--title); font-weight: 400; font-size: 16px; line-height: 1.1; }
.pm-top small { color: var(--muted); font-weight: 600; }
.pm-card .cc-row { font-size: 13px; margin: 5px 0; }
.pm-st { color: #ced4da; letter-spacing: 1px; } .pm-st i { font-style: normal; color: #f08c00; }
.pm-amts { color: var(--muted); font-weight: 600; white-space: nowrap; }
.pm-amts u { color: var(--ink); font-weight: 800; }
.pm-foot { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pm-foot .ico { width: 16px; height: 16px; }
.act-row.pick { max-width: 780px; }
.act-row.pick.rich { max-width: min(1040px, 96vw); align-items: stretch; }
.btn.pick-opt { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; width: 236px; white-space: normal; text-align: left; padding: 8px 12px; border-radius: 16px; }
.pick-opt .po-main { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; }
.pick-opt .po-main .ico { width: 22px; height: 22px; }
.pick-opt .po-desc { font-size: 12.5px; font-weight: 600; line-height: 1.3; color: var(--muted); }
/* agrandissement : nouvelle valeur bien visible (le texte autour est déjà semi-gras et grisé) */
.pick-opt .po-desc b { font-weight: 900; color: var(--ink); }
.pick-head { flex-basis: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.pick-head b { font-family: var(--title); font-weight: 400; font-size: 21px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.pick-head b .ico { width: 30px; height: 30px; }
.pick-head small { color: var(--muted); font-weight: 600; font-size: 14px; max-width: 680px; }

/* ───── Mini-jeux : textes géants, touches à l'écran, bulle de Jacques ───── */
.mg-big { position: absolute; top: 20%; left: 50%; translate: -50% 0; font-family: var(--title); font-size: 56px; color: #fff; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; pointer-events: none !important; white-space: nowrap; text-align: center; }
.mg-big.pop { animation: countPop .4s ease-out; }
.mg-big.soft { font-size: 38px; top: 17%; }
.mg-big.in-hud { position: static; translate: none; font-size: 30px; -webkit-text-stroke-width: 6px; }
.mg-big.in-hud:empty { display: none; }
.mg-big.warn { color: #ff6b6b; }
.mg-big.good { color: #8ce99a; }
.kpad { position: absolute; bottom: 28px; left: 50%; translate: -50% 0; display: flex; gap: 12px; }
.kp { width: 88px; height: 88px; border: 5px solid var(--ink); border-radius: 24px; background: var(--c, #fff); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--title); font-size: 44px; line-height: 1; color: var(--ink); box-shadow: 0 8px 0 var(--ink); cursor: pointer; transition: transform .05s; touch-action: manipulation; }
.kp small { font: 700 12px var(--font); opacity: .8; margin-top: 2px; }
.kp.hit { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); filter: brightness(1.2); }
.kp.next { outline: 4px solid #ffd43b; }
.simon-say { position: absolute; top: 14%; left: 50%; translate: -50% 0; background: #fff; border: 5px solid var(--ink); border-radius: 30px; padding: 8px 34px 12px; text-align: center; box-shadow: 0 8px 0 var(--ink); pointer-events: none !important; animation: popin .25s; min-width: 320px; }
.simon-say::after { content: ''; position: absolute; left: 50%; bottom: -22px; translate: -50% 0; border: 14px solid transparent; border-top: 18px solid var(--ink); }
.simon-say small { display: block; min-height: 24px; font: 400 24px var(--title); color: #e64980; }
.simon-say b { display: block; font: 400 56px var(--title); color: var(--ink); white-space: nowrap; }
.simon-say.jq { background: #fff3bf; }
.simon-bar { position: absolute; top: calc(14% + 150px); left: 50%; translate: -50% 0; width: 340px; height: 18px; border: 4px solid var(--ink); border-radius: 999px; background: rgba(43, 33, 53, .55); overflow: hidden; pointer-events: none !important; }
.simon-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff6b6b, #ffd43b); border-radius: 999px; }

/* Chasse au trésor : légende du butin et rappel des touches */
.dig-legend { position: absolute; left: 14px; top: 50%; translate: 0 -50%; background: var(--card); border: 4px solid #fff; border-radius: 20px; padding: 10px 14px 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; pointer-events: none !important; min-width: 150px; }
.dig-legend h4 { margin: 0 0 2px; font: 400 20px var(--title); color: var(--violet); text-align: center; }
.dig-legend div { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.dig-legend span { font-size: 22px; width: 26px; text-align: center; }
.dig-legend b { margin-left: auto; font: 400 20px var(--title); }
.dig-legend b.pos { color: #2f9e44; } .dig-legend b.neg { color: #e03131; }
.dig-legend small { color: var(--muted); font-weight: 700; font-size: 12px; text-align: center; }
.dig-keys { position: absolute; left: 50%; bottom: 20px; translate: -50% 0; background: var(--card); border: 4px solid #fff; border-radius: 999px; padding: 8px 18px; box-shadow: var(--shadow); font-weight: 700; font-size: 17px; white-space: nowrap; pointer-events: none !important; }
.dig-keys kbd { margin: 0 2px; }

/* Mémo-pattes : points de progression de la séquence */
.paw-dots { position: absolute; left: 50%; bottom: 150px; translate: -50% 0; display: flex; gap: 7px; pointer-events: none !important; }
.paw-dots i { width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .55); border: 3px solid var(--ink); transition: background .1s, transform .1s; }
.paw-dots i.show { background: #ffd43b; transform: scale(1.15); }
.paw-dots i.me { background: #8ce99a; transform: scale(1.15); }
.paw-dots i.bad { background: #ff6b6b; }
.mg-big.paw-big { top: auto; bottom: 178px; font-size: 32px; }

.rps-big { position: absolute; top: 10%; left: 50%; translate: -50% 0; display: flex; gap: min(22vw, 220px); pointer-events: none !important; }
.rps-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rps-card { width: 150px; height: 150px; display: grid; place-items: center; background: var(--card); border: 5px solid #fff; border-radius: 28px; box-shadow: var(--shadow); font-family: var(--title); font-size: 90px; color: var(--violet); }
.rps-card .ico { width: 80%; height: 80%; }
.rps-card.done { color: #2f9e44; }
.rps-card.st-count { animation: rpsBounce .5s ease-in-out infinite; }
.rps-card.st-reveal { animation: countPop .35s ease-out; }
.rps-card.win { border-color: #ffd43b; box-shadow: 0 0 0 5px #ffd43b, var(--shadow); }
.rps-card.lose { opacity: .55; }
.rps-name { font-weight: 800; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; font-size: 20px; }
@keyframes rpsBounce { 50% { translate: 0 -18px; } }
@media (max-width: 600px) { .rps-card { width: 96px; height: 96px; font-size: 56px; } .rps-big { gap: 24vw; } }
.rps-msg { position: absolute; top: calc(10% + 200px); left: 50%; translate: -50% 0; font-family: var(--title); font-size: 34px; color: #fff; -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; pointer-events: none !important; white-space: nowrap; }
.rps-bar { position: absolute; left: 50%; bottom: 24px; translate: -50% 0; display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--card); padding: 10px 16px; border: 4px solid #fff; border-radius: 26px; box-shadow: var(--shadow); }
.rps-rule { font-weight: 700; color: var(--violet); }
.rps-btns { display: flex; gap: 12px; }
.rps-btn { display: flex; align-items: center; gap: 8px; font-size: 20px; padding: 8px 16px; }
.rps-btn .ico { width: 40px; height: 40px; }
.rps-bar.locked .rps-btn { opacity: .45; }
.rps-bar .rps-btn.sel { opacity: 1; outline: 4px solid #ffd43b; }

/* ───── Manette : curseur de menu ───── */
.pad-focus { outline: 4px solid #ffd43b !important; outline-offset: 3px; box-shadow: 0 0 0 9px rgba(255, 212, 59, .45), 0 6px 0 var(--ink) !important; z-index: 2; }
/* Boutons de la manette (A vert, B rouge, X bleu, Y jaune) : remplacent les touches clavier quand on joue à la manette */
kbd.pb { min-width: 1.7em; text-align: center; border-radius: 99px; padding: 0 5px; color: #fff; -webkit-text-stroke: 0; }
kbd.pb.a { background: #40c057; } kbd.pb.b { background: #fa5252; } kbd.pb.x { background: #339af0; } kbd.pb.y { background: #fab005; }
kbd.pb.stick { background: #495057; }
/* croix : dessin seul ; Start / Select : petites pilules allongées comme sur la manette */
kbd.pb.dpad { background: none; border: 0; padding: 0; min-width: 0; line-height: 0; }
kbd.pb.dpad .ico { width: 1.6em; height: 1.6em; }
kbd.pb.start, kbd.pb.select { background: #868e96; border-radius: 99px; min-width: 0; padding: 0 3px; line-height: 0; }
kbd.pb.start .ico, kbd.pb.select .ico { width: 1.5em; height: 1em; vertical-align: middle; }
.keys.pk { display: none; }
body.pad .keys.pk { display: inline-flex; align-items: center; gap: 4px; }
body.pad .ctl .keys:not(.pk) { display: none; }
/* Touches sur les boutons : clavier par défaut, équivalent manette à la place quand on joue à la manette */
.pk-alt { display: none; }
body.pad .pk-alt { display: inline-flex; align-items: center; gap: 2px; vertical-align: middle; }
body.pad kbd.kb-key { display: none; }
/* curseur de menu présent : A valide le bouton visé, les autres A s'effacent (le bouton visé porte un A) */
body.pad.pad-cursor .pk-alt.pa { display: none; }
body.pad.pad-cursor .pad-focus .pk-alt.pa { display: inline-flex; }
.pad-badge { position: fixed; z-index: 70; pointer-events: none; font-size: 15px; box-shadow: 0 3px 0 var(--ink); }
body:not(.pad) .pad-badge { display: none !important; }
body.pad .sk small { display: none; }
.pad-only { display: none; }
body.pad .pad-only { display: inline; } body.pad .kb-only { display: none; }
/* Exploration du plateau (V) */
.explore-hint { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 20px; text-align: center; animation: popin .25s; }
.explore-hint > b { display: inline-flex; align-items: center; gap: 6px; font-family: var(--title); font-size: 18px; }
.explore-hint .ico { width: 24px; height: 24px; }
.explore-hint > small { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; }
.explore-hint > small.pad-only, body.pad .explore-hint > small.kb-only { display: none; }
body.pad .explore-hint > small.pad-only { display: inline-flex; }
.eh-space { display: flex; align-items: center; gap: 10px; text-align: left; max-width: 380px; }
.eh-space i { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 0 0 3px var(--ink); }
.eh-space b { display: block; font-family: var(--title); font-weight: 400; font-size: 17px; }
.eh-space small { display: block; color: var(--muted); font-weight: 600; line-height: 1.3; }
.eh-biz { width: 320px; text-align: left; font-size: 14px; }
.eh-star { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #e67700; }
.shop-hint { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: .9em; color: #e67700; }
.eh-who { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.eh-who span { background: var(--c); color: #fff; border-radius: 99px; padding: 1px 10px; font-weight: 700; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
body.exploring .actions, body.exploring .order-box { visibility: hidden; }
body.touch .btn kbd, body.touch .pk-alt, body.touch .mash-hint kbd, body.touch .vote-key, body.touch .sk small, body.touch .pm-head span { display: none; }

/* ───── Commandes tactiles des mini-jeux ───── */
html, body { touch-action: none; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.lobby-left, .lobby-right, .pm-body, .end, .modal .card, .lobby { touch-action: pan-y; }
.touch-ctl { position: absolute; inset: 0; z-index: 30; pointer-events: none !important; }
.touch-ctl > * { pointer-events: auto; position: absolute; touch-action: none; }
.tc-zone { left: 0; top: 18%; bottom: 0; width: 58%; }
.tc-stick { position: fixed; width: 180px; height: 180px; margin: -90px 0 0 -90px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .3), rgba(43, 33, 53, .35)); border: 4px solid rgba(255, 255, 255, .9); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; pointer-events: none; }
.tc-stick.on { opacity: 1; transform: scale(1); }
.tc-knob { position: absolute; left: 50%; top: 50%; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ff8fc7 60%, #e64980); border: 4px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.tc-btns { right: max(22px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 14px; }
.tc-btn { min-width: 92px; height: 92px; padding: 0 10px; border-radius: 46px; display: flex; align-items: center; justify-content: center; text-align: center; font: 400 17px/1.05 var(--title); color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; background: radial-gradient(circle at 35% 30%, #ffe066, #ff922b); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); user-select: none; -webkit-user-select: none; }
.tc-btn.b { min-width: 74px; height: 74px; background: radial-gradient(circle at 35% 30%, #d0bfff, #845ef7); }
.tc-btn.on { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); filter: brightness(1.15); }
.tc-dir { min-width: 0; width: 72px; height: 72px; border-radius: 20px; font-size: 38px; background: linear-gradient(#fff, #e9defe); color: var(--ink); -webkit-text-stroke: 0; }
.tc-cross { left: max(18px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); width: 230px; height: 230px; }
.tc-cross .tc-dir { position: absolute; }
.tc-cross .u { left: 79px; top: 0; } .tc-cross .d { left: 79px; bottom: 0; } .tc-cross .l { left: 0; top: 79px; } .tc-cross .r { right: 0; top: 79px; }
.tc-row { left: 50%; translate: -50% 0; bottom: max(14%, 40px); display: flex; gap: 10px; width: min(560px, 96vw); }
.tc-row .tc-dir { flex: 1; width: auto; height: auto; aspect-ratio: 1; max-height: 130px; font-size: 52px; border-radius: 26px; }
/* Téléphone couché : ← ↓ sous le pouce gauche, ↑ → sous le pouce droit */
@media (orientation: landscape) and (max-height: 520px) { .tc-row { bottom: max(18px, env(safe-area-inset-bottom)); width: calc(100vw - 36px); } .tc-row .tc-dir { flex: none; width: 96px; height: 96px; } .tc-row .tc-dir:nth-child(3) { margin-left: auto; } body.touch .dance-wrap { right: 50%; translate: 50% -50%; } }
body.touch .dig-keys, body.touch .sprint-keys small { display: none; }

/* ───── Petits écrans (téléphone, petite tablette) : l'interface rétrécit en bloc ───── */
:root { --z: 1; }
@media (max-width: 1000px), (max-height: 680px) { :root { --z: .8; } }
@media (max-width: 760px), (max-height: 520px) { :root { --z: .64; } }
@media (max-height: 400px) { :root { --z: .56; } }
.lobby-left, .lobby-right, .share, .pp, .round-box, .actions, .order-box, .corner-tools, .dialog, .toast, .banner-txt, .banner-por,
.mg-hud, .mg-over > *, .modal .card, .end > *, .mv-card, .city-hud, .city-card, .city-props, .sprint-keys, .kpad, .bj-big, .bj-actions,
.mash-hint, .tug-bar, .dance-wrap, .duel-big, .mg-big, .simon-say, .simon-bar, .dig-legend, .dig-keys, .paw-dots, .rps-big, .rps-msg, .rps-bar,
.reveal-cap, .explore-hint { zoom: var(--z); }
@media (max-width: 1000px), (max-height: 680px) {
  .actions { max-width: calc(96vw / var(--z)); bottom: 14px; }
  .city-props { width: calc(96vw / var(--z)); min-width: 0; max-height: calc(100vh / var(--z) - 200px); top: 110px; }
  .lobby-left { max-height: calc(100vh / var(--z) - 44px); }
  .lobby-right { max-height: calc(100vh / var(--z) - 170px); }
  .results { margin-top: 18vh; }
  .count, .go, .finish { font-size: 110px; }
  /* Les vw sont eux aussi rétrécis par zoom : on compense pour garder la largeur voulue à l'écran */
  .rl-window { width: min(560px, calc(90vw / var(--z))); }
  .intro, .results { width: min(620px, calc(94vw / var(--z))); }
  .mv-card { width: min(760px, calc(94vw / var(--z))); }
  .modal .card { width: min(440px, calc(92vw / var(--z))); max-height: calc(100vh / var(--z) - 20px); overflow: auto; }
  .order-box { width: min(420px, calc(92vw / var(--z))); }
  .tug-bar { width: min(760px, calc(94vw / var(--z))); }
  .final { width: min(460px, calc(94vw / var(--z))); }
  .share { max-width: calc(94vw / var(--z)); }
  /* left: 50% ne laisse que la moitié de l'écran à ces blocs centrés : on leur rend toute la largeur */
  .mg-hud, .round-box, .city-hud { width: max-content; max-width: calc(96vw / var(--z)); }
  .act-row.pick.rich { max-width: min(1040px, calc(96vw / var(--z))); }
  .rl-title { font-size: 44px; }
  .intro h2 { font-size: 36px; }
  .intro, .results { max-height: calc(100vh / var(--z) - 30px); overflow: auto; }
  .mg-over { align-items: center; }
}
/* Paysage très bas (téléphone couché) : plus de place en hauteur pour la carte du mini-jeu */
@media (max-height: 520px) {
  .intro { width: min(760px, calc(96vw / var(--z))); padding: 12px 16px; }
  .intro-desc { margin: 2px 0 8px; }
  .controls { flex-direction: row; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
  .results { margin-top: 0; }
  .pp.ml, .pp.mr { top: 38%; }
}
/* Portrait : le salon s'empile, les panneaux des joueurs se resserrent */
@media (orientation: portrait) and (max-width: 760px) {
  .lobby { overflow: auto; display: flex; flex-direction: column; gap: 10px; padding: 46px 10px 16px; pointer-events: auto !important; }
  .lobby-left, .lobby-right { position: static; width: auto; max-height: none; overflow: visible; }
  .lobby .share { position: static; translate: none; max-width: none; }
  .lobby .corner-tools { position: fixed; }
  .pp { width: 230px; }
  .pp.ml, .pp.mr { top: auto; bottom: 150px; }
  .pp.ml { left: 14px; } .pp.mr { right: 14px; }
  .actions, .order-box { bottom: calc(14px + 120px * var(--z)); }
  .dance-wrap { right: 50%; translate: 50% -50%; }
  .rps-big { gap: 18vw; }
  .mg-hud { top: 80px; }
  .tc-cross, .tc-btns { bottom: 40px; }
}
body.touch .corner-tools { zoom: .85; }
body.touch .ctl .keys { display: none; }
body:has(.round-sub:not(:empty)) .city-hud { top: 136px; }

/* ───── Roue des cases chance / malchance (ui.js : wheel) ───── */
.wheel { --d: min(300px, 74vw, 44vh); position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%) scale(.85); opacity: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; background: rgba(255, 255, 255, .94); border: 4px solid var(--ink); border-radius: 28px; padding: 12px 22px 16px; box-shadow: 0 8px 0 rgba(43, 33, 53, .3), var(--shadow); cursor: pointer; animation: wh-in .35s cubic-bezier(.2, 1.4, .4, 1) forwards; transition: opacity .25s; }
.wheel.out { opacity: 0 !important; pointer-events: none !important; }
.wheel.trap { background: rgba(243, 240, 255, .95); }
@keyframes wh-in { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.wh-title { font-family: var(--title); font-size: clamp(20px, 5vw, 26px); color: var(--violet); white-space: nowrap; }
.wheel.trap .wh-title { color: #5f3dc4; }
.wh-wrap { position: relative; width: var(--d); height: var(--d); margin-top: 6px; }
.wh-disc { position: absolute; inset: 0; border-radius: 50%; border: 5px solid var(--ink); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .55), 0 5px 0 rgba(43, 33, 53, .25); will-change: transform; }
.wh-slot { position: absolute; inset: 0; transform: rotate(var(--a)); pointer-events: none; }
.wh-slot .ico { position: absolute; left: 50%; top: 7%; width: 17%; height: 17%; transform: translateX(-50%); filter: drop-shadow(0 2px 0 rgba(43, 33, 53, .35)); }
.wh-slot span { position: absolute; left: 50%; top: 25%; width: calc(var(--w) * .42); transform: translateX(-50%); text-align: center; font: 700 clamp(10px, calc(var(--d) * .048), 14px)/1.05 var(--font); color: var(--ink); text-shadow: 0 1px 0 rgba(255, 255, 255, .7); overflow-wrap: anywhere; }
.wh-hub { position: absolute; left: 50%; top: 50%; width: 16%; height: 16%; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; border: 4px solid var(--ink); }
.wh-pin { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--ink); }
.wh-pin::after { content: ''; position: absolute; left: -8px; top: -23px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 15px solid #ff6b9d; }
.wh-label { display: flex; flex-direction: column; align-items: center; min-height: 2.6em; }
.wh-label b { font-family: var(--title); font-weight: 400; font-size: clamp(19px, 4.6vw, 24px); white-space: nowrap; }
.wh-label small { font-size: clamp(13px, 3.4vw, 15px); font-weight: 600; opacity: .8; }
.wheel.done .wh-label b { animation: wh-pop .45s cubic-bezier(.2, 1.6, .4, 1); color: var(--violet); }
.wheel.trap.done .wh-label b { color: #c2255c; }
.wheel.done .wh-disc { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .55), 0 0 0 6px #ffd43b, 0 5px 0 rgba(43, 33, 53, .25); }
@keyframes wh-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.wh-skip { padding: 5px 14px; font-size: 14px; }

/* Compteur de FPS (réglages) : petit, en bas à gauche, ne gêne pas les clics */
.debug-panel{position:fixed;top:6px;left:6px;z-index:9999;margin:0;padding:6px 9px;border-radius:8px;background:rgba(20,16,30,.7);color:#fff;font:11px/1.35 ui-monospace,Consolas,monospace;pointer-events:none;white-space:pre;max-width:calc(100vw - 12px);overflow:hidden}
.debug-panel b{font-weight:700}.debug-panel .g{color:#6ee787}.debug-panel .o{color:#ffb454}.debug-panel .r{color:#ff6b6b}
.fps-counter{position:fixed;bottom:6px;left:6px;z-index:9999;padding:2px 7px;border-radius:8px;background:rgba(20,16,30,.6);color:#fff;font:600 12px/1.4 system-ui,sans-serif;pointer-events:none;font-variant-numeric:tabular-nums}
