/* ==========================================================
   Aqua de Redstonia : thème de la carte
   Palette : abysse #031a24, lagon #0fb9b1, écume #e6fbff,
             redstone #ff5a4d (petit accent, clin d'oeil à Redstonia)
   ========================================================== */
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600&family=Unbounded:wght@500;700&display=swap");

/* ---- Variables (écrasent tous les thèmes) ---- */
:root, :root .theme-dark, :root .theme-light, :root .theme-contrast {
  --theme-bg: rgba(4, 30, 42, .78) !important;
  --theme-bg-hover: rgba(15, 185, 177, .16) !important;
  --theme-bg-light: rgba(15, 185, 177, .30) !important;
  --theme-fg: #e6fbff !important;
  --theme-fg-light: #7fd6e6 !important;
  --theme-switch-button-on: #0fb9b1 !important;
  --theme-stars-day: #e6fbff !important;
  --theme-moon-day: #7fd6e6 !important;
  --theme-stars-night: #063747 !important;
  --theme-moon-night: #031a24 !important;
  --aqua: #0fb9b1;
  --aqua-glow: rgba(15, 185, 177, .55);
  --redstone: #ff5a4d;
  font-family: "Sora", "Quicksand", sans-serif !important;
  font-weight: 400 !important;
}

/* ---- Verre : tous les panneaux ---- */
.control-bar, .side-menu, #zoom-buttons,
#map-container .bm-marker-popup, #map-container .bm-marker-labelpopup,
#map-container .bm-marker-html .bm-marker-poi-label {
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(127, 214, 230, .28);
  box-shadow: 0 8px 32px rgba(0, 20, 30, .55), inset 0 1px 0 rgba(255, 255, 255, .10);
  filter: none;
}
.control-bar { border-radius: 14px; overflow: hidden; height: 2.4em; }
.control-bar > :not(:first-child) { border-left: 1px solid rgba(127, 214, 230, .18); }
.side-menu { border-radius: 0 18px 18px 0; border-left: none; }
#zoom-buttons { border-radius: 14px; overflow: hidden; }
#map-container .bm-marker-popup,
#map-container .bm-marker-labelpopup,
#map-container .bm-marker-html .bm-marker-poi-label { border-radius: 12px; }

@media (max-width: 575.98px) {
  .control-bar { border-radius: 0 0 14px 14px; margin: 0; }
  .side-menu { border-radius: 0; }
}

/* ---- Boutons et lignes du menu ---- */
.svg-button { transition: background-color .25s, box-shadow .25s; }
.svg-button:hover { box-shadow: inset 0 0 18px var(--aqua-glow); }
.svg-button.active { box-shadow: inset 0 -2px 0 var(--redstone); }
.svg-button svg { fill: var(--theme-fg) !important; }
.svg-button:active svg { fill: #031a24 !important; }
.side-menu .simple-button, .side-menu .map-button { border-radius: 8px; transition: background-color .2s, padding-left .2s; }
.side-menu .simple-button:hover, .side-menu .map-button:hover { padding-left: 1em; }
.side-menu .map-button.selected { box-shadow: inset 3px 0 0 var(--redstone); }
.side-menu > .title {
  font-family: "Unbounded", "Sora", sans-serif;
  font-weight: 500;
  letter-spacing: .04em;
  border-bottom: 1px solid rgba(127, 214, 230, .25);
}
.side-menu .group { border: 1px solid rgba(127, 214, 230, .25); border-radius: 10px; }
.side-menu .group > .title { background: transparent; color: var(--aqua); }
.side-menu > .content hr { border-bottom: 1px solid rgba(127, 214, 230, .2); }
.side-menu .switch.on { box-shadow: 0 0 10px var(--aqua-glow); }
.side-menu .slider > label > input { background: rgba(127, 214, 230, .18); }
.side-menu .slider > label > input::-webkit-slider-thumb { background: var(--aqua); border-color: #e6fbff; }
.side-menu .slider > label > input::-moz-range-thumb { background: var(--aqua); border-color: #e6fbff; }
.choice-box { border: 1px solid rgba(127, 214, 230, .3); border-radius: 8px; }
.choice-box .choices .choice.selected { background: var(--aqua); color: #031a24; }
.side-menu .text-input, .number-input { background: rgba(3, 26, 36, .6); }
kbd { background: rgba(15, 185, 177, .25); }
::-webkit-scrollbar-thumb { background: rgba(15, 185, 177, .5); border-color: transparent; }

/* ---- Joueurs ---- */
#map-container .bm-marker-player img {
  border-radius: 6px;
  box-shadow: 0 0 0 2px var(--aqua), 0 0 14px var(--aqua-glow);
}
#map-container .bm-marker-player .bm-player-name {
  background: rgba(3, 26, 36, .85);
  border-radius: 6px;
  border-bottom: 2px solid var(--redstone);
}

/* ---- Pied de la fiche d'infos et écran d'erreur : sans signature externe ---- */
.info-content .info-footer { display: none; }
#bm-app-err { background: radial-gradient(circle at 50% 40%, #063747, #031a24 70%); }

/* ---- Ambiance : voile d'eau sur la carte + vague en haut ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(3, 26, 36, .55) 100%),
    linear-gradient(180deg, rgba(15, 185, 177, .10), rgba(3, 55, 71, .12));
  mix-blend-mode: multiply;
}
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  z-index: 20000;
  pointer-events: none;
  background: linear-gradient(90deg, #063747, #0fb9b1, #7fd6e6, #0fb9b1, #063747);
  background-size: 200% 100%;
  animation: aqua-wave 7s linear infinite;
}
@keyframes aqua-wave { to { background-position: -200% 0; } }

/* ---- Plaque de nom : le moment fort ---- */
#app::before {
  content: "Aqua";
  position: fixed;
  left: 1rem;
  bottom: 1.1rem;
  padding: .35em .9em .35em .8em;
  font: 700 1.5rem/1 "Unbounded", "Sora", sans-serif;
  letter-spacing: .06em;
  color: #e6fbff;
  background: linear-gradient(135deg, rgba(15, 185, 177, .55), rgba(4, 30, 42, .8));
  border: 1px solid rgba(127, 214, 230, .45);
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 0 28px var(--aqua-glow), 0 8px 24px rgba(0, 20, 30, .5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
#app::after {
  content: "de Redstonia";
  position: fixed;
  left: 1rem;
  bottom: .35rem;
  font: 400 .72rem/1 "Sora", sans-serif;
  color: var(--redstone);
  letter-spacing: .08em;
  text-shadow: 0 0 8px rgba(255, 90, 77, .6);
  pointer-events: none;
}
@media (max-width: 575.98px) {
  #app::before { font-size: 1.1rem; bottom: 1.4rem; }
  #app::after { bottom: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}