/* SG Panic : le menu EST la console de poche (dessin mesuré : écran, 4 touches, croix, 2 boutons rouges).
   Toutes les positions sont des fractions du dessin (largeur = 100cqw, hauteur = 146.25cqw) : la console
   garde exactement la même taille en Rétro et en Moderne. */
#overlay{background:#6b4a2a url(bureau.webp?v=1) center/cover no-repeat!important}
body.modern #overlay::before{display:none!important}
#menu-panel.gw{position:relative;width:min(560px,92vw,calc((100dvh - 36px) / 1.4625))!important;max-width:none!important;max-height:none!important;aspect-ratio:720/1053;
  padding:0!important;margin:auto!important;background:none!important;border:0!important;box-shadow:none!important;border-radius:0!important;overflow:visible!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;perspective:1400px}
@supports not (height:100dvh){#menu-panel.gw{width:min(560px,92vw,calc((100vh - 36px) / 1.4625))!important}}
.gw-carte{position:absolute;inset:0;container-type:inline-size;transform-style:preserve-3d;transition:transform .6s cubic-bezier(.4,.1,.2,1)}
.gw-carte.dos{transform:rotateY(180deg)}
.gw-face,.gw-dos{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;background:center/100% 100% no-repeat;filter:drop-shadow(0 18px 24px rgba(0,0,0,.45))}
.gw-face{background-image:url(console-face.webp?v=1)}
.gw-dos{background-image:url(console-dos.webp?v=1);transform:rotateY(180deg)}
#menu-panel.gw button{font-family:inherit}
@media (prefers-reduced-motion:reduce){.gw-carte{transition:none}}

/* l'écran LCD : x 10,7 → 90 %, y 12,1 → 52,9 % */
#menu-panel.gw .gw-lcd{position:absolute;left:10.7cqw;width:79.3cqw;top:17.64cqw;height:59.73cqw;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.2cqw;
  text-align:center;color:#2b3324;overflow:hidden;border-radius:1cqw;padding:2cqw}
.gw-lcd::after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,rgba(0,0,0,.035) 0 1px,transparent 1px 3px)}
#menu-panel.gw .gw-lcd .menu-brand{margin:0!important;font-size:2.6cqw!important;letter-spacing:.3em!important;color:#3b4733!important}
#menu-panel.gw .gw-lcd h1{margin:0!important;font-size:9cqw!important;line-height:.95!important;color:#2b3324!important;letter-spacing:-.04em!important}
#menu-panel.gw .gw-lcd h1 b{display:inline!important;font-size:1em!important}
#menu-panel.gw .gw-lcd h2{margin:0!important;font-size:2.9cqw!important;color:#3b4733!important}
#menu-panel.gw .gw-lcd #hero{display:block!important;width:auto!important;height:21cqw!important;margin:0!important;object-fit:contain}
#menu-panel.gw .gw-lcd #message{margin:0!important;font-size:2.7cqw!important;line-height:1.3!important;color:#3b4733!important}
#menu-panel.gw .gw-lcd #logo-moderne{display:none}
.gw-mode{margin:0;font-size:3.4cqw;font-weight:900;letter-spacing:.06em;color:#2b3324;animation:gw-clign 1.2s steps(2) infinite}
@keyframes gw-clign{50%{opacity:.35}}
/* en Moderne, l'écran s'allume en couleur : même cadre, même place */
body.modern #menu-panel.gw .gw-lcd{background:linear-gradient(160deg,#1c3f8f,#3b1f6d);color:#fff;box-shadow:inset 0 0 3cqw rgba(0,0,0,.45)}
body.modern #menu-panel.gw .gw-lcd h1,body.modern #menu-panel.gw .gw-lcd .menu-brand{display:none!important}
body.modern #menu-panel.gw .gw-lcd #logo-moderne{display:block!important;width:auto!important;height:24cqw!important;margin:0!important}
body.modern #menu-panel.gw .gw-lcd h2,body.modern #menu-panel.gw .gw-lcd #message{color:#d9f0ff!important}
body.modern #menu-panel.gw .gw-mode{color:#ffd23f}
body.modern #menu-panel.gw .gw-lcd #hero{height:17cqw!important}

/* les quatre touches de mode (y 60,2 → 65,2 %) avec leur nom sérigraphié au-dessus */
#menu-panel.gw #modes{position:absolute!important;left:0;right:0;top:82.6cqw;height:12.8cqw;margin:0!important;padding:0!important;display:block!important;background:none!important;border:0!important;box-shadow:none!important}
#menu-panel.gw #modes button{position:absolute!important;top:0;height:12.8cqw;padding:0!important;margin:0!important;min-height:0!important;flex:none!important;border:0!important;border-radius:1.4cqw!important;
  background:transparent!important;box-shadow:none!important;color:#5a3a24!important;font-size:2.3cqw!important;letter-spacing:.04em!important;line-height:1!important;
  display:flex!important;align-items:flex-start!important;justify-content:center!important;text-shadow:none!important;white-space:nowrap}
