/* ==========================================================================
   BEST OF RESTO — Jeux (pages publiques + mode salle du back-office)
   ========================================================================== */
:root {
  --g-night: #121A21;
  --g-night-2: #1C2630;
  --g-line: rgba(193, 152, 66, .26);
  --g-line-2: rgba(244, 239, 230, .1);
  --g-muted: rgba(244, 239, 230, .66);
  --g-ink: #1C2630;
  --g-spring: cubic-bezier(.34, 1.56, .64, 1);
  --g-out: cubic-bezier(.16, 1, .3, 1);
}

/* ---------- Mise en page des pages de jeu ---------- */
.gp { padding-top: calc(var(--hdr-h, 76px) + 1.4rem); padding-bottom: 6rem; }
.gp__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gp__sound { display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 .95rem; border-radius: 999px; background: rgba(254, 253, 249, .05); border: 1px solid var(--g-line); color: var(--gold-2); font-size: .78rem; font-weight: 800; transition: background .25s, color .25s, transform .3s var(--g-spring); }
.gp__sound:hover { background: rgba(193, 152, 66, .14); }
.gp__sound:active { transform: scale(.94); }
.gp__sound.is-muted { color: var(--g-muted); border-color: var(--g-line-2); }
.gp__sound .i { width: 18px; height: 18px; }
.gp__sounds { display: flex; align-items: center; gap: .45rem; }
.gp-card--free { border-color: var(--g-line); background: linear-gradient(135deg, rgba(193, 152, 66, .16), rgba(36, 48, 60, .45)); }
.gp-card--free p { margin: 0; font-size: .86rem; color: var(--g-muted); }
.gp-free-note { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; background: rgba(193, 152, 66, .14); border: 1px solid var(--g-line); color: var(--gold-2); font-size: .76rem; font-weight: 800; }
.gp-free-note .i { width: 15px; height: 15px; }
.gp__back { display: inline-flex; align-items: center; gap: .45rem; font-size: .84rem; font-weight: 700; color: var(--g-muted); transition: color .3s; }
.gp__back:hover { color: var(--gold); }
.gp__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .85fr); gap: clamp(1.4rem, 3vw, 2.6rem); align-items: start; margin-top: 1.2rem; }
.gp__stage { position: relative; isolation: isolate; min-height: 600px; display: grid; place-items: center; padding: clamp(1.2rem, 3vw, 2.4rem); border-radius: 40px; overflow: hidden; border: 1px solid var(--g-line); background: radial-gradient(ellipse 70% 50% at 50% 100%, rgba(224, 90, 50, .16), transparent 70%), radial-gradient(ellipse 60% 60% at 50% 30%, rgba(193, 152, 66, .1), transparent 70%), linear-gradient(180deg, #17222C, #0E151B); }
.gp__stage > .smoke { z-index: -1; opacity: .6; }
.gp__inner { position: relative; width: 100%; display: grid; place-items: center; }
.gp__loading { display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--g-line); border-top-color: var(--gold); animation: gspin .8s linear infinite; }
@keyframes gspin { to { transform: rotate(360deg); } }
.gp__side { position: sticky; top: calc(var(--hdr-h, 76px) + 1.2rem); }
.gp__title { font-size: clamp(2.8rem, 5.4vw, 4.6rem) !important; }
.gp__sub { margin: .3rem 0 0; font-size: 1.9rem; color: var(--gold-2); line-height: 1.1; }
.gp-card { margin-top: 1rem; padding: 1.3rem 1.4rem; border-radius: 22px; background: rgba(36, 48, 60, .45); border: 1px solid var(--g-line-2); }
.gp-card h2 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .8rem; font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.gp-prizes { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.gp-prizes li { display: grid; grid-template-columns: 14px auto; column-gap: .7rem; align-items: center; }
.gp-prizes i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px rgba(193, 152, 66, .5); grid-row: span 2; }
.gp-prizes b { font-size: .92rem; }
.gp-prizes span { grid-column: 2; font-size: .78rem; color: var(--g-muted); }
.gp-bob { display: flex; align-items: center; gap: 1rem; }
.gp-bob p { margin: 0; font-size: .88rem; color: var(--g-muted); }
.gp-bob b { color: var(--cream); }
@media (max-width: 980px) {
  .gp__grid { grid-template-columns: 1fr; }
  .gp__side { position: static; order: -1; }
  .gp__stage { min-height: 520px; border-radius: 30px; }
  .gp-card { display: none; }
  .gp-card.gp-card--free { display: block; margin-top: .8rem; }
  .gp__side .gz-fair { display: none; }
}
@media (max-width: 980px) { .gp--roue .gp-card:last-of-type { display: block; } }

/* États communs : non connecté, gain à utiliser */
.gp-gate, .gp-lock { display: grid; justify-items: center; gap: .8rem; max-width: 460px; text-align: center; padding: 1rem; }
.gp-gate__icon, .gp-lock__icon { width: 74px; height: 74px; border-radius: 24px; display: grid; place-items: center; background: rgba(193, 152, 66, .14); color: var(--gold); border: 1px solid var(--g-line); }
.gp-lock__icon { background: linear-gradient(135deg, #E2C27A, #C19842); color: var(--g-night); }
.gp-gate__icon .i, .gp-lock__icon .i { width: 34px; height: 34px; }
.gp-gate h2, .gp-lock h2 { margin: .3rem 0 0; font-family: var(--f-display); font-weight: 400; font-size: 2.6rem; line-height: .95; text-transform: uppercase; }
.gp-gate p, .gp-lock p { margin: 0; color: var(--g-muted); }
.gp-gate__cta { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: .6rem; }
.gp-code { display: inline-flex; align-items: center; gap: .8rem; padding: .7rem .8rem .7rem 1.1rem; border-radius: 16px; background: rgba(254, 253, 249, .06); border: 1px dashed var(--g-line); }
.gp-code small { font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); }
.gp-code b { font-family: var(--f-display); font-weight: 400; font-size: 2rem; letter-spacing: .1em; color: var(--gold-2); }

/* ---------- Dé 3D ---------- */
.dice-stage { position: relative; flex: none; width: 170px; height: 170px; display: grid; place-items: center; perspective: 650px; perspective-origin: 50% 30%; }
.dice { --s: 82px; position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d; transform: rotateX(-52deg) rotateY(35deg) rotateX(-90deg) rotateZ(0deg); transition: transform 1.55s cubic-bezier(.16, .9, .24, 1.04); }
.dice__face { position: absolute; inset: 0; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); place-items: center; padding: 14%; border-radius: 20%; background: linear-gradient(145deg, #FFFEFA, #E9DFCC); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05), inset 0 -8px 14px rgba(142, 110, 44, .18); transition: box-shadow .5s, background .5s; }
.dice__face.is-top { background: linear-gradient(145deg, #FFF8E4, #F1DFAE); box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 18px rgba(193, 152, 66, .45), 0 0 26px rgba(193, 152, 66, .55); }
.dice__face i { width: 72%; aspect-ratio: 1; border-radius: 50%; background: var(--g-ink); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .55); }
.dice__face--1 i { background: var(--ember); grid-area: 2 / 2; width: 90%; }
.dice__face--2 i:nth-child(1) { grid-area: 1 / 1; } .dice__face--2 i:nth-child(2) { grid-area: 3 / 3; }
.dice__face--3 i:nth-child(1) { grid-area: 1 / 1; } .dice__face--3 i:nth-child(2) { grid-area: 2 / 2; } .dice__face--3 i:nth-child(3) { grid-area: 3 / 3; }
.dice__face--4 i:nth-child(1) { grid-area: 1 / 1; } .dice__face--4 i:nth-child(2) { grid-area: 1 / 3; } .dice__face--4 i:nth-child(3) { grid-area: 3 / 1; } .dice__face--4 i:nth-child(4) { grid-area: 3 / 3; }
.dice__face--5 i:nth-child(1) { grid-area: 1 / 1; } .dice__face--5 i:nth-child(2) { grid-area: 1 / 3; } .dice__face--5 i:nth-child(3) { grid-area: 2 / 2; } .dice__face--5 i:nth-child(4) { grid-area: 3 / 1; } .dice__face--5 i:nth-child(5) { grid-area: 3 / 3; }
.dice__face--6 i:nth-child(1) { grid-area: 1 / 1; } .dice__face--6 i:nth-child(2) { grid-area: 2 / 1; } .dice__face--6 i:nth-child(3) { grid-area: 3 / 1; } .dice__face--6 i:nth-child(4) { grid-area: 1 / 3; } .dice__face--6 i:nth-child(5) { grid-area: 2 / 3; } .dice__face--6 i:nth-child(6) { grid-area: 3 / 3; }
.dice__face--1 { transform: translateZ(calc(var(--s) / 2)); }
.dice__face--6 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.dice__face--2 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.dice__face--5 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.dice__face--3 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.dice__face--4 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }
.dice-shadow { position: absolute; bottom: 14%; left: 50%; width: 52%; height: 9%; translate: -50% 0; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .55), transparent 70%); }
.dice-stage.is-rolling { animation: gHop 1.55s var(--g-out); }
.dice-stage.is-rolling .dice-shadow { animation: gShadow 1.55s var(--g-out); }
.dice-stage.is-waiting .dice { animation: gWait .18s ease-in-out infinite alternate; }
@keyframes gHop { 22% { transform: translateY(-46px); } 50% { transform: translateY(0); } 64% { transform: translateY(-12px); } 78% { transform: translateY(0); } 88% { transform: translateY(-3px); } }
@keyframes gShadow { 22% { transform: scale(.5); opacity: .4; } 50% { transform: scale(1); opacity: 1; } 64% { transform: scale(.8); } }
@keyframes gWait { to { translate: 0 -4px; } }

/* Jeu du dé */
.gd { display: grid; justify-items: center; gap: 1.1rem; width: 100%; max-width: 540px; text-align: center; }
.gd__table { display: grid; place-items: center; width: min(320px, 74vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #2A3846, #121A21 68%); box-shadow: 0 0 0 10px rgba(193, 152, 66, .18), 0 0 0 11px rgba(193, 152, 66, .5), inset 0 20px 50px rgba(0, 0, 0, .55), 0 40px 60px -30px #000; }
.gd__dice { width: 250px; height: 250px; }
.gd__dice .dice { --s: 112px; }
.gd__streak { display: flex; gap: .7rem; }
.gd__streak i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; border: 2px dashed var(--g-line); color: var(--g-muted); transition: background .5s, border-color .5s, transform .6s var(--g-spring), box-shadow .5s; }
.gd__streak i b { font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; opacity: .35; }
.gd__streak i.is-on { border-style: solid; border-color: var(--gold); background: linear-gradient(135deg, #E2C27A, #C19842); color: var(--g-night); transform: translateY(-4px) rotate(-6deg); box-shadow: 0 10px 26px -6px rgba(193, 152, 66, .7); }
.gd__streak i.is-on b { opacity: 1; }
.gd__msg { min-height: 1.6em; margin: 0; font-weight: 700; font-size: 1.05rem; }
.gd__roll { min-width: 240px; }
.gd__left { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem; font-size: .82rem; color: var(--g-muted); }
.gd__left i { width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(193, 152, 66, .6); transition: background .4s, box-shadow .4s; }
.gd__left i.is-used { background: rgba(244, 239, 230, .14); box-shadow: none; }
.gd__left span { width: 100%; margin-top: .3rem; }
.gd__left b { color: var(--cream); }
.gd__history { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem; }
.gd__history small { width: 100%; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); }
.mini-die { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: rgba(254, 253, 249, .9); color: var(--g-ink); font-weight: 800; font-size: .82rem; }
.mini-die--6 { background: linear-gradient(135deg, #E2C27A, #C19842); }

/* ---------- Roue ---------- */
.gw { display: grid; justify-items: center; gap: 1.3rem; width: 100%; }
.gw__wheel { width: min(470px, 84vw); aspect-ratio: 1; }
.wh { position: relative; width: 100%; height: 100%; }
.wh__glow { position: absolute; inset: -9%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(193, 152, 66, .3), transparent 62%); animation: gGlow 3s ease-in-out infinite; }
@keyframes gGlow { 50% { opacity: .55; transform: scale(.96); } }
.wh__rot { width: 100%; height: 100%; will-change: transform; filter: drop-shadow(0 28px 40px rgba(0, 0, 0, .6)); }
.wh__rot svg { width: 100%; height: 100%; display: block; }
.wh__seg text { font-family: var(--f-display); letter-spacing: .04em; pointer-events: none; }
.wh__seg path { transition: filter .4s; }
.wh__seg.is-win path { filter: brightness(1.35) saturate(1.2); animation: gWin 1s ease-in-out infinite alternate; }
@keyframes gWin { to { filter: brightness(1.7) saturate(1.3); } }
.wh__hub { color: var(--gold); }
.wh__bulb { fill: #FFF3D1; animation: gBulb 1.2s steps(2) infinite; }
.wh__bulb.is-alt { animation-delay: -.6s; }
.wh.is-spinning .wh__bulb { animation-duration: .24s; }
@keyframes gBulb { 50% { fill: #8E6E2C; } }
.wh__pointer { position: absolute; top: -5%; left: 50%; width: 11%; translate: -50% 0; transform-origin: 50% 22%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)); z-index: 2; }
.wh__pointer svg { width: 100%; height: auto; display: block; }
.wh__pointer.is-tick { animation: gTick .14s ease-out; }
@keyframes gTick { 40% { transform: rotate(-16deg); } }
.gw__form { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: .7rem; }
.gw__form .field { min-width: 210px; }
.gw__input { text-align: center; text-transform: uppercase; font-family: var(--f-display) !important; font-size: 1.6rem !important; letter-spacing: .18em; height: 56px !important; }
.gw__codes { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem; max-width: 520px; text-align: center; }
.gw__codes small { width: 100%; color: var(--g-muted); font-size: .8rem; }

/* ---------- Puissance 4 ---------- */
.p4 { position: relative; display: grid; gap: 1rem; width: 100%; max-width: 640px; }
.p4__top { display: flex; align-items: center; gap: 1rem; min-height: 74px; }
.p4__speech { position: relative; flex: 1; margin: 0; padding: .75rem 1rem; border-radius: 18px 18px 18px 4px; background: var(--cream); color: var(--g-ink); font-weight: 700; font-size: .9rem; box-shadow: 0 14px 30px -14px #000; }
.p4__speech.is-in { animation: gPop .45s var(--g-spring); }
@keyframes gPop { from { opacity: 0; transform: translateY(6px) scale(.96); } }
.p4__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.p4__series { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.p4__series small { font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); }
.p4__slots { display: flex; gap: .35rem; }
.p4__slots i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--g-line); color: var(--g-night); }
.p4__slots i .i { width: 14px; height: 14px; stroke-width: 3; }
.p4__slots i.is-won { background: linear-gradient(135deg, #E2C27A, #C19842); border-color: transparent; }
.p4__slots i.is-lost { background: rgba(224, 90, 50, .25); border-color: rgba(224, 90, 50, .6); color: var(--ember-2); }
.p4__slots i.is-draw { background: rgba(244, 239, 230, .15); }
.p4__slots i.is-live { border-color: var(--ember); animation: gLive 1.2s ease-in-out infinite; }
@keyframes gLive { 50% { box-shadow: 0 0 0 6px rgba(224, 90, 50, .2); } }
.p4__wins { font-size: .82rem; color: var(--g-muted); }
.p4__wins b { font-family: var(--f-display); font-weight: 400; font-size: 1.4rem; color: var(--gold-2); }
.p4__overlay { position: absolute; inset: 64px 0 46px; z-index: 6; display: grid; place-items: center; padding: 1rem; border-radius: 26px; background: rgba(11, 16, 21, .74); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: gFade .4s; }
@keyframes gFade { from { opacity: 0; } }
.p4-card { display: grid; justify-items: center; gap: .7rem; max-width: 420px; padding: 1.6rem; text-align: center; border-radius: 24px; background: var(--g-night-2); border: 1px solid var(--g-line); box-shadow: 0 30px 60px -20px #000; animation: gPop .5s var(--g-spring); }
.p4-card h3 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 2.2rem; line-height: 1; text-transform: uppercase; }
.p4-card p { margin: 0; color: var(--g-muted); font-size: .9rem; }
.p4-card .t-ember { color: var(--ember-2); }
.p4-code { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.p4-code .input { width: 170px; text-align: center; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; }

.c4 { position: relative; padding-top: calc(100% / 7); user-select: none; -webkit-user-select: none; }
.c4__ghost { position: absolute; top: 0; left: calc(var(--c, 3) * 100% / 7); width: calc(100% / 7); aspect-ratio: 1; display: grid; place-items: center; opacity: 0; transition: left .18s var(--g-out), opacity .2s; pointer-events: none; }
.c4__ghost::before { content: ''; width: 72%; height: 72%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FF9A73, var(--ember) 60%, #A63D1C); box-shadow: 0 0 20px rgba(224, 90, 50, .5); animation: gBob 1s ease-in-out infinite; }
.c4__ghost.is-on { opacity: .9; }
@keyframes gBob { 50% { transform: translateY(-5px); } }
.c4__board { position: relative; isolation: isolate; aspect-ratio: 7 / 6; }
.c4__tokens { position: absolute; inset: 0; z-index: 1; }
.c4-tok { position: absolute; left: calc(var(--c) * 100% / 7); top: calc((5 - var(--r)) * 100% / 6); width: calc(100% / 7); height: calc(100% / 6); display: grid; place-items: center; }
.c4-tok::before { content: ''; width: 79%; height: 79%; border-radius: 50%; transition: box-shadow .4s, opacity .4s; }
.c4-tok--p1::before { background: radial-gradient(circle at 34% 28%, #FFB08F 0%, #FF7A4D 22%, var(--ember) 55%, #9C3416 100%); box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .3), inset 0 0 0 4px rgba(255, 255, 255, .08); }
.c4-tok--p2::before { background: radial-gradient(circle at 34% 28%, #FFF2C6 0%, #E2C27A 25%, var(--gold) 58%, #6E5321 100%); box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .3), inset 0 0 0 4px rgba(255, 255, 255, .1); }
.c4-tok svg { position: absolute; width: 24%; height: 30%; color: rgba(28, 38, 48, .45); }
.c4-tok.is-win::before { box-shadow: 0 0 0 4px #FEFDF9, 0 0 30px 10px rgba(255, 210, 120, .75); animation: gTokWin .9s ease-in-out infinite alternate; }
@keyframes gTokWin { to { transform: scale(1.08); } }
.c4.is-over .c4-tok:not(.is-win) { opacity: .4; }
.c4__front { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; border-radius: 4.5%; filter: drop-shadow(0 26px 30px rgba(0, 0, 0, .55)); }
.c4__board::after { content: ''; position: absolute; inset: -6px; z-index: -1; border-radius: 6%; background: linear-gradient(135deg, #E2C27A, #8E6E2C 50%, #C19842); box-shadow: 0 40px 60px -30px #000; }
.c4__board::before { content: ''; position: absolute; inset: 0; z-index: 0; border-radius: 4.5%; background: #070B0F; }
.c4__cols { position: absolute; inset: calc(-100% / 6) 0 0; z-index: 3; display: grid; grid-template-columns: repeat(7, 1fr); }
.c4__cols button { border-radius: 14px; transition: background .2s; -webkit-tap-highlight-color: transparent; }
.c4.is-active .c4__cols button { cursor: pointer; }
.c4.is-active .c4__cols button:hover { background: linear-gradient(180deg, rgba(254, 253, 249, .06), rgba(254, 253, 249, .02)); }
.c4.is-active .c4__cols button:focus-visible { outline: 2px solid var(--gold); outline-offset: -4px; }
.c4.is-shake { animation: gShake .4s; }
@keyframes gShake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* Fin de partie : ligne gagnante, bandeau, confettis, plateau qui tremble */
.c4__line { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.c4__line line { stroke: #FFF6DC; stroke-width: 15; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: c4Line .55s .1s var(--g-out) forwards; }
.c4__line--won { filter: drop-shadow(0 0 6px #FF9A73) drop-shadow(0 0 18px #E05A32); }
.c4__line--lost { filter: drop-shadow(0 0 6px #F3DFA8) drop-shadow(0 0 18px #C19842); }
@keyframes c4Line { to { stroke-dashoffset: 0; } }
.c4-banner { position: absolute; left: 50%; top: 50%; z-index: 5; display: grid; justify-items: center; width: max-content; max-width: 104%; translate: -50% -50%; text-align: center; pointer-events: none; }
.c4-banner b { font-family: var(--f-display); font-weight: 400; font-size: clamp(3.2rem, 15vw, 7rem); line-height: .88; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; }
.c4-banner span { margin-top: .5rem; padding: .4rem 1rem; border-radius: 999px; background: rgba(11, 16, 21, .82); border: 1px solid var(--g-line); color: var(--cream); font-weight: 800; font-size: clamp(.78rem, 2.6vw, .95rem); animation: c4Rise .5s .35s var(--g-out) both; }
.c4-banner--won::before { content: ''; position: absolute; left: 50%; top: 45%; z-index: -1; width: 190%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 228, 160, .26) 0deg 8deg, transparent 8deg 20deg); -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%); mask: radial-gradient(circle, #000 18%, transparent 66%); animation: gspin 9s linear infinite, gFade .6s both; }
.c4-banner--won b { background: linear-gradient(180deg, #FFF8E6 10%, #E2C27A 50%, #C19842 90%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 5px 0 #6E5321) drop-shadow(0 16px 26px rgba(0, 0, 0, .7)); animation: c4Slam .75s var(--g-spring) both; }
.c4-banner--lost b { color: #FF5A3C; text-shadow: 0 0 26px rgba(255, 70, 40, .75), 3px 0 0 rgba(0, 220, 255, .5), -3px 0 0 rgba(255, 0, 90, .55), 0 10px 26px rgba(0, 0, 0, .8); animation: c4Slam .55s var(--g-spring) both, c4Glitch 1.8s .7s steps(1) infinite; }
.c4-banner--draw b { color: var(--cream); text-shadow: 0 10px 26px rgba(0, 0, 0, .8); animation: c4Rise .6s var(--g-out) both; }
@keyframes c4Slam { from { opacity: 0; transform: scale(2.7) rotate(-7deg); } 55% { opacity: 1; } }
@keyframes c4Rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes c4Glitch { 0%, 100% { transform: none; } 6% { transform: translate(-4px, 1px) skewX(-9deg); } 8% { transform: translate(4px, -1px); } 10% { transform: none; } 54% { transform: translate(3px, 0) skewX(7deg); } 56% { transform: none; } }
.c4.is-glory .c4__board::after { animation: c4Glory 1.1s ease-in-out 2; }
@keyframes c4Glory { 50% { box-shadow: 0 0 0 4px rgba(255, 230, 170, .6), 0 0 70px 14px rgba(224, 90, 50, .55), 0 40px 60px -30px #000; filter: brightness(1.35); } }
.c4.is-quake .c4__board { animation: c4Quake .65s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes c4Quake { 10%, 90% { transform: translateX(-2px) rotate(-.3deg); } 20%, 80% { transform: translateX(5px) rotate(.4deg); } 30%, 50%, 70% { transform: translateX(-9px) rotate(-.6deg); } 40%, 60% { transform: translateX(9px) rotate(.6deg); } }
.c4-flash { position: absolute; inset: -8px; z-index: 6; border-radius: 6%; pointer-events: none; box-shadow: inset 0 0 90px 26px rgba(230, 40, 25, .6); animation: c4Flash 1.4s ease-out forwards; }
@keyframes c4Flash { from { opacity: 0; } 12% { opacity: 1; } to { opacity: 0; } }
.c4-confetti { position: fixed; inset: 0; z-index: 150; width: 100%; height: 100%; pointer-events: none; }

/* BOB, le robot de Best Of */
.bob { position: relative; flex: none; width: 78px; height: 66px; display: flex; align-items: center; justify-content: center; gap: 14px; border-radius: 20px; background: linear-gradient(180deg, #2B3A49, #16212C); border: 2px solid var(--gold); box-shadow: 0 12px 26px -10px #000, inset 0 2px 0 rgba(255, 255, 255, .08); margin-top: 14px; }
.bob__ant { position: absolute; top: -17px; left: 50%; width: 3px; height: 15px; translate: -50% 0; background: var(--gold); border-radius: 2px; }
.bob__ant::after { content: ''; position: absolute; top: -8px; left: 50%; width: 10px; height: 10px; translate: -50% 0; border-radius: 50%; background: var(--ember-2); box-shadow: 0 0 12px 3px rgba(255, 122, 77, .7); animation: gAnt 1.8s ease-in-out infinite; }
@keyframes gAnt { 50% { opacity: .55; } }
.bob__eye { position: relative; width: 15px; height: 15px; border-radius: 50%; background: var(--ember-2); box-shadow: 0 0 12px 3px rgba(255, 122, 77, .65); animation: gBlink 4.5s infinite; transition: height .3s, border-radius .3s, background .3s; }
@keyframes gBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.bob__mouth { position: absolute; bottom: 9px; left: 50%; width: 24px; height: 4px; translate: -50% 0; border-radius: 4px; background: rgba(254, 253, 249, .32); transition: all .3s; }
.bob--think .bob__eye { animation: gScan .7s ease-in-out infinite alternate; }
.bob--think .bob__ant::after { animation-duration: .35s; }
@keyframes gScan { from { transform: translateX(-4px); } to { transform: translateX(4px); } }
.bob--happy .bob__eye { height: 8px; border-radius: 15px 15px 2px 2px; }
.bob--happy .bob__mouth { height: 8px; width: 26px; border-radius: 0 0 14px 14px; background: var(--gold); }
.bob--sad .bob__eye { height: 7px; border-radius: 2px 2px 15px 15px; background: #8DC2F0; box-shadow: 0 0 12px 3px rgba(91, 164, 230, .6); }
.bob--sad .bob__mouth { width: 18px; height: 6px; border-radius: 14px 14px 0 0; bottom: 8px; }
.bob--smug .bob__eye:last-of-type { height: 4px; border-radius: 4px; }
.bob--smug .bob__mouth { width: 18px; translate: -30% 0; rotate: -8deg; }
/* BOB gagne : il saute de joie, yeux rouges incandescents */
.bob--victory { animation: bobHop .45s ease-in-out 5; }
.bob--victory .bob__eye { height: 9px; border-radius: 15px 15px 3px 3px; background: #FF3B2F; box-shadow: 0 0 20px 6px rgba(255, 59, 47, .85); animation: none; }
.bob--victory .bob__mouth { width: 30px; height: 10px; border-radius: 0 0 16px 16px; background: var(--gold); }
.bob--victory .bob__ant::after { animation-duration: .25s; }
@keyframes bobHop { 50% { transform: translateY(-9px) rotate(-5deg); } }
/* BOB perd : court-circuit, yeux en croix */
.bob--ko { animation: bobKo 1s var(--g-out) forwards; }
.bob--ko .bob__eye { background: none; box-shadow: none; animation: none; }
.bob--ko .bob__eye::before, .bob--ko .bob__eye::after { content: ''; position: absolute; left: 50%; top: 50%; width: 17px; height: 3px; border-radius: 2px; background: #8DC2F0; box-shadow: 0 0 8px rgba(91, 164, 230, .8); translate: -50% -50%; rotate: 45deg; }
.bob--ko .bob__eye::after { rotate: -45deg; }
.bob--ko .bob__mouth { width: 20px; height: 3px; rotate: 8deg; }
.bob--ko .bob__ant::after { background: #8DC2F0; box-shadow: 0 0 12px 3px rgba(91, 164, 230, .7); animation: gAnt .14s steps(2) infinite; }
@keyframes bobKo { 25% { transform: rotate(-14deg) translateX(-4px); } 50% { transform: rotate(9deg); } 75% { transform: rotate(-5deg); } to { transform: rotate(-7deg) translateY(3px); } }
.bob--sm { width: 56px; height: 48px; gap: 10px; border-radius: 15px; margin-top: 10px; }
.bob--sm .bob__eye { width: 11px; height: 11px; }

@media (max-width: 560px) {
  .p4__overlay { inset: 60px 0 50px; }
  .bob { width: 64px; height: 54px; gap: 11px; }
  .bob__eye { width: 12px; height: 12px; }
  .p4__speech { font-size: .82rem; }
  .gp__stage { padding: 1rem .7rem; }
}

/* ---------- Réseau : hors connexion, pause ---------- */
.gp-offline { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem; width: 100%; max-width: 640px; margin: 0 0 1rem; padding: .6rem 1rem; border-radius: 14px; background: rgba(91, 164, 230, .12); border: 1px solid rgba(91, 164, 230, .4); color: #BFDDF7; font-size: .84rem; text-align: center; }
.gp-offline .i { width: 18px; height: 18px; flex: none; }
.gp-offline b { color: #FEFDF9; }
.gp-offline .btn { margin-left: .4rem; }
.gp-net { position: absolute; inset: 0; z-index: 12; display: grid; place-items: center; padding: 1rem; background: rgba(11, 16, 21, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: gFade .35s; }
.gp-net__icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: rgba(91, 164, 230, .14); color: #8DC2F0; border: 1px solid rgba(91, 164, 230, .4); }
.gp-net__icon .i { width: 30px; height: 30px; }
.gp-net__note { color: var(--g-muted); font-size: .76rem; }
.gp-net__note b { color: var(--cream); }

/* ---------- Fenêtre de victoire ---------- */
.gwin { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; padding: 20px; }
.gwin__bg { position: absolute; inset: 0; background: rgba(5, 8, 11, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s; }
.gwin.is-open .gwin__bg { opacity: 1; }
.gwin__box { position: relative; isolation: isolate; overflow: hidden; width: min(460px, 100%); display: grid; justify-items: center; gap: .8rem; padding: 2.2rem 1.6rem 1.6rem; text-align: center; border-radius: 32px; background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(193, 152, 66, .32), transparent 70%), var(--g-night-2); border: 1px solid rgba(193, 152, 66, .6); box-shadow: 0 50px 100px -30px #000; opacity: 0; transform: scale(.85) translateY(20px); transition: opacity .35s, transform .6s var(--g-spring); }
.gwin.is-open .gwin__box { opacity: 1; transform: none; }
.gwin__burst { position: absolute; top: -120px; left: 50%; z-index: -1; width: 420px; height: 420px; translate: -50% 0; border-radius: 50%; background: repeating-conic-gradient(rgba(226, 194, 122, .2) 0deg 10deg, transparent 10deg 24deg); mask: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); animation: gspin 14s linear infinite; }
.gwin__trophy { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 28px; background: linear-gradient(135deg, #F3DFA8, #C19842 60%, #8E6E2C); color: var(--g-night); box-shadow: 0 16px 40px -10px rgba(193, 152, 66, .8); animation: gTrophy .9s var(--g-spring); }
.gwin__trophy .i { width: 44px; height: 44px; }
@keyframes gTrophy { from { transform: scale(0) rotate(-30deg); } }
.gwin h2 { margin: .2rem 0 0; font-family: var(--f-display); font-weight: 400; font-size: 3rem; line-height: .95; text-transform: uppercase; }
.gwin__text { margin: 0; color: var(--g-muted); }
.gwin__coupon { width: 100%; display: grid; justify-items: center; gap: .6rem; padding: 1.1rem; border-radius: 20px; background: var(--cream); color: var(--g-ink); }
.gwin__coupon .gp-code { background: rgba(28, 38, 48, .06); border-color: rgba(28, 38, 48, .2); }
.gwin__coupon .gp-code small { color: rgba(28, 38, 48, .55); }
.gwin__coupon .gp-code b { color: var(--g-ink); }
.gwin__label { font-family: var(--f-display); font-weight: 400; font-size: 1.9rem; line-height: 1; }
.gwin__exp, .gwin__how { display: flex; align-items: center; justify-content: center; gap: .35rem; margin: 0; font-size: .76rem; color: rgba(28, 38, 48, .65); }

@media (prefers-reduced-motion: reduce) {
  .wh__bulb, .gwin__burst, .gz-mini-wheel svg { animation: none !important; }
}

/* ---------- Puissance 4 : qui commence ? ---------- */
.p4__overlay { display: flex; overflow-y: auto; overscroll-behavior: contain; }
.p4__overlay > .p4-card { margin: auto; }
.p4-first { display: grid; justify-items: center; gap: .45rem; width: 100%; }
.p4-first > span { font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--g-muted); }
.p4-first__opts { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(254, 253, 249, .06); border: 1px solid var(--g-line-2); }
.p4-first__opts button { display: inline-flex; align-items: center; gap: .45rem; height: 38px; padding: 0 1.1rem; border-radius: 999px; font-weight: 800; font-size: .86rem; color: var(--g-muted); transition: background .3s, color .3s, transform .3s var(--g-spring); }
.p4-first__opts button.is-on { background: var(--cream); color: var(--g-ink); box-shadow: 0 8px 20px -10px #000; }
.p4-first__opts button:active { transform: scale(.95); }
.p4-first__dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.p4-first__dot--p1 { background: radial-gradient(circle at 34% 28%, #FFB08F, #FF7A4D 30%, var(--ember) 60%, #9C3416); }
.p4-first__dot--p2 { background: radial-gradient(circle at 34% 28%, #FFF2C6, #E2C27A 30%, var(--gold) 62%, #6E5321); }
.p4-first small { font-size: .74rem; color: var(--g-muted); }

/* ---------- Puissance 4 : note de jeu (écran de résultat) ---------- */
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }
.p4r-mini { display: inline-flex; align-items: baseline; gap: .45rem; padding: .35rem .95rem; border-radius: 999px; background: rgba(193, 152, 66, .14); border: 1px solid var(--g-line); }
.p4r-mini b { font-family: var(--f-display); font-weight: 400; font-size: 1.7rem; line-height: 1; color: var(--gold-2); }
.p4r-mini span { font-size: .8rem; font-weight: 800; color: var(--cream); }
.p4r-see { font-size: .78rem; font-weight: 700; color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }

.p4m { position: fixed; inset: 0; z-index: 420; display: grid; place-items: center; padding: 20px; }
.p4m__bg { position: absolute; inset: 0; background: rgba(5, 8, 11, .74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .35s; }
.p4m.is-open .p4m__bg { opacity: 1; }
.p4m__box {
  position: relative; width: min(560px, 100%); max-height: calc(100svh - 40px); overflow-y: auto; overscroll-behavior: contain;
  border-radius: 32px; border: 1px solid var(--g-line); color: var(--cream); scrollbar-width: thin; scrollbar-color: rgba(193, 152, 66, .4) transparent;
  background: radial-gradient(ellipse 120% 60% at 50% 0%, rgba(193, 152, 66, .14), transparent 60%), linear-gradient(180deg, #18222C, #10171E);
  box-shadow: 0 50px 100px -30px #000, inset 0 1px 0 rgba(255, 255, 255, .05);
  opacity: 0; transform: translateY(26px) scale(.96); transition: opacity .35s, transform .6s var(--g-spring);
}
.p4m.is-open .p4m__box { opacity: 1; transform: none; }
.p4m__x { position: absolute; top: 14px; right: 14px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(254, 253, 249, .08); color: var(--cream); transition: background .25s, transform .4s var(--g-spring); }
.p4m__x:hover { background: rgba(254, 253, 249, .16); transform: rotate(90deg); }
.p4m__x .i { width: 18px; height: 18px; }

.p4m__hero { display: grid; justify-items: center; gap: .55rem; padding: 2.1rem 3.6rem 1.3rem; text-align: center; }
.p4m__hero--won { background: radial-gradient(ellipse 80% 75% at 50% 0%, rgba(61, 190, 122, .22), transparent 70%); }
.p4m__hero--lost { background: radial-gradient(ellipse 80% 75% at 50% 0%, rgba(224, 90, 50, .2), transparent 70%); }
.p4m__outcome { font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--g-muted); }
.p4m__ring {
  position: relative; width: 170px; height: 170px; margin: .35rem 0 .15rem; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: conic-gradient(from 210deg, var(--ember) 0%, var(--gold) calc(var(--p) * .55%), var(--gold-2) calc(var(--p) * 1%), rgba(254, 253, 249, .07) calc(var(--p) * 1%));
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)); animation: p4mRing 1.6s var(--g-out);
}
.p4m__ring::before { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: radial-gradient(circle at 50% 28%, #25333F, #121A21 72%); box-shadow: inset 0 2px 10px rgba(0, 0, 0, .5); }
.p4m__ring b, .p4m__ring small { position: relative; }
.p4m__ring b { font-family: var(--f-display); font-weight: 400; font-size: 4.2rem; line-height: .85; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.p4m__ring small { margin-top: .2rem; font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--g-muted); }
@keyframes p4mRing { from { --p: 0; } }
.p4m__hero h2 { margin: .1rem 0 0; font-family: var(--f-display); font-weight: 400; font-size: 2.7rem; line-height: 1; letter-spacing: .02em; text-transform: uppercase; color: var(--gold-2); text-shadow: 0 6px 24px rgba(193, 152, 66, .3); }
.p4m__hero p { margin: 0; max-width: 38ch; font-size: .92rem; color: var(--g-muted); }
.p4m__badge { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem 1rem; border-radius: 999px; background: linear-gradient(135deg, #F3DFA8, #C19842); color: var(--g-ink); font-size: .8rem; font-weight: 800; box-shadow: 0 10px 24px -10px rgba(193, 152, 66, .8); animation: p4mBadge .8s var(--g-spring) 1s backwards; }
.p4m__badge .i { width: 16px; height: 16px; }
@keyframes p4mBadge { from { opacity: 0; transform: scale(.5) rotate(-8deg); } }
.p4m__tag { padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--g-line); font-size: .72rem; font-weight: 800; color: var(--gold-2); }

.p4m__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; padding: 0 1.4rem; }
.p4m__stats div { display: grid; gap: .2rem; padding: .85rem .4rem; border-radius: 18px; background: rgba(254, 253, 249, .05); border: 1px solid rgba(254, 253, 249, .07); text-align: center; }
.p4m__stats b { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.p4m__stats span { font-size: .66rem; font-weight: 700; letter-spacing: .03em; color: var(--g-muted); }

.p4m__sec { display: grid; gap: .75rem; margin: 1.3rem 1.4rem 0; padding-top: 1.2rem; border-top: 1px solid rgba(254, 253, 249, .07); }
.p4m__sec h3 { margin: 0; font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.p4m__bars { display: flex; align-items: flex-end; gap: 5px; height: 84px; padding: 0 2px 2px; border-bottom: 1px dashed rgba(254, 253, 249, .12); }
.p4m__bars i { flex: 1; max-width: 26px; height: var(--h); min-height: 6px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); transform-origin: bottom; animation: p4mBar .7s var(--g-out) backwards; animation-delay: calc(var(--i, 0) * 50ms + .35s); }
@keyframes p4mBar { from { transform: scaleY(0); } }
.p4m .is-brillant { --c: #B48CF2; }
.p4m .is-parfait { --c: #3DBE7A; }
.p4m .is-excellent { --c: #8EDDB0; }
.p4m .is-bon { --c: #E2C27A; }
.p4m .is-imprecis { --c: #E8A33D; }
.p4m .is-erreur { --c: #FF7A4D; }
.p4m .is-gaffe { --c: #E05A32; }
.p4m__legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--g-muted); }
.p4m__legend span { display: inline-flex; align-items: center; gap: .35rem; }
.p4m__legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.p4m__legend b { color: var(--cream); }
.p4m__turn { display: flex; align-items: flex-start; gap: .55rem; margin: 0; padding: .75rem .9rem; border-radius: 16px; background: rgba(224, 90, 50, .1); border: 1px solid rgba(224, 90, 50, .22); color: #FFC2A8; font-size: .84rem; line-height: 1.45; }
.p4m__turn.is-good { background: rgba(180, 140, 242, .1); border-color: rgba(180, 140, 242, .25); color: #D9C6FA; }
.p4m__turn .i { flex: none; width: 18px; height: 18px; margin-top: 1px; }

.p4m__board { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; }
.p4m__board li { display: flex; align-items: center; gap: .75rem; padding: .55rem .8rem; border-radius: 14px; background: rgba(254, 253, 249, .04); font-size: .9rem; }
.p4m__board li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p4m__board li b { font-variant-numeric: tabular-nums; }
.p4m__board li.is-me { background: rgba(193, 152, 66, .16); color: var(--gold-2); font-weight: 800; box-shadow: inset 0 0 0 1px var(--g-line); }
.p4m__rank { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .74rem; font-weight: 800; background: rgba(254, 253, 249, .08); color: var(--cream); }
.p4m__board li:nth-child(1) .p4m__rank { background: linear-gradient(135deg, #F3DFA8, #C19842); color: var(--g-ink); }
.p4m__board li:nth-child(2) .p4m__rank { background: linear-gradient(135deg, #EEF1F4, #9AA3AB); color: var(--g-ink); }
.p4m__board li:nth-child(3) .p4m__rank { background: linear-gradient(135deg, #F1C29E, #A0623A); color: var(--g-ink); }
.p4m__best { margin: 0; font-size: .86rem; color: var(--g-muted); }
.p4m__best b { color: var(--gold-2); }
.p4m__best--solo { margin: 1.1rem 1.4rem 0; text-align: center; }

.p4m__how { margin: 1.2rem 1.4rem 0; border-radius: 16px; background: rgba(254, 253, 249, .04); border: 1px solid rgba(254, 253, 249, .06); }
.p4m__how summary { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem; cursor: pointer; list-style: none; font-size: .84rem; font-weight: 800; color: var(--gold-2); }
.p4m__how summary::-webkit-details-marker { display: none; }
.p4m__how summary::after { content: '+'; margin-left: auto; font-size: 1.1rem; transition: transform .3s; }
.p4m__how[open] summary::after { transform: rotate(45deg); }
.p4m__how summary .i { width: 17px; height: 17px; }
.p4m__how ul { display: grid; gap: .5rem; margin: 0; padding: 0 1.1rem 1.1rem 2.1rem; font-size: .82rem; line-height: 1.5; color: var(--g-muted); }
.p4m__how b { color: var(--cream); }

.p4m__next { justify-items: center; }
.p4m__next h3 { justify-self: start; }
.p4m__foot { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: 1.1rem; padding: 1.4rem 1.4rem 1.2rem; background: linear-gradient(to top, #10171E 64%, rgba(16, 23, 30, 0)); }
.p4m__cta { flex: 1; max-width: 300px; }
.p4m__close { height: 50px; padding: 0 1.2rem; border-radius: 999px; border: 1px solid var(--g-line-2); font-size: .86rem; font-weight: 700; color: var(--g-muted); transition: color .25s, border-color .25s; }
.p4m__close:hover { color: var(--cream); border-color: var(--g-line); }

@media (max-width: 560px) {
  .p4m { padding: 0; place-items: end stretch; }
  .p4m__box { width: 100%; max-height: 94svh; border-radius: 28px 28px 0 0; border-bottom: 0; transform: translateY(100%); opacity: 1; transition: transform .55s var(--g-out); padding-bottom: env(safe-area-inset-bottom); }
  .p4m__hero { padding: 1.8rem 3.4rem 1.2rem; }
  .p4m__ring { width: 144px; height: 144px; }
  .p4m__ring b { font-size: 3.5rem; }
  .p4m__hero h2 { font-size: 2.2rem; }
  .p4m__stats { grid-template-columns: repeat(2, 1fr); padding: 0 1rem; }
  .p4m__sec, .p4m__how { margin-left: 1rem; margin-right: 1rem; }
  .p4m__bars { gap: 3px; }
  .p4-card { padding: 1.1rem; gap: .55rem; }
  .p4-card h3 { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .p4m__ring, .p4m__bars i, .p4m__badge { animation: none; }
}

/* BOB : expressions, accessoire de l'« humeur du soir » (une par partie) et petites bulles qui s'envolent */
.bob__acc { position: absolute; pointer-events: none; }
.bob__fx { position: absolute; z-index: 3; top: -8px; right: -12px; font-family: var(--f-display, 'Bebas Neue', Impact, sans-serif); font-size: 1.1rem; line-height: 1; letter-spacing: .05em; color: var(--gold-2, #E2C27A); text-shadow: 0 2px 8px rgba(0, 0, 0, .7); white-space: nowrap; pointer-events: none; animation: bobFx 1.35s cubic-bezier(.16, 1, .3, 1) forwards; }
.bob__fx--l { right: auto; left: -14px; animation-name: bobFxL; }
@keyframes bobFx { from { opacity: 0; transform: translate(0, 8px) scale(.5) rotate(-10deg); } 22% { opacity: 1; transform: translate(4px, -4px) scale(1.12) rotate(5deg); } to { opacity: 0; transform: translate(16px, -34px) scale(.9) rotate(12deg); } }
@keyframes bobFxL { from { opacity: 0; transform: translate(0, 8px) scale(.5) rotate(10deg); } 22% { opacity: 1; transform: translate(-4px, -4px) scale(1.12) rotate(-5deg); } to { opacity: 0; transform: translate(-16px, -34px) scale(.9) rotate(-12deg); } }

/* Rire : il se secoue, yeux plissés, grande bouche */
.bob--laugh { animation: bobLaugh .17s ease-in-out 10; }
@keyframes bobLaugh { 50% { transform: translateY(-3px) rotate(-2.5deg); } }
.bob--laugh .bob__eye { height: 8px; background: none; box-shadow: none; animation: none; border: 3px solid var(--ember-2); border-bottom: 0; border-radius: 12px 12px 0 0; }
.bob--laugh .bob__mouth { width: 26px; height: 11px; bottom: 6px; border-radius: 3px 3px 14px 14px; background: var(--gold); }
/* Clin d'œil */
.bob--wink { animation: bobTilt .55s var(--g-spring); }
@keyframes bobTilt { 45% { transform: rotate(-8deg); } }
.bob--wink .bob__eye:last-of-type { height: 3px; border-radius: 3px; animation: none; }
.bob--wink .bob__mouth { width: 18px; translate: -24% 0; rotate: -10deg; background: var(--gold); }
/* Surprise */
.bob--shock { animation: bobJump .45s var(--g-spring); }
@keyframes bobJump { 40% { transform: translateY(-9px) scale(1.05); } }
.bob--shock .bob__eye { transform: scale(1.32); animation: none; }
.bob--shock .bob__mouth { width: 12px; height: 12px; bottom: 5px; border-radius: 50%; background: transparent; border: 3px solid rgba(254, 253, 249, .75); }
/* Sueurs froides */
.bob--sweat .bob__eye { height: 10px; border-radius: 4px 4px 12px 12px; animation: gScan .9s ease-in-out infinite alternate; }
.bob--sweat .bob__mouth { width: 20px; rotate: -7deg; }
.bob--sweat::after { content: ''; position: absolute; top: 8px; right: -3px; width: 9px; height: 9px; border-radius: 0 50% 50% 50%; rotate: 45deg; background: #8DC2F0; box-shadow: 0 0 8px rgba(91, 164, 230, .7); animation: bobDrop 1.5s ease-in infinite; }
@keyframes bobDrop { from { opacity: 0; transform: translate(0, -2px); } 20% { opacity: 1; } to { opacity: 0; transform: translate(18px, 18px); } }
/* Étoiles dans les yeux (coup de maître) */
.bob--starry .bob__eye { width: 19px; height: 19px; border-radius: 0; background: var(--gold-2); box-shadow: none; clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); animation: bobSpin 1.6s linear infinite; }
@keyframes bobSpin { to { transform: rotate(360deg); } }
.bob--starry .bob__mouth { width: 14px; height: 10px; border-radius: 50%; background: transparent; border: 3px solid rgba(254, 253, 249, .65); }
/* Sommeil */
.bob--sleep { animation: bobBreath 2.6s ease-in-out infinite; }
@keyframes bobBreath { 50% { transform: scale(.97) translateY(2px); } }
.bob--sleep .bob__eye { height: 3px; border-radius: 3px; background: rgba(254, 253, 249, .55); box-shadow: none; animation: none; }
.bob--sleep .bob__ant::after { animation-duration: 3.2s; opacity: .45; }
/* Faux énervement */
.bob--angry { animation: bobShake .1s linear 7; }
@keyframes bobShake { 25% { transform: translateX(-2px) rotate(-1.5deg); } 75% { transform: translateX(2px) rotate(1.5deg); } }
.bob--angry .bob__eye { height: 9px; border-radius: 2px 2px 12px 12px; background: #FF3B2F; box-shadow: 0 0 14px 4px rgba(255, 59, 47, .7); animation: none; }
.bob--angry .bob__eye:first-of-type { rotate: 18deg; }
.bob--angry .bob__eye:last-of-type { rotate: -18deg; }
.bob--angry .bob__ant::after { background: #FF3B2F; animation-duration: .2s; }
/* Danse */
.bob--dance { animation: bobDance .5s ease-in-out 6; }
@keyframes bobDance { 25% { transform: rotate(-8deg) translateY(-3px); } 75% { transform: rotate(8deg) translateY(-3px); } }
.bob--dance .bob__eye { height: 8px; border-radius: 15px 15px 2px 2px; animation: none; }
.bob--dance .bob__mouth { width: 24px; height: 8px; border-radius: 0 0 14px 14px; background: var(--gold); }
/* Lunettes noires */
.bob--cool .bob__eye { width: 20px; height: 11px; border-radius: 3px 3px 9px 9px; background: #0B1015; border: 2px solid var(--gold); box-shadow: inset 5px -2px 0 rgba(255, 255, 255, .16); animation: none; }
.bob--cool .bob__mouth { width: 16px; translate: -20% 0; rotate: -6deg; background: var(--gold); }

/* Humeur du soir : accessoires */
.bob--acc-bowtie .bob__acc { left: 50%; bottom: -13px; width: 30px; height: 13px; translate: -50% 0; background: linear-gradient(180deg, #F2D58C, #A9822F); clip-path: polygon(0 0, 42% 34%, 58% 34%, 100% 0, 100% 100%, 58% 66%, 42% 66%, 0 100%); animation: bobTie 3.2s ease-in-out infinite; }
@keyframes bobTie { 50% { transform: rotate(-4deg); } }
.bob--acc-cap .bob__ant { z-index: 2; }
.bob--acc-cap .bob__acc { z-index: 1; left: 9px; top: -9px; width: 56px; height: 15px; border-radius: 30px 30px 3px 3px; background: linear-gradient(180deg, #F2774A, var(--ember)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.bob--acc-cap .bob__acc::after { content: ''; position: absolute; left: -15px; bottom: 0; width: 22px; height: 5px; border-radius: 6px 0 0 6px; background: #B8431F; }
.bob--acc-phones .bob__acc { left: -8px; right: -8px; top: -12px; height: 42px; border: 4px solid var(--gold); border-bottom: 0; border-radius: 40px 40px 0 0; animation: bobBeat .55s ease-in-out infinite; }
.bob--acc-phones .bob__acc::before, .bob--acc-phones .bob__acc::after { content: ''; position: absolute; bottom: -14px; width: 12px; height: 22px; border-radius: 6px; background: linear-gradient(180deg, var(--ember-2), var(--ember)); border: 2px solid var(--gold); }
.bob--acc-phones .bob__acc::before { left: -9px; }
.bob--acc-phones .bob__acc::after { right: -9px; }
@keyframes bobBeat { 50% { transform: translateY(-1.5px); } }
.bob--acc-glasses .bob__acc { left: 50%; top: 50%; width: 48px; height: 19px; translate: -50% -50%; background: linear-gradient(rgba(254, 253, 249, .85), rgba(254, 253, 249, .85)) center 8px / 10px 2px no-repeat; }
.bob--acc-glasses .bob__acc::before, .bob--acc-glasses .bob__acc::after { content: ''; position: absolute; top: 0; width: 19px; height: 19px; border-radius: 50%; border: 2px solid rgba(254, 253, 249, .85); box-shadow: inset 0 0 6px rgba(254, 253, 249, .12); }
.bob--acc-glasses .bob__acc::before { left: 0; }
.bob--acc-glasses .bob__acc::after { right: 0; }
.bob--acc-mic .bob__acc { right: -15px; bottom: -8px; width: 7px; height: 22px; border-radius: 3px; background: linear-gradient(90deg, #3A4B5C, #0D1318); border: 1px solid rgba(254, 253, 249, .25); rotate: 22deg; animation: bobMic 2.4s ease-in-out infinite; }
.bob--acc-mic .bob__acc::before { content: ''; position: absolute; left: 50%; top: -11px; width: 14px; height: 14px; translate: -50% 0; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #F1ECE3, #8A8F96 60%, #4A5058); box-shadow: 0 0 0 2px var(--gold); }
@keyframes bobMic { 50% { transform: rotate(-6deg); } }
.bob--acc-crown .bob__ant { opacity: 0; }
.bob--acc-crown .bob__acc { left: 50%; top: -19px; width: 38px; height: 19px; translate: -50% 0; background: linear-gradient(110deg, #C19842 20%, #FFF2C9 45%, #C19842 70%) 0 0 / 300% 100%; clip-path: polygon(0 100%, 0 26%, 20% 62%, 35% 4%, 50% 58%, 65% 4%, 80% 62%, 100% 26%, 100% 100%); animation: bobGleam 3s linear infinite; }
@keyframes bobGleam { to { background-position: 150% 0; } }
.bob--ko.bob--acc-crown .bob__acc { rotate: -24deg; translate: -85% 6px; transition: rotate .5s, translate .5s; }
.bob--ko.bob--acc-cap .bob__acc { rotate: 14deg; }
@media (max-width: 560px) {
  .bob--acc-glasses .bob__acc { width: 38px; height: 15px; background-position: center 6px; background-size: 8px 2px; }
  .bob--acc-glasses .bob__acc::before, .bob--acc-glasses .bob__acc::after { width: 15px; height: 15px; }
  .bob--acc-cap .bob__acc { left: 6px; width: 48px; }
  .bob--starry .bob__eye { width: 15px; height: 15px; }
  .bob--cool .bob__eye { width: 16px; height: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .bob, .bob__acc, .bob__fx, .bob::after { animation: none !important; }
}
