/* ============================================================
   PAGES.CSS — styles spécifiques par page
   ============================================================ */

/* ============================================================
   HERO (page d'accueil)
   ============================================================ */
.hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: 40px 0 100px;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}
.hero-logo {
  width: 240px;
  height: 240px;
  object-fit: contain;
  filter: drop-shadow(0 0 40px var(--accent-glow));
  animation: heroLogoFloat 6s ease-in-out infinite;
}
@keyframes heroLogoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.hero-title {
  font-size: clamp(3rem, 9vw, 6rem);
  margin: 20px 0 0;
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 50%, var(--primary-soft) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 20px var(--accent-glow));
}
.hero-sub {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.8vw, 1.2rem);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 8px 0 0;
  text-indent: 0.5em;
}
.hero-quote {
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--text-soft);
  max-width: 50ch;
  margin: 32px auto 0;
}
.hero-ip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  padding: 14px 20px;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), inset 0 0 20px rgba(255,255,255,0.02);
}
.hero-ip .ip-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.hero-ip code {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 1.1rem;
  color: var(--accent-strong);
  font-weight: 600;
}
.ip-copy {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  width: 30px;
  height: 30px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  transition: all .25s;
}
.ip-copy:hover {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
}
.hero-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}
.status-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.4;
  animation: statusPulse 1.5s ease-out infinite;
}
.status-online  { background: #4ade80; }
.status-offline { background: #ef4444; }
.status-loading { background: #a8a8a8; }
@keyframes statusPulse {
  0%   { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2.5); opacity: 0; }
}
.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-bottom {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.scroll-cue {
  display: inline-block;
  color: var(--accent);
  font-size: 1.4rem;
  animation: scrollBounce 2s ease-in-out infinite;
  opacity: 0.6;
}
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%      { transform: translateY(10px); opacity: 0.9; }
}

/* ============================================================
   FEATURES GRID (page accueil)
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 30px;
}
.feature {
  text-align: center;
  padding: 36px 24px;
}
.feature-icon {
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: 12px;
  text-shadow: 0 0 20px var(--accent-glow);
}
.feature h3 {
  font-family: var(--font-decor);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.feature p {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: 0;
}

/* Quicklinks */
.quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.quicklink {
  display: block;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  position: relative;
}
.quicklink h3 { font-family: var(--font-decor); }
.quicklink p {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin: 10px 0 0;
}
.ql-icon {
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.ql-arrow {
  position: absolute;
  bottom: 20px;
  right: 24px;
  color: var(--accent);
  font-size: 1.4rem;
  transition: transform .35s;
}
.quicklink:hover .ql-arrow { transform: translateX(6px); }

/* ============================================================
   PAGE INNER HEADER (autres pages)
   ============================================================ */
.page-head {
  padding: 80px 0 50px;
  text-align: center;
  position: relative;
}
.page-head h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin: 0;
  background: linear-gradient(180deg, var(--accent-strong) 0%, var(--accent) 70%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
/* Titre image (typographie LOTR fournie) — texte doré sur fond transparent.
   Le drop-shadow utilise la couleur d'accent du thème pour un halo cohérent. */
.page-head h1.page-title-img {
  background: none;
  -webkit-text-fill-color: initial;
  color: inherit;
  line-height: 0;
  font-size: 0;
  margin: 0;
}
.page-head h1.page-title-img img {
  display: block;
  margin: 0 auto;
  max-width: min(720px, 85%);
  height: auto;
  filter:
    drop-shadow(0 2px 6px rgba(0,0,0,0.55))
    drop-shadow(0 0 22px color-mix(in srgb, var(--accent) 35%, transparent));
  animation: titleImgIn 0.9s cubic-bezier(0.22, 0.85, 0.3, 1) both;
}
@keyframes titleImgIn {
  from { opacity: 0; transform: translateY(-8px); filter: drop-shadow(0 0 0 transparent); }
  to   { opacity: 1; transform: none; }
}

/* Hero (page d'accueil) — titre image plus grand */
.hero-title.hero-title-img {
  background: none;
  -webkit-text-fill-color: initial;
  color: inherit;
  filter: none;
  line-height: 0;
  font-size: 0;
  margin: 20px 0 0;
}
.hero-title.hero-title-img img {
  display: block;
  margin: 0 auto;
  max-width: min(820px, 92%);
  height: auto;
  filter:
    drop-shadow(0 3px 10px rgba(0,0,0,0.6))
    drop-shadow(0 0 32px color-mix(in srgb, var(--accent) 45%, transparent));
  animation: titleImgIn 1.1s cubic-bezier(0.22, 0.85, 0.3, 1) both;
}
.page-head .lead { margin-top: 14px; }

/* ============================================================
   CARTE INTERACTIVE
   ============================================================ */
.map-page {
  padding-bottom: 80px;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
}
.map-frame {
  position: relative;
  background: linear-gradient(180deg, var(--bg-base), var(--bg-card));
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(0,0,0,0.3);
  overflow: hidden;
}
.map-frame::before,
.map-frame::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent);
  opacity: 0.5;
  pointer-events: none;
}
.map-frame::before { top: 8px; left: 8px;  border-right: 0; border-bottom: 0; }
.map-frame::after  { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.map-corners {
  position: absolute;
  pointer-events: none;
}
.map-container {
  position: relative;
  width: 100%;
  aspect-ratio: 3200 / 4000;
  overflow: hidden;
  border-radius: 8px;
  background: #0a0a0a;
}
.map-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}
.map-banners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.map-hotspot {
  position: absolute;
  width: 38px;
  height: 50px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  transition: transform .25s;
}
/* Reveal de la position au survol (cercle subtil) */
.map-hotspot::before {
  content: "";
  position: absolute;
  inset: 50% 50% 50% 50%;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--accent-glow);
  transition: inset .3s, box-shadow .3s, opacity .3s;
  opacity: 0;
}
.map-hotspot:hover::before,
.map-hotspot:focus-visible::before,
.map-hotspot.active::before {
  inset: -10%;
  opacity: 0.25;
  box-shadow: 0 0 0 4px var(--accent-glow);
  animation: hotspotPulse 1.5s ease-out infinite;
}
@keyframes hotspotPulse {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.5; }
}
.map-hotspot:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Mode édition : montre tous les hotspots */
.map-frame.edit-mode .map-hotspot::before {
  inset: -20%;
  opacity: 0.5;
  background: var(--evil);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
  animation: none;
}
.map-frame.edit-mode .map-hotspot {
  cursor: grab;
}
.map-frame.edit-mode .map-hotspot:active { cursor: grabbing; }
.map-frame.edit-mode::after {
  content: "MODE ÉDITION — drag les bannières · E pour quitter · L pour copier les coords";
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  border: 0;
  text-align: center;
  background: var(--evil);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  padding: 6px 0;
  width: auto;
  height: auto;
  opacity: 1;
}

