* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top, #050816 0, #02030a 50%, #000 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 16;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #f5f5f5;
}

/* Utils */
.hidden {
  display: none !important;
}

/* Canvas principal */
#gameCanvas {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  touch-action: manipulation;
  background: #000;
}

/* Barre du bas avec bouton MENU */
.bottom-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 30px;
  margin-top: -2px;
}

.menu-main-button {
  padding: 12px 52px;
  border-radius: 3px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #30336b, #130f40);
  color: #f5f6fa;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  text-transform: uppercase;
}

/* En jeu : bouton invisible mais la barre reste -> pas de décalage */
.menu-main-button.in-game {
  opacity: 0;
  pointer-events: none;
}

.menu-main-button:active {
  transform: translateY(1px);
}

/* Panneau de menu (réglages) */
.menu-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.menu-panel.hidden {
  display: none;
}

/* Contenu du menu : au-dessus du bouton MENU */
.menu-panel-content {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  width: 75%;
  max-width: 280px;
  background: #050816;
  border-radius: 3px;
  padding: 10px 12px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

/* Boutons du menu (SKIN / SOUND / CGU) */
.menu-button {
  padding: 10px 10px;
  margin-top: 2px;
  border-radius: 3px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  background: #1f2937;
  color: #f9fafb;
  cursor: pointer;
}

.menu-button:active {
  transform: translateY(1px);
}

/* Son OFF : plus sombre */
.menu-button.sound-off {
  background: #111827;
  color: #e5e7eb;
}

/* Bouton CONTINUE (Game Over) */
.continue-button {
  position: absolute;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  padding: 10px 32px;
  border-radius: 3px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: #16a085;
  color: #f5f5f5;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  text-transform: uppercase;
}

.continue-button:active {
  transform: translate(-50%, 1px);
}

/* Overlay PUB */
.ad-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
}

.ad-box {
  width: 70%;
  max-width: 260px;
  background: #050816;
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
}

.ad-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 6px;
}

.ad-text {
  font-size: 13px;
  margin-bottom: 10px;
  color: #e5e7eb;
}

.ad-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #111827;
  overflow: hidden;
}

.ad-bar-fill {
  width: 0;
  height: 100%;
  background: #22c55e;
}
