:root {
  --bg: #120e0b;
  --bg-elevated: #1c1510;
  --panel: rgba(42, 32, 26, 0.82);
  --panel-solid: #2a211c;
  --ink: #f3e7d3;
  --muted: #b9a48a;
  --accent: #d4b56a;
  --accent-deep: #a8843a;
  --danger: #c45c4a;
  --line: rgba(196, 163, 90, 0.18);
  --line-strong: #4a3c30;
  --ok: #6a9e6a;
  --admin: #c4895a;
  --dev: #7eb8c9;
  --sidebar-w: 268px;
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 15% -10%, rgba(196, 140, 70, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 45% at 90% 10%, rgba(90, 50, 30, 0.35), transparent 50%),
    radial-gradient(ellipse 70% 60% at 50% 110%, rgba(40, 70, 55, 0.12), transparent 55%),
    linear-gradient(180deg, #1a1410 0%, var(--bg) 40%, #0c0907 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }

/* ——— Login ——— */
.login-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  animation: fadeRise 0.7s ease both;
}

.login-stage {
  width: min(440px, 100%);
  text-align: center;
}

.brand-mark {
  margin: 0;
  font-size: 2.4rem;
  color: var(--accent);
  text-shadow: 0 0 40px rgba(212, 181, 106, 0.45);
  animation: crestGlow 3.5s ease-in-out infinite;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: 0.06em;
  margin: 0.4rem 0 0.75rem;
  background: linear-gradient(180deg, #fff3d8 0%, var(--accent) 55%, var(--accent-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-tagline {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
}

.login-card {
  background: rgba(48, 36, 28, 0.94);
  border: 1px solid rgba(212, 181, 106, 0.28);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  text-align: left;
  animation: fadeRise 0.85s 0.12s ease both;
}

.login-hint {
  margin: 0 0 1rem;
  color: #e4d4bc;
  font-size: 0.95rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.25rem;
  background: linear-gradient(180deg, #6570f5, #5865f2);
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  font-size: 0.98rem;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.28);
}

.oauth-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.oauth-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'%3E%3Cpath fill='black' d='M107.7 8.07A105.15 105.15 0 0 0 81.14.2a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.3.2 105.89 105.89 0 0 0 18.64 8.1C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69c-6.23 0-11.36-5.66-11.36-12.63s5-12.66 11.36-12.66S54 46.05 53.89 53.06 48.84 65.69 42.45 65.69Zm42.24 0c-6.23 0-11.36-5.66-11.36-12.63s5-12.66 11.36-12.66 11.47 5.7 11.36 12.66S91.04 65.69 84.69 65.69Z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.oauth-hint { margin-top: 0.85rem; word-break: break-all; color: #cbb89a; }

.code-login {
  margin-top: 1.1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 0.85rem;
}

.code-login summary {
  cursor: pointer;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

/* ——— Shell ——— */
.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  animation: fadeRise 0.45s ease both;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.35rem 1rem 1rem;
  background:
    linear-gradient(180deg, rgba(40, 30, 22, 0.96), rgba(22, 16, 12, 0.98));
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.45rem 1rem;
  border-bottom: 1px solid var(--line);
}

.sidebar-crest {
  font-size: 1.55rem;
  color: var(--accent);
  filter: drop-shadow(0 0 12px rgba(212, 181, 106, 0.35));
}

.sidebar-name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.sidebar-sub {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group { margin-top: 0.25rem; }

.nav-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0.45rem 0.45rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-weight: 600;
}

.nav-group-dev {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(126, 184, 201, 0.28);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.side-nav button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 560;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.side-nav button:hover {
  background: rgba(212, 181, 106, 0.08);
}

.side-nav button.active {
  background: linear-gradient(90deg, rgba(212, 181, 106, 0.22), rgba(212, 181, 106, 0.06));
  color: #fff4d8;
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-group-dev .side-nav button.active {
  background: linear-gradient(90deg, rgba(126, 184, 201, 0.2), rgba(126, 184, 201, 0.05));
  box-shadow: inset 3px 0 0 var(--dev);
}

.nav-ico {
  width: 1.2rem;
  text-align: center;
  opacity: 0.85;
  font-size: 0.9rem;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.who-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  padding: 0 0.25rem;
}

.who-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.logout-btn {
  width: 100%;
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #3a2f28;
  color: var(--accent);
}

.pill-admin {
  background: rgba(196, 137, 90, 0.18);
  color: var(--admin);
  border: 1px solid rgba(196, 137, 90, 0.35);
}

.pill-dev {
  background: rgba(126, 184, 201, 0.15);
  color: var(--dev);
  border: 1px solid rgba(126, 184, 201, 0.35);
}

/* ——— Workspace ——— */
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.5rem 1.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 21, 16, 0.65), transparent);
}

.page-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.workspace-body {
  padding: 1.25rem 1.75rem 2.5rem;
  max-width: 1180px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  animation: panelIn 0.35s ease both;
}

.lead {
  margin: 0 0 1.1rem;
  color: var(--muted);
  max-width: 52ch;
}

.section-title {
  margin: 1.35rem 0 0.65rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.dev-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(126, 184, 201, 0.08);
  border: 1px solid rgba(126, 184, 201, 0.22);
  color: var(--muted);
  font-size: 0.9rem;
}

.field-inline,
.field-row label,
label {
  display: block;
  margin: 0.65rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-inline {
  max-width: 360px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0.75rem;
}

input, textarea, select {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #15100d;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(212, 181, 106, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 181, 106, 0.12);
}

button {
  margin-top: 0.75rem;
  margin-right: 0.4rem;
  background: linear-gradient(180deg, #dfc07a, var(--accent-deep));
  color: #1a1410;
  border: 0;
  border-radius: 9px;
  padding: 0.58rem 1.05rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

button:hover { filter: brightness(1.05); transform: translateY(-1px); }
button:active { transform: translateY(0); }

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-strong);
}

button.danger {
  background: linear-gradient(180deg, #d46a58, var(--danger));
  color: #fff;
}

.muted { color: var(--muted); font-size: 0.85rem; }
.error { color: #ff8a7a; min-height: 1.2em; margin: 0 0 0.75rem; }
details { margin-top: 1rem; color: var(--muted); }
details summary { cursor: pointer; margin-bottom: 0.5rem; }

pre {
  background: #15100d;
  border-radius: 10px;
  padding: 0.9rem;
  overflow: auto;
  font-size: 0.82rem;
  border: 1px solid var(--line-strong);
  max-height: 420px;
}

textarea#configJson {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.84rem;
  min-height: 320px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.stat {
  background: linear-gradient(160deg, #1a130f, #15100d);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat:hover {
  border-color: rgba(212, 181, 106, 0.35);
  transform: translateY(-2px);
}

.stat .label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat .value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: var(--accent);
}

.clean-list { list-style: none; padding: 0; margin: 0; }
.clean-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
}

.mini-card {
  background: #15100d;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  transition: border-color 0.18s ease;
}

.mini-card:hover { border-color: rgba(212, 181, 106, 0.4); }
.mini-card strong { display: block; margin-bottom: 0.25rem; }
.mini-card .meta { color: var(--muted); font-size: 0.82rem; }

.table-wrap { overflow: auto; margin-top: 0.5rem; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
table.data th { color: var(--muted); font-weight: 600; }

.player-card {
  background: #15100d;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin: 0.75rem 0;
}
.player-card h3 { margin: 0 0 0.5rem; }

.badge {
  display: inline-block;
  background: #3a2f28;
  color: var(--accent);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  margin-right: 0.35rem;
}

.live-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.live-controls .field-inline { margin: 0; }
.live-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}
.live-toolbar .inline,
.shop-toggles .inline,
label.inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--muted);
}
.live-toolbar input[type="checkbox"],
.shop-toggles input[type="checkbox"] { width: auto; margin: 0; }
.live-toolbar button { margin-top: 0; }

.live-stats { margin: 0.5rem 0 1rem; }

.live-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.live-map-wrap { min-width: 0; }

.live-map {
  position: relative;
  width: 100%;
  /* Même ratio que l'image de carte (1024×768) et étirement exact :
     les % des pins correspondent alors pile aux positions sur l'image. */
  aspect-ratio: 4 / 3;
  max-width: 747px;
  margin-inline: auto;
  background-color: #15100d;
  background-size: 100% 100%;
  background-position: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35);
}

.live-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 72px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  color: var(--ink);
  font: inherit;
}
.live-node .dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin: 0 auto 0.2rem;
  border: 2px solid rgba(243, 231, 211, 0.75);
  transition: transform 0.18s ease;
}
.live-node:hover .dot,
.live-node.selected .dot { transform: scale(1.25); }
.live-node.selected .name {
  color: #fff4d8;
  text-shadow: 0 0 10px rgba(212, 181, 106, 0.7);
}
.live-node .name {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: #f3e7d3;
  text-shadow: 0 1px 3px #000, 0 0 8px rgba(0,0,0,0.8);
  white-space: nowrap;
}
.live-node .wx {
  display: block;
  font-size: 0.62rem;
  line-height: 1;
  margin-top: 0.1rem;
}
.live-node.occupied .dot {
  animation: livePulse 1.8s ease-in-out infinite;
}
.live-node.hot .dot { box-shadow: 0 0 16px rgba(196, 80, 60, 0.75) !important; }
.live-node.boss .dot {
  outline: 2px solid #ff7043;
  outline-offset: 3px;
  animation: bossHalo 1.4s ease-in-out infinite;
}
.live-node.wanted .dot {
  outline: 2px dashed #b54a3c;
  outline-offset: 3px;
  animation: wantedBlink 2.2s ease-in-out infinite;
}