#menu-panel.gw #modes button::after{content:"";position:absolute;left:0;right:0;bottom:0;height:7.3cqw;border-radius:1.4cqw;transition:box-shadow .15s}
#menu-panel.gw #modes button.selected::after{box-shadow:0 0 0 .8cqw #ff8a1a,0 0 3cqw rgba(255,138,26,.7)}
#menu-panel.gw #modes button.selected{color:#c2410c!important}
#menu-panel.gw #a{left:10.83cqw;width:15.28cqw}#menu-panel.gw #b{left:31.81cqw;width:15.41cqw}#menu-panel.gw #c{left:52.92cqw;width:15.41cqw}#menu-panel.gw #d{left:73.89cqw;width:15.42cqw}

/* la croix : moitié gauche = Rétro, moitié droite = Moderne ; leur nom sous la croix */
#menu-panel.gw .editions{position:absolute!important;left:6cqw;width:38cqw;top:101.6cqw;height:42cqw;margin:0!important;display:block!important}
#menu-panel.gw .editions button{position:absolute!important;top:0;bottom:0;width:50%;padding:0 0 1cqw!important;margin:0!important;min-height:0!important;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;color:#5a3a24!important;font-size:2.5cqw!important;line-height:1!important;letter-spacing:.05em!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-end!important;text-shadow:none!important}
#menu-panel.gw .editions button small{display:none!important}
#menu-panel.gw #retro{left:0}#menu-panel.gw #modern{right:0}
#menu-panel.gw .editions button.selected{color:#c2410c!important}
#menu-panel.gw .editions button.selected::before{content:"";position:absolute;top:44%;width:4cqw;height:4cqw;border-radius:50%;background:#ff8a1a;box-shadow:0 0 2cqw #ff8a1a}
#menu-panel.gw #retro.selected::before{left:30%}#menu-panel.gw #modern.selected::before{right:30%}

/* les deux boutons rouges : x 51,3 → 67,2 % (OPTIONS) et 74,2 → 90,3 % (JOUER), y 74,5 → 85,4 % ; nom dessous */
#menu-panel.gw .gw-rouge{position:absolute!important;top:108.9cqw;height:23cqw;padding:0 0 .5cqw!important;margin:0!important;min-height:0!important;border:0!important;border-radius:0!important;
  background:transparent!important;box-shadow:none!important;color:#5a3a24!important;font-size:2.6cqw!important;font-weight:900!important;letter-spacing:.06em!important;line-height:1!important;
  display:flex!important;align-items:flex-end!important;justify-content:center!important;text-shadow:none!important;white-space:nowrap;width:auto!important}
#menu-panel.gw .gw-gauche{left:51.25cqw;width:15.97cqw!important}
#menu-panel.gw .gw-droite{left:74.17cqw;width:16.11cqw!important}
#menu-panel.gw .gw-rouge::before{content:"";position:absolute;left:0;right:0;top:0;height:16cqw;border-radius:50%}
#menu-panel.gw .gw-rouge:active::before{background:rgba(0,0,0,.18)}
#menu-panel.gw #play:not(:disabled)::before{animation:gw-halo 1.4s ease-in-out infinite}
@keyframes gw-halo{50%{box-shadow:0 0 0 1.2cqw rgba(255,210,63,.75),0 0 5cqw rgba(255,210,63,.6)}}
/* 15/11 : plus de cadre bleu autour du bouton choisi aux flèches : la touche allumée suffit à montrer le choix */
#menu-panel.gw button:focus,#menu-panel.gw button:focus-visible{outline:none!important;-webkit-tap-highlight-color:transparent}