/* Tooltip flottant sur la carte (apparait avec le panneau latéral en réalité) */

/* ============================================================
   PANNEAU LATÉRAL FACTION (carte)
   ============================================================ */
.faction-panel {
  position: sticky;
  top: 100px;
  background: linear-gradient(180deg, var(--bg-base), var(--bg-card));
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 28px;
  max-height: calc(100vh - 130px);
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.faction-empty {
  text-align: center;
  color: var(--text-mute);
  font-style: italic;
  padding: 40px 12px;
}
.faction-empty-icon {
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.4;
  margin-bottom: 16px;
}
.faction-card {
  animation: factionIn .4s cubic-bezier(.2,.8,.2,1);
}
@keyframes factionIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.faction-banner {
  width: 80px;
  height: 110px;
  margin: 0 auto 20px;
  background: var(--banner-color);
  color: var(--banner-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  clip-path: polygon(0 0, 100% 0, 100% 88%, 50% 100%, 0 88%);
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.5));
  position: relative;
}
.faction-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), transparent 50%);
  clip-path: inherit;
}
/* Variante avec image : on désactive le clip-path et le pseudo-élément,
   la bannière Minecraft a déjà sa forme + son design. */
.faction-banner.has-image {
  width: 70px;
  height: 140px;
  background: transparent;
  clip-path: none;
  padding: 0;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.55));
}
.faction-banner.has-image::after { display: none; }
.faction-banner.has-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}
.faction-card h3 {
  font-family: var(--font-decor);
  font-size: 1.6rem;
  text-align: center;
  margin: 0 0 8px;
}
.faction-allegiance {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  margin: 0 auto 20px;
  display: block;
  width: fit-content;
}
.faction-allegiance.bien   { background: rgba(111,179,255,0.12); color: var(--good); border: 1px solid rgba(111,179,255,0.3); }
.faction-allegiance.mal    { background: rgba(214,58,42,0.12);  color: var(--evil); border: 1px solid rgba(214,58,42,0.3); }
.faction-allegiance.neutre { background: rgba(212,185,98,0.12); color: var(--neutral); border: 1px solid rgba(212,185,98,0.3); }
.faction-desc {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: 0 0 20px;
  line-height: 1.7;
}
.faction-meta {
  display: grid;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.faction-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}