.live-badge {
  position: absolute;
  top: -4px;
  right: 10px;
  min-width: 1.1rem;
  padding: 0 4px;
  border-radius: 8px;
  background: #c9a227;
  color: #1a120c;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
  z-index: 3;
}
.live-badge.inbound { background: #546e7a; color: #f3e7d3; }

.live-route {
  position: absolute;
  height: 3px;
  background: linear-gradient(90deg, rgba(212,181,106,0.1), rgba(212,181,106,0.95), rgba(212,181,106,0.1));
  transform-origin: left center;
  z-index: 1;
  pointer-events: none;
  border-radius: 2px;
  animation: routeShimmer 1.6s linear infinite;
  background-size: 200% 100%;
}
.live-route.bivouac {
  background: linear-gradient(90deg, rgba(84,110,122,0.2), rgba(126,184,201,0.85), rgba(84,110,122,0.2));
  background-size: 200% 100%;
  animation: none;
  opacity: 0.7;
}

.live-traveler {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff3d0;
  border: 2px solid #c9a227;
  transform: translate(-50%, -50%);
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(212, 181, 106, 0.8);
  animation: travelerBob 1.1s ease-in-out infinite;
}
.live-traveler.bivouac {
  background: #90caf9;
  border-color: #546e7a;
  box-shadow: 0 0 8px rgba(84, 110, 122, 0.7);
}

.live-traveler.horse {
  width: auto;
  height: auto;
  min-width: 1.2rem;
  background: transparent;
  border: none;
  box-shadow: none;
  font-size: 1.15rem;
  line-height: 1;
  transform: translate(-50%, -50%);
  animation: travelerBob 1.4s ease-in-out infinite;
}
.live-map.night { filter: saturate(0.85) brightness(0.88); }
.live-map.fog-on .live-node.fog { opacity: 0.55; }
.live-node.invasion .dot { animation: wantedBlink 1s ease-in-out infinite; }
.live-node.maritime::after {
  content: "⚓";
  position: absolute;
  top: -0.55rem;
  right: -0.15rem;
  font-size: 0.55rem;
}
.live-blazon {
  position: absolute;
  top: -0.65rem;
  left: -0.25rem;
  font-size: 0.75rem;
}
.live-flash {
  position: absolute;
  right: -0.35rem;
  bottom: -0.15rem;
  animation: wantedBlink 0.8s ease-in-out infinite;
}
.live-statue {
  position: absolute;
  font-size: 1rem;
  transform: translate(-50%, -50%);
  opacity: 0.85;
  pointer-events: none;
}
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(196, 163, 90, 0.35);
  color: inherit;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.btn-ghost:hover { border-color: var(--accent, #c4a35a); }
.route-panel {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.45;
}
.eco-mass { margin-bottom: 0.5rem; font-size: 0.9rem; }
.eco-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 52px;
  margin-bottom: 0.5rem;
}
.eco-bar {
  flex: 1;
  background: linear-gradient(180deg, #c9a227, #8a6b1f);
  border-radius: 2px 2px 0 0;
  min-width: 4px;
}
.btn-link { color: var(--accent, #c9a227); font-size: 0.85rem; }

.live-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
.leg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(21, 16, 13, 0.75);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
}
.leg-chip i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.leg-chip i.leg-route {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.leg-chip i.leg-pulse {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.leg-chip.alert {
  color: #ffb4a8;
  border-color: rgba(196, 92, 74, 0.45);
}

.live-side {
  background: rgba(21, 16, 13, 0.55);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
  max-height: 620px;
  overflow: auto;
}
.live-district-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.85rem;
}
.live-district-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.live-district-row:hover,
.live-district-row.active {
  background: rgba(212, 181, 106, 0.12);
}
.ldr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.ldr-name { font-size: 0.82rem; font-weight: 600; }
.ldr-meta { font-size: 0.75rem; color: var(--accent); }

.live-detail {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  font-size: 0.88rem;
}
.live-detail-head {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.65rem;
}
.live-detail-emoji { font-size: 1.5rem; }
.emoji-ico { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }
.live-detail-emoji .emoji-ico { width: 1.5rem; height: 1.5rem; }
.live-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.5rem;
}
.live-alert {
  margin: 0.45rem 0 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
}
.live-alert.boss {
  background: rgba(255, 112, 67, 0.12);
  border: 1px solid rgba(255, 112, 67, 0.35);
  color: #ffab91;
}
.live-alert.wanted {
  background: rgba(181, 74, 60, 0.12);
  border: 1px solid rgba(181, 74, 60, 0.35);
  color: #ffab91;
}

.prog {
  display: inline-block;
  width: 64px;
  height: 6px;
  border-radius: 4px;
  background: #2a211c;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 0.35rem;
}
.prog span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 181, 106, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(212, 181, 106, 0); }
}
@keyframes routeShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
@keyframes bossHalo {
  0%, 100% { outline-color: #ff7043; box-shadow: 0 0 6px 2px rgba(255, 112, 67, 0.5); }
  50% { outline-color: #ffab91; box-shadow: 0 0 18px 6px rgba(255, 112, 67, 0.85); }
}
@keyframes wantedBlink {
  0%, 100% { outline-color: #b54a3c; }
  50% { outline-color: rgba(181, 74, 60, 0.25); }
}
@keyframes travelerBob {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -56%) scale(1.15); }
}

.shop-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.75rem 0; }
.shop-toolbar input { max-width: 240px; margin-top: 0; }
.shop-toolbar button { margin-top: 0; }
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.shop-cat-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.25rem;
}
.shop-card {
  background: #15100d;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem;
  text-align: center;
  cursor: pointer;
  color: var(--ink);
  margin: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.shop-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.shop-card-create {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border-style: dashed;
  background: transparent;
}
.shop-card-create .plus { font-size: 2rem; color: var(--accent); line-height: 1; }
.shop-card-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.4rem;
  border-radius: 8px;
  background: #2a211c center/cover no-repeat;
}
.shop-card-name { font-size: 0.78rem; font-weight: 600; }
.shop-card-price { font-size: 0.75rem; color: var(--accent); margin-top: 0.25rem; }
.shop-card-off { font-size: 0.65rem; color: var(--danger); }
.shop-editor {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.shop-toggles { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; margin: 0.5rem 0; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.shop-actions button { margin-top: 0; }
.discord-embed {
  background: #2b2d31;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  font-family: "gg sans", "Segoe UI", sans-serif;
  min-height: 120px;
}
.discord-embed .de-bar { width: 4px; background: #c9a227; flex-shrink: 0; }
.discord-embed .de-body { padding: 0.75rem 1rem; flex: 1; position: relative; }
.discord-embed .de-title { color: #f2f3f5; font-weight: 600; margin-bottom: 0.4rem; }
.discord-embed .de-desc { color: #dbdee1; font-size: 0.9rem; line-height: 1.35; white-space: pre-wrap; }
.discord-embed .de-small { color: #949ba4; font-size: 0.78rem; }
.discord-embed .de-thumb {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: center/cover no-repeat #1e1f22;
}

.mobile-nav-btn { display: none; margin: 0; }
.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.55);
}

@keyframes fadeRise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes crestGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(212, 181, 106, 0.25)); }
  50% { filter: drop-shadow(0 0 22px rgba(212, 181, 106, 0.55)); }
}

/* ——— Équipe (whitelist) ——— */
.team-heading {
  margin: 1.2rem 0 0.6rem;
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.04em;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.8rem;
}
.team-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0.9rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.team-card-dev { border-color: rgba(126, 184, 201, 0.45); }
.team-card-admin { border-color: rgba(196, 137, 90, 0.45); }
.team-badge {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}
.team-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}
.team-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.team-avatar-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--muted);
  font-weight: 700;
}
.team-name { margin: 0; font-weight: 600; }
.team-id { margin: 0.1rem 0 0; font-size: 0.72rem; color: var(--muted); }
.team-note { margin: 0.15rem 0 0; font-size: 0.75rem; color: var(--muted); font-style: italic; }
.team-remove { flex-shrink: 0; font-size: 0.75rem; padding: 0.3rem 0.6rem; }

