/* Mur de presse Foxhole : deux journaux, une carte */

:root {
  --warden: #3f6c9b;
  --colonial: #5e7f45;
  --neutral: #cfc7ae;
  --inactive: #8a8474;
  --fire: #ff8a3d;
  --typewriter: "Special Elite", "Courier New", Courier, monospace;
  --text: "Courier Prime", "Courier New", Courier, monospace;
}

/* Le Rempart : encre bleu acier sur papier gris froid */
.ed-wardens {
  --paper: #dcdfe0;
  --strip: #e9ebe9;
  --ink: #18273a;
  --ink-soft: #46576b;
  --accent: #24527a;
  --sea: #2c3a46;
  --head: "Big Shoulders Stencil Display", Impact, "Arial Narrow", sans-serif;
  --head-size: clamp(3.4rem, 13vw, 8.5rem);
  --head-track: 0.04em;
}

/* L'Étendard : encre olive sur papier kaki */
.ed-colonials {
  --paper: #ddd3b6;
  --strip: #e8e0c8;
  --ink: #26281a;
  --ink-soft: #5b5a40;
  --accent: #6b2e22;
  --sea: #393a2b;
  --head: "IM Fell English SC", Georgia, "Times New Roman", serif;
  --head-size: clamp(3rem, 11vw, 7.5rem);
  --head-track: 0.01em;
}

.ed-neutre {
  --paper: #e4e1d8; --strip: #eeebe3; --ink: #222; --ink-soft: #555; --accent: #333;
  --sea: #34383a; --head: var(--typewriter); --head-size: clamp(2.6rem, 9vw, 6rem); --head-track: 0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--text);
}

/* grain du papier */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .28 0 0 0 0 .24 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 10;
}

a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* --- En-tête ----------------------------------------------------------- */

.masthead {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  border-bottom: 4px double var(--ink);
}
.dateline { margin: 0; font-family: var(--typewriter); color: var(--ink-soft); font-size: 0.9rem; }
.masthead h1 {
  margin: 0.1em 0 0;
  font: var(--head-size)/0.95 var(--head);
  letter-spacing: var(--head-track);
}
.ed-wardens .masthead h1 { text-transform: uppercase; }
.masthead h1 a { text-decoration: none; }
.devise { margin: 0.5rem 0 0; font-style: italic; font-size: 1.05rem; }

.score { display: grid; gap: 0.35rem; max-width: 34rem; margin: 1.1rem auto 0; text-align: left; }
.tally { display: grid; grid-template-columns: 12rem 1fr; align-items: center; gap: 0.75rem; font-family: var(--typewriter); font-size: 0.85rem; }
.cells { display: flex; gap: 2px; }
.cells i { flex: 1; height: 0.7rem; border: 1px solid var(--ink-soft); }
.t-wardens .cells i.on { background: var(--warden); border-color: var(--warden); }
.t-colonials .cells i.on { background: var(--colonial); border-color: var(--colonial); }

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

.front { max-width: 72rem; margin: 1.5rem auto 0; padding: 0 1.25rem; }
.front > h2, .columns h2 {
  margin: 0 0 0.75rem;
  font: 1.6rem/1.1 var(--head);
  letter-spacing: var(--head-track);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.3rem;
}

.map-wrap {
  position: relative;
  background: var(--sea);
  border: 6px solid var(--ink);
  box-shadow: inset 0 0 0 1px var(--paper);
}
#map { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
#map.panning { cursor: grabbing; }

.map-controls { position: absolute; right: 0.6rem; top: 0.6rem; display: grid; gap: 0.3rem; }
.map-controls button {
  width: 2.4rem; height: 2.4rem;
  font: 1.25rem/1 var(--typewriter);
  background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); cursor: pointer;
}