/* le dos : étiquette en haut (x 33 → 67 %, y 7 → 15 %), réglages sur la trappe à piles */
.gw-etiquette{position:absolute;left:33cqw;width:34cqw;top:25.1cqw;height:13.3cqw;display:flex;align-items:center;justify-content:center;font-size:4cqw;letter-spacing:.12em;color:#7a2a1a}
#menu-panel.gw .gw-dos .menu-links,#menu-panel.gw .gw-dos .menu-audio{position:absolute;left:14cqw;right:14cqw;display:grid!important;grid-template-columns:1fr 1fr;gap:2cqw!important;margin:0!important}
#menu-panel.gw .gw-dos .menu-links{top:55cqw}
#menu-panel.gw .gw-dos .menu-audio{top:84cqw}
#menu-panel.gw .gw-dos button{min-height:8.5cqw!important;padding:0 1cqw!important;font-size:2.8cqw!important;border-radius:5cqw!important}
#menu-panel.gw .gw-dos .menu-links button:last-child:nth-child(odd){grid-column:1/-1}
#menu-panel.gw .gw-dos .scene-label{position:absolute;left:14cqw;right:14cqw;top:41cqw;margin:0!important;font-size:2.6cqw!important;color:#5a3a24}
#menu-panel.gw .gw-dos #hint{display:none!important}
#menu-panel.gw .gw-dos .gw-retour{position:absolute;left:30cqw;right:30cqw;top:120cqw;min-height:9cqw!important;font-size:2.6cqw!important}

/* JOUER et OPTIONS : on garde le rouge du dessin (l'ancien habillage peignait JOUER en orange) */
#menu-panel.gw #play.gw-rouge,#menu-panel.gw #gw-options.gw-rouge{background:transparent!important;box-shadow:none!important;color:#5a3a24!important}
#menu-panel.gw .gw-dos .menu-links button,#menu-panel.gw .gw-dos #salle{width:100%!important;margin:0!important;position:static!important}
#menu-panel.gw .gw-dos .menu-links button:last-child:nth-child(odd){grid-column:1/-1}
html body #overlay{background:#6b4a2a url(bureau.webp?v=1) center/cover no-repeat!important}
#menu-panel.gw .gw-lcd h1{display:block!important}
body.modern #menu-panel.gw .gw-lcd h1{display:none!important}
#menu-panel.gw .gw-dos #salle{border:0!important;background:linear-gradient(180deg,#5b606c,#454953)!important;color:#eef0f4!important;box-shadow:inset 0 2px 0 rgba(255,255,255,.18),0 3px 0 #2c2f36!important;min-height:8.5cqw!important;padding:0 1cqw!important;font-size:2.8cqw!important;border-radius:5cqw!important;padding-left:1cqw!important}
#menu-panel.gw .gw-dos .menu-links{top:53cqw;gap:1.8cqw!important;left:16cqw;right:16cqw}
#menu-panel.gw .gw-dos .menu-links button,#menu-panel.gw .gw-dos #salle{min-height:8cqw!important}

/* ===== Réglage fin 1.20 : tout est posé sur les zones mesurées au pixel sur les deux dessins (720 px = 100cqw) ===== */
/* touches de mode : x 78-187, 229-339, 381-490, 533-642 ; y 634-686 */
#menu-panel.gw #a,#menu-panel.gw #b,#menu-panel.gw #c,#menu-panel.gw #d{width:15.14cqw!important}
#menu-panel.gw #a{left:10.83cqw}#menu-panel.gw #b{left:31.81cqw}#menu-panel.gw #c{left:52.92cqw}#menu-panel.gw #d{left:74.03cqw}
/* croix : x 61-294, y 732-958 ; branche gauche x 61-130, branche droite x 225-294, branche horizontale y 796-893 */
#menu-panel.gw .editions{left:8.47cqw!important;width:32.36cqw!important;top:101.67cqw!important;height:37.03cqw!important}
#menu-panel.gw .editions button{padding:0!important;font-size:2.4cqw!important;justify-content:flex-end!important;white-space:nowrap}
#menu-panel.gw #retro{padding-right:6.6cqw!important}   /* nom centré sous la branche gauche (x 13,26cqw) */
#menu-panel.gw #modern{padding-left:6.6cqw!important}   /* nom centré sous la branche droite (x 36,04cqw) */
#menu-panel.gw .editions button.selected::before{top:13.82cqw!important;width:3.6cqw!important;height:3.6cqw!important;right:auto!important}
#menu-panel.gw #retro.selected::before{left:2.99cqw!important}
#menu-panel.gw #modern.selected::before{left:9.59cqw!important}
/* boutons rouges : y 784-897 ; leur nom 3cqw sous le bouton, comme ceux de la croix */
#menu-panel.gw .gw-rouge{height:21.3cqw!important;padding:0!important}

/* dos : plaque x 236-484, y 162-264 ; grilles x 71-183 et 535-647 (bas y 274) ; trappe x 72-648, y 410-657 sous la languette ;
   fenêtre de la béquille x 253-465, y 768-883 */
.gw-dos .gw-etiquette{top:22.5cqw!important;height:14.17cqw!important;left:32.78cqw!important;width:34.44cqw!important}
#menu-panel.gw .gw-dos .menu-links{position:absolute!important;inset:0!important;display:block!important;margin:0!important;padding:0!important;gap:0!important}
#menu-panel.gw .gw-dos #menu-scores,#menu-panel.gw .gw-dos #ludo-btn,#menu-panel.gw .gw-dos #tuto-btn,#menu-panel.gw .gw-dos #aide-btn,
#menu-panel.gw .gw-dos #salle,#menu-panel.gw .gw-dos #home,#menu-panel.gw .gw-dos #menu-music,#menu-panel.gw .gw-dos #menu-sound,#menu-panel.gw .gw-dos #gw-retour{
  position:absolute!important;margin:0!important;padding:0!important;min-height:0!important;box-sizing:border-box!important;display:flex!important;align-items:center!important;justify-content:center!important;
  border:0!important;border-radius:999px!important;background:linear-gradient(180deg,#5b606c,#40444e)!important;color:#eef0f4!important;
  box-shadow:inset 0 .3cqw 0 rgba(255,255,255,.2),0 .7cqw 0 #2a2d34,0 1.2cqw 1.6cqw rgba(0,0,0,.25)!important;
  font-size:2.7cqw!important;letter-spacing:.06em!important;line-height:1!important;text-align:center!important;white-space:nowrap!important;grid-column:auto!important;transform:none!important}
#menu-panel.gw .gw-dos #menu-scores,#menu-panel.gw .gw-dos #tuto-btn,#menu-panel.gw .gw-dos #salle{left:14cqw!important;width:34.5cqw!important;height:9cqw!important}
#menu-panel.gw .gw-dos #ludo-btn,#menu-panel.gw .gw-dos #aide-btn,#menu-panel.gw .gw-dos #home{left:51.5cqw!important;width:34.5cqw!important;height:9cqw!important}
#menu-panel.gw .gw-dos #menu-scores,#menu-panel.gw .gw-dos #ludo-btn{top:58.6cqw!important}
#menu-panel.gw .gw-dos #tuto-btn,#menu-panel.gw .gw-dos #aide-btn{top:69.6cqw!important}
#menu-panel.gw .gw-dos #salle,#menu-panel.gw .gw-dos #home{top:80.6cqw!important}
/* le son se règle sur les haut-parleurs : un interrupteur centré sous chaque grille */
#menu-panel.gw .gw-dos #menu-music{left:5.64cqw!important;width:24cqw!important;top:39.6cqw!important;height:7cqw!important;font-size:2.4cqw!important}
#menu-panel.gw .gw-dos #menu-sound{left:70.08cqw!important;width:24cqw!important;top:39.6cqw!important;height:7cqw!important;font-size:2.4cqw!important}
/* RETOURNER : dans la fenêtre de la béquille, centré */
#menu-panel.gw .gw-dos #gw-retour{left:37.86cqw!important;right:auto!important;width:24cqw!important;top:110.15cqw!important;height:9cqw!important;
  background:linear-gradient(180deg,#3d63f0,#1f3fc4)!important;box-shadow:inset 0 .3cqw 0 rgba(255,255,255,.3),0 .7cqw 0 #142a85,0 1.2cqw 1.6cqw rgba(0,0,0,.3)!important}
/* l'écran : tout le contenu tient dedans avec une marge égale en haut et en bas (mesuré 360, 390 et 1280 px) */
#menu-panel.gw .gw-lcd{gap:1.1cqw!important;padding:2.4cqw 2cqw!important;justify-content:center!important}
#menu-panel.gw .gw-lcd>*{flex:none!important;margin:0!important}
#menu-panel.gw .gw-lcd #hero{height:17cqw!important}
#menu-panel.gw .gw-lcd .gw-mode{margin-top:1cqw!important}
body.modern #menu-panel.gw .gw-lcd #logo-moderne{height:19cqw!important}
body.modern #menu-panel.gw .gw-lcd #hero{height:13cqw!important}
/* ligne du mode choisi : une règle de l'habillage la peignait en gris foncé (illisible sur l'écran bleu) ; clignotement adouci */
#menu-panel.gw .gw-lcd #gw-mode{color:#2b3324!important;font-weight:900!important;font-size:3.5cqw!important;letter-spacing:.06em!important;text-shadow:none!important;animation:gw-clign2 1.4s ease-in-out infinite!important}
body.modern #menu-panel.gw .gw-lcd #gw-mode{color:#ffd23f!important;text-shadow:0 .3cqw 0 rgba(0,0,0,.55),0 0 2cqw rgba(255,210,63,.45)!important}
@keyframes gw-clign2{50%{opacity:.7}}
@media (prefers-reduced-motion:reduce){#menu-panel.gw .gw-lcd #gw-mode{animation:none!important}}
/* le bureau reste le décor en Rétro aussi (l'ancien fond LCD passait par-dessus) */
html body #overlay::before{display:none!important}
html,body{background:#6b4a2a url(bureau.webp?v=1) center/cover no-repeat fixed!important}
/* Mes scores : même mise en page que Ludothèque et Comment jouer (titre centré, colonne centrée, bouton de retour à largeur raisonnable) */
#scores-panel{text-align:center;padding:max(22px,env(safe-area-inset-top)) 18px 20px}
#scores-panel h2{font-size:26px;margin:6px 0 4px}
#scores-panel>*{max-width:460px;margin-left:auto;margin-right:auto}
#scores-panel table{width:100%}
#scores-close{display:block;width:100%!important;max-width:320px!important;margin:18px auto 0!important}
#scores-panel th,#scores-panel td{text-align:center}
/* grand écran : le bureau de l'accueil se cale sur celui de la page, plus de raccord visible de part et d'autre de la console */
html body #overlay{background-attachment:fixed!important;background-size:cover!important;background-position:50% 50%!important}

/* 15/11 : sur Android, le toucher d'un bouton (croix directionnelle, touches A à D) dessinait un cadre bleu : on l'efface partout */
html,body,button,a,[role=button]{-webkit-tap-highlight-color:transparent}
/* 19/11 : retour à la salle d'arcade sur la face de la console, sous les deux boutons rouges (le dos garde le sien) */
.gw-salle{display:none}
#menu-panel.gw .gw-salle{display:flex;align-items:center;justify-content:center;position:absolute!important;left:51.25cqw;width:39cqw;top:133.6cqw;height:6.4cqw;margin:0!important;padding:0!important;min-height:0!important;border:0!important;border-radius:999px!important;background:linear-gradient(#4a4744,#2b2926)!important;box-shadow:0 .8cqw 0 #1a1816,inset 0 .4cqw 0 rgba(255,255,255,.18)!important;color:#f4e6c8!important;font-size:2.4cqw!important;font-weight:800!important;line-height:1!important;letter-spacing:.1em;white-space:nowrap;cursor:pointer;touch-action:manipulation}
#menu-panel.gw .gw-salle:active{transform:translateY(.5cqw);box-shadow:0 .3cqw 0 #1a1816!important}
#menu-panel.gw .gw-salle::before,#menu-panel.gw .gw-salle::after{content:none!important;display:none!important}
#menu-panel.gw .gw-salle .gw-fleche{display:block;width:0;height:0;margin-right:1.4cqw;border-top:1.1cqw solid transparent;border-bottom:1.1cqw solid transparent;border-right:1.6cqw solid #ff8a1a}
