:root {
  --bg: #333333;
  --panel: #252525;
  --panel-2: #202020;
  --line: rgba(255,255,255,.12);
  --text: #f3f3f0;
  --muted: #c9c9c3;
  --muted-2: #999991;
  --accent: #97af1e;
  --accent-2: #c6df4d;
  --danger: #e05c4a;
  --good: #9ac84b;
  --warning: #f2c14e;
  --shadow: 0 20px 70px rgba(0,0,0,.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .42; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }

.app-shell {
  min-height: 100%;
  display: grid;
  grid-template-rows: 50px minmax(0,1fr) 24px;
  background: radial-gradient(circle at top left, rgba(151,175,30,.18), transparent 30%), var(--bg);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(33,33,33,.94);
  backdrop-filter: blur(12px);
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; min-width: 0; }
.brand img { width: 32px; height: 32px; object-fit: contain; filter: drop-shadow(0 5px 12px rgba(0,0,0,.45)); }
.brand strong { display: block; font-size: .94rem; letter-spacing: .02em; }
.brand em { display: block; font-size: .68rem; color: var(--muted); font-style: normal; margin-top: 2px; }
.toplinks { display: flex; align-items: center; gap: 6px; }
.toplinks a, .toplinks button {
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .74rem;
}
.toplinks a:hover, .toplinks button:hover { border-color: rgba(198,223,77,.5); background: rgba(151,175,30,.12); }

.game-layout { min-height: 0; display: grid; grid-template-columns: 306px minmax(0,1fr); grid-template-areas: 'panel map'; gap: 6px; padding: 8px; }
.side-panel { grid-area: panel; }
.map-wrap { grid-area: map; }
.side-panel { min-height: 0; display: grid; grid-template-rows: auto auto auto auto minmax(0,1fr); gap: 7px; }
.side-panel section { border: 1px solid var(--line); border-radius: 16px; background: rgba(31,31,31,.92); box-shadow: 0 10px 30px rgba(0,0,0,.18); }

.target-card {
  position: relative;
  overflow: hidden;
  padding: 12px 12px 13px;
  background: linear-gradient(145deg, rgba(151,175,30,.32), rgba(31,31,31,.98) 56%) !important;
  border-color: rgba(198,223,77,.46) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.33), inset 0 0 0 1px rgba(198,223,77,.12) !important;
}
.target-card::before {
  content: "";
  position: absolute;
  inset: -70px -80px auto auto;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198,223,77,.36), transparent 68%);
  pointer-events: none;
}
.target-kicker { color: var(--accent-2); text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 900; margin-bottom: 7px; }
.target-name { font-size: clamp(1.35rem, 2.4vw, 2.05rem); line-height: .96; font-weight: 950; letter-spacing: -.04em; text-wrap: balance; min-height: 48px; display: flex; align-items: center; }
.target-name.pulse { animation: pulseTarget .42s ease-out; }
@keyframes pulseTarget { 0% { transform: translateY(4px); opacity: .25; } 100% { transform: translateY(0); opacity: 1; } }
.target-meta { margin-top: 7px; color: var(--muted); font-size: .78rem; line-height: 1.35; }

