/* ─────────────────────────────────────────────────────────────
   KILLSWITCH — UI « dossier d'enquête cyber »
   Accent jaune = outils du joueur · cyan = phase/hologramme
   rouge = l'assassin. Le canvas est toujours derrière.
   ───────────────────────────────────────────────────────────── */
:root {
  --ink: #e9ecf6;
  --dim: #8b91ad;
  --bg: rgba(8, 10, 20, 0.72);
  --panel: rgba(12, 14, 28, 0.82);
  --line: rgba(160, 170, 220, 0.18);
  --yellow: #ffd65a;
  --cyan: #5cf6ff;
  --red: #ff2d55;
  --violet: #a77bff;
  --display: 'Chakra Petch', 'Rajdhani', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05060c; color: var(--ink); font-family: var(--display); }
canvas#view { position: fixed; inset: 0; display: block; cursor: crosshair; }
button { font-family: inherit; color: inherit; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); color: var(--ink); }
b { color: #fff; }

.screen { position: fixed; inset: 0; display: none; z-index: 10; }
.screen.active { display: flex; }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; color: var(--cyan); opacity: 0.85; }
h2 { font-size: clamp(26px, 3.4vw, 42px); margin: 6px 0 0; letter-spacing: 0.02em; }

/* ── boutons ── */
.btn { display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px; border: 1px solid var(--line); background: rgba(14, 16, 32, 0.75); font-size: 17px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); transition: background 0.15s, transform 0.15s, color 0.15s; backdrop-filter: blur(6px); }
.btn span { font-family: var(--mono); color: var(--yellow); width: 18px; }
.btn:hover { background: rgba(255, 214, 90, 0.14); transform: translateX(4px); }
.btn.primary { background: var(--yellow); color: #121222; border-color: var(--yellow); }
.btn.primary span { color: #121222; }
.btn.primary:hover { background: #ffe38a; }
.back { width: 46px; height: 46px; border: 1px solid var(--line); background: var(--panel); font-size: 20px; cursor: pointer; border-radius: 50%; }
.back:hover { border-color: var(--yellow); color: var(--yellow); }
.row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; }

/* ── menu ── */
#menu { align-items: stretch; background: linear-gradient(90deg, rgba(5, 6, 14, 0.92) 0%, rgba(5, 6, 14, 0.6) 42%, rgba(5, 6, 14, 0) 70%); }
.menu-left { padding: 9vh 6vw; display: flex; flex-direction: column; justify-content: center; max-width: 640px; }
.menu-right { flex: 1; display: flex; align-items: flex-end; justify-content: flex-end; padding: 6vh 4vw 10vh; }
h1.glitch { font-size: clamp(56px, 9vw, 124px); margin: 10px 0 6px; line-height: 0.9; letter-spacing: -0.02em; position: relative; color: #fff; text-shadow: 0 0 30px rgba(255, 45, 85, 0.35); }
h1.glitch::before, h1.glitch::after { content: attr(data-text); position: absolute; inset: 0; overflow: hidden; }
h1.glitch::before { color: var(--red); transform: translate(3px, 0); clip-path: inset(10% 0 60% 0); animation: gl1 3.2s infinite steps(1); mix-blend-mode: screen; }
h1.glitch::after { color: var(--cyan); transform: translate(-3px, 0); clip-path: inset(55% 0 15% 0); animation: gl2 2.7s infinite steps(1); mix-blend-mode: screen; }
@keyframes gl1 { 0%, 86%, 100% { clip-path: inset(100% 0 0 0); } 88% { clip-path: inset(12% 0 62% 0); transform: translate(5px, -1px); } 92% { clip-path: inset(40% 0 30% 0); transform: translate(-4px, 1px); } }
@keyframes gl2 { 0%, 80%, 100% { clip-path: inset(100% 0 0 0); } 83% { clip-path: inset(62% 0 8% 0); transform: translate(-6px, 0); } 90% { clip-path: inset(20% 0 66% 0); transform: translate(4px, 1px); } }
.sub { font-size: 20px; line-height: 1.5; color: #c9cde2; margin: 0 0 30px; }
.menu-buttons { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.menu-buttons .btn { min-width: 300px; }
.agent-line { margin-top: 30px; display: flex; gap: 16px; align-items: center; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.agent-line input { margin-left: 8px; background: transparent; border: none; border-bottom: 1px solid var(--line); color: var(--yellow); font-family: var(--mono); font-size: 15px; padding: 4px 2px; width: 170px; outline: none; }
.rating-chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 30px; color: var(--ink); }
.card-note { max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red); padding: 16px 18px; backdrop-filter: blur(8px); font-family: var(--mono); }
.note-title { color: var(--red); font-size: 11px; letter-spacing: 0.2em; margin-bottom: 8px; }
.note-body { font-size: 13px; line-height: 1.6; color: #d7dbee; min-height: 3.2em; }
.note-body .caret { display: inline-block; width: 8px; height: 14px; background: var(--red); vertical-align: middle; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.foot { position: absolute; bottom: 14px; left: 6vw; font-family: var(--mono); font-size: 11px; color: var(--dim); display: flex; gap: 10px; align-items: center; }
.foot input { accent-color: var(--yellow); }

/* ── cartes ── */
#maps, #help, #profile { flex-direction: column; padding: 5vh 5vw; background: rgba(5, 6, 12, 0.86); backdrop-filter: blur(4px); overflow: auto; }
.screen-head { display: flex; gap: 20px; align-items: center; margin-bottom: 28px; }
.map-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.map-card { position: relative; background: var(--panel); border: 1px solid var(--line); cursor: pointer; overflow: hidden; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s; text-align: left; padding: 0; }
.map-card:hover { transform: translateY(-6px); border-color: var(--yellow); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }
.map-card canvas { display: block; width: 100%; height: 230px; }
.map-card .mc-body { padding: 16px 18px 20px; }
.map-card h3 { margin: 0; font-size: 26px; letter-spacing: 0.04em; }
.map-card .tag { font-family: var(--mono); font-size: 12px; color: var(--cyan); }
.map-card p { color: #c2c6dc; font-size: 15px; line-height: 1.45; margin: 10px 0 12px; }
.traits { display: flex; gap: 16px; font-family: var(--mono); font-size: 11px; color: var(--dim); flex-wrap: wrap; }
.traits i { font-style: normal; color: var(--yellow); letter-spacing: 2px; }
.map-card .best { position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-size: 11px; padding: 4px 8px; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--line); }

/* ── briefing ── */
#brief { align-items: center; justify-content: center; background: rgba(5, 6, 12, 0.78); backdrop-filter: blur(5px); }
.dossier { width: min(1000px, 92vw); background: var(--panel); border: 1px solid var(--line); padding: 30px 34px; position: relative; }
.dossier::before { content: 'CONFIDENTIEL'; position: absolute; top: 20px; right: -36px; transform: rotate(18deg); font-family: var(--mono); font-weight: 800; color: rgba(255, 45, 85, 0.5); border: 2px solid rgba(255, 45, 85, 0.5); padding: 4px 12px; letter-spacing: 0.2em; }
.dossier-grid { display: grid; grid-template-columns: 300px 1fr; gap: 30px; margin-top: 22px; }
.threat { border: 1px solid rgba(255, 45, 85, 0.35); background: rgba(255, 45, 85, 0.06); padding: 18px; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; color: var(--dim); text-transform: uppercase; }
.arch { font-size: 34px; font-weight: 700; color: var(--red); margin: 8px 0 6px; }
.arch.small { font-size: 18px; margin-top: 8px; }
.arch-desc { color: #d5d9ea; line-height: 1.45; font-size: 15px; }
.meter { height: 6px; background: rgba(255, 255, 255, 0.08); margin: 16px 0 10px; }
.meter div { height: 100%; background: linear-gradient(90deg, var(--yellow), var(--red)); }
.elo-line { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; line-height: 1.45; color: #cdd1e4; }
.rules b { color: var(--yellow); }
.hint { font-family: var(--mono); color: var(--cyan); font-size: 13px; margin-top: 20px; opacity: 0.85; }

/* ── aide ── */
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.help-grid article { background: var(--panel); border: 1px solid var(--line); padding: 18px 20px; }
.help-grid h3 { margin: 0 0 8px; color: var(--yellow); }
.help-grid p { color: #cdd1e4; line-height: 1.55; font-size: 15px; margin: 0; }
.keys { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; font-family: var(--mono); font-size: 13px; color: var(--dim); }

/* ── profil ── */
.profile-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.pcard { background: var(--panel); border: 1px solid var(--line); padding: 18px 20px; }
.pcard .big { font-size: 46px; font-weight: 700; }
.pcard table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
.pcard td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.pcard td:last-child { text-align: right; color: var(--yellow); }
.habit { margin: 10px 0; font-family: var(--mono); font-size: 12px; }
.habit .bar { height: 5px; background: rgba(255, 255, 255, 0.08); margin-top: 4px; }
.habit .bar div { height: 100%; background: var(--cyan); }

/* ── HUD ── */
.hud { position: fixed; inset: 0; pointer-events: none; display: none; z-index: 5; font-family: var(--mono); }
.hud.active { display: block; }
.hud-tl { position: absolute; top: 16px; left: 18px; }
.hud-map { font-family: var(--display); font-weight: 700; letter-spacing: 0.12em; font-size: 14px; color: var(--cyan); }
.hud-time { font-size: 30px; font-weight: 800; letter-spacing: 0.04em; }
.hud-time.warn { color: var(--red); }
.hud-tc { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); text-align: center; }
.victims { display: flex; gap: 6px; justify-content: center; }
.victims i { width: 20px; height: 26px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 10px 10px 4px 4px; background: rgba(255, 255, 255, 0.04); position: relative; transition: all 0.3s; }
.victims i.dead { background: var(--red); border-color: var(--red); box-shadow: 0 0 12px var(--red); }
.victims i.dead::after { content: '×'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.victims-label { font-size: 11px; letter-spacing: 0.2em; color: var(--dim); margin-top: 6px; }
.hud-tr { position: absolute; top: 16px; right: 18px; text-align: right; }
.strikes { display: flex; gap: 6px; justify-content: flex-end; }
.strikes i { width: 12px; height: 28px; background: var(--yellow); clip-path: polygon(50% 0, 100% 25%, 100% 100%, 0 100%, 0 25%); }
.strikes i.used { background: rgba(255, 255, 255, 0.15); }
.ai-chip { margin-top: 8px; font-size: 12px; color: var(--red); letter-spacing: 0.08em; background: var(--panel); border: 1px solid rgba(255, 45, 85, 0.35); padding: 4px 9px; display: inline-block; }
.rot-btns { position: absolute; left: 226px; bottom: 22px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.rot-btns .mini { background: var(--panel); padding: 7px 10px; font-size: 12px; }
.hud-time { text-shadow: 0 2px 10px rgba(0,0,0,0.6); }
.hud-map, .victims-label { text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
#minimap { position: absolute; left: 16px; bottom: 16px; width: 200px; height: 200px; border-radius: 50%; background: rgba(8, 10, 20, 0.72); border: 1px solid var(--line); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.25); }
.feed { position: absolute; right: 18px; top: 90px; width: 320px; display: flex; flex-direction: column; gap: 8px; }
.feed .msg { background: var(--panel); border-left: 3px solid var(--red); padding: 9px 12px; font-size: 12px; line-height: 1.4; animation: slidein 0.35s ease-out; backdrop-filter: blur(6px); }
.feed .msg.info { border-left-color: var(--cyan); }
.feed .msg.warn { border-left-color: var(--yellow); }
.feed .msg b { color: var(--red); }
.feed .msg.info b { color: var(--cyan); }
.feed .msg.warn b { color: var(--yellow); }
.feed .msg.out { opacity: 0; transform: translateX(30px); transition: all 0.5s; }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } }
.abilities { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); pointer-events: auto; }
.energy { height: 5px; background: rgba(255, 255, 255, 0.1); margin-bottom: 8px; border-radius: 3px; overflow: hidden; }
.energy div { height: 100%; width: 100%; background: linear-gradient(90deg, var(--cyan), #9ff); transition: width 0.1s; }
.ab-row { display: flex; gap: 8px; }
.ab { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 104px; padding: 8px 6px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; font-family: var(--mono); font-size: 12px; backdrop-filter: blur(6px); transition: border-color 0.15s, background 0.15s; }
.ab:hover, .ab.on { border-color: var(--cyan); background: rgba(92, 246, 255, 0.12); }
.ab.danger { border-color: rgba(255, 45, 85, 0.4); }
.ab.danger:hover { background: rgba(255, 45, 85, 0.18); border-color: var(--red); }
.ab.disabled { opacity: 0.35; }
.sel-panel { position: absolute; right: 18px; bottom: 18px; display: none; gap: 12px; background: var(--panel); border: 1px solid rgba(255, 214, 90, 0.4); padding: 10px 14px 10px 10px; pointer-events: auto; backdrop-filter: blur(6px); }
.sel-panel.active { display: flex; }
.sel-panel canvas { width: 96px; height: 110px; background: radial-gradient(circle at 50% 70%, rgba(255, 214, 90, 0.15), transparent 70%); }
.sel-id { font-size: 20px; font-weight: 800; color: var(--yellow); }
.sel-model { font-size: 12px; color: var(--dim); margin-top: 2px; }
.sel-act { font-size: 13px; margin-top: 8px; color: var(--ink); }
.sel-btns { margin-top: 10px; display: flex; gap: 6px; }
.mini { font-family: var(--mono); font-size: 11px; background: transparent; border: 1px solid var(--line); padding: 4px 8px; cursor: pointer; }
.mini:hover, .mini.on { border-color: var(--yellow); color: var(--yellow); }
.tooltip { position: absolute; display: none; padding: 5px 9px; background: rgba(5, 6, 14, 0.88); border: 1px solid var(--line); font-size: 11px; white-space: nowrap; transform: translate(14px, -50%); }
.tooltip b { color: var(--yellow); }
.toast { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); max-width: 560px; text-align: center; background: var(--panel); border: 1px solid rgba(92, 246, 255, 0.4); padding: 10px 16px; font-size: 13px; line-height: 1.5; opacity: 0; transition: opacity 0.5s; backdrop-filter: blur(6px); }
.toast.show { opacity: 1; }
.lock-fx { position: absolute; inset: 0; pointer-events: none; }
.lock-fx.flash { animation: flash 0.6s ease-out; }
@keyframes flash { 0% { background: rgba(255, 255, 255, 0.5); } 100% { background: transparent; } }
.lock-fx.miss { animation: miss 0.7s ease-out; }
@keyframes miss { 0%, 30% { background: rgba(255, 45, 85, 0.35); } 100% { background: transparent; } }

/* ── carte test : police ── */
.map-card.proto { border: 1px dashed rgba(79, 209, 197, 0.6); }
.map-card.gas { border-color: rgba(255, 180, 92, 0.6); }
.map-card.gas h3 { font-family: 'Georgia', serif; }
.map-card.proto::after { content: 'CARTE TEST'; position: absolute; top: 12px; left: 12px; font-family: var(--mono); font-size: 11px; font-weight: 800; letter-spacing: 0.15em; padding: 4px 8px; background: #4fd1c5; color: #06121a; }
.map-card.gas::after { background: #ffb45c; }
.police-bar { position: absolute; left: 16px; bottom: 236px; display: none; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid rgba(122, 168, 255, 0.45); border-left: 3px solid #7aa8ff; padding: 10px 12px; pointer-events: auto; backdrop-filter: blur(6px); width: 236px; }
.police-bar.active { display: flex; }
.p-title { font-size: 11px; letter-spacing: 0.25em; color: #7aa8ff; font-weight: 800; }
.p-status { font-size: 12px; line-height: 1.5; color: var(--dim); }
.p-status b { color: var(--ink); }
.p-btns { display: flex; gap: 6px; align-items: stretch; }
.p-btns .ab { width: 78px; }
.p-btns .mini { background: transparent; }
@media (max-width: 860px) { .police-bar { bottom: 150px; width: 200px; } }

/* ── Cendreville : briefing, casier, gazette, lettres ── */
:root { --sepia: #e8d6b4; --gas: #ffb45c; --ink-brown: #2a1d14; --serif: 'Georgia', 'Times New Roman', serif; }
.dossier.gaslight { background: linear-gradient(180deg, rgba(40, 28, 20, 0.95), rgba(22, 16, 12, 0.95)); border-color: rgba(255, 180, 92, 0.3); }
.dossier.gaslight h2 { font-family: var(--serif); font-weight: 700; color: var(--sepia); }
.dossier.gaslight .rules b { color: var(--gas); }
.brief-choice:empty { display: none; }
.brief-choice { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.city-line { font-family: var(--mono); font-size: 12px; color: #c9b89a; line-height: 1.5; }
.city-tier { display: inline-block; padding: 2px 8px; margin-right: 8px; font-weight: 800; letter-spacing: 0.1em; }
.city-tier.ok { background: #4f6b5a; color: #fff; }
.city-tier.warn { background: #b08d57; color: #1a120c; }
.city-tier.bad { background: #8c2a1e; color: #fff; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: flex; flex-direction: column; text-align: left; gap: 3px; padding: 10px 14px; background: rgba(255, 180, 92, 0.05); border: 1px solid rgba(255, 180, 92, 0.25); cursor: pointer; font-family: var(--serif); font-size: 16px; color: var(--sepia); }
.choice small { font-family: var(--mono); font-size: 10.5px; color: #a8957a; }
.choice:hover, .choice.on { border-color: var(--gas); background: rgba(255, 180, 92, 0.15); }
.forced { border-left: 3px solid #c0392b; padding: 10px 14px; background: rgba(140, 42, 30, 0.18); font-family: var(--serif); color: var(--sepia); font-size: 16px; }
.forced blockquote, .file blockquote { margin: 8px 0 0; font-style: italic; color: #d9c49c; font-family: var(--serif); border-left: 2px solid rgba(255, 180, 92, 0.4); padding-left: 10px; font-size: 14px; }

.end-nem:empty { display: none; }
.end-nem { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.gazette { background: #e9dcc0; color: var(--ink-brown); font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.3; padding: 12px 16px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); transform: rotate(-0.6deg); }
.gazette span { display: block; font-size: 11px; letter-spacing: 0.35em; border-bottom: 2px double var(--ink-brown); padding-bottom: 4px; margin-bottom: 6px; font-weight: 800; }
.nem-lines p { margin: 4px 0; font-family: var(--mono); font-size: 12.5px; color: #d6d0c4; line-height: 1.5; }
.nem-lines .learned { color: var(--gas); }
.letter { background: #f2e6cc; color: #3a2414; font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.5; padding: 14px 18px; transform: rotate(0.5deg); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); border-left: 4px solid #8c2a1e; }
.letter span { display: block; font-style: normal; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.2em; color: #8c2a1e; margin-bottom: 6px; font-weight: 800; }
.letter.silent { background: #2a221c; color: #a8957a; border-left-color: #555; }

#casier { flex-direction: column; padding: 5vh 5vw; background: radial-gradient(circle at 30% 0%, rgba(80, 50, 25, 0.5), rgba(8, 6, 5, 0.94) 60%); backdrop-filter: blur(4px); overflow: auto; }
#casier h2 { font-family: var(--serif); color: var(--sepia); }
.casier-head { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.casier-head > div { background: rgba(30, 22, 16, 0.85); border: 1px solid rgba(255, 180, 92, 0.2); padding: 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.casier-head b { font-family: var(--serif); font-size: 28px; color: var(--sepia); }
.casier-head small { font-family: var(--mono); font-size: 11px; color: #a8957a; }
.red { color: #e0533d !important; }
.empty { font-family: var(--serif); font-style: italic; color: #a8957a; font-size: 18px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.file { position: relative; display: flex; gap: 14px; background: #e9dcc0; color: var(--ink-brown); padding: 14px 16px; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5); }
.file:nth-child(odd) { transform: rotate(-0.4deg); }
.file:nth-child(even) { transform: rotate(0.35deg); }
.file canvas { width: 110px; height: 120px; flex: none; background: radial-gradient(circle at 50% 70%, rgba(120, 80, 40, 0.25), transparent 70%); border: 1px solid rgba(42, 29, 20, 0.3); }
.file h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; }
.file p { margin: 3px 0; font-family: var(--serif); font-size: 13.5px; line-height: 1.4; }
.file p b { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8c2a1e; }
.file h3 { padding-right: 96px; }
.file .meta { font-family: var(--mono); font-size: 11px; color: #5a4430; }
.file blockquote { color: #5a3420; border-left-color: #8c2a1e; }
.stamp { position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-weight: 800; letter-spacing: 0.15em; font-size: 12px; padding: 3px 8px; border: 2px solid; transform: rotate(8deg); }
.file.fugitive .stamp { color: #8c2a1e; }
.file.captured .stamp { color: #2f5a3a; }
.file.captured { opacity: 0.85; }

/* ── pause / fin ── */
.modal { align-items: center; justify-content: center; background: rgba(4, 5, 10, 0.7); backdrop-filter: blur(6px); }
.modal-box { background: var(--panel); border: 1px solid var(--line); padding: 30px; display: flex; flex-direction: column; gap: 12px; min-width: 320px; }
#end { align-items: center; justify-content: center; background: rgba(4, 5, 10, 0.82); backdrop-filter: blur(5px); overflow: auto; }
.end-wrap { width: min(1180px, 94vw); display: grid; grid-template-columns: 1.05fr 1fr; gap: 30px; padding: 30px 0; }
.end-sub { color: #cdd1e4; font-size: 17px; line-height: 1.5; }
#endTitle.win { color: var(--yellow); }
#endTitle.lose { color: var(--red); }
.end-card { display: flex; gap: 18px; align-items: center; background: var(--panel); border: 1px solid rgba(255, 45, 85, 0.4); padding: 14px 18px; margin: 18px 0; }
.end-card canvas { width: 140px; height: 158px; background: radial-gradient(circle at 50% 70%, rgba(255, 45, 85, 0.25), transparent 70%); }
.big-id { font-family: var(--mono); font-size: 30px; font-weight: 800; color: var(--red); }
#endBotDesc { font-family: var(--mono); font-size: 13px; color: #cdd1e4; line-height: 1.5; margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats div { background: var(--panel); border: 1px solid var(--line); padding: 10px 12px; }
.stats b { display: block; font-size: 24px; font-family: var(--mono); }
.stats span { font-family: var(--mono); font-size: 10px; color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; }
.stats .up { color: #5cff9d; }
.stats .down { color: var(--red); }
.end-right { background: var(--panel); border: 1px solid var(--line); padding: 20px 22px; display: flex; flex-direction: column; max-height: 82vh; }
.ai-log { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: #d7dbee; padding-left: 0; list-style: none; overflow: auto; flex: 1; margin: 12px 0; }
.ai-log li { padding: 5px 0 5px 12px; border-left: 2px solid rgba(255, 45, 85, 0.35); margin-bottom: 4px; animation: slidein 0.3s ease-out both; }
.ai-log li .t { color: var(--red); margin-right: 6px; }
.adapt { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; border-top: 1px solid var(--line); padding-top: 12px; color: var(--cyan); }

.fade { position: fixed; inset: 0; background: #000; pointer-events: none; opacity: 0; transition: opacity 0.45s; z-index: 50; }
.fade.on { opacity: 1; }

@media (max-width: 860px) {
  .dossier-grid, .end-wrap { grid-template-columns: 1fr; }
  .menu-right { display: none; }
  .feed { width: 220px; top: 120px; }
  .ab { width: 74px; font-size: 10px; }
  #minimap { width: 120px; height: 120px; }
  .rot-btns { left: 144px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ═════════════════════════════════════════════════════════════
   TACTILE & TÉLÉPHONE
   html.touch : écran tactile (gestes, textes adaptés)
   html.m     : téléphone (HUD compact) · html.land : paysage
   Sur ordinateur rien ne change : .dock est « display: contents ».
   ═════════════════════════════════════════════════════════════ */
:root { --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px); --dock: 150px; }
.dock { display: contents; }
.ab .ico { display: none; }
.hud-btn, .journal, .m-hint, .touch-only { display: none; }

html.touch, html.touch body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
html.touch input { -webkit-user-select: text; user-select: text; font-size: 16px !important; } /* iOS ne zoome pas au focus */
html.touch canvas#view { touch-action: none; cursor: default; }
html.touch button, html.touch .map-card, html.touch .choice { touch-action: manipulation; }
html.touch .desk-only { display: none !important; }
html.touch span.touch-only { display: inline; }
html.touch div.touch-only { display: flex; }
html.touch .tooltip { display: none !important; }
html.touch .btn:hover { transform: none; }
html.touch .map-card:hover { transform: none; }
html.touch .btn:active { transform: scale(0.97); background: rgba(255, 214, 90, 0.18); }
html.touch .btn.primary:active { background: #ffe38a; }

/* boutons de HUD tactiles */
html.touch .hud-btn { display: grid; place-items: center; position: absolute; pointer-events: auto; width: 42px; height: 42px; background: var(--panel); border: 1px solid var(--line); font-size: 17px; border-radius: 10px; backdrop-filter: blur(6px); top: calc(var(--sat) + 12px); right: calc(var(--sar) + 12px); }
html.touch .hud-btn:active { border-color: var(--yellow); color: var(--yellow); }
html.touch #journalBtn { right: calc(var(--sar) + 62px); width: auto; padding: 0 10px; display: flex; gap: 6px; align-items: center; font-family: var(--mono); font-size: 12px; }
html.touch #journalBtn b { color: var(--red); }
html.touch:not(.m) .hud-tr { right: calc(var(--sar) + 190px); }
html.touch #minimap { pointer-events: auto; touch-action: none; }
.ab.arm { border-color: var(--red) !important; background: rgba(255, 45, 85, 0.35) !important; animation: armPulse 0.6s ease-in-out infinite alternate; }
@keyframes armPulse { to { box-shadow: 0 0 18px rgba(255, 45, 85, 0.7); } }

/* journal d'enquête (tous les messages du fil, pour ne rien rater) */
html.touch .journal.open { display: flex; flex-direction: column; position: absolute; pointer-events: auto; top: calc(var(--sat) + 62px); right: calc(var(--sar) + 12px); width: min(420px, calc(100vw - 24px)); max-height: 55vh; background: rgba(8, 10, 22, 0.94); border: 1px solid var(--line); border-top: 2px solid var(--red); backdrop-filter: blur(8px); z-index: 3; }
.j-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-size: 11px; letter-spacing: 0.2em; color: var(--red); border-bottom: 1px solid var(--line); }
.j-head .mini { font-size: 14px; padding: 6px 12px; }
.j-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 12px 12px; font-size: 12px; line-height: 1.45; }
.j-list div { padding: 7px 0 7px 10px; border-left: 2px solid var(--red); margin-top: 6px; }
.j-list div.info { border-left-color: var(--cyan); }
.j-list div.warn { border-left-color: var(--yellow); }
.j-list .jt { color: var(--dim); margin-right: 6px; }
.j-list b { color: var(--red); }
.j-list .info b { color: var(--cyan); }
.j-list .warn b { color: var(--yellow); }
.j-empty { color: var(--dim); padding: 10px 0; }

/* consigne contextuelle (ex. « touche la destination ») */
html.touch .m-hint.show { display: block; position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--dock) + var(--sab) + 18px); background: rgba(20, 30, 60, 0.92); border: 1px solid #7aa8ff; color: #cfe0ff; padding: 9px 14px; font-size: 12.5px; white-space: nowrap; pointer-events: none; animation: hintPulse 1.2s ease-in-out infinite alternate; }
@keyframes hintPulse { to { border-color: #cfe0ff; } }

.pause-info { font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--dim); }
.pause-info .chip { color: var(--red); margin-bottom: 6px; }
.pause-info b { color: var(--yellow); font-weight: 600; }

/* ─────────── écrans : tout défile, rien n'est coupé ─────────── */
html.m .screen { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: calc(var(--sat) + 14px) calc(var(--sar) + 16px) calc(var(--sab) + 18px) calc(var(--sal) + 16px); }
html.m .screen.modal { padding-top: calc(var(--sat) + 14px); }
html.m #menu { flex-direction: column; background: linear-gradient(180deg, rgba(5, 6, 14, 0.55) 0%, rgba(5, 6, 14, 0.92) 55%); }
html.m .menu-left { padding: 6vh 4px 10px; max-width: none; margin: auto 0; }
html.m h1.glitch { font-size: clamp(48px, 15vw, 76px); }
html.m .sub { font-size: 16px; margin-bottom: 22px; }
html.m .menu-buttons { align-items: stretch; }
html.m .menu-buttons .btn { min-width: 0; width: 100%; padding: 15px 18px; font-size: 16px; }
html.m .agent-line { flex-wrap: wrap; gap: 10px; margin-top: 22px; }
html.m .agent-line input { width: 150px; }
html.m .foot { position: static; padding: 6px 4px 0; flex-wrap: wrap; line-height: 1.6; }
html.m .foot input { width: 110px; }
html.m .screen-head { gap: 14px; margin-bottom: 18px; }
html.m .back { width: 44px; height: 44px; flex: none; }
html.m h2 { font-size: 26px; }
html.m .map-cards { grid-template-columns: 1fr; gap: 14px; }
html.m .map-card canvas { height: 170px; }
html.m .map-card .mc-body { padding: 12px 14px 16px; }
html.m .map-card h3 { font-size: 22px; }
html.m .map-card p { font-size: 14px; }
html.m #brief, html.m #end { align-items: flex-start; }
html.m .dossier { width: 100%; margin: auto 0; padding: 20px 16px; }
html.m .dossier::before { top: auto; bottom: 14px; right: 12px; transform: rotate(-6deg); font-size: 9px; padding: 2px 6px; opacity: 0.6; }
html.m .dossier h2 { font-size: 22px; }
html.m .dossier > .row { position: sticky; bottom: calc(-18px - var(--sab)); margin: 18px -16px -20px; padding: 12px 16px calc(14px + var(--sab)); background: linear-gradient(180deg, rgba(12, 14, 28, 0.6), rgba(12, 14, 28, 0.98) 30%); box-shadow: 0 60px 0 rgba(12, 14, 28, 0.98); z-index: 2; }
html.m .dossier > .row .btn:first-child { order: 2; flex-basis: 100%; padding: 11px; font-size: 14px; }
html.m .dossier-grid { gap: 16px; margin-top: 14px; }
html.m .arch { font-size: 28px; }
html.m .arch.small { font-size: 16px; }
html.m .rules { font-size: 14.5px; gap: 12px; }
html.m .rules kbd { font-size: 11px; white-space: nowrap; }
html.m .row .btn { flex: 1 1 100%; justify-content: center; }
html.m .row { gap: 10px; }
html.m .help-grid { grid-template-columns: 1fr; }
html.m .keys { gap: 10px 16px; }
html.m .profile-body { grid-template-columns: 1fr; }
html.m .casier-head { grid-template-columns: 1fr 1fr; }
html.m .files { grid-template-columns: 1fr; }
html.m .file { flex-direction: column; }
html.m .file canvas { width: 90px; height: 98px; }
html.m .choice { width: 100%; }
html.m .modal-box { min-width: 0; width: 100%; max-width: 380px; margin: auto; }
html.m .end-wrap { width: 100%; margin: auto 0; padding: 0; gap: 16px; }
html.m .end-card { gap: 12px; padding: 10px 12px; }
html.m .end-card canvas { width: 96px; height: 108px; flex: none; }
html.m .big-id { font-size: 22px; }
html.m .end-right { max-height: none; }
html.m .ai-log { max-height: 46vh; }

/* ─────────── HUD téléphone (portrait) ─────────── */
html.m .hud-tl { top: calc(var(--sat) + 10px); left: calc(var(--sal) + 12px); }
html.m .hud-map { font-size: 10px; letter-spacing: 0.1em; max-width: 30vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.m .hud-time { font-size: 22px; }
html.m .hud-tc { top: calc(var(--sat) + 12px); }
html.m .victims { gap: 3px; }
html.m .victims i { width: 11px; height: 15px; border-radius: 6px 6px 2px 2px; }
html.m .victims i.dead::after { font-size: 10px; }
html.m .victims-label { font-size: 9px; letter-spacing: 0.12em; margin-top: 4px; }
html.m .hud-tr { top: calc(var(--sat) + 12px); right: calc(var(--sar) + 62px); }
html.m .strikes { gap: 4px; }
html.m .strikes i { width: 9px; height: 20px; }
html.m .ai-chip { display: none; }
html.m #minimap { left: auto; bottom: auto; right: calc(var(--sar) + 12px); top: calc(var(--sat) + 64px); width: 108px; height: 108px; }
html.m .rot-btns { left: auto; bottom: auto; right: calc(var(--sar) + 12px); top: calc(var(--sat) + 180px); flex-direction: row; gap: 6px; }
html.m .rot-btns .mini { width: 51px; height: 40px; padding: 0; font-size: 12px; border-radius: 8px; }
html.m .rot-btns .mini:active { border-color: var(--yellow); color: var(--yellow); }
html.m #journalBtn { right: calc(var(--sar) + 12px); top: calc(var(--sat) + 228px); width: 108px; height: 36px; justify-content: center; }
html.m #journalBtn span { display: none; }
html.m .feed { top: calc(var(--sat) + 66px); left: calc(var(--sal) + 12px); right: calc(var(--sar) + 132px); width: auto; gap: 6px; }
html.m .feed .msg { font-size: 11px; padding: 6px 9px; line-height: 1.35; }
html.m .feed .msg:nth-child(n + 3) { display: none; }
html.m .toast { top: auto; bottom: calc(var(--dock) + var(--sab) + 18px); left: calc(var(--sal) + 12px); right: calc(var(--sar) + 12px); transform: none; max-width: none; font-size: 12.5px; padding: 9px 12px; }
html.m .toast:not(.show) { pointer-events: none; }

/* dock du bas : sélection, police, capacités — empilés, gros boutons */
html.m .dock { display: flex; flex-direction: column; gap: 7px; position: absolute; left: calc(var(--sal) + 10px); right: calc(var(--sar) + 10px); bottom: calc(var(--sab) + 10px); pointer-events: none; }
html.m .dock > * { position: static !important; transform: none !important; left: auto !important; bottom: auto !important; right: auto !important; width: auto !important; }
html.m .abilities { pointer-events: auto; }
html.m .energy { margin-bottom: 6px; height: 4px; }
html.m .ab-row { gap: 6px; }
html.m .ab { flex: 1 1 0; width: auto; min-width: 0; min-height: 52px; padding: 6px 2px 5px; font-size: 10.5px; gap: 3px; border-radius: 10px; }
html.m .ab kbd { display: none; }
html.m .ab .ico, html.touch .ab .ico { display: block; width: 22px; height: 22px; }
.ab .ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.m .ab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
html.m .ab:active { background: rgba(92, 246, 255, 0.2); }
html.m .ab.danger { color: #ffb3c2; }
html.m .ab.disabled { opacity: 0.3; }
html.m .sel-panel { padding: 5px 8px 5px 4px; gap: 6px; align-items: center; border-radius: 10px; }
html.m .sel-panel canvas { width: 42px; height: 48px; flex: none; }
html.m .sel-info { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; }
html.m .sel-id { font-size: 15px; grid-column: 1; }
html.m .sel-model, html.m .sel-act { grid-column: 1; font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.m .sel-btns { grid-column: 2; grid-row: 1 / span 3; margin: 0; flex-direction: row; align-items: center; gap: 6px; }
html.m .sel-btns .mini { height: 40px; min-width: 40px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
html.m .police-bar { flex-direction: row; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; }
html.m .p-title { display: none; }
html.m .p-status { flex: 1; min-width: 0; font-size: 10.5px; line-height: 1.35; }
html.m .p-btns { flex: none; gap: 6px; }
html.m .p-btns .ab { width: auto !important; min-height: 40px; flex: none; flex-direction: row; gap: 5px; padding: 0 9px; }
html.m .p-btns .ab .ico { width: 17px; height: 17px; }
html.m .police-bar { padding: 5px 6px 5px 8px; }
html.m .police-bar.armed { border-color: #cfe0ff; }
html.m .police-bar.armed .p-status { color: #cfe0ff; font-size: 11.5px; animation: hintPulse 1.2s ease-in-out infinite alternate; }
html.m .p-btns .mini { font-size: 15px; padding: 0 10px; border-radius: 8px; min-width: 40px; }
html.m .lock-fx { pointer-events: none; }

/* ─────────── téléphone en paysage ─────────── */
html.m.land .hud-map { max-width: 22vw; }
html.m.land .dock { left: auto; right: calc(var(--sar) + 10px); width: min(400px, 50vw); }
html.m.land .ab { min-height: 48px; }
html.m.land .ab .ico { width: 18px; height: 18px; }
html.m.land .sel-panel canvas { width: 44px; height: 50px; }
html.m.land #minimap { top: auto; right: auto; left: calc(var(--sal) + 12px); bottom: calc(var(--sab) + 12px); width: 96px; height: 96px; }
html.m.land .rot-btns { top: auto; right: auto; left: calc(var(--sal) + 116px); bottom: calc(var(--sab) + 12px); flex-direction: column; }
html.m.land .rot-btns .mini { width: 46px; height: 42px; }
html.m.land #journalBtn { top: calc(var(--sat) + 12px); right: calc(var(--sar) + 62px); width: auto; height: 42px; }
html.m.land #journalBtn span { display: inline; }
html.m.land .hud-tr { right: calc(var(--sar) + 200px); }
html.m.land .feed { top: calc(var(--sat) + 62px); right: auto; width: min(330px, 40vw); }
html.m.land .toast { bottom: auto; top: calc(var(--sat) + 62px); left: auto; right: calc(var(--sar) + 12px); width: min(400px, 50vw); }
html.m.land .m-hint.show { left: auto; right: calc(var(--sar) + 10px); transform: none; }
html.m.land .journal.open { max-height: 70vh; }