.hex-fill { fill: var(--neutral); }
.hex-fill.off { fill: var(--inactive); }
.zone { stroke: rgba(30, 30, 20, 0.35); stroke-width: 0.35; }
.hex-line { fill: none; stroke: #1d1d17; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.hit { fill: transparent; cursor: pointer; }
.hit:hover, .hit:focus-visible, .hit.sel { fill: rgba(255, 250, 230, 0.18); stroke: #fff8e0; stroke-width: 2.5; vector-effect: non-scaling-stroke; outline: none; }
.label {
  font: 6.4px var(--typewriter);
  fill: #1d1d17;
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(235, 228, 205, 0.75);
  stroke-width: 1.3px;
}
.base { stroke: #1d1d17; stroke-width: 0.45; pointer-events: none; }
.scorch { stroke: #1d1d17; stroke-width: 0.7; pointer-events: none; }

.boom-flash, .boom-ring, .pulse, .smoke { transform-box: fill-box; transform-origin: center; pointer-events: none; }
.boom-flash { fill: #ffd27a; animation: flash 0.9s ease-out forwards; }
.boom-ring { fill: none; stroke: var(--fire); stroke-width: 0.5; animation: ring 1.1s ease-out forwards; }
.smoke { fill: rgba(40, 32, 26, 0.45); animation: smoke 2.4s ease-out forwards; }
@keyframes flash { 0% { transform: scale(0.2); opacity: 1; } 35% { fill: var(--fire); opacity: 0.95; } 100% { transform: scale(2.2); opacity: 0; fill: #5a3b2a; } }
@keyframes ring { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(3.6); opacity: 0; } }
@keyframes smoke { 0% { transform: scale(0.6) translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: scale(2.6) translateY(-3px); opacity: 0; } }

.pulse { fill: none; stroke-width: 0.7; animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(3); opacity: 0; } }
.ember { fill: var(--fire); pointer-events: none; }
.event-dot { stroke: #fff8e0; stroke-width: 0.5; cursor: pointer; }

.region-panel {
  margin-top: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--strip);
  border: 1px solid var(--ink);
  font-size: 0.95rem;
}
.region-panel h3 { margin: 0 0 0.3rem; font: 1.3rem/1.2 var(--head); }
.region-panel p { margin: 0.2rem 0; }
.region-panel ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.region-panel li span { color: var(--ink-soft); font-size: 0.85rem; }

.legend { font-family: var(--typewriter); font-size: 0.85rem; color: var(--ink-soft); margin: 0.6rem 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.legend span { white-space: nowrap; }
.k { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.35rem; vertical-align: -0.1rem; border: 1px solid var(--ink); }
.k-w { background: var(--warden); } .k-c { background: var(--colonial); } .k-n { background: var(--neutral); }
.k-boom { background: var(--fire); border-radius: 50%; }
.k-ev { border-radius: 50%; background: transparent; border: 2px solid var(--ink); }

/* --- Colonnes ---------------------------------------------------------- */

.columns {
  max-width: 72rem;
  margin: 2rem auto 0;
  padding: 0 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 23rem) minmax(0, 1fr);
  gap: 2.5rem;
}

/* le télex : bande de papier perforée */
.telex {
  background:
    radial-gradient(circle at 0.55rem 0.75rem, var(--paper) 0.22rem, transparent 0.25rem) 0 0 / 1.1rem 1.5rem repeat-y,
    var(--strip);
  padding: 1rem 1rem 1rem 1.9rem;
  border-left: 1px dashed var(--ink-soft);
  font-family: var(--typewriter);
  align-self: start;
}
.telex h2 { font-family: var(--typewriter); letter-spacing: 0; }
.depeche { padding: 0.9rem 0; border-bottom: 1px dashed var(--ink-soft); }
.depeche:last-child { border-bottom: 0; }
.depeche:target { background: rgba(255, 215, 120, 0.35); }
.depeche h3 { margin: 0.15rem 0 0.35rem; font-size: 1.08rem; line-height: 1.3; }
.depeche p { margin: 0 0 0.4rem; font-size: 0.92rem; line-height: 1.5; }
.stamp { margin: 0; font-family: var(--typewriter); font-size: 0.8rem; color: var(--ink-soft); }

.une h2 {
  margin: 0.3rem 0 0.6rem;
  font: clamp(2rem, 4.5vw, 3.2rem)/1.05 var(--head);
  letter-spacing: var(--head-track);
  border: 0;
  padding: 0;
}
.une h2 a { text-decoration: none; }
.chapo { font-size: 1.12rem; line-height: 1.65; font-weight: 700; max-width: 38rem; }
.lire { font-family: var(--typewriter); color: var(--accent); }
.archives { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 1px solid var(--ink); }
.archives li { padding: 0.7rem 0; border-bottom: 1px solid rgba(0, 0, 0, 0.15); }
.archives a { display: block; font-weight: 700; text-decoration: none; }
.archives span { font-size: 0.85rem; color: var(--ink-soft); }
.empty { font-family: var(--typewriter); color: var(--ink-soft); }

/* --- Page récit -------------------------------------------------------- */

.recit-page { max-width: 40rem; margin: 2rem auto; padding: 0 1.25rem 3rem; }
.recit-page h1 { font: clamp(2.2rem, 6vw, 3.4rem)/1.05 var(--head); letter-spacing: var(--head-track); margin: 0.3rem 0 1rem; }
.corps { font-size: 1.05rem; line-height: 1.75; }
.corps h2 { font: 1.5rem/1.2 var(--head); margin: 2rem 0 0.5rem; letter-spacing: var(--head-track); }
.corps p:first-of-type::first-letter { float: left; font: 3.4rem/0.85 var(--head); margin: 0.35rem 0.4rem 0 0; }
.retour { font-family: var(--typewriter); margin-top: 2.5rem; }

.pied {
  max-width: 72rem; margin: 0 auto; padding: 1.25rem 1.25rem 2.5rem;
  border-top: 4px double var(--ink);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--typewriter);
}

/* --- Accueil ----------------------------------------------------------- */

.accueil { background: #1e1f1a; color: #ece6d2; min-height: 100vh; display: flex; flex-direction: column; }
.choix { margin: 0; padding: 1.4rem 1.25rem; text-align: center; font: 1.2rem/1.3 var(--typewriter); font-weight: 400; }
.moities { flex: 1; display: grid; grid-template-columns: 1fr 1fr; }
.moitie {
  display: flex; flex-direction: column; justify-content: center; gap: 1rem;
  padding: 3rem 2rem; text-decoration: none;
  background: var(--paper); color: var(--ink);
}
.moitie .titre { font: clamp(3rem, 6.5vw, 6rem)/0.95 var(--head); letter-spacing: var(--head-track); }
.moitie.ed-wardens .titre { text-transform: uppercase; }
.moitie .devise { font-family: var(--text); }
.moitie ul { margin: 0; padding-left: 1.1rem; font-family: var(--typewriter); max-width: 30rem; }
.moitie .lire { margin-top: 0.5rem; }
.moitie:hover .lire, .moitie:focus-visible .lire { text-decoration: underline; }
.moitie.ed-colonials { border-left: 6px solid #1e1f1a; }

/* --- Petits écrans ----------------------------------------------------- */

@media (max-width: 52rem) {
  .columns { grid-template-columns: 1fr; }
  .moities { grid-template-columns: 1fr; }
  .moitie.ed-colonials { border-left: 0; border-top: 6px solid #1e1f1a; }
  .tally { grid-template-columns: 1fr; gap: 0.2rem; }
  .map-controls { right: 0.35rem; top: 0.35rem; }
  .map-controls button { width: 1.9rem; height: 1.9rem; font-size: 1rem; }
  .map-wrap { border-width: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; opacity: 0.8; }
}
