/* ===============================
   Snake – styles spécifiques
   =============================== */

.sn-root {
  /* Barre commune (css/games.css) aux couleurs du jardin */
  --mg-jeu-largeur: 624px;
  --mgb-fond: radial-gradient(120% 160% at 0% 0%, rgba(160, 230, 90, 0.25), transparent 55%),
    linear-gradient(120deg, #1d3a14, #3f6d2a);
  --mgb-texte: #eef7e6;
  --mgb-doux: #a9c79a;
  --mgb-accent: #b9f27c;
  --mgb-titre: linear-gradient(100deg, #d8ff9c, #8fe36b 50%, #ffd36b);
  --mgb-ombre: 0 4px 18px rgba(40, 80, 20, 0.3);
  --mg-fs-fond: radial-gradient(circle at 50% 40%, #3f6d2a, #1d3a14);
  --mg-bulle-fond: #1d3a14;
  align-items: center;
}

.sn-canvas-wrap {
  position: relative;
}

#sn-canvas {
  display: block;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgba(40, 80, 20, 0.35);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

.sn-skins {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-weight: bold;
  color: #555;
}

.sn-skins button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s;
}

.sn-skins button[data-skin="0"] { background: linear-gradient(135deg, #3d6ef5, #8fb0ff); }
.sn-skins button[data-skin="1"] { background: linear-gradient(135deg, #ff5e62, #ffb36b); }
.sn-skins button[data-skin="2"] { background: repeating-linear-gradient(45deg, #6b4f2a 0 6px, #c9a45c 6px 12px); }
.sn-skins button[data-skin="3"] { background: conic-gradient(#ff4d4d, #ffd24d, #4dff88, #4dc3ff, #b84dff, #ff4d4d); }

.sn-skins button.sel {
  outline: 3px solid #4a8a2c;
  outline-offset: 2px;
  transform: scale(1.1);
}

/* ---------- Modale d'aide ---------- */
.sn-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(20, 40, 10, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.sn-help-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #eef6e8;
  color: #2f5d1e;
  font-size: 16px;
  cursor: pointer;
}

.sn-help-close:hover {
  background: #dcebd0;
}

.sn-help {
  position: relative;
  max-width: 600px;
  max-height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  margin: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 16px 22px 18px 22px;
  color: #444;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  line-height: 1.45;
}

.sn-help-title {
  font-family: "Madimi One", cursive;
  font-size: 1.3em;
  color: #2f5d1e;
}

.sn-help p {
  margin: 6px 0 10px 0;
}

.sn-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 4px 16px;
  font-size: 0.93em;
}

.sn-help-grid span {
  display: inline-block;
  width: 26px;
  text-align: center;
}

/* Rocher de la légende (même dessin que dans le jeu) */
.sn-rock {
  display: inline-block;
  width: 20px;
  height: 16px;
  vertical-align: -2px;
  background: radial-gradient(circle at 32% 30%, #c4c6ca 0 20%, #8d8f94 45%);
  border: 2px solid #5f6166;
  border-radius: 48% 55% 45% 52% / 55% 50% 50% 45%;
  box-sizing: border-box;
}

/* ---------- Plein écran ---------- */

.sn-root.mg-fs {
  justify-content: center;
  overflow: hidden;
}

.sn-root.mg-fs .sn-skins {
  color: #e6f2dc;
}

