:root {
  --forest: #14281d;
  --forest-2: #1f3b2b;
  --card: #ffffff;
  --text: #15201a;
  --muted: #5d6b63;
  --hunt: #d62828;
  --hunt-bg: #fdecec;
  --free: #2a9d4b;
  --free-bg: #e8f6ec;
  --neutral: #8a958f;
  --orange: #f77f00;
  --shadow: 0 6px 24px rgba(0, 0, 0, .18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --card: #17211b;
    --text: #eef3ef;
    --muted: #9fb0a6;
    --hunt-bg: #3a1717;
    --free-bg: #15301e;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--forest);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#map { position: fixed; inset: 0; }

.top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: linear-gradient(var(--forest), rgba(20, 40, 29, .85));
  color: #fff;
}

.brand { font-weight: 800; font-size: 18px; letter-spacing: .2px; white-space: nowrap; }

.days { display: flex; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 3px; }
.days button {
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}
.days button[aria-selected="true"] { background: #fff; color: var(--forest); }

.alert {
  position: fixed;
  z-index: 1000;
  top: calc(var(--safe-top) + 58px);
  left: 12px; right: 12px;
  background: var(--hunt);
  color: #fff;
  border-radius: 12px;
  padding: 10px 40px 10px 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
}
.alert p { margin: 4px 0 0; }
.alert-close {
  position: absolute; top: 6px; right: 6px;
  border: 0; background: transparent; color: #fff;
  font-size: 18px; width: 32px; height: 32px;
}

.locate {
  position: fixed;
  z-index: 1000;
  right: 16px;
  bottom: calc(var(--card-h, 180px) + 16px);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--card);
  color: var(--forest-2);
  box-shadow: var(--shadow);
  display: grid; place-items: center;
}
@media (prefers-color-scheme: dark) { .locate { color: #fff; } }
.locate.following { color: #1a73e8; }

.card {
  position: fixed;
  z-index: 1000;
  left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow);
  padding: 18px 16px calc(var(--safe-bottom) + 12px);
  max-height: 50vh;
  overflow-y: auto;
}

.status { display: flex; align-items: center; gap: 14px; }
.dot { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--neutral); }
.card.hunt .dot { background: var(--hunt); box-shadow: 0 0 0 6px var(--hunt-bg); animation: pulse 1.6s infinite; }
.card.free .dot { background: var(--free); box-shadow: 0 0 0 6px var(--free-bg); }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px var(--hunt-bg); } }
@media (prefers-reduced-motion: reduce) { .card.hunt .dot { animation: none; } }

.status-title { font-size: 22px; font-weight: 800; line-height: 1.2; }
.card.hunt .status-title { color: var(--hunt); }
.card.free .status-title { color: var(--free); }
.status-sub { color: var(--muted); font-size: 15px; margin-top: 2px; }

.status-extra { margin-top: 12px; font-size: 14px; }
.status-extra:empty { display: none; }
.status-extra .warn {
  background: #fff3e0; color: #7a3d00;
  border-radius: 10px; padding: 8px 10px; margin-bottom: 8px;
}
@media (prefers-color-scheme: dark) { .status-extra .warn { background: #3a2a10; color: #ffd8a8; } }
.warn-alert { display: flex; align-items: center; cursor: pointer; }
.warn-alert .more { margin-left: auto; padding-left: 12px; white-space: nowrap; font-size: 13px; text-decoration: underline; }
.status-extra .next { color: var(--muted); }
.status-extra .next b { color: var(--text); }

.meta {
  margin-top: 10px; padding-top: 8px;
  border-top: 1px solid rgba(127, 127, 127, .2);
  color: var(--muted); font-size: 12px;
}
.meta summary { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; list-style: none; }
.meta summary::-webkit-details-marker { display: none; }
.meta .more { margin-left: auto; white-space: nowrap; text-decoration: underline; }
.meta .more::after { content: " ›"; }
.meta[open] .more::after { content: " ˅"; }
.meta-more { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.meta a { color: inherit; }
.emoji { display: inline-block; margin: 0 .4em; }
/* Emoji en début de ligne : pas de marge à gauche. */
.warn > .emoji:first-child, .signature > .emoji:first-child, #alert-title > .emoji:first-child, .stale > .emoji:first-child { margin-left: 0; }
#meta-data { display: flex; flex-direction: column; gap: 2px; }
.meta .stale { color: #b45309; font-weight: 600; }
@media (prefers-color-scheme: dark) { .meta .stale { color: #fbbf24; } }
.signature { margin-top: 6px; text-align: center; font-weight: 600; letter-spacing: .2px; }
.signature a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-link { display: block; margin-top: 2px; text-align: center; font-size: .75rem; color: inherit; opacity: .7; }

.lot-label {
  background: transparent; border: 0; box-shadow: none;
  font-weight: 800; font-size: 15px; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 6px #000;
}
.lot-label::before { display: none; }

.leaflet-control-attribution { font-size: 10px; }
.leaflet-top { top: calc(var(--safe-top) + 56px); }
