/* Écrans de jeu plein écran : Ludo (public/ludo.js).
   Polices Bangers / Playfair : déclarées dans theme-spider.css. */

/* ============================== LUDO ============================== */
.ludo { --board: #fffdf8; --cell: #ffffff; --line: #d9d2c5; --accent: #e53945; --text: #fbf3f8; --muted: #b6a9b6; --panel: #1d1424;
  --die: #ffffff; --die-edge: #e8e1d6; --die-shade: #c9c1b4; --die-pip: #1b1220; --die-web: none; --pip-mask: none;
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 20%, #2a1630, #0c0710 70%); color: var(--text); font-family: 'Outfit', 'Jost', system-ui, sans-serif; }
.ludo > * { width: 100%; max-width: 460px; }
.ludo.spider { --board: #120a14; --cell: #1b111d; --line: #3a2436; --accent: #ff2e88; --sky1: #2a0d24; --sky2: #ff2e88; --build: #07030a; --win: #ffd3e8;
  --die: #ffffff; --die-edge: #ff2e88; --die-shade: #b3155f; --die-pip: #ff2e88; background: radial-gradient(circle at 50% 20%, #2a0f24, #0a0510 70%); }
.ludo.spider[data-hero="woman"] { --board: #2a0a10; --cell: #4a121c; --line: #8a2434; --accent: #ff2a45; --sky1: #3a0710; --sky2: #ff2a45; --build: #0a0204; --win: #ffb3be;
  --die: #e8112f; --die-edge: #111; --die-shade: #5a0412; --die-pip: #0b0b0b; background: radial-gradient(circle at 50% 20%, #3a0710, #0d0305 70%); }
/* couleurs des joueurs : classiques (r, y) ou Spider (a = blanc/noir, b = rose/rouge) */
.ludo .c-r { --c: #e53945; --cd: #a8202b; --cr: #ffffff; --ct: #fff; }
.ludo .c-y { --c: #f4c430; --cd: #b88a09; --cr: #ffffff; --ct: #3a2a00; }
.ludo.spider .c-a { --c: #e0162b; --cd: #8a0a19; --cr: #ffffff; --ct: #fff; }      /* lui, en Spider-Gwen : rouge */
.ludo.spider .c-b { --c: #ffffff; --cd: #9b8f99; --cr: #ff2e88; --ct: #1b1220; }    /* elle, en Spider-Gwen : araignées blanches */
.ludo.spider[data-hero="woman"] .c-a { --c: #1b2a6b; --cd: #0b1236; --cr: #8fa6ff; --ct: #fff; } /* lui, en Spider-Woman : bleu nuit */
.ludo.spider[data-hero="woman"] .c-b { --c: #e8112f; --cd: #7a0618; --cr: #ffffff; --ct: #fff; } /* elle, en Spider-Woman : araignées rouges */

.ludo-top { display: flex; align-items: center; gap: 10px; }
.ludo-top b { font-family: 'Bangers', Impact, sans-serif; font-size: 28px; letter-spacing: 1px; flex: 1; color: var(--accent); text-shadow: 2px 2px 0 #000; }
.ludo-top small { font-size: 12px; color: var(--muted); }
.ludo-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #ffffff14; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.ludo-player { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 14px; background: var(--panel); border: 2px solid transparent; transition: border-color .3s, box-shadow .3s; }
.ludo-player.turn { border-color: var(--c); box-shadow: 0 0 18px -4px var(--c); }
.ludo-player .av { width: 32px; height: 32px; border-radius: 50%; background: var(--c); color: var(--ct); display: grid; place-items: center; font-weight: 800; box-shadow: 0 0 0 2px var(--cr); }
.ludo-player .nm { flex: 1; display: grid; }
.ludo-player .nm strong { font-size: 14px; }
.ludo-player .nm small { font-size: 11.5px; color: var(--muted); }
.ludo-player .home { display: flex; gap: 3px; }
.ludo-player .home i { width: 10px; height: 10px; border-radius: 50%; background: #ffffff1a; }
.ludo-player .home i.in { background: var(--c); box-shadow: 0 0 6px var(--c), 0 0 0 1px var(--cr); }

.ludo-board-wrap { display: grid; place-items: center; }
.ludo-board { --cs: calc(var(--bs) / 15); --bs: min(92vw, 50vh, 440px); position: relative; width: var(--bs); height: var(--bs); border-radius: 10px; overflow: hidden;
  display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(15, 1fr); background: var(--board); box-shadow: 0 10px 30px #0008, 0 0 0 2px var(--line); }
.ludo-board .cell { border: .5px solid var(--line); position: relative; background: var(--cell); }
.ludo-board .cell.c-r, .ludo-board .cell.c-y, .ludo-board .cell.c-a, .ludo-board .cell.c-b { background: var(--c); }
.ludo-board .cell.idle { background: color-mix(in srgb, var(--cell) 80%, var(--line)); }
.ludo-board .cell.star::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cs) * .6); color: #0004; }
.ludo.spider .ludo-board .cell.star::after { content: ''; inset: 14%; opacity: .75;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-12 -12 24 24'%3E%3Cg fill='none' stroke='%23ff7ab8' stroke-width='1'%3E%3Cpath d='M0-11V11M-11 0H11M-8-8L8 8M8-8L-8 8'/%3E%3Cpath d='M0-4L4 0 0 4-4 0Z M0-8L8 0 0 8-8 0Z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.ludo-board .yard { position: absolute; width: calc(var(--cs) * 6); height: calc(var(--cs) * 6); display: grid; place-items: center; }
.ludo-board .yard.tl { left: 0; top: 0; } .ludo-board .yard.br { right: 0; bottom: 0; } .ludo-board .yard.tr { right: 0; top: 0; } .ludo-board .yard.bl { left: 0; bottom: 0; }
.ludo-board .yard.c-r, .ludo-board .yard.c-y, .ludo-board .yard.c-a, .ludo-board .yard.c-b { background: var(--c); box-shadow: inset 0 0 0 3px var(--cr); }
.ludo-board .yard .in { width: 72%; height: 72%; border-radius: 14px; background: var(--board); display: grid; grid-template-columns: 1fr 1fr; place-items: center; padding: 10%; }
.ludo-board .yard .in i { width: 60%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--c) 25%, var(--board)); box-shadow: inset 0 2px 4px #0006, 0 0 0 2px var(--c); }
.ludo-board .yard.idle-yard { background: color-mix(in srgb, var(--board) 85%, var(--line)); }
.ludo-board .yard.city { overflow: hidden; background: linear-gradient(180deg, var(--sky1), color-mix(in srgb, var(--sky2) 35%, var(--sky1))); }
.ludo-board .yard.city svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ludo-board .yard.city .moon { fill: var(--win); opacity: .85; }
.ludo-board .yard.city .strand { stroke: var(--win); stroke-width: .6; fill: none; opacity: .55; }
.ludo-board .yard.city .bld { fill: var(--build); }
.ludo-board .yard.city .win { fill: var(--win); opacity: .8; }
.ludo-board .center { position: absolute; left: calc(var(--cs) * 6); top: calc(var(--cs) * 6); width: calc(var(--cs) * 3); height: calc(var(--cs) * 3); display: grid; place-items: center;
  background: conic-gradient(from -45deg, var(--cell) 0 25%, var(--c1, #f4c430) 0 50%, var(--cell) 0 75%, var(--c0, #e53945) 0); box-shadow: inset 0 0 0 1px var(--line); }
.ludo-board .center span { font-family: 'Bangers', Impact, sans-serif; font-size: calc(var(--cs) * 1.1); color: var(--accent); text-shadow: 2px 2px 0 #0007; }
.ludo-token { position: absolute; width: calc(var(--cs) * .86); height: calc(var(--cs) * .86); margin: calc(var(--cs) * -.43) 0 0 calc(var(--cs) * -.43); padding: 0; border-radius: 50%; cursor: default; z-index: 5;
  background: radial-gradient(circle at 35% 30%, #fff8, transparent 45%), var(--c); box-shadow: 0 3px 0 var(--cd), 0 5px 8px #0006; border: 2px solid var(--cr); transition: left .1s ease, top .1s ease, transform .2s; }
.ludo-token::after { content: ''; position: absolute; inset: 26%; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--cr) 60%, transparent); }
.ludo.spider[data-hero="woman"] .ludo-token.c-a { box-shadow: 0 3px 0 var(--cd), 0 0 0 1.5px #c9d4ff, 0 0 10px 2px #5a78ffaa, 0 5px 8px #0008; }
/* ses pions à elle : de petites araignées (blanches en Gwen, rouges en Woman) */
.ludo.spider .ludo-token.c-b { background: none; border: 0; box-shadow: none; width: calc(var(--cs) * 1.02); height: calc(var(--cs) * 1.02); margin: calc(var(--cs) * -.51) 0 0 calc(var(--cs) * -.51);
  filter: drop-shadow(0 0 1px #1b1220) drop-shadow(0 0 1px #1b1220) drop-shadow(0 3px 3px #0009); }
.ludo.spider[data-hero="woman"] .ludo-token.c-b { filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 0 6px #ff2a4599) drop-shadow(0 3px 3px #000a); }
.ludo.spider .ludo-token.c-b::after { inset: 0; border: 0; border-radius: 0; background: var(--c);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg stroke='%23000' stroke-width='1.5' fill='none' stroke-linecap='round'%3E%3Cpath d='M10 11L4 7M10 12L2.5 12M10 13L4 17M11 14L7 21M14 11L20 7M14 12L21.5 12M14 13L20 17M13 14L17 21'/%3E%3C/g%3E%3Ccircle cx='12' cy='8.6' r='2.6'/%3E%3Cellipse cx='12' cy='13.8' rx='3.6' ry='4.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg stroke='%23000' stroke-width='1.5' fill='none' stroke-linecap='round'%3E%3Cpath d='M10 11L4 7M10 12L2.5 12M10 13L4 17M11 14L7 21M14 11L20 7M14 12L21.5 12M14 13L20 17M13 14L17 21'/%3E%3C/g%3E%3Ccircle cx='12' cy='8.6' r='2.6'/%3E%3Cellipse cx='12' cy='13.8' rx='3.6' ry='4.3'/%3E%3C/svg%3E") center / contain no-repeat; }
.ludo-token.moving { z-index: 9; }
.ludo-token.hop { transform: translateY(-6px) scale(1.12); }
.ludo-token.can { cursor: pointer; z-index: 8; animation: ludo-pulse .8s ease-in-out infinite; }
.ludo-token.can::before { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 2px dashed #fff; animation: ludo-spin 3s linear infinite; }
.ludo-token.done { transform: scale(.8); }
@keyframes ludo-pulse { 50% { transform: translateY(-4px) scale(1.08); } }
@keyframes ludo-spin { to { transform: rotate(360deg); } }

.ludo-dock { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 6px 0; }
.ludo-hint { font-size: 13px; color: var(--muted); max-width: 170px; line-height: 1.35; }
.ludo-hint b { color: var(--text); }
.ludo-dice { position: relative; width: 86px; height: 86px; border: 0; padding: 0; background: none; cursor: default; flex-shrink: 0; }
.ludo-dice .face { position: absolute; inset: 0; border-radius: 17px; background: var(--die); border: 3px solid var(--die-edge); box-shadow: 0 6px 0 var(--die-shade), 0 12px 20px #0007;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 10px; gap: 2px; }
.ludo-dice i { width: 15px; height: 15px; border-radius: 50%; background: var(--die-pip); place-self: center; visibility: hidden; }
.ludo-dice i.on { visibility: visible; }
.ludo.spider .ludo-dice .face { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23ff2e88' stroke-width='.8' opacity='.15'%3E%3Cpath d='M50 50L0 0M50 50L100 0M50 50L0 100M50 50L100 100M50 50V0M50 50V100M50 50H0M50 50H100'/%3E%3Cpath d='M50 30L64 36L70 50L64 64L50 70L36 64L30 50L36 36Z M50 12L77 23L88 50L77 77L50 88L23 77L12 50L23 23Z'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat, var(--die); }
.ludo.spider[data-hero="woman"] .ludo-dice .face { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23000' stroke-width='.8' opacity='.2'%3E%3Cpath d='M50 50L0 0M50 50L100 0M50 50L0 100M50 50L100 100M50 50V0M50 50V100M50 50H0M50 50H100'/%3E%3Cpath d='M50 30L64 36L70 50L64 64L50 70L36 64L30 50L36 36Z M50 12L77 23L88 50L77 77L50 88L23 77L12 50L23 23Z'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat, var(--die); }
/* Spider : les points du dé sont de petites araignées */
.ludo.spider .ludo-dice i { width: 20px; height: 20px; border-radius: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg stroke='%23000' stroke-width='1.6' fill='none' stroke-linecap='round'%3E%3Cpath d='M10 11L4 7M10 12L3 12M10 13L4 17M11 14L7 20M14 11L20 7M14 12L21 12M14 13L20 17M13 14L17 20'/%3E%3C/g%3E%3Ccircle cx='12' cy='9.5' r='2.4'/%3E%3Cellipse cx='12' cy='13.6' rx='3.2' ry='3.8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg stroke='%23000' stroke-width='1.6' fill='none' stroke-linecap='round'%3E%3Cpath d='M10 11L4 7M10 12L3 12M10 13L4 17M11 14L7 20M14 11L20 7M14 12L21 12M14 13L20 17M13 14L17 20'/%3E%3C/g%3E%3Ccircle cx='12' cy='9.5' r='2.4'/%3E%3Cellipse cx='12' cy='13.6' rx='3.2' ry='3.8'/%3E%3C/svg%3E") center / contain no-repeat; }
.ludo.spider .ludo-dice i:nth-child(odd) { transform: rotate(18deg); }
.ludo.spider .ludo-dice i:nth-child(even) { transform: rotate(-22deg); }
.ludo-dice.rolling .face { animation: ludo-roll .55s cubic-bezier(.3,.7,.3,1); }
@keyframes ludo-roll { 30% { transform: rotate(200deg) scale(1.15) translateY(-14px); } 70% { transform: rotate(330deg) scale(1.05); } 100% { transform: rotate(360deg); } }
.ludo.spider .ludo-dice.rolling::after { content: 'THWIP!'; position: absolute; left: 50%; top: -32px; transform: translateX(-50%) rotate(-8deg); font-family: 'Bangers', Impact, sans-serif; font-size: 22px; color: #fff;
  -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; text-shadow: 3px 3px 0 var(--accent); white-space: nowrap; animation: ludo-thwip .55s ease-out forwards; }
.ludo.spider .ludo-dice.rolling::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 90px; background: linear-gradient(#fff0, #fff); transform-origin: bottom; animation: ludo-strand .55s ease-out forwards; }
@keyframes ludo-strand { 0% { transform: scaleY(0); } 40% { transform: scaleY(1); opacity: 1; } 100% { opacity: 0; } }
@keyframes ludo-thwip { 0% { opacity: 0; transform: translateX(-50%) scale(.4) rotate(-14deg); } 30% { opacity: 1; transform: translateX(-50%) scale(1.15) rotate(-8deg); } 100% { opacity: 0; transform: translateX(-50%) translateY(-10px) rotate(-8deg); } }
.ludo-dice.ready { cursor: pointer; }
/* résultat en chiffre : pastille au coin du dé */
.ludo-dice .num { position: absolute; right: -10px; top: -10px; z-index: 2; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; display: grid; place-items: center;
  font: 800 19px/1 system-ui, sans-serif; color: #fff; background: var(--accent); border: 2px solid #fff; box-shadow: 0 2px 6px #0008; opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s cubic-bezier(.2,1.6,.4,1); }
.ludo-dice .num.on { opacity: 1; transform: none; }
.ludo-hint b.big { font-size: 18px; color: var(--accent); }

.ludo-dice.ready:not(.rolling) .face { animation: ludo-wobble 1.2s ease-in-out infinite; box-shadow: 0 6px 0 var(--die-shade), 0 0 0 4px var(--accent), 0 0 28px var(--accent); }
@keyframes ludo-wobble { 50% { transform: rotate(-6deg) scale(1.04); } }

/* petite zone de messages sous le dé */
.ludo-chat { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 14px; background: #00000055; border: 1px solid #ffffff14; }
.ludo-chat-list { max-height: 96px; min-height: 36px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; scrollbar-width: none; }
.ludo-chat-list p { max-width: 85%; padding: 4px 10px; border-radius: 12px; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.ludo-chat-list p.mine { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ludo-chat-list p.theirs { align-self: flex-start; background: #ffffff1c; border-bottom-left-radius: 4px; }
.ludo-chat-in { display: flex; gap: 6px; }
.ludo-chat-in input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid #ffffff22; background: #00000066; color: #fff; font: inherit; font-size: 14px; }
.ludo-chat-in button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--accent); display: grid; place-items: center; cursor: pointer; }
.ludo-chat-in button svg { width: 18px; height: 18px; fill: #fff; }

.ludo-pop { position: fixed; left: 50%; top: 42%; z-index: 230; pointer-events: none; transform: translate(-50%, -50%); text-align: center; animation: ludo-popin 1.1s cubic-bezier(.2,1.5,.4,1) forwards; width: auto !important; }
.ludo-pop b { display: block; font-family: 'Bangers', Impact, sans-serif; font-size: 60px; letter-spacing: 2px; line-height: 1; color: var(--accent); -webkit-text-stroke: 2px #000; paint-order: stroke fill; text-shadow: 5px 5px 0 #000; white-space: nowrap; }
.ludo-pop small { display: block; margin-top: 4px; font-weight: 800; font-size: 15px; text-shadow: 0 2px 6px #000; white-space: nowrap; }
@keyframes ludo-popin { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-12deg); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(-6deg); } 70% { opacity: 1; transform: translate(-50%, -50%) rotate(-6deg); } 100% { opacity: 0; transform: translate(-50%, -60%) rotate(-6deg); } }
.ludo.shake { animation: ludo-shake .35s; }
@keyframes ludo-shake { 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(3px, 0); } }
.ludo-end { position: fixed; inset: 0; z-index: 240; display: none; place-items: center; background: rgba(8, 4, 10, .75); backdrop-filter: blur(4px); max-width: none !important; }
.ludo-end.on { display: grid; }
.ludo-end .card { width: min(300px, 86vw); padding: 26px 20px 20px; text-align: center; border-radius: 22px; background: var(--panel); border: 2px solid var(--accent); box-shadow: 0 0 40px -6px var(--accent); }
.ludo-end h3 { font-family: 'Bangers', Impact, sans-serif; font-size: 50px; letter-spacing: 2px; color: var(--accent); -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; text-shadow: 4px 4px 0 #000; }
.ludo-end p { margin-top: 8px; color: var(--muted); }
.ludo-end button { margin-top: 18px; padding: 12px 22px; border: 0; border-radius: 30px; background: var(--accent); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.ludo-confetti { position: fixed; top: -20px; width: 8px !important; height: 14px; border-radius: 2px; z-index: 239; animation: ludo-fall linear forwards; }
.ludo-confetti.k0 { background: var(--accent); } .ludo-confetti.k1 { background: #fff; } .ludo-confetti.k2 { background: #f4c430; } .ludo-confetti.k3 { background: #22d8ea; }
@keyframes ludo-fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) { .ludo * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }

/* bouton son des jeux */
.sound-btn { width: 34px; height: 34px; flex-shrink: 0; border: 0; border-radius: 50%; background: #ffffff18; display: grid; place-items: center; cursor: pointer; }
.sound-btn svg { width: 19px; height: 19px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-btn svg path:first-child { fill: #fff; }
.sound-btn.off { opacity: .55; }
.music-btn svg path:first-child { fill: none; }
.music-btn svg circle { fill: #fff; }

/* ============================== MOTS MÊLÉS ============================== */
.mm { --mm-acc: #ff2e88; --mm-bg: #0c0710; --mm-panel: #170c1c; position: fixed; inset: 0; z-index: 205; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--mm-acc) 16%, var(--mm-bg)), var(--mm-bg) 60%); color: #fbf3f8; font-family: 'Outfit', 'Jost', system-ui, sans-serif; }
.mm[data-hero="woman"] { --mm-acc: #e8112f; --mm-bg: #0d0305; --mm-panel: #1d0508; }
.mm-muted { color: #b6a9b6; font-size: 13px; text-align: center; }
.mm-wait { margin: auto; }
.mm-x, .mm-zoom { width: 36px; height: 36px; flex-shrink: 0; border: 0; border-radius: 50%; background: #ffffff16; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.mm-home { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: max(12px, env(safe-area-inset-top)) 16px 24px; }
.mm-home header { align-self: stretch; display: flex; justify-content: space-between; }
.mm-home h2 { font-family: 'Bangers', Impact, sans-serif; font-size: 50px; letter-spacing: 2px; line-height: 1; color: #fff; -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; text-shadow: 4px 4px 0 #000; }
.mm-home h2 span { color: var(--mm-acc); }
.mm-resume { padding: 12px 18px; border: 0; border-radius: 24px; background: var(--mm-acc); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 0 20px -4px var(--mm-acc); }
.mm-sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(360px, 100%); }
.mm-sizes button { display: grid; gap: 2px; padding: 14px 6px; border-radius: 16px; border: 1.5px solid color-mix(in srgb, var(--mm-acc) 55%, transparent); background: var(--mm-panel); color: #fff; cursor: pointer; font: inherit; }
.mm-sizes button b { font-family: 'Bangers', Impact, sans-serif; font-size: 32px; letter-spacing: 1px; color: var(--mm-acc); font-weight: 400; }
.mm-sizes button small { font-size: 12px; color: #b6a9b6; }
.mm-records { width: min(360px, 100%); }
.mm-records table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mm-records th { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: #b6a9b6; padding: 6px; text-align: left; }
.mm-records td { padding: 8px 6px; border-top: 1px solid #ffffff12; font-variant-numeric: tabular-nums; }
.mm-records td.best { color: var(--mm-acc); font-weight: 800; }
.mm-bar { display: flex; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 10px 8px; background: #000a; }
.mm-title { flex: 1; font-family: 'Bangers', Impact, sans-serif; font-size: 22px; letter-spacing: 1px; color: var(--mm-acc); }
.mm-time { font-variant-numeric: tabular-nums; font-size: 16px; margin-right: 4px; }
.mm-board { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.mm-canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.mm-drawer { position: relative; z-index: 2; max-height: 46px; overflow: hidden; background: var(--mm-panel); border-top: 1px solid color-mix(in srgb, var(--mm-acc) 40%, transparent); transition: max-height .25s; padding-bottom: env(safe-area-inset-bottom); }
.mm-drawer.open { max-height: 45vh; }
.mm-handle { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border: 0; background: none; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.mm-drawer.open .mm-chev { transform: rotate(180deg); }
.mm-list { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0 16px 16px; max-height: calc(45vh - 46px); overflow-y: auto; font-size: 13px; letter-spacing: .5px; }
.mm-list .found { text-decoration: line-through; color: var(--mm-acc); opacity: .7; }
.mm-pop { position: fixed; left: 50%; top: 30%; z-index: 230; transform: translate(-50%, -50%); pointer-events: none; font-family: 'Bangers', Impact, sans-serif; font-size: 40px; letter-spacing: 2px; color: var(--mm-acc); -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; text-shadow: 3px 3px 0 #000; animation: mm-pop .9s ease-out forwards; }
@keyframes mm-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -80%); } }
.mm-end { position: fixed; inset: 0; z-index: 240; display: grid; place-items: center; background: #000b; backdrop-filter: blur(4px); }
.mm-end .card { width: min(320px, 88vw); padding: 24px 18px 18px; text-align: center; border-radius: 22px; background: var(--mm-panel); border: 2px solid var(--mm-acc); box-shadow: 0 0 40px -6px var(--mm-acc); }
.mm-end h3 { font-family: 'Bangers', Impact, sans-serif; font-size: 40px; letter-spacing: 2px; color: var(--mm-acc); -webkit-text-stroke: 1.5px #000; paint-order: stroke fill; text-shadow: 3px 3px 0 #000; }
.mm-big { font-size: 40px; font-weight: 800; margin: 8px 0; font-variant-numeric: tabular-nums; }
.mm-end button { margin-top: 14px; padding: 11px 20px; border: 0; border-radius: 24px; background: var(--mm-acc); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }

/* ============================== MORPION (fenêtre) ============================== */
.mp { --vlive: #22c55e; position: fixed; inset: 0; z-index: 205; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow-y: auto;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.mp > * { width: 100%; max-width: 440px; }
.mp-top { display: flex; align-items: center; gap: 10px; }
.mp-title { flex: 1; display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 17px; }
.mp-title small { font-weight: 400; opacity: .7; font-size: 14px; }
.mp-ic svg { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 1.6; display: block; }
.mp-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; }

.mp-players { display: flex; gap: 30px; justify-content: center; align-items: center; }
.mp-player { display: flex; align-items: center; gap: 9px; }
.mp-av { position: relative; width: 48px; height: 48px; flex: none; }
.mp-pic { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--panel-2); display: grid; place-items: center; font-weight: 700; font-size: 19px; color: var(--text); box-shadow: 0 0 0 0 transparent; transition: box-shadow .3s; }
.mp-player.turn .mp-pic { box-shadow: 0 0 0 2.5px var(--c); }
.mp-player.me { --c: var(--accent); } .mp-player.you { --c: #f59e0b; }
.mp-mark { font-weight: 800; font-size: 22px; }
.mp-mark.x { color: var(--accent); } .mp-mark.o { color: #f59e0b; }

.mp-board-wrap { display: grid; place-items: center; padding: 4px 0; }
.mp .ttt { --ttt-cell: min(26vw, 96px); gap: 7px; }
.mp .ttt.big { --ttt-cell: min(9vw, 40px); gap: 3px; }
.mp .ttt-cell { border-radius: 14px; font-size: calc(var(--ttt-cell) * .52); }
.mp .ttt.big .ttt-cell { border-radius: 6px; font-size: 15px; }
.mp .game-status { font-size: 14px; color: var(--muted); min-height: 18px; text-align: center; }
.mp .game-status b { color: var(--text); }
.mp .game-status.win { color: var(--vlive); font-weight: 700; }
.mp .game-actions { justify-content: center; min-height: 18px; }
.mp .game-actions .link { border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; padding: 0; }
.mp-chat { background: color-mix(in srgb, var(--text) 5%, transparent); border: 1px solid var(--line); }

/* ---- pastille micro sur un profil (Ludo et Morpion) ---- */
.vmic-badge { position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--bg); fill: var(--muted); }
.vmic-badge.on { fill: var(--vlive, #22c55e); filter: drop-shadow(0 0 4px var(--vlive, #22c55e)); }
/* dans Ludo, la pastille se pose sur l'avatar .av et doit suivre son fond sombre */
.ludo .vmic-badge { background: var(--panel); }
.ludo-player .av { position: relative; }

/* ---- barre voix : icônes sans contour ---- */
.vbar { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 4px; }
.vbtn { width: 46px; height: 46px; border: 0; background: none; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.vbtn svg { width: 26px; height: 26px; fill: currentColor; }
.vmic-btn.on { color: #f56055; }
.ludo .vbtn { color: #fff; }

/* ---- feuille de sortie audio ---- */
.vout-sheet { border: 0; border-radius: 18px 18px 0 0; padding: 0; background: var(--panel); color: var(--text); width: 100%; max-width: 440px; margin: auto auto 0; }
.vout-sheet::backdrop { background: #000a; }
.vout-h { padding: 14px 16px 6px; font-weight: 700; font-size: 15px; }
.vout-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; color: var(--text); padding: 13px 16px; font-size: 15px; cursor: pointer; text-align: left; font-family: inherit; }
.vout-item:hover { background: var(--panel-2); }
.vout-item.sel { color: #f59e0b; font-weight: 600; }
.vout-item svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.vout-item .chk { margin-left: auto; }

/* Zone de messages dans la fenêtre Morpion : utiliser les tokens de l'app (sinon bulle « Toi » = blanc sur blanc). */
.mp .ludo-chat-list p.mine { background: var(--mine); color: var(--text); }
.mp .ludo-chat-list p.theirs { background: var(--panel-2); color: var(--text); }
.mp .ludo-chat-in input { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.mp .ludo-chat-in button { background: var(--mine); }
.mp .ludo-chat-in button svg { fill: var(--text); }

/* Thème Spider sur la fenêtre Morpion (discussion au thème) : fond sombre teinté + titre rose. */
.mp.spider { background: radial-gradient(circle at 50% 0%, #1b0a1f, #0c0710 70%); }
.mp.spider[data-hero="woman"] { background: radial-gradient(circle at 50% 0%, #240609, #0d0305 70%); }
.mp.spider .mp-title { color: #ff2e88; }
.mp.spider[data-hero="woman"] .mp-title { color: #e8112f; }
.mp.spider .mp-ic svg { stroke: currentColor; }

/* ---- Photos de profil + couleurs par thème dans les jeux ---- */
.mp-pic img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.ludo-player .av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
/* adversaire : plus de jaune par défaut ; la marque suit la couleur du joueur */
.mp-player.you { --c: #4a9ff5; }
.mp .mp-player .mp-mark { color: var(--c); }
/* Spider : couleur de l'héroïne du compte au thème (Narindra) */
.mp[data-hero="gwen"]  .mp-player.you { --c: #ff2e88; }
.mp[data-hero="woman"] .mp-player.you { --c: #e8112f; }
.mp.spider .mp-player.me { --c: #ffffff; }
/* Poudlard : couleurs de la maison (Ved'ma) */
.mp[data-house] .mp-player.you { --c: var(--house); }
.mp[data-house] .mp-player.me  { --c: var(--house-2); }