.faction-meta-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.faction-meta-value {
  color: var(--text);
  text-align: right;
}

/* Filtres factions */
.faction-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}
.filter-btn {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-soft);
  cursor: pointer;
  transition: all .25s;
}
.filter-btn:hover { color: var(--accent); border-color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* ============================================================
   BOUTIQUE
   ============================================================ */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.shop-card {
  text-align: center;
  display: flex;
  flex-direction: column;
}
.shop-card[data-featured="true"] {
  border-color: var(--accent);
  transform: scale(1.02);
}
.shop-card[data-featured="true"]::before {
  content: "POPULAIRE";
  position: absolute;
  top: -1px;
  right: -1px;
  background: var(--accent);
  color: var(--bg-deep);
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  padding: 6px 12px;
  border-radius: 0 10px 0 10px;
  opacity: 1;
  height: auto;
  width: auto;
}
.shop-tier {
  font-family: var(--font-decor);
  font-size: 1.6rem;
  margin: 0 0 8px;
}
.tier-bronze   { color: #cd7f32; }
.tier-argent   { color: #c0c0c0; }
.tier-or       { color: #ffd700; }
.tier-mithril  { color: #87ceeb; }
.shop-price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--accent);
  margin: 12px 0 24px;
  text-shadow: 0 0 20px var(--accent-glow);
}
.shop-perks {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  text-align: left;
  flex: 1;
}
.shop-perks li {
  padding: 10px 0 10px 26px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-soft);
  position: relative;
}
.shop-perks li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--accent);
  opacity: 0.7;
}

/* ============================================================
   REJOINDRE — étapes
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 30px;
}
.step {
  text-align: center;
  position: relative;
}
.step-number {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--bg-deep);
  font-family: var(--font-decor);
  font-size: 1.5rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 30px var(--accent-glow);
  position: relative;
}
.step-number::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0.4;
}
.step h3 {
  font-family: var(--font-decor);
  font-size: 1.15rem;
  margin: 0 0 12px;
}
.step p {
  color: var(--text-soft);
  font-size: 0.92rem;
  margin: 0;
}
.step kbd {
  font-family: monospace;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.85em;
  color: var(--accent);
}

/* ============================================================
   REGLEMENT
   ============================================================ */
.reglement-iframe {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #f5e6c4;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

/* ============================================================
   VOTER
   ============================================================ */
.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.vote-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
}
.vote-card h3 {
  font-family: var(--font-decor);
  margin: 0 0 6px;
}
.vote-card p {
  color: var(--text-mute);
  font-size: 0.85rem;
  margin: 0;
}
.vote-arrow {
  color: var(--accent);
  font-size: 1.6rem;
  transition: transform .3s;
}
.vote-card:hover .vote-arrow { transform: translateX(8px); }

/* ============================================================
   ADMIN PANEL TABS
   ============================================================ */
.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.admin-tab {
  background: transparent;
  border: 0;
  padding: 12px 18px;
  color: var(--text-mute);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .25s, border-color .25s;
}
.admin-tab:hover { color: var(--accent); }
.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .map-layout {
    grid-template-columns: 1fr;
  }
  .faction-panel {
    position: static;
    max-height: none;
  }
}
@media (max-width: 640px) {
  .hero-logo { width: 180px; height: 180px; }
  .hero-actions { flex-direction: column; width: 100%; max-width: 320px; }
  .hero-actions .btn { justify-content: center; width: 100%; }
  .hero-ip { flex-wrap: wrap; }
  .map-frame { padding: 8px; }
  .map-hotspot { width: 28px; height: 38px; }
}

