/* Finitions visuelles uniquement : les cases, les commandes et leurs zones
   de clic conservent leurs dimensions et leur position. */
#view-game .game-center .game-nav-btn,
#view-game .game-center .rack-wrap>.controls>button{
  background:linear-gradient(160deg,#fffef8,#edf3e8);
  border-color:#b7c9b5;
  box-shadow:inset 0 1px 0 #fff,0 2px 0 #acbfa8,0 3px 6px #2246330d;
}
#view-game .game-center .rack-wrap>.controls #btn-validate:not(:disabled){
  background:linear-gradient(155deg,#ffe69b,#f4ca62 62%,#eabb4a);
  border-color:#b58934;color:#30230a;
  box-shadow:inset 0 1px 0 #fff3ca,inset 0 -1px 0 #e0ad3c,0 3px 0 #a77925;
}
#view-game .game-center .rack-wrap>.controls>button:disabled{
  color:#62715e;background:#e4e9dc;border-color:#c0cbb7;box-shadow:inset 0 1px 0 #f7f9f1;
}
#view-game .game-center :is(.game-nav-btn,.rack-wrap>.controls>button) .ic,
#panel-more .menu-panel-actions .ic{stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#panel-more .menu-panel-actions button:not(:disabled):not(.btn-danger){
  background:linear-gradient(155deg,#fffef8,#f0f4e9);
  border-color:#bdceb7;box-shadow:inset 0 1px 0 #fff,0 2px 0 #c1d0b8;
}
#panel-more .menu-panel-actions :is(#btn-verif-coup,#btn-hint,#btn-loupe) .ic{
  box-sizing:border-box;padding:3px;border:1px solid #ffffff66;border-radius:50%;
  color:#fff;stroke:currentColor;
  box-shadow:inset 0 1px 0 #ffffff44,0 1px 2px #22473335;
}
#panel-more #btn-verif-coup .ic{background:linear-gradient(145deg,#5e984f,#346c37)}
#panel-more #btn-hint .ic{background:linear-gradient(145deg,#539ec0,#226e95)}
#panel-more #btn-loupe .ic{background:linear-gradient(145deg,#f6db81,#d1a13f);color:#594115;stroke:#594115}
#panel-more .menu-panel-actions button:disabled .ic{background:#d7dfd1;color:#52664e;stroke:#52664e;box-shadow:none}
#panel-more .menu-panel-actions :is(#btn-gestion-partie,.menu-history-btn,#btn-board-skin-game,#btn-a11y-settings-game) .ic{color:#315f49}
#panel-more .menu-action-mascot{flex:0 0 22px;width:22px;height:22px;object-fit:contain}
/* Même biseau en réserve, sur le plateau et pendant un glisser. Pas de
   modification des lettres, des valeurs ou des indicateurs de validation. */