/* ——— Page publique ——— */
.public-shell {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.4rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.public-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}
.public-title {
  margin: 0.2rem 0 0.3rem;
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 1.7rem;
}
.public-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.public-board {
  margin: 0;
  padding: 0 0 0 1.4rem;
}
.public-board li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.public-board li:last-child { border-bottom: 0; }
.board-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.board-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-val { color: var(--accent); font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.public-foot { text-align: center; font-size: 0.8rem; }

/* ——— Timeline (publique + onglet admin) ——— */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-height: 460px;
  overflow-y: auto;
}
.timeline-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.5rem 0.3rem;
  border-left: 2px solid var(--line-strong);
  margin-left: 0.55rem;
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.85rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-deep);
  border: 2px solid var(--bg-elevated);
}
.timeline-ico { flex-shrink: 0; font-size: 1rem; margin-left: 0.5rem; }
.timeline-body { min-width: 0; }
.timeline-msg { font-size: 0.9rem; }
.timeline-meta { font-size: 0.72rem; margin-top: 0.1rem; }

/* ——— Live map avatars ——— */
.live-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 3px;
  max-width: 72px;
  justify-content: center;
}
.live-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  object-fit: cover;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  animation: avatarPop 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
@keyframes avatarPop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ——— Ops panel ——— */
.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.ops-card {
  background:
    linear-gradient(160deg, rgba(58, 44, 32, 0.55), rgba(28, 20, 14, 0.7)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 11px,
      rgba(196, 163, 90, 0.03) 11px,
      rgba(196, 163, 90, 0.03) 12px
    );
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1.1rem;
  min-height: 220px;
}
.ops-card label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.45rem 0;
}
.ops-card input {
  width: 100%;
  margin-top: 0.2rem;
  background: rgba(12, 9, 7, 0.55);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
}
.ops-list {
  margin-top: 0.65rem;
  max-height: 320px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ops-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(196, 163, 90, 0.1);
  font-size: 0.82rem;
}
.ops-time {
  font-size: 0.68rem;
  color: var(--muted);
}
.ops-sim {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 0.6rem;
  max-height: 200px;
  overflow: auto;
  color: var(--ink);
}

