/* SURVIVE THE BOARD — mode YOUR PICK (choisir sa case) + choix du mode
   éléments créés par js/mines.js : #msMode, #msTap, #msBoard.picking, .mc.best, .msheat (.hm, .hbest) */

/* ---------- choix du mode (à l'entrée et à AGAIN) ---------- */
#msMode .btn.mmode {
  font: 900 31px/1 Montserrat; color: #e9eee8; letter-spacing: .3px;
  background: linear-gradient(#22332a, #16221c); border: 2px solid rgba(143,246,255,.22);
  --glow: rgba(143,246,255,.10); opacity: .8;
}
#msMode .btn.mmode small { font-size: 16px; opacity: .8; }
#msMode .btn.mmode.on {
  opacity: 1; color: #141414; border-color: #fff3c4;
  background: linear-gradient(#ffd84a, #e8b51e); --glow: rgba(250,208,63,.45);
  animation: mmodeOn .7s ease-in-out infinite alternate;
}
@keyframes mmodeOn { from { box-shadow: 0 6px 0 rgba(0,0,0,.4), 0 0 18px rgba(250,208,63,.25); } to { box-shadow: 0 6px 0 rgba(0,0,0,.4), 0 0 42px rgba(250,208,63,.6); } }

/* ---------- consigne pendant la fenêtre de décision ---------- */
#msTap .mstap {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  border: 2px dashed rgba(255,210,63,.55); border-radius: 16px; background: rgba(8,14,11,.55);
  animation: mstapPulse .9s ease-in-out infinite alternate;
}
#msTap .mstap b { font: 900 34px/1 Montserrat; color: #ffd23f; letter-spacing: .5px; text-shadow: 0 0 18px rgba(255,210,63,.45); }
#msTap .mstap span { font: 700 17px/1 'Barlow Semi Condensed'; color: #aab8b0; letter-spacing: .6px; }
@keyframes mstapPulse { from { border-color: rgba(255,210,63,.3); } to { border-color: rgba(255,210,63,.85); } }

/* ---------- plateau touchable (YOUR PICK seulement, fenêtre de décision) ---------- */
#msBoard { touch-action: manipulation; }
#msBoard.picking { cursor: pointer; box-shadow: 0 0 34px rgba(0,0,0,.55), inset 0 0 26px rgba(0,0,0,.6), 0 0 0 2px rgba(255,210,63,.35); }
@media (hover: hover) {
  #msBoard.picking .mc:not(.rev):not(.flag):not(.boom):not(.mine):hover {
    background: linear-gradient(145deg, #7a9886 0%, #587263 50%, #435a4e 100%);
    box-shadow: 0 0 0 1.5px rgba(255,210,63,.7), inset 1.5px 1.5px 0 rgba(255,255,255,.25);
  }
}

/* ---------- après le clic : case(s) la(les) plus sûre(s) ---------- */
#msBoard .mc.best { outline: 2px solid #5cf08a; outline-offset: 1px; z-index: 4; }
#msBoard .mc.best:not(.tgt) { box-shadow: 0 0 12px rgba(92,240,138,.75), inset 1.5px 1.5px 0 rgba(255,255,255,.2); }