html[data-board-skin="jouet"]{
  --jt-yellow:linear-gradient(155deg,#fff1bd 0%,#ffe5a1 12%,#ffd34d 35%,#f6c65e 70%,#f5b942 85%,#e8ad3c 100%);
}
html[data-board-skin="jouet"] :is(#view-game,#view-equipe-spectate) .game-center :is(#board,#equipe-spectate-board) .cell.tile,
html[data-board-skin="jouet"] :is(#view-game,#view-equipe-spectate) .rack-tile,
html[data-board-skin="jouet"] body > :is(.cell.tile,.rack-tile){
  border-color:#b38124!important;border-top-color:#e7bd65!important;border-bottom-color:#96681e!important;
  box-shadow:inset 0 2px 0 #fff4ce,inset 1px 0 0 #ffedb8,inset -1px 0 0 #e6b349,inset 0 -3px 0 #dba23b,0 1px 0 #96681e,0 2px 3px #20382926!important;
}
.pet-opt{border-color:#c5d4c3!important;background:linear-gradient(155deg,#fffdf5,#edf4ec)!important;box-shadow:inset 0 1px 0 #fff,0 3px 0 #d1ddc9!important}
#pet-picker-card{box-sizing:border-box;max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
.pet-opt.active{border-color:#497852!important;box-shadow:inset 0 0 0 1px #497852,0 3px 0 #c4d6ba!important}
.pet-art::after{content:none}
#mascot::after{background:linear-gradient(145deg,#c84b35,#a92e25);border-color:#ebc975}
/* Les illustrations restent derrière les choix et les résultats : la mascotte
   flottante ne doit pas recouvrir une commande pendant une fenêtre ouverte. */
/* (V399) Sans recherche dans toute la page : ces fenêtres sont des enfants directs de body, et le
   menu de partie est suivi par html[data-vues] (vues-visibles.js). Un :has() descendant réévaluait la
   page entière à chaque recalcul de la mascotte, dont chaque début et fin de glisser de tuile. */
[data-vues~="view-game"][data-vues~="panel-more"] body:not(#sans-vue):not(#sans-fenetre) #mascot,
body:not(#sans-vue):not(.sans-fenetre):has(> #pet-picker-overlay:not(.hidden),> #board-skin-overlay:not(.hidden),> #a11y-overlay:not(.hidden),> #forfeit-overlay:not(.hidden),> #endgame-overlay:not(.hidden),> #menu-partie-detail:not(.hidden),> dialog[open]) #mascot{visibility:hidden!important;pointer-events:none!important}
/* V387 : seul le corps de l'animal se touche (zone ovale ajoutée par ux-enhancements.js).
   Les marges transparentes de l'image laissent passer les touchers, y compris vers les
   cases du plateau en partie ; l'animal se touche pour danser et se fait glisser partout. */
body #mascot{pointer-events:none}
#mascot .mascot-prise{position:absolute;left:16%;right:16%;top:9%;bottom:2%;border-radius:50%;pointer-events:auto;cursor:grab;touch-action:none;z-index:5;-webkit-tap-highlight-color:transparent}
#mascot.burst .mascot-prise{pointer-events:none}
/* (V480) Posée en haut de la partie (choix du joueur), la mascotte est un décor qui laisse passer
   tous les appuis. Déplaçable (par défaut, comme avant la V478), seul le corps de l'animal se
   touche et se déplace ; ses coins vides laissent jouer les cases dessous. */
body.in-game .game-header>#mascot,body.in-game .game-header>#mascot .mascot-prise{pointer-events:none!important}
/* Le poisson dispose de huit nouvelles vues du même dessin dans une seule
   planche. Les cinq autres gardent leurs huit poses originales. */
#mascot .mascot-fish-turn{display:none;position:absolute;inset:auto 0 0;aspect-ratio:1;pointer-events:none;background-position:0 0;background-size:400% 200%;background-repeat:no-repeat;filter:drop-shadow(0 8px 7px #183c4b30)}
#mascot[data-pet="fish"].mascot-performing .mascot-fish-turn{display:block;background-image:url("assets/mascots/fish-turnaround.webp")}
#mascot[data-pet="fish"].mascot-performing .pet-fish{visibility:hidden}
#mascot[data-frame="1"] .mascot-fish-turn{background-position:0 0}
#mascot[data-frame="2"] .mascot-fish-turn{background-position:33.333333% 0}
#mascot[data-frame="3"] .mascot-fish-turn{background-position:66.666667% 0}
#mascot[data-frame="4"] .mascot-fish-turn{background-position:100% 0}
#mascot[data-frame="5"] .mascot-fish-turn{background-position:0 100%}
#mascot[data-frame="6"] .mascot-fish-turn{background-position:33.333333% 100%}
#mascot[data-frame="7"] .mascot-fish-turn{background-position:66.666667% 100%}
#mascot[data-frame="8"] .mascot-fish-turn{background-position:0 0}
@media(hover:hover){
  #view-game .game-center :is(.game-nav-btn,.rack-wrap>.controls>button):not(:disabled):hover,
  #panel-more .menu-panel-actions button:not(:disabled):not(.btn-danger):hover{filter:brightness(1.035)}
}
@media(forced-colors:active){
  #view-game .game-center .game-nav-btn,#view-game .game-center .rack-wrap>.controls>button,
  #view-game .game-center .rack-wrap>.controls #btn-validate:not(:disabled),
  #panel-more .menu-panel-actions button:not(:disabled):not(.btn-danger),.pet-opt{
    background:Canvas!important;border-color:ButtonText!important;color:ButtonText!important;box-shadow:none!important;
  }
  #panel-more .menu-panel-actions :is(#btn-verif-coup,#btn-hint,#btn-loupe) .ic{background:Canvas!important;color:ButtonText!important;stroke:ButtonText!important;box-shadow:none}
  .pet-opt[aria-pressed="true"]{outline:2px solid Highlight;outline-offset:-4px}
  html[data-board-skin="jouet"] :is(#view-game,#view-equipe-spectate) .game-center :is(#board,#equipe-spectate-board) .cell.tile,
  html[data-board-skin="jouet"] :is(#view-game,#view-equipe-spectate) .rack-tile,
  html[data-board-skin="jouet"] body > :is(.cell.tile,.rack-tile){border-color:CanvasText!important;box-shadow:none!important}
}
/* V387 : le bloc « Jouer » garde les mêmes couleurs sur téléphone et sur PC, quel que soit le
   thème de l'appareil (Océan, Forêt, Plage repeignaient ces quatre boutons en bleu, vert ou
   turquoise). Chaque bouton a son identité : hasard doré, Facebook bleu de la marque,
   recherche verte, robot crème. */
html .home-play-panel #opt-random{background:linear-gradient(180deg,#dba32e 0%,#c98a1d 55%,#96650f 100%)!important;color:#241c10!important;border:1px solid rgba(140,90,10,.6)!important;box-shadow:0 4px 0 #7a5209,0 8px 20px rgba(150,101,15,.35),inset 0 1px 0 rgba(255,255,255,.5)!important}
html .home-play-panel #opt-friend{background:#1877f2!important;color:#fff!important;border:1px solid #0f5fcb!important;box-shadow:0 3px 0 #0f5fcb!important}
html .home-play-panel #opt-search-player{background:linear-gradient(180deg,#357a50,#2f7d4d)!important;color:#fff!important;border:1px solid #1f5c37!important;box-shadow:0 4px 0 #1f5c37,0 8px 18px rgba(47,125,77,.30),inset 0 1px 0 rgba(255,255,255,.4)!important}
html .home-play-panel #opt-bot{background:#fbf1dc!important;color:#241c10!important;border:1px solid #e6d4ac!important;box-shadow:none!important}
html .home-play-panel :is(#opt-random,#opt-bot) .ic{color:#241c10!important}
html .home-play-panel :is(#opt-friend,#opt-search-player) .ic{color:#fff!important}
/* V387 : « Défier » vert quand c'est au joueur de commencer la partie, doré (couleur habituelle)
   quand c'est à l'adversaire. Une mention écrite accompagne la couleur. */
html button.btn-primary.defi-a-toi{background:linear-gradient(180deg,#3f9a62,#2f7d4d)!important;color:#fff!important;border:1px solid #1f5c37!important;box-shadow:0 4px 0 #1f5c37,0 8px 18px rgba(47,125,77,.30),inset 0 1px 0 rgba(255,255,255,.4)!important}
.defi-qui-commence{font-weight:800;font-size:12px}
.defi-qui-commence.defi-a-toi{color:#1f6b45}
.defi-qui-commence.defi-adversaire{color:#7a5a1a}

/* Le téléphone réserve le centre de l'en-tête à l'animal et au code de partie.
   Le chrono Speedy partage l'emplacement du code. Les scores gardent leurs colonnes. */
@media(max-width:860px){
  body.mascot-on.in-game #view-game .game-header:has(>#mascot) :is(#mobile-score-a,#mobile-score-b){grid-row:1 / 3;}
  body.mascot-on.in-game #view-game .game-header:has(>#mascot) :is(#g-code,#g-chrono){grid-column:2;grid-row:2;}
  body.mascot-on.in-game #view-game .game-header>#mascot{
    position:relative!important;inset:auto!important;grid-column:2;grid-row:1;place-self:center;
    width:clamp(30px,calc(41px * var(--mascot-scale,1)),58px)!important;
    height:clamp(34px,calc(46px * var(--mascot-scale,1)),66px)!important;
    margin:0;z-index:auto;transform:none!important;overflow:hidden;pointer-events:none!important;
  }
  #view-game .game-header>#mascot::after{display:none;}
}

/* (V480) Fenêtre Mascotte : place pendant une partie sur téléphone. */
.pet-place{margin-top:12px;padding:10px 12px;border-radius:14px;background:var(--ma-card-2,#eef4fb);border:1px solid var(--ma-line,#c9d6e3)}
.pet-place-titre{font-weight:800;font-size:14px;margin-bottom:8px;color:var(--ma-ink,#163954)}
.pet-place-choix{display:grid;grid-template-columns:1fr 1fr;gap:8px}
/* V481 — aide du choix « Couleurs des cases bonus » (Confort visuel). */
#a11y-card .a11y-softbonus-aide{display:block;margin:-2px 0 8px}
#a11y-card #a11y-softbonus{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
#a11y-card #a11y-softbonus .a11y-opt{font-size:14px;line-height:1.15;padding:8px 6px;white-space:normal;min-width:0}
.pet-place-choix button{min-height:44px;white-space:normal;line-height:1.2}