/* ============================================================
   TERRITOIRES SVG (page Carte publique — nouveau système)
   ============================================================ */
.map-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.territory {
  fill: var(--territory-color, #888);
  fill-opacity: 0.03;
  stroke: var(--territory-color, #888);
  stroke-width: 0.25;
  stroke-opacity: 0;
  vector-effect: non-scaling-stroke;
  pointer-events: auto;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: fill-opacity 0.3s ease, stroke-opacity 0.3s ease, filter 0.3s ease;
}
.territory:focus { outline: none; }
.territory:focus-visible {
  /* Accessibilité clavier : surbrillance subtile via le stroke (au lieu du rectangle natif) */
  stroke-opacity: 1;
  stroke-width: 0.55;
}
.territory:hover,
.territory.active {
  fill-opacity: 0.42;
  stroke-opacity: 1;
  stroke-width: 0.5;
  filter: drop-shadow(0 0 8px var(--territory-color));
}
.territory.dim {
  fill-opacity: 0.02 !important;
  stroke-opacity: 0 !important;
}

/* Mode "toujours visible" : on voit les zones en permanence en très léger */
.map-frame.show-territories .territory {
  fill-opacity: 0.12;
  stroke-opacity: 0.35;
}
.map-frame.show-territories .territory:hover,
.map-frame.show-territories .territory.active {
  fill-opacity: 0.45;
  stroke-opacity: 1;
}

/* Toggle bouton "voir tous les territoires" */
.map-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.map-toolbar .toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-mute);
  cursor: pointer;
  user-select: none;
}
.map-toolbar .toggle-switch input { accent-color: var(--accent); }

/* ============================================================
   ÉDITEUR DE POLYGONES (page interne /pages/editor.html)
   ============================================================ */
.editor-page { overflow-x: hidden; }

.editor-main {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: calc(100vh - 70px);
}

.editor-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 22px 20px;
  overflow-y: auto;
  height: calc(100vh - 70px);
  position: sticky;
  top: 70px;
}

.editor-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.35rem;
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.editor-hint {
  font-size: 0.83rem;
  color: var(--text-mute);
  line-height: 1.55;
  margin-bottom: 14px;
}

.editor-current-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--c) 22%, transparent),
    color-mix(in srgb, var(--c) 6%, transparent));
  border: 1px solid var(--c);
  border-left: 4px solid var(--c);
  border-radius: 10px;
  margin: 12px 0;
}
.editor-current-badge {
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--c);
  color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--c) 50%, transparent);
}
.editor-current-info { min-width: 0; }
.editor-current-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-mute);
}
.editor-current-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'Cinzel', serif;
  margin: 2px 0;
}
.editor-current-meta {
  font-size: 0.78rem;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.editor-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 14px 0;
}
.editor-controls .btn {
  padding: 8px 6px;
  font-size: 0.78rem;
  justify-content: center;
}

.editor-zoom {
  margin: 14px 0;
  font-size: 0.82rem;
  color: var(--text-mute);
}
.editor-zoom label { display: flex; justify-content: space-between; }
.editor-zoom input { width: 100%; margin-top: 6px; accent-color: var(--accent); }

.editor-display {
  margin: 8px 0 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.editor-display label {
  display: block;
  font-size: 0.83rem;
  color: var(--text-mute);
  margin: 4px 0;
  cursor: pointer;
}
.editor-display input { margin-right: 8px; accent-color: var(--accent); }

.editor-sidebar h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.editor-progress {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: none;
}

.editor-faction-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 16px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.editor-faction-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
}
.editor-faction-item:last-child { border-bottom: none; }
.editor-faction-item:hover { background: rgba(255,255,255,0.04); }
.editor-faction-item.active {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  padding-left: 7px;
  border-left: 3px solid var(--accent);
}
.editor-faction-item.done .editor-faction-name    { color: #6abf6a; font-weight: 600; }
.editor-faction-item.partial .editor-faction-name { color: #d4933a; }
.editor-faction-item.empty .editor-faction-name   { color: var(--text-mute); }

.editor-faction-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.25);
}
.editor-faction-name { flex: 1; font-size: 0.84rem; }
.editor-faction-status {
  font-size: 0.72rem;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.editor-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}