/* ---------- carte de chaleur : toutes les cases cachées, colorées par le risque, ≈ 2 mesures en fondu ---------- */
.msheat { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; z-index: 5; }
.msheat .hm {
  position: absolute; border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font: 800 14px/1 'Barlow Semi Condensed'; color: #07100c; letter-spacing: -.5px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  opacity: 0; animation-name: hmFade; animation-timing-function: linear; animation-fill-mode: forwards; animation-duration: 4s;
}
.msheat .hm.hot { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
@keyframes hmFade { 0% { opacity: 0; transform: scale(.6); } 8% { opacity: 1; transform: scale(1); } 65% { opacity: .9; } 100% { opacity: 0; } }
/* étiquette de la case la plus sûre (valeur exacte) : au-dessus de la case, reste jusqu'à la manche suivante */
.msheat .hbest { position: absolute; z-index: 6; display: flex; justify-content: center; align-items: flex-start; overflow: visible; }
.msheat .hbest b {
  transform: translateY(-15px); padding: 2px 4px 1px; border-radius: 4px; white-space: nowrap;
  font: 800 12px/1 'Barlow Semi Condensed'; color: #07100c; background: #5cf08a;
  box-shadow: 0 1px 4px rgba(0,0,0,.6), 0 0 10px rgba(92,240,138,.6);
  animation: hbestIn .3s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes hbestIn { from { transform: translateY(-6px) scale(.5); opacity: 0; } to { transform: translateY(-15px) scale(1); opacity: 1; } }

/* =====================================================================
   YOUR PICK — grand plateau (classe #game.mspick posée par js/mines.js de l'intro à la fin ;
   le mode rapide et l'écran de choix du mode gardent la disposition d'origine).
   Scène 720×1280 : cases 66 px (≈ 33 px CSS sur un téléphone de 360 px), HUD en bandeau, oscilloscope réduit.
   ===================================================================== */
#game.mspick #gTitle { top: 102px; font-size: 38px; padding: 10px 18px 8px; }
#game.mspick #sub { top: 164px; }

/* bandeau du haut : vies / mines / clics à gauche, la lecture du pourcentage à droite */
#game.mspick #msHud {
  left: 22px; top: 212px; width: 344px; display: grid; grid-auto-flow: column; grid-template-rows: auto auto;
  column-gap: 18px; justify-items: center; align-items: start;
}
#game.mspick #msHud .lab { margin: 0 0 8px; }
#game.mspick #hudR {
  left: 374px; top: 204px; width: 330px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px;
  align-items: center; text-align: left;
}
#game.mspick #pct { grid-row: 1; font-size: 46px; }
#game.mspick #pctLab { margin-top: 0; font-size: 24px; line-height: 1.05; }
/* libellés à 24 px de scène : le détail passe sous le % (une ligne), puis MATH SAYS / stat */
#game.mspick #pctSub { grid-column: 1 / 3; margin-top: 2px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#game.mspick #stat2, #game.mspick #mathSays { grid-column: 1 / 3; text-align: center; }
#game.mspick #stat2 { margin-top: 6px; }
#game.mspick #stat2:empty, #game.mspick #mathSays:empty { display: none; }
#game.mspick #mathSays { margin-top: 6px; }
#game.mspick #mathSays br { display: none; }
#game.mspick #mathSays span { margin-left: 6px; }

/* le plateau, aussi grand que la scène le permet : 9 × 74 px + 8 × 3 px + 2 × 6 px + cadre = 704 px
   (pas de 77 px ≈ 38,5 px CSS à 360 px de large, 44 px à 412 px ; tout toucher compte pour la case la plus proche) */
#game.mspick #msBoard {
  left: 8px; top: 312px; width: 704px; height: 704px; padding: 6px;
  grid-template-columns: repeat(9, 74px); grid-auto-rows: 74px; gap: 3px; border-radius: 12px;
}
#game.mspick #msBoard .mc { width: 74px; height: 74px; border-radius: 7px; font-size: 46px; }
#game.mspick #msBoard .mc.flag, #game.mspick #msBoard .mc.boom, #game.mspick #msBoard .mc.mine, #game.mspick #msBoard .mc.peek { background-size: 74%, auto; }
#game.mspick #msBoard .mc.tgt::before { left: 41px; top: 36px; width: 29px; height: 40px; background-size: 100% 100%; }
#game.mspick .msheat .hm { font-size: 24px; border-radius: 6px; }
#game.mspick .msheat .hbest b { font-size: 19px; padding: 3px 6px 2px; transform: translateY(-26px); animation-name: hbestInBig; }
@keyframes hbestInBig { from { transform: translateY(-10px) scale(.5); opacity: 0; } to { transform: translateY(-26px) scale(1); opacity: 1; } }

/* sous le plateau : état, minuteur, oscilloscope réduit, formules (f3/f4 = sons, masquées), légende, boutons de fin */
#game.mspick #status { top: 1024px; }
#game.mspick #prog { top: 1062px; }
#game.mspick #bSkip { top: 1022px; }
/* l'oscilloscope (le son) laisse sa place au plateau ; la pastille, le minuteur et les maths restent */
#game.mspick #scope { display: none; }
#game.mspick .f1 { top: 1072px; font-size: 28px; }
#game.mspick #fx { top: 1112px; height: 40px; }
#game.mspick #fx .f { font-size: 24px; }
#game.mspick #fx .f3, #game.mspick #fx .f4 { display: none !important; }
#game.mspick .cap { top: auto; bottom: 80px; font-size: 24px; padding: 6px 10px; }
#game.mspick #msActions { top: 1216px; height: 56px; }
#game.mspick #msActions .arow { height: 56px; }
#game.mspick #msActions .btn { font-size: 26px; border-radius: 12px; }
#game.mspick #msActions .btn small { display: none; }
/* grand plateau : la consigne est déjà dans la pastille (PICK A TILE) et le détail du risque dans la lecture du % */
#game.mspick #msTap { display: none !important; }
#game.mspick #mathSays span { display: none; }
#game.mspick #mathSays b { margin-left: 6px; }
