@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

body {
  font-family: 'Inter', sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overflow: hidden;
  background-color: #1c1311;
  color: #fceee9;
}

body.is-pseudo-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 99999 !important;
}

/* ═══════════════════════════════════════════════════════════
   FOND MENU PRINCIPAL — SLIDESHOW (image/home/1.jpeg → 2 → 3)
   ═══════════════════════════════════════════════════════════ */
#main-menu-overlay {
  position: fixed;
  inset: 0;
  background-color: #1c1311;
}

/* Couche de slideshow (remplie par JS) */
.slideshow-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
  pointer-events: none;
}

.slideshow-layer.active {
  opacity: 1;
}

/* Overlay sombre par-dessus le slideshow pour la lisibilité */
.menu-overlay-dim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(
    ellipse at center,
    rgba(28, 19, 17, 0.35) 0%,
    rgba(12, 8, 7, 0.75) 100%
  );
  pointer-events: none;
}

/* Le contenu du menu doit être au-dessus du slideshow et de l'overlay */
#main-menu-overlay > *:not(.slideshow-layer):not(.menu-overlay-dim):not(#slideshow-container) {
  position: relative;
  z-index: 2;
}

/* ═══════════════════════════════════════════════════════════
   PANNEAU LATÉRAL DU MENU PRINCIPAL
   ═══════════════════════════════════════════════════════════ */
.menu-board-panel {
  background-color: rgba(43, 30, 27, 0.92);
  border: 4px solid #63463e;
  border-radius: 2rem;
  box-shadow: 0 16px 35px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

/* ═══════════════════════════════════════════════════════════
   MODALES ET PANNEAUX SECONDAIRES (fond flou sombre classique)
   ═══════════════════════════════════════════════════════════ */
.notebook-card {
  background-color: rgba(43, 30, 27, 0.95);
  border: 4px solid #63463e;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), inset 0 2px 6px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border-radius: 2rem;
  color: #fceee9;
}

/* Ligne latérale décorative */
.notebook-margin-red {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 3px;
  background-color: #e05a47;
  opacity: 0.7;
  pointer-events: none;
}

/* Fond de la zone de dessin de roue */
.drawing-grid-bg {
  background-color: #1f1412;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 16px 16px;
}

/* ═══════════════════════════════════════════════════════════
   ZONE DE JEU (canvas Matter.js) — cachée par défaut
   ═══════════════════════════════════════════════════════════ */
#game-area {
  background-color: #f8fafc;
}

#game-area canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ═══════════════════════════════════════════════════════════
   STYLE BOUTONS RELIEF 3D (menu principal)
   ═══════════════════════════════════════════════════════════ */
#main-menu-overlay button:not(#profile-display-header) {
  background-color: #4e3a35;
  color: #ffffff;
  border: 3px solid #7c5c53;
  border-radius: 1.5rem;
  box-shadow: 0 6px 0 #281d1a, 0 10px 22px rgba(0, 0, 0, 0.4);
  font-family: 'Fredoka', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease;
}

#main-menu-overlay button:not(#profile-display-header):hover {
  background-color: #634b45;
  border-color: #a1796d;
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #281d1a, 0 14px 26px rgba(0, 0, 0, 0.5);
}

#main-menu-overlay button:not(#profile-display-header):active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #281d1a, 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* Bouton "Jouer" / Action principale (Rouge Corail) */
#btn-start-game,
.btn-action-primary {
  background-color: #e05a47 !important;
  border: 3px solid #f28b7c !important;
  color: #ffffff !important;
  box-shadow: 0 6px 0 #8c2a1c, 0 10px 22px rgba(224, 90, 71, 0.4) !important;
}

#btn-start-game:hover,
.btn-action-primary:hover {
  background-color: #eb6d5b !important;
  box-shadow: 0 8px 0 #8c2a1c, 0 14px 26px rgba(224, 90, 71, 0.6) !important;
}

/* Cartes de terrain & véhicules */
.btn-terrain-card,
.btn-car-preset {
  background-color: #352420;
  border: 2px solid #543b35;
  color: #fceee9;
  transition: all 0.15s ease;
}

.btn-terrain-card:hover,
.btn-car-preset:hover {
  background-color: #48322c;
  border-color: #e05a47;
  transform: translateY(-2px);
}

/* Personnalisation des entrées & selects */
input[type="text"],
select {
  background-color: #231816 !important;
  border: 2px solid #543b35 !important;
  color: #ffffff !important;
}

input[type="text"]:focus,
select:focus {
  border-color: #e05a47 !important;
}

/* ═══════════════════════════════════════════════════════════
   TYPOGRAPHIE GLOBALE
   ═══════════════════════════════════════════════════════════ */
h1, h2, h3, .font-mono {
  font-family: 'Fredoka', 'Inter', sans-serif;
}