:root {
  --cream: #fff7ec;
  --card: #ffffff;
  --ink: #4a3b32; /* brun chaleureux */
  --muted: #a4917f;
  --orange: #ff6b2c;
  --orange-dark: #e8551a;
  --teal: #21b8a6;
  --ok: #34c759;
  --off: #f0a03c;
  --r: 26px; /* rayon généreux */
  --shadow: 0 10px 30px rgba(74, 59, 50, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--cream);
}

#app {
  display: grid;
  grid-template-columns: 380px 1fr;
  grid-template-areas: "panel map";
  height: 100vh;
}

/* ---------------- Panneau ---------------- */

#panel {
  grid-area: panel;
  background: radial-gradient(
      120% 60% at 50% 0%,
      #ffe9d4 0%,
      var(--cream) 55%
    );
  padding: 26px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  z-index: 1;
}

/* ---------------- Hero / photo ---------------- */

#hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#photo-wrap {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: var(--card);
  border: 6px solid #fff;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  overflow: hidden;
  animation: bob 3.2s ease-in-out infinite;
}
#lipton-photo {
  width: 132px;
  height: 132px;
  object-fit: contain;
  transition: transform 0.2s;
}
#photo-wrap:hover #lipton-photo {
  transform: rotate(-4deg) scale(1.06);
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

#hero h1 {
  font-family: "Baloo 2", cursive;
  font-weight: 800;
  font-size: 1.9rem;
  margin: 6px 0 0;
  line-height: 1.1;
  color: var(--orange-dark);
}
#tagline {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 700;
}

.badge {
  margin-top: 4px;
  padding: 7px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  border: 2px solid transparent;
}
.badge.online {
  background: #e3f9e9;
  color: #1c8c3c;
  border-color: #b6ecc4;
}
.badge.offline {
  background: #fdeed6;
  color: #c47314;
  border-color: #f6d6a8;
}

/* ---------------- Stats ---------------- */

dl#stats {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  padding: 14px 16px;
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.stat .ico {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: #fff1e6;
  border-radius: 50%;
  flex: none;
}
.stat dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 800;
  margin-bottom: 2px;
}
.stat dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---------------- Actions ---------------- */

#actions button {
  width: 100%;
  background: linear-gradient(180deg, var(--orange), var(--orange-dark));
  color: #fff;
  border: none;
  border-radius: var(--r);
  padding: 16px;
  font-family: "Baloo 2", cursive;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 107, 44, 0.4);
  transition: transform 0.08s, box-shadow 0.15s;
}
#actions button:hover {
  box-shadow: 0 10px 22px rgba(255, 107, 44, 0.5);
}
#actions button:active {
  transform: translateY(2px);
  box-shadow: 0 4px 10px rgba(255, 107, 44, 0.4);
}
#actions button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.error {
  background: #fdecec;
  border: 2px solid #f5b5b5;
  color: #b23b3b;
  padding: 12px 14px;
  border-radius: 18px;
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0;
}

#panel footer {
  margin-top: auto;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

/* ---------------- Carte ---------------- */

#map {
  grid-area: map;
  height: 100%;
  width: 100%;
}

.lipton-marker {
  background: none;
  border: none;
}
.lipton-marker img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
  transition: transform 0.15s;
}
.lipton-marker:hover img {
  transform: scale(1.12) rotate(-3deg);
}

.home-marker {
  background: none;
  border: none;
  font-size: 22px;
  text-align: center;
  line-height: 30px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.leaflet-popup-content-wrapper {
  border-radius: 18px;
  font-family: "Baloo 2", cursive;
  font-weight: 700;
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: var(--shadow);
  z-index: 1000;
}

/* ---------------- Mobile : la carte d'abord ---------------- */

@media (max-width: 760px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: 60vh auto;
    grid-template-areas:
      "map"
      "panel";
    height: auto;
    min-height: 100vh;
  }
  #map {
    height: 60vh;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    box-shadow: var(--shadow);
  }
  #panel {
    border-radius: 28px 28px 0 0;
    margin-top: -22px;
    padding: 32px 16px 16px;
    gap: 12px;
  }
  #hero {
    gap: 4px;
  }
  #photo-wrap {
    width: 96px;
    height: 96px;
    border-width: 4px;
  }
  #lipton-photo {
    width: 74px;
    height: 74px;
  }
  #hero h1 {
    font-size: 1.4rem;
    margin-top: 2px;
  }
  #tagline {
    font-size: 0.85rem;
  }
  .badge {
    margin-top: 0;
    padding: 5px 13px;
    font-size: 0.82rem;
  }
  dl#stats {
    gap: 8px;
  }
  .stat {
    gap: 11px;
    padding: 10px 13px;
    border-radius: 18px;
  }
  .stat .ico {
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
  }
  .stat dd {
    font-size: 1rem;
  }
  #panel footer {
    font-size: 0.72rem;
  }
}