/* ——— Parchemin polish ——— */
body.is-dash .workspace {
  background:
    linear-gradient(180deg, rgba(48, 36, 26, 0.35), transparent 120px),
    var(--bg-elevated);
}
body.is-dash .panel {
  position: relative;
  background:
    linear-gradient(165deg, rgba(70, 52, 36, 0.28), rgba(28, 20, 14, 0.55)),
    repeating-linear-gradient(
      -2deg,
      transparent,
      transparent 14px,
      rgba(212, 181, 106, 0.025) 14px,
      rgba(212, 181, 106, 0.025) 15px
    );
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(243, 231, 211, 0.04),
    var(--shadow);
}
body.is-dash .panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(196, 163, 90, 0.08);
  border-radius: calc(var(--radius) - 4px);
  pointer-events: none;
}
.lead {
  color: var(--muted);
  font-style: italic;
  max-width: 42rem;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 30;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-scrim { display: block !important; }
  .mobile-nav-btn { display: inline-flex; }
  .workspace-body { padding: 1rem 1.1rem 2rem; }
  .workspace-head { padding: 1.1rem 1.1rem 0.85rem; }
  .shop-editor { grid-template-columns: 1fr; }
  .live-stage { grid-template-columns: 1fr; }
  .live-node .name { font-size: 0.58rem; }
  .ops-grid { grid-template-columns: 1fr; }
  .live-avatar { width: 16px; height: 16px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel { padding: 0.95rem 1rem; }
  body.is-dash .panel::before { inset: 4px; }
}