.btn-danger { color: var(--evil)!important; border-color: var(--evil)!important; }
.btn-danger:hover { background: color-mix(in srgb, var(--evil) 15%, transparent); }

.editor-storage {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.editor-storage .hint {
  font-size: 0.74rem;
  color: var(--text-mute);
  line-height: 1.6;
  margin: 0;
}
.editor-storage kbd {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.7rem;
}

/* Canvas */
.editor-canvas-wrap {
  overflow: auto;
  background:
    radial-gradient(circle at 30% 20%, rgba(212,185,98,0.04), transparent 60%),
    #0a0a0a;
  padding: 20px;
}
.editor-canvas {
  position: relative;
  width: 600px;
  margin: 0 auto;
  cursor: crosshair;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}
.editor-canvas img {
  display: block;
  width: 100%;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
.editor-canvas svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* Modal d'import */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: min(640px, 92vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-card h3 {
  margin: 0 0 8px;
  font-family: 'Cinzel', serif;
  color: var(--accent);
}
.modal-card .hint { font-size: 0.85rem; color: var(--text-mute); margin: 0 0 12px; }
.modal-card textarea {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.82rem;
  resize: vertical;
  line-height: 1.4;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 1000px) {
  .editor-main { grid-template-columns: 1fr; }
  .editor-sidebar { position: relative; top: 0; height: auto; max-height: none; }
  .editor-canvas { width: 100%; }
}

/* ============================================================
   PETITS COMPLÉMENTS CARTE
   ============================================================ */
.faction-empty-hint {
  font-size: 0.78rem;
  margin-top: 14px;
  opacity: 0.75;
}
.faction-empty-hint a,
.link-accent {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.faction-empty-hint a:hover,
.link-accent:hover { color: var(--accent-bright, var(--accent)); }

.faction-locked {
  margin-top: 14px;
  padding: 8px 12px;
  background: rgba(212,185,98,0.12);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent);
}

/* ============================================================
   PLAYER NARRATION — bouton play/pause + barre + temps
   ============================================================ */
.faction-narration {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 4px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(212,185,98,0.08), rgba(212,185,98,0.02));
  border: 1px solid rgba(212,185,98,0.25);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.faction-narration::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 50%, rgba(212,185,98,0.10), transparent 60%);
  pointer-events: none;
}
.narration-play {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000));
  color: var(--bg-deep, #0c1224);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  position: relative;
  z-index: 1;
}
.narration-play:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0,0,0,0.45), 0 0 16px color-mix(in srgb, var(--accent) 50%, transparent), inset 0 1px 0 rgba(255,255,255,0.3);
}
.narration-play:active { transform: scale(0.96); }
.narration-play svg { display: block; }
.narration-play .icon-pause { display: none; }
.faction-narration.is-playing .narration-play .icon-play { display: none; }
.faction-narration.is-playing .narration-play .icon-pause { display: block; }
.faction-narration.is-playing .narration-play {
  animation: narrationPulse 1.8s ease-in-out infinite;
}
@keyframes narrationPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(0,0,0,0.35), 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent), inset 0 1px 0 rgba(255,255,255,0.25); }
  50%      { box-shadow: 0 4px 14px rgba(0,0,0,0.35), 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent), inset 0 1px 0 rgba(255,255,255,0.25); }
}
.faction-narration.is-loading .narration-play {
  opacity: 0.7;
  cursor: wait;
}
.narration-body {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.narration-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.narration-progress {
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.narration-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff));
  border-radius: 100px;
  transition: width 0.1s linear;
}
.narration-time {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-mute, rgba(255,255,255,0.55));
  font-variant-numeric: tabular-nums;
}
.narration-time .narration-current { color: var(--accent); }
.faction-narration.is-error {
  border-color: rgba(255,100,100,0.4);
  background: rgba(255,100,100,0.05);
}
.faction-narration.is-error .narration-label::after {
  content: " — erreur";
  color: rgba(255,140,140,0.85);
}

code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.88em;
  padding: 1px 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--accent);
}