.context-card, .stats-card, .controls-card { padding: 10px; }
.section-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 850; color: var(--muted-2); margin-bottom: 6px; }
.context-line, .stat-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--muted); font-size: .78rem; }
.context-line strong, .stat-row strong { color: var(--text); font-size: .9rem; font-variant-numeric: tabular-nums; text-align: right; }
.context-card { display: grid; gap: 6px; }
.timer-block { display: grid; gap: 6px; }
.timer-track { width: 100%; height: 7px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.timer-bar { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s linear; }
.timer-bar.is-danger { background: linear-gradient(90deg, #e05c4a, #f2c14e); }
.stats-card { display: grid; gap: 6px; }
.controls-card { display: grid; gap: 6px; }
.controls-card button, .end-actions button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 8px;
  font-weight: 800;
}
.controls-card button:hover, .end-actions button:hover { border-color: rgba(198,223,77,.5); }
.primary-btn { background: linear-gradient(180deg, var(--accent-2), var(--accent)) !important; color: #1e2505 !important; border-color: transparent !important; }
.hint-card { align-self: end; padding: 9px; font-size: .76rem; line-height: 1.35; color: var(--muted); }
.hint-card p { margin: 0; }

.map-wrap { position: relative; min-height: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #1b1e1a; box-shadow: var(--shadow); }
#map { height: 100%; width: 100%; background: radial-gradient(circle at center, #3b413b 0%, #232723 55%, #181b18 100%); }
.leaflet-container { font: inherit; background: transparent; }
body.map-click-mode:not(.is-guess-locked) .map-wrap {
  border-color: rgba(198,223,77,.42);
  box-shadow: var(--shadow), 0 0 0 2px rgba(198,223,77,.10), inset 0 0 0 1px rgba(198,223,77,.08);
}
body.map-click-mode:not(.is-guess-locked) .map-wrap:hover {
  border-color: rgba(198,223,77,.68);
  box-shadow: var(--shadow), 0 0 0 3px rgba(198,223,77,.16), inset 0 0 0 1px rgba(198,223,77,.16);
}
body.map-click-mode .leaflet-container { cursor: crosshair !important; }
body.polygon-click-mode .leaflet-interactive { cursor: pointer; }
body.is-guess-locked .leaflet-container,
body.is-guess-locked .leaflet-interactive { cursor: wait !important; }
.leaflet-control-attribution { background: rgba(0,0,0,.58) !important; color: rgba(255,255,255,.7) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: rgba(198,223,77,.92) !important; }
.map-toast { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 700; padding: 11px 16px; border-radius: 999px; background: rgba(26,26,26,.9); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 850; }
.map-toast.ok { color: var(--accent-2); border-color: rgba(198,223,77,.5); }
.map-toast.ko { color: #ffb3a8; border-color: rgba(224,92,74,.55); }
.map-toast.info { color: #e8e8e2; border-color: rgba(255,255,255,.25); }
.click-cue {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 660;
  transform: translateX(-50%);
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(198,223,77,.48);
  background: rgba(24,24,24,.82);
  color: var(--accent-2);
  font-size: .78rem;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(0,0,0,.34), 0 0 0 7px rgba(198,223,77,.08);
  pointer-events: none;
  animation: clickCuePulse 1.15s ease-in-out infinite;
}
.click-cue[hidden] { display: none; }
@keyframes clickCuePulse {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}
.footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px; color: var(--muted-2); font-size: .68rem; border-top: 1px solid rgba(255,255,255,.06); }
.footer a { color: var(--accent-2); text-decoration: none; font-weight: 760; }
.zafferise-link { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.zafferise-link img { width: 20px; height: 20px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }

.overlay-panel { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; background: rgba(13,13,13,.72); backdrop-filter: blur(12px); }
.overlay-panel.is-hidden { display: none; }
.home-card, .end-card { border-radius: 22px; border: 1px solid rgba(198,223,77,.22); background: linear-gradient(145deg, rgba(51,51,51,.98), rgba(26,26,26,.98)); box-shadow: var(--shadow); padding: 15px; }
.home-card { width: min(1040px, 96vw); max-height: min(720px, 92vh); overflow: auto; }
.home-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 10px; }
.eyebrow { margin: 0 0 5px; color: var(--accent-2); text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 850; }
h1, h2 { margin: 0; letter-spacing: -.03em; }
h1 { font-size: clamp(1.55rem, 3.2vw, 2.35rem); line-height: 1; }
.home-head p:not(.eyebrow) { margin: 7px 0 0; max-width: 820px; color: var(--muted); }
.ghost-close { min-width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); font-size: 1.55rem; line-height: 1; }
.home-quickline { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.home-quickline span { border: 1px solid rgba(198,223,77,.2); border-radius: 999px; padding: 5px 8px; background: rgba(151,175,30,.1); color: var(--muted); font-size: .72rem; font-weight: 780; }
.territory-section, .mode-choice { padding: 10px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.035); }
.mode-choice { margin-top: 12px; }
.mode-choice.is-muted { opacity: .58; }
.section-heading { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.section-heading > span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #1e2505; font-weight: 950; }
.section-heading h2 { font-size: 1.05rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: .84rem; }
.territory-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; }
.territory-card {
  position: relative;
  overflow: hidden;
  min-height: 116px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  color: var(--text);
  text-align: left;
  padding: 10px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(0,0,0,.12);
  transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.territory-card::before { content: ""; position: absolute; inset: auto -25px -36px auto; width: 118px; height: 118px; border-radius: 38% 62% 45% 55%; background: radial-gradient(circle, rgba(198,223,77,.26), transparent 68%); transform: rotate(18deg); opacity: .55; transition: opacity .22s ease, transform .22s ease, filter .22s ease; }
.territory-card:hover {
  border-color: rgba(198,223,77,.58);
  transform: translateY(-4px) scale(1.01);
  background: linear-gradient(145deg, rgba(151,175,30,.18), rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 18px 34px rgba(0,0,0,.22), 0 0 0 1px rgba(198,223,77,.10);
}
.territory-card.is-selected {
  border-color: rgba(198,223,77,.88);
  transform: translateY(-3px);
  background: linear-gradient(145deg, rgba(151,175,30,.24), rgba(255,255,255,.05));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 20px 36px rgba(0,0,0,.26), 0 0 0 2px rgba(198,223,77,.18), 0 0 28px rgba(151,175,30,.14);
}
.territory-card:hover::before,
.territory-card.is-selected::before { opacity: .95; transform: rotate(15deg) scale(1.05); filter: saturate(110%); }
.territory-card:focus-visible { outline: none; border-color: rgba(198,223,77,.88); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 2px rgba(198,223,77,.22), 0 16px 30px rgba(0,0,0,.24); }
.territory-card:hover .territory-silhouette svg, .territory-card.is-selected .territory-silhouette svg { animation-duration: 5.6s; transform-origin: center; }
.territory-card:hover .territory-silhouette path,
.territory-card.is-selected .territory-silhouette path { fill: rgba(198,223,77,.18); stroke: rgba(198,223,77,1); }
.territory-card:hover .territory-meta span,
.territory-card.is-selected .territory-meta span { border-color: rgba(198,223,77,.24); color: var(--text); background: rgba(151,175,30,.14); }
@keyframes silhouetteDrift { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-1.5px) scale(1.008); } }
@keyframes silhouettePulse { 0%,100% { opacity: .92; } 50% { opacity: 1; } }
.territory-code { color: var(--accent-2); font-size: .74rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; transition: color .22s ease, transform .22s ease; }
.territory-card:hover .territory-code, .territory-card.is-selected .territory-code { color: #eff9b0; transform: translateX(1px); }
.territory-card h3 { margin: 2px 0 3px; font-size: .94rem; line-height: 1; letter-spacing: -.03em; }
.territory-card p { margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.15; }
.territory-top { display: grid; grid-template-columns: minmax(0,1fr) 82px; gap: 8px; align-items: start; }
.territory-copy { min-width: 0; }
.territory-silhouette { position: relative; align-self: start; justify-self: end; width: 82px; height: 58px; border-radius: 16px; border: 1px solid rgba(198,223,77,.14); background: linear-gradient(145deg, rgba(151,175,30,.09), rgba(255,255,255,.02)), repeating-linear-gradient(155deg, rgba(255,255,255,.025) 0 2px, transparent 2px 8px); display: grid; place-items: center; overflow: hidden; }
.territory-silhouette::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 28%, rgba(198,223,77,.15), transparent 46%), linear-gradient(180deg, rgba(255,255,255,.05), transparent 58%); }
.territory-silhouette::after { content: ""; position: absolute; inset: 8px; border-radius: 12px; border: 1px dashed rgba(198,223,77,.10); }
.territory-silhouette svg { position: relative; z-index: 1; width: 76px; height: 50px; overflow: visible; filter: drop-shadow(0 8px 16px rgba(0,0,0,.28)); animation: silhouetteDrift 9s ease-in-out infinite; animation-delay: var(--silhouette-delay, 0s); }
.territory-silhouette path { fill: rgba(198,223,77,.12); stroke: rgba(198,223,77,.90); stroke-width: 1.05; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: fill .25s ease, stroke .25s ease, transform .25s ease, opacity .25s ease; }
.territory-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.territory-meta span { border: 1px solid rgba(255,255,255,.1); border-radius: 999px; padding: 4px 8px; font-size: .66rem; font-weight: 780; color: var(--muted); background: rgba(0,0,0,.18); }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.mode-card-choice { text-align: left; min-height: 96px; padding: 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; color: var(--text); background: linear-gradient(145deg, rgba(255,255,255,.07), rgba(255,255,255,.025)); }
.mode-card-choice:hover { transform: translateY(-2px); border-color: rgba(198,223,77,.55); background: rgba(151,175,30,.13); }
.mode-card-choice.danger:hover { border-color: rgba(224,92,74,.7); background: rgba(224,92,74,.12); }
.mode-card-choice strong { display: block; color: var(--accent-2); font-size: .95rem; margin-bottom: 5px; }
.mode-card-choice span { display: block; color: var(--muted); font-size: .74rem; line-height: 1.22; }
.manoux-stamp { width: fit-content; margin: 10px auto 0; display: inline-flex; align-items: center; gap: 6px; color: var(--accent-2); text-decoration: none; font-size: .76rem; font-weight: 850; letter-spacing: .02em; }
.manoux-stamp img { width: 24px; height: 24px; object-fit: contain; filter: drop-shadow(0 5px 12px rgba(0,0,0,.45)); }

.end-card { width: min(420px, 94vw); text-align: center; padding: 14px; }
.badge { width: 104px; height: 104px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; align-content: center; border: 6px solid rgba(255,255,255,.12); box-shadow: inset 0 0 22px rgba(0,0,0,.3), 0 14px 38px rgba(0,0,0,.32); }
.badge span { display: block; font-size: 1.8rem; line-height: 1; font-weight: 950; }
.badge small { display: block; margin-top: 4px; font-size: .66rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.badge-none { background: #383838; color: #aaa; }
.badge-plastic { background: linear-gradient(145deg, #515151, #c9c9c9); color: #202020; }
.badge-bronze { background: linear-gradient(145deg, #6d3f20, #c68144); color: #fff3df; }
.badge-silver { background: linear-gradient(145deg, #70757a, #f1f3f5); color: #202124; }
.badge-gold { background: linear-gradient(145deg, #9b6b00, #ffe27a); color: #342600; }
.end-card h2 { font-size: 1.32rem; margin-bottom: 4px; }
.end-card p { color: var(--muted); margin: 0 0 8px; }
.end-details { display: grid; gap: 4px; margin: 10px 0; text-align: left; }
.end-details div { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 10px; align-items: baseline; padding: 7px 9px; border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.035); }
.end-details strong { display: block; min-width: 0; overflow-wrap: anywhere; font-size: .82rem; }
.end-details span { color: var(--muted-2); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 850; }
.end-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.end-actions .primary-btn { grid-column: span 2; }

@media (max-width: 1100px) {
  .territory-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 960px) {
  html, body { overflow: auto; }
  .app-shell { min-height: 100vh; grid-template-rows: auto 1fr auto; }
  .topbar { flex-wrap: wrap; }
  .game-layout { grid-template-columns: 1fr; grid-template-rows: auto 68vh; }
  .side-panel { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .target-card { grid-column: 1 / -1; }
  .territory-grid, .mode-grid { grid-template-columns: 1fr; }
  .end-details { grid-template-columns: 1fr; }
}

/* V2 — couche marketing et score-card */
.home-head strong { color: var(--text); }
.territory-card::after {
  content: "";
  position: absolute;
  inset: 10px 10px auto auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 0 0 5px rgba(255,255,255,.02);
  transition: all .22s ease;
}
.territory-card:hover::after {
  background: rgba(198,223,77,.58);
  border-color: rgba(198,223,77,.72);
  box-shadow: 0 0 0 6px rgba(198,223,77,.08);
}
.territory-card.is-selected::after {
  content: "✓";
  width: auto;
  height: auto;
  min-width: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #1e2505;
  border-color: rgba(198,223,77,.95);
  box-shadow: 0 10px 18px rgba(0,0,0,.24);
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
}
.mode-card-choice strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); margin-right: 8px; box-shadow: 0 0 0 4px rgba(198,223,77,.12); }
.mode-card-choice.danger strong::before { background: var(--danger); box-shadow: 0 0 0 4px rgba(224,92,74,.14); }
.result-topline { color: var(--accent-2); text-transform: uppercase; letter-spacing: .16em; font-size: .66rem; font-weight: 950; margin-bottom: 6px; }
.badge-phrase { margin: 0 auto 6px !important; color: var(--accent-2) !important; font-weight: 850; max-width: 360px; font-size: .84rem; }
.end-card { max-height: 94vh; overflow: auto; }
.share-preview-frame { margin: 10px auto 12px; padding: 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.035); width: min(210px, 100%); }
.share-preview { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; background: #242424; box-shadow: 0 12px 38px rgba(0,0,0,.35); }
.share-preview-frame figcaption { margin-top: 6px; color: var(--muted-2); font-size: .6rem; overflow-wrap: anywhere; }
.end-actions { grid-template-columns: repeat(2, 1fr); }
.end-actions .primary-btn { grid-column: 1 / -1; }
.end-actions #endRetryMistakes { grid-column: 1 / -1; }
.end-actions button[hidden] { display: none; }
.hint-card strong { color: var(--accent-2); }
@media (max-width: 760px) {
  .end-actions { grid-template-columns: 1fr; }
  .end-actions .primary-btn, .end-actions #endRetryMistakes, .end-actions #endMenu { grid-column: auto; }
}

@media (max-width: 960px) {
  .game-layout { grid-template-columns: 1fr; grid-template-areas: 'map' 'panel'; grid-template-rows: minmax(46vh, 52vh) auto; }
  .map-wrap { min-height: 46vh; }
  .side-panel { grid-template-columns: 1fr; grid-template-rows: auto; }
  .target-card, .context-card, .stats-card, .controls-card { grid-column: auto; }
  .controls-card button, .end-actions button, .toplinks a, .toplinks button { min-height: 44px; }
  .home-card { width: min(94vw, 860px); max-height: 92vh; }
}
@media (max-width: 760px) {
  .topbar { align-items: stretch; }
  .brand { width: 100%; }
  .toplinks { width: 100%; flex-wrap: wrap; }
  .toplinks a, .toplinks button { flex: 1 1 calc(33.333% - 8px); text-align: center; }
  .app-shell { grid-template-rows: auto 1fr auto; }
  .game-layout { padding: 10px; gap: 10px; grid-template-rows: 44vh auto; }
  .target-name { font-size: clamp(1.4rem, 8vw, 2.1rem); min-height: auto; }
  .context-card, .stats-card, .controls-card { padding: 11px; }
  .overlay-panel { padding: 10px; }
  .home-card, .end-card { padding: 16px; border-radius: 20px; }
  .territory-card { min-height: 132px; padding: 11px; }
  .territory-top { grid-template-columns: minmax(0,1fr) 78px; }
  .territory-silhouette { width: 78px; height: 56px; }
  .territory-silhouette svg { width: 70px; height: 48px; }
  .leaflet-control-zoom { margin-bottom: 60px !important; }
}


/* V2.8 — ergonomie mobile/tablette : viseur central + validation */
.mobile-target-strip,
.aim-reticle,
.aim-controls { display: none; }

body.touch-aim .mobile-target-strip {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 690;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(198,223,77,.25);
  background: linear-gradient(145deg, rgba(31,31,31,.92), rgba(31,31,31,.72));
  box-shadow: 0 18px 36px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
body.touch-aim .mobile-target-strip span {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .62rem;
  font-weight: 950;
}
body.touch-aim .mobile-target-strip strong {
  font-size: clamp(1.2rem, 5vw, 1.65rem);
  line-height: 1;
  letter-spacing: -.035em;
}
body.touch-aim .mobile-target-strip em {
  color: var(--muted);
  font-size: .72rem;
  font-style: normal;
}
body.touch-aim .aim-reticle {
  display: grid;
  place-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 78px;
  height: 78px;
  transform: translate(-50%, -50%);
  z-index: 675;
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.5));
}
body.touch-aim .aim-reticle::before,
body.touch-aim .aim-reticle::after {
  content: "";
  position: absolute;
  background: rgba(198,223,77,.86);
  border-radius: 999px;
}
body.touch-aim .aim-reticle::before { width: 2px; height: 78px; }
body.touch-aim .aim-reticle::after { width: 78px; height: 2px; }
body.touch-aim .aim-reticle span {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(198,223,77,.94);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198,223,77,.12) 0 20%, transparent 22%);
  box-shadow: 0 0 0 8px rgba(198,223,77,.08), inset 0 0 18px rgba(198,223,77,.08);
}
body.touch-aim .aim-controls {
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 690;
  display: grid;
  gap: 5px;
  width: min(360px, calc(100% - 24px));
  text-align: center;
  pointer-events: auto;
}
body.touch-aim .aim-controls[hidden],
body.touch-aim .mobile-target-strip[hidden] { display: none; }
body.touch-aim .aim-controls button {
  min-height: 54px;
  border-radius: 999px;
  border: 0;
  font-size: 1.02rem;
  font-weight: 950;
  letter-spacing: -.01em;
  box-shadow: 0 18px 36px rgba(0,0,0,.32), 0 0 0 1px rgba(255,255,255,.08) inset;
}
body.touch-aim .aim-controls small {
  justify-self: center;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(18,18,18,.68);
  border: 1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(8px);
}
body.touch-aim .leaflet-control-zoom { display: none; }
body.touch-aim .leaflet-control-attribution { max-width: 70vw; }

@media (max-width: 960px) {
  html, body { overflow: auto; }
  .app-shell { min-height: 100svh; grid-template-rows: auto minmax(0,1fr); }
  .footer { display: none; }
  .topbar { padding: 7px 10px; }
  .brand img { width: 32px; height: 32px; }
  .brand em { font-size: .66rem; }
  .game-layout {
    min-height: calc(100svh - 54px);
    padding: 8px;
    grid-template-columns: 1fr;
    grid-template-areas: 'map' 'panel';
    grid-template-rows: minmax(58svh, 1fr) auto;
    gap: 6px;
  }
  .map-wrap { min-height: 58svh; border-radius: 16px; }
  .side-panel {
    grid-template-columns: 1.2fr .8fr;
    grid-template-rows: auto auto;
    gap: 6px;
  }
  .target-card { display: none; }
  .context-card, .stats-card, .controls-card { padding: 10px; border-radius: 15px; }
  .context-card { grid-column: 1; }
  .stats-card { grid-column: 2; grid-row: 1 / span 2; align-content: start; }
  .controls-card { grid-column: 1; grid-template-columns: 1fr 1fr; }
  .controls-card .primary-btn { grid-column: span 2; }
  .controls-card #hintBtn { grid-column: span 2; }
  .hint-card { grid-column: 1 / -1; align-self: stretch; padding: 10px; border-radius: 15px; }
  .context-line, .stat-row { font-size: .78rem; }
  .context-line strong, .stat-row strong { font-size: .9rem; }
  .timer-track { height: 6px; }
}

@media (max-width: 620px) {
  .toplinks a { display: none; }
  .toplinks button { min-height: 40px; padding: 7px 12px; }
  .game-layout {
    padding: 6px;
    grid-template-rows: minmax(64svh, 1fr) auto;
  }
  .map-wrap { min-height: 64svh; border-radius: 16px; }
  .side-panel { grid-template-columns: 1fr; }
  .context-card, .stats-card, .controls-card { grid-column: 1; grid-row: auto; }
  .stats-card { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .stat-row { display: grid; gap: 2px; justify-items: start; padding: 7px 8px; border-radius: 12px; background: rgba(255,255,255,.035); }
  .stat-row strong { text-align: left; }
  .controls-card { grid-template-columns: 1fr; }
  .controls-card .primary-btn { grid-column: auto; }
  .controls-card #hintBtn { grid-column: auto; }
  .click-cue { bottom: 18px; max-width: calc(100% - 24px); text-align: center; }
  body.touch-aim .mobile-target-strip { top: 10px; left: 10px; right: 10px; padding: 9px 11px; }
  body.touch-aim .aim-reticle { width: 70px; height: 70px; }
  body.touch-aim .aim-reticle::before { height: 70px; }
  body.touch-aim .aim-reticle::after { width: 70px; }
  body.touch-aim .aim-reticle span { width: 38px; height: 38px; }
}


/* V2.9 — optimisation écrans 13 pouces */
@media (min-width: 961px) and (max-height: 820px) {
  .app-shell { grid-template-rows: 48px minmax(0,1fr) 22px; }
  .game-layout { grid-template-columns: 292px minmax(0,1fr); gap: 7px; padding: 7px; }
  .target-card { padding: 10px 11px; }
  .target-name { min-height: 42px; font-size: clamp(1.25rem, 2.1vw, 1.8rem); }
  .target-meta { font-size: .72rem; line-height: 1.22; }
  .context-card, .stats-card, .controls-card { padding: 8px; }
  .controls-card button { padding: 7px; border-radius: 10px; }
  .hint-card { font-size: .72rem; line-height: 1.22; padding: 7px; }
  .home-card { max-height: 90vh; padding: 13px; }
  .home-head { margin-bottom: 8px; }
  .territory-card { min-height: 104px; padding: 9px; border-radius: 15px; }
  .territory-silhouette { width: 76px; height: 52px; border-radius: 13px; }
  .territory-silhouette svg { width: 70px; height: 46px; }
  .mode-card-choice { min-height: 84px; padding: 9px; }
}
