:root {
  --bg: #05070a;
  --ink: #e9edf1;
  --muted: rgba(233,237,241,.62);
  --blue: #65c7ff;
  --blue-soft: rgba(101,199,255,.22);
  --blue-hard: rgba(61,174,255,.72);
  --red: #ff2a2a;
  --red-soft: rgba(255,42,42,.18);
  --gold: #d8cfad;
  --glass: rgba(10, 15, 22, .70);
  --line: rgba(166, 214, 255, .18);
  --death-line: rgba(220, 226, 228, .20);
  --shadow: 0 28px 80px rgba(0,0,0,.65);
  /* Ajustement du logo écran de connexion. Augmente/diminue ici si ton PNG contient plus ou moins de marge transparente. */
  --login-logo-size: min(560px, 112%);
  --login-logo-glow-size: min(520px, 108%);
  --letter-move-duration: 5200ms;
  --anagram-move-duration: 2600ms;
  --style-morph-duration: 3200ms;
  --intro-fade-duration: 1500ms;
  --marker-red: #ff3030;
  --marker-green: #49f28d;
  --interface-top: 150px;
  --interface-bottom: 46px;
}
* { box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; margin: 0; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body {
  background:
    radial-gradient(circle at 50% 22%, rgba(34,107,151,.24), transparent 36%),
    radial-gradient(circle at 80% 82%, rgba(49,66,84,.22), transparent 38%),
    linear-gradient(145deg, #05070a 0%, #080d13 46%, #020305 100%);
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .32;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 0%, black 58%, transparent 100%);
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0px, rgba(255,255,255,.025) 1px, transparent 2px, transparent 6px);
  opacity: .10; mix-blend-mode: screen;
}
button, input { font: inherit; }
.hidden { display: none !important; }

/* LOGIN */
#loginScreen {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 40;
  transition: opacity 900ms ease, transform 900ms ease, filter 900ms ease;
}
#loginScreen.out { opacity: 0; transform: scale(1.04); filter: blur(12px); pointer-events: none; }
.login-card {
  width: min(920px, calc(100vw - 48px)); min-height: 540px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  border: 0; border-radius: 0; overflow: visible;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.login-brand {
  position: relative; padding: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: transparent;
  border-right: 0;
}
.login-brand::before {
  content: "";
  position: absolute;
  width: var(--login-logo-glow-size);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(68,159,237,.20), rgba(68,159,237,.08) 35%, transparent 67%);
  filter: blur(10px);
  z-index: -1;
}
.login-brand::after {
  content: "COUVERTURE PUBLIQUE"; position: absolute; left: 24px; bottom: 20px;
  font-size: 11px; letter-spacing: .28em; color: rgba(210,230,255,.34);
}
.logo-image {
  width: var(--login-logo-size); height: auto; aspect-ratio: auto; object-fit: contain;
  filter: drop-shadow(0 0 28px rgba(72,170,255,.25));
  transform: translateY(-4px);
}
.login-form {
  padding: 52px 48px; display: flex; flex-direction: column; justify-content: center;
  border: 1px solid var(--line); border-radius: 28px;
  background: linear-gradient(135deg, rgba(8,15,23,.92), rgba(8,9,12,.82));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(18px);
}
.kicker {
  font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--blue);
  margin-bottom: 18px;
}
.login-form h1 {
  margin: 0 0 10px; font-family: "Cormorant Garamond", serif; font-size: 48px; line-height: .95; font-weight: 700;
}
.login-form p { margin: 0 0 32px; color: var(--muted); line-height: 1.55; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(233,237,241,.55); }
.field input {
  width: 100%; padding: 15px 16px; border: 1px solid rgba(137,196,255,.22); border-radius: 14px;
  background: rgba(2,5,9,.74); color: var(--ink); outline: none; letter-spacing: .12em;
  box-shadow: inset 0 0 18px rgba(0,0,0,.34);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(101,199,255,.10), inset 0 0 18px rgba(0,0,0,.34); }
.login-button {
  margin-top: 8px; padding: 15px 18px; border: 1px solid rgba(101,199,255,.42); border-radius: 14px;
  color: #eef8ff; background: linear-gradient(135deg, rgba(35,104,149,.78), rgba(10,22,34,.74));
  cursor: pointer; letter-spacing: .18em; text-transform: uppercase; font-weight: 700;
  box-shadow: 0 12px 36px rgba(20,93,144,.18);
}
.login-button:hover { border-color: rgba(101,199,255,.8); box-shadow: 0 0 30px rgba(101,199,255,.15); }
#error {
  min-height: 24px; margin-top: 14px; color: #ffb2b2; font-size: 13px; letter-spacing: .09em; text-transform: uppercase;
}
#error.active { animation: deny 360ms ease; }
@keyframes deny { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-8px)} 75%{transform:translateX(8px)} }

/* MAIN STAGE */
#stage {
  position: fixed; inset: 0; opacity: 0; pointer-events: none; z-index: 10;
  transition: opacity 1000ms ease;
}
#stage.active { opacity: 1; pointer-events: auto; }
.warm-room {
  position: absolute; inset: 0; opacity: .72; transition: opacity 2200ms ease, filter 2200ms ease;
  background:
    radial-gradient(circle at 30% 32%, rgba(255,213,142,.10), transparent 28%),
    radial-gradient(circle at 67% 42%, rgba(120,199,255,.12), transparent 32%),
    linear-gradient(135deg, rgba(21,30,42,.70), rgba(6,8,11,.98));
}
.warm-room::before {
  content: ""; position: absolute; inset: 14% 7% 10% 7%; border: 1px solid rgba(255,255,255,.025); border-radius: 24px;
  background:
    radial-gradient(circle at 15% 62%, rgba(255,255,255,.025), transparent 18%),
    radial-gradient(circle at 78% 26%, rgba(255,255,255,.025), transparent 20%);
  box-shadow: inset 0 0 85px rgba(0,0,0,.46);
}
.warm-room::after {
  content: "DOSSIERS  •  ARCHIVES  •  CAFÉ  •  ANOMALIES"; position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.12); font-size: 11px; letter-spacing: .42em; white-space: nowrap;
}
body.death-mode .warm-room { opacity: .18; filter: saturate(.45) brightness(.55); }
.death-grid {
  position: absolute; inset: 0; opacity: 0; transition: opacity 2000ms ease;
  background:
    radial-gradient(circle at center, transparent 0 42%, rgba(0,0,0,.74) 78%),
    linear-gradient(rgba(205,221,230,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(205,221,230,.035) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
}
body.death-mode .death-grid { opacity: .72; }
.header {
  position: absolute; top: 22px; left: 28px; right: 28px; display: flex; align-items: center; justify-content: space-between;
  z-index: 24; opacity: 0; transform: translateY(-8px); transition: opacity 1200ms ease, transform 1200ms ease;
}
body.breach-mode .header { opacity: 1; transform: translateY(0); }
.header .left, .header .right {
  display: flex; gap: 16px; align-items: center; color: rgba(235,241,245,.58); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 16px var(--red); animation: pulse-dot 1500ms ease-in-out infinite; }
@keyframes pulse-dot { 0%,100%{opacity:.45; transform:scale(.8)} 50%{opacity:1; transform:scale(1.35)} }

/* ANAGRAM */
#anagram {
  position: absolute; left: 50%; top: 40.5%; width: 820px; height: 250px; transform: translate(-50%, -50%);
  z-index: 26; pointer-events: none; opacity: 0;
  transition:
    opacity 1200ms ease,
    top var(--anagram-move-duration) cubic-bezier(.16,.82,.18,1),
    width var(--anagram-move-duration) cubic-bezier(.16,.82,.18,1),
    height var(--anagram-move-duration) cubic-bezier(.16,.82,.18,1),
    transform var(--anagram-move-duration) cubic-bezier(.16,.82,.18,1),
    filter 2200ms ease;
  filter: drop-shadow(0 0 28px rgba(80,181,255,.18));
}
body.source-mode #anagram,
body.transform-mode #anagram,
body.style-mode #anagram,
body.breach-mode #anagram { opacity: 1; }
#anagram.final { top: 72px; width: 650px; height: 96px; transform: translate(-50%, -50%); filter: drop-shadow(0 0 25px rgba(240,245,248,.14)); }
.letter {
  position: absolute; transform: translate(-50%, -50%); display: block;
  font-family: "Cormorant Garamond", "Cinzel Decorative", serif; font-size: 100px; font-weight: 600;
  color: #061524;
  -webkit-text-stroke: 1px rgba(232,248,255,.96);
  text-shadow:
    0 1px 0 rgba(255,255,255,.70),
    0 0 10px rgba(76,176,255,.50),
    0 0 30px rgba(31,121,211,.30);
  transition:
    left var(--letter-move-duration) cubic-bezier(.16,.82,.18,1),
    top var(--anagram-move-duration) cubic-bezier(.16,.82,.18,1),
    font-size var(--letter-move-duration) cubic-bezier(.16,.82,.18,1),
    color var(--style-morph-duration) ease,
    text-shadow var(--style-morph-duration) ease,
    -webkit-text-stroke var(--style-morph-duration) ease,
    opacity 1200ms ease,
    filter 3000ms ease;
  animation: glyph-float 5.4s ease-in-out infinite;
}
@keyframes glyph-float { 0%,100%{ transform: translate(-50%, -50%) translateY(0); } 50%{ transform: translate(-50%, -50%) translateY(-4px); } }
body.transform-mode .letter,
body.style-mode .letter,
body.breach-mode .letter { animation: none; }
.letter.small-source { font-size: 82px; }
body.style-mode .letter {
  font-family: "Cinzel", "Cormorant Garamond", serif; font-weight: 600; letter-spacing: .08em;
  color: #eef2f2; -webkit-text-stroke: 0px transparent;
  text-shadow: 0 0 18px rgba(240,248,255,.18), 0 0 40px rgba(112,170,210,.11);
  filter: grayscale(.12) contrast(1.08);
  animation: typeface-shift var(--style-morph-duration) ease both;
}
#anagram.final .letter { font-size: 51px; }
@keyframes typeface-shift {
  0% { opacity: 1; filter: blur(0px) brightness(1); }
  24% { opacity: .58; filter: blur(7px) brightness(1.15); }
  55% { opacity: .84; filter: blur(2px) brightness(1.08); }
  100% { opacity: 1; filter: blur(0px) grayscale(.12) contrast(1.08); }
}
#anagram .line {
  position: absolute; left: 50%; top: 79%; width: 410px; height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(108,192,255,.48), transparent);
  box-shadow: 0 0 18px rgba(108,192,255,.24); opacity: 0; transition: opacity 1200ms ease, top var(--anagram-move-duration) ease, width var(--anagram-move-duration) ease;
}
body.source-mode #anagram .line,
body.style-mode #anagram .line,
body.transform-mode #anagram .line { opacity: .72; }
#anagram.final .line { top: 82%; width: 360px; opacity: .28; background: linear-gradient(90deg, transparent, rgba(240,245,248,.75), transparent); }
#anagram .line { display: none; }
#subtitle {
  position: absolute; left: 50%; top: 116px; transform: translateX(-50%); z-index: 25;
  font-size: 11px; letter-spacing: .36em; color: rgba(238,242,242,.56); text-transform: uppercase;
  opacity: 0; transition: opacity 1600ms ease 1800ms;
}
body.breach-mode #subtitle { opacity: 1; }

/* DANGER FLASH */
#dangerOverlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none; opacity: 0; }
#dangerOverlay.flash { animation: danger-flash 520ms ease; }
#dangerOverlay .danger-stack {
  display: grid; gap: 7px; text-align: center; transform: rotate(-2deg);
}
#dangerOverlay .danger-word {
  font-size: clamp(52px, 9vw, 158px); line-height: .78; font-weight: 900; letter-spacing: .20em; color: rgba(255,255,255,.92);
  text-transform: uppercase; text-shadow: 0 0 18px var(--red), 0 0 56px var(--red);
}
#dangerOverlay .danger-word:nth-child(2) { opacity: .62; transform: translateX(18px); }
#dangerOverlay .danger-word:nth-child(3) { opacity: .38; transform: translateX(-26px); }
@keyframes danger-flash {
  0% { opacity: 0; background: transparent; filter: blur(0); }
  8% { opacity: 1; background: rgba(175,0,0,.62); filter: blur(1px); }
  30% { opacity: .92; background: rgba(75,0,0,.32); }
  58% { opacity: .16; background: transparent; }
  100% { opacity: 0; background: transparent; }
}

/* GLOBE */
#globeArea {
  position: absolute; inset: var(--interface-top) 368px var(--interface-bottom) 46px; z-index: 16;
  opacity: 0; transform: translateY(28px) scale(.98); transition: opacity 1800ms ease, transform 1800ms cubic-bezier(.16,.8,.2,1);
  border-radius: 28px; overflow: hidden;
  border: 1px solid rgba(210,224,235,.12);
  background: radial-gradient(circle at 50% 45%, rgba(71,151,200,.10), rgba(2,4,6,.12) 34%, rgba(0,0,0,.48) 100%);
  box-shadow: inset 0 0 120px rgba(0,0,0,.55), 0 24px 80px rgba(0,0,0,.42);
}
body.breach-mode #globeArea { opacity: 1; transform: translateY(0) scale(1); }
#globeCanvas { width: 100%; height: 100%; display: block; cursor: grab; }
#globeCanvas:active { cursor: grabbing; }
.scan-ring {
  position: absolute; left: 50%; top: 50%; width: min(64vw, 780px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 1px solid rgba(117,198,255,.16); border-radius: 50%; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 70px rgba(117,198,255,.06), 0 0 70px rgba(117,198,255,.04);
}
body.breach-mode .scan-ring { opacity: 1; animation: scan 5s ease-in-out infinite; }
@keyframes scan { 0%,100%{transform:translate(-50%,-50%) scale(.96); opacity:.28} 50%{transform:translate(-50%,-50%) scale(1.05); opacity:.74} }

#sidePanel {
  position: absolute; top: var(--interface-top); right: 32px; width: 300px; bottom: var(--interface-bottom); z-index: 22;
  border: 1px solid rgba(220,226,228,.16); border-radius: 24px; overflow: hidden;
  background: linear-gradient(180deg, rgba(7,10,13,.88), rgba(4,5,7,.74));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.03);
  opacity: 0; transform: translateX(26px); transition: opacity 1200ms ease 900ms, transform 1200ms ease 900ms;
  backdrop-filter: blur(18px);
}
body.breach-mode #sidePanel { opacity: 1; transform: translateX(0); }
.panel-top { padding: 20px 22px 18px; border-bottom: 1px solid rgba(220,226,228,.12); }
.panel-top .tiny { font-size: 10px; letter-spacing: .28em; text-transform: uppercase; }
.panel-top h2 { margin: 9px 0 0; font-family: "Cormorant Garamond", serif; font-size: 28px; line-height: 1.05; font-weight: 700; }
.panel-top.mode-active .tiny { color: rgba(238,242,242,.42); }
.panel-top.mode-active h2 { color: rgba(247,249,250,.98); }
.panel-top.mode-mastered .tiny { color: rgba(73,242,141,.76); }
.panel-top.mode-mastered h2 { color: rgba(229,255,238,.98); }
.mission-list { padding: 16px; display: grid; gap: 12px; border-bottom: 1px solid rgba(220,226,228,.08); }
.mission-button {
  text-align: left; border: 1px solid rgba(220,226,228,.10); border-radius: 16px; padding: 14px 14px;
  background: rgba(255,255,255,.025); color: rgba(238,242,242,.66); cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}
.mission-button:hover, .mission-button.active { border-color: rgba(255,42,42,.42); background: rgba(255,42,42,.05); color: #fff; }
.mission-button strong { display: block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.mission-button span { display: block; font-size: 11px; color: rgba(238,242,242,.44); }
#dossier { padding: 18px 18px 20px; }
.locked-note { margin-top: 0; padding: 13px 13px; border: 1px solid rgba(255,42,42,.22); border-radius: 14px; background: rgba(255,42,42,.045); color: rgba(255,232,232,.72); font-size: 12px; line-height: 1.5; }
.panel-back { margin-bottom: 16px; border: 1px solid rgba(220,226,228,.16); border-radius: 999px; background: rgba(255,255,255,.025); color: rgba(238,242,242,.64); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; padding: 9px 13px; cursor: pointer; }
.panel-back:hover { color: #fff; border-color: rgba(101,199,255,.42); }
#dossier .code { font-size: 10px; letter-spacing: .28em; color: var(--red); text-transform: uppercase; margin-bottom: 12px; }
#dossier h3 { margin: 0 0 12px; font-family: "Cormorant Garamond", serif; font-size: 26px; line-height: 1.05; }
.meta { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0 0 16px; }
.meta div { padding: 8px 10px; border: 1px solid rgba(238,242,242,.09); border-radius: 11px; color: rgba(238,242,242,.62); font-size: 12px; }
.meta b { color: rgba(238,242,242,.92); font-weight: 700; }
#dossier p { margin: 0; color: rgba(238,242,242,.66); line-height: 1.58; font-size: 13px; }
.action-row { padding: 16px 20px 20px; margin-top: auto; }
.deploy {
  width: 100%; padding: 13px 14px; border-radius: 13px; border: 1px solid rgba(255,42,42,.36);
  background: linear-gradient(135deg, rgba(111,0,0,.72), rgba(22,8,8,.80));
  color: #ffe6e6; text-transform: uppercase; letter-spacing: .18em; font-weight: 800; cursor: pointer;
}
.deploy:hover { box-shadow: 0 0 24px rgba(255,42,42,.14); }

.mission-button.status-active:hover, .mission-button.status-active.active { border-color: rgba(255,48,48,.55); background: rgba(255,48,48,.06); }
.mission-button.status-mastered:hover, .mission-button.status-mastered.active { border-color: rgba(73,242,141,.48); background: rgba(73,242,141,.045); }
.mission-button.status-mixed:hover, .mission-button.status-mixed.active { border-color: rgba(255,204,92,.48); background: rgba(255,204,92,.045); }
.status-chip { display:inline-flex; align-items:center; gap:7px; text-transform:uppercase; letter-spacing:.14em; font-size:10px; color:rgba(238,242,242,.55); }
.status-chip::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--marker-red); box-shadow:0 0 12px var(--marker-red); }
.status-chip.mastered::before { background:var(--marker-green); box-shadow:0 0 12px var(--marker-green); }
.status-chip.mixed::before { background:linear-gradient(90deg, var(--marker-red) 0 50%, var(--marker-green) 50%); box-shadow:0 0 12px rgba(255,204,92,.6); }
.dossier-list { display:grid; gap:14px; margin-top:16px; max-height:calc(100vh - 430px); overflow:auto; padding-right:4px; }
.dossier-card { border:1px solid rgba(238,242,242,.10); border-radius:16px; padding:14px 14px; background:rgba(255,255,255,.025); }
.dossier-card.active { border-color:rgba(255,48,48,.24); background:rgba(255,48,48,.035); }
.dossier-card.mastered { border-color:rgba(73,242,141,.22); background:linear-gradient(180deg, rgba(16,41,28,.52), rgba(8,22,16,.68)); box-shadow: inset 0 0 0 1px rgba(73,242,141,.05); }
.dossier-card .code { font-size:9px; letter-spacing:.22em; text-transform:uppercase; margin-bottom:8px; }
.dossier-card.active .code { color:var(--marker-red); }
.dossier-card.mastered .code { color:var(--marker-green); }
.dossier-card h4 { margin:0 0 10px; font-family:"Cormorant Garamond", serif; font-size:21px; line-height:1.04; }
.dossier-card.mastered h4 { color: rgba(236,255,244,.98); }
.dossier-card p { font-size:12px !important; line-height:1.58 !important; color:rgba(238,242,242,.70) !important; }
.dossier-meta { display:grid; gap:7px; margin:10px 0 12px; }
.dossier-meta div { padding:8px 10px; border:1px solid rgba(238,242,242,.08); border-radius:10px; color:rgba(238,242,242,.57); font-size:11px; }
.dossier-card.mastered .dossier-meta div { border-color: rgba(73,242,141,.16); background: rgba(73,242,141,.035); color: rgba(226,248,233,.76); }
.dossier-meta b { color:rgba(238,242,242,.86); }
.archive-ref { margin: 6px 0 12px; font-size:10px; letter-spacing:.24em; text-transform:uppercase; color: rgba(118,248,171,.88); }
.data-error { padding:18px 20px; color:#ffb2b2; line-height:1.5; font-size:13px; }

/* INCIDENT CARDS — vue de surveillance et vue lieu */
.incident-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(238,242,242,.10);
  border-radius: 16px;
  padding: 14px 14px;
  background: rgba(255,255,255,.025);
  color: rgba(238,242,242,.72);
}
.incident-card.active {
  border-color: rgba(255,48,48,.24);
  background: linear-gradient(180deg, rgba(55,15,15,.44), rgba(18,7,8,.62));
}
.incident-card.mastered {
  border-color: rgba(73,242,141,.22);
  background: linear-gradient(180deg, rgba(16,41,28,.52), rgba(8,22,16,.68));
  box-shadow: inset 0 0 0 1px rgba(73,242,141,.05);
}
.incident-overview-button {
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, color 180ms ease;
}
.incident-overview-button:hover {
  transform: translateY(-1px);
  color: #fff;
}
.incident-overview-button.active:hover { border-color: rgba(255,48,48,.55); background: rgba(255,48,48,.07); }
.incident-status-row { margin-bottom: 10px; }
.incident-card h4 {
  margin: 0 0 10px;
  font-family: "Cormorant Garamond", serif;
  font-size: 21px;
  line-height: 1.05;
}
.incident-card.active h4 { color: rgba(255,238,238,.96); }
.incident-card.mastered h4 { color: rgba(236,255,244,.98); }
.incident-meta {
  display: grid;
  gap: 7px;
  margin: 10px 0 12px;
}
.incident-meta div {
  padding: 8px 10px;
  border: 1px solid rgba(238,242,242,.08);
  border-radius: 10px;
  color: rgba(238,242,242,.62);
  font-size: 11px;
  line-height: 1.35;
}
.incident-card.active .incident-meta div {
  border-color: rgba(255,48,48,.14);
  background: rgba(255,48,48,.025);
}
.incident-card.mastered .incident-meta div {
  border-color: rgba(73,242,141,.16);
  background: rgba(73,242,141,.035);
  color: rgba(226,248,233,.76);
}
.incident-meta b { color: rgba(238,242,242,.88); }
.incident-card p {
  margin: 0;
  color: rgba(238,242,242,.68);
  font-size: 12px;
  line-height: 1.58;
}
.resolution-summary {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid rgba(73,242,141,.16);
  background: rgba(73,242,141,.035);
  color: rgba(226,248,233,.78);
  font-size: 12px;
  line-height: 1.5;
}
.resolution-summary b { color: rgba(236,255,244,.95); }
.location-dossier-list { margin-top: 0; }


#lowerHud {
  position: absolute; left: 52px; bottom: 54px; z-index: 21; width: min(520px, calc(100vw - 430px));
  opacity: 0; transform: translateY(18px); transition: opacity 1200ms ease 1200ms, transform 1200ms ease 1200ms;
}
body.breach-mode #lowerHud { opacity: 1; transform: translateY(0); }
#lowerHud .label { color: rgba(238,242,242,.40); font-size: 10px; letter-spacing: .34em; text-transform: uppercase; margin-bottom: 9px; }
.progress-line { height: 2px; background: rgba(238,242,242,.08); overflow: hidden; border-radius: 4px; }
.progress-line::before { content:""; display:block; height:100%; width:33%; background: linear-gradient(90deg, transparent, rgba(255,42,42,.8), transparent); animation: sweep 2.7s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(310%); } }

#preRevealNote {
  position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); z-index: 28;
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(220,240,255,.48);
  transition: opacity 800ms ease;
}
body.death-mode #preRevealNote { opacity: 0; }

#introOverlay {
  position: absolute; inset: 0; z-index: 27; display: grid; place-items: center; pointer-events: none;
  opacity: 0; transition: opacity 900ms ease, filter var(--intro-fade-duration) ease, transform var(--intro-fade-duration) ease;
}
body.stage-ready #introOverlay { opacity: 1; }
body.transform-mode #introOverlay,
body.style-mode #introOverlay,
body.breach-mode #introOverlay { opacity: 0; filter: blur(12px); transform: scale(1.03); }
.intro-wrap { text-align: center; transform: translateY(128px); }
.welcome-line {
  font-family: "Cormorant Garamond", serif; font-size: clamp(34px, 4.8vw, 68px); font-weight: 600; letter-spacing: .025em;
  color: rgba(243,248,251,.92); text-shadow: 0 0 24px rgba(109,190,255,.11);
  transition: opacity var(--intro-fade-duration) ease, transform var(--intro-fade-duration) ease, filter var(--intro-fade-duration) ease;
}
.welcome-line .accent { color: #9fdcff; letter-spacing: .10em; text-transform: uppercase; }
.welcome-line.subtle-out { opacity: 0; transform: translateY(-18px); filter: blur(10px); }
.intro-small {
  margin-top: 20px; font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: rgba(220,240,255,.38);
  transition: opacity var(--intro-fade-duration) ease;
}
.welcome-line.subtle-out + .intro-small { opacity: 0; }

@media (max-width: 980px) {
  .login-card { grid-template-columns: 1fr; min-height: auto; gap: 18px; }
  .login-brand { min-height: 260px; border-right: none; border-bottom: none; }
  .login-form { padding: 32px; }
  #globeArea { inset: 122px 24px 300px 24px; }
  #sidePanel { top: auto; left: 24px; right: 24px; width: auto; height: 264px; bottom: 24px; }
  #lowerHud { display: none; }
  #anagram { transform: translate(-50%, -50%) scale(.78); }
  #anagram.final { transform: translate(-50%, -50%) scale(.82); }
}

/* LOADING TRANSFORMATION */
#loadingOverlay {
  position: absolute;
  left: 50%;
  bottom: 12.5%;
  transform: translateX(-50%);
  z-index: 31;
  display: grid;
  justify-items: center;
  gap: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms ease, transform 700ms ease, filter 700ms ease;
  filter: drop-shadow(0 0 20px rgba(101,199,255,.12));
}
#loadingOverlay.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#loadingOverlay.out {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  filter: blur(7px);
}
.loading-label {
  font-size: 10px;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: rgba(238,242,242,.58);
  white-space: nowrap;
}
.loading-hourglass {
  width: 38px;
  height: 48px;
  position: relative;
  animation: hourglass-spin 2600ms cubic-bezier(.42,0,.2,1) infinite;
}
.loading-hourglass::before,
.loading-hourglass::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 28px;
  height: 20px;
  transform: translateX(-50%);
  border: 1px solid rgba(238,242,242,.72);
  box-shadow: 0 0 14px rgba(101,199,255,.16), inset 0 0 10px rgba(101,199,255,.06);
}
.loading-hourglass::before {
  top: 2px;
  border-radius: 7px 7px 14px 14px;
  clip-path: polygon(0 0, 100% 0, 55% 100%, 45% 100%);
}
.loading-hourglass::after {
  bottom: 2px;
  border-radius: 14px 14px 7px 7px;
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
}
.loading-hourglass .sand-top,
.loading-hourglass .sand-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(216,207,173,.98), rgba(101,199,255,.62));
  box-shadow: 0 0 10px rgba(216,207,173,.16);
}
.loading-hourglass .sand-top {
  top: 8px;
  width: 18px;
  height: 10px;
  clip-path: polygon(0 0, 100% 0, 54% 100%, 46% 100%);
  transform-origin: 50% 0%;
  animation: sand-top-empty var(--loading-duration, 18000ms) linear forwards;
}
.loading-hourglass .sand-bottom {
  bottom: 8px;
  width: 18px;
  height: 3px;
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  transform-origin: 50% 100%;
  animation: sand-bottom-fill var(--loading-duration, 18000ms) linear forwards;
}
.loading-hourglass .sand-stream {
  position: absolute;
  left: 50%;
  top: 21px;
  width: 1px;
  height: 8px;
  transform: translateX(-50%);
  background: rgba(216,207,173,.78);
  box-shadow: 0 0 8px rgba(216,207,173,.22);
}
.loading-progress {
  width: min(320px, 42vw);
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(238,242,242,.08);
  box-shadow: inset 0 0 0 1px rgba(238,242,242,.06);
}
.loading-progress .loading-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(101,199,255,.20), rgba(216,207,173,.92), rgba(238,242,242,.82));
  box-shadow: 0 0 18px rgba(216,207,173,.22);
  animation: loading-fill var(--loading-duration, 18000ms) linear forwards;
}
@keyframes loading-fill { from { width: 0%; } to { width: 100%; } }
@keyframes sand-top-empty {
  from { height: 10px; opacity: .98; }
  to { height: 1px; opacity: .30; }
}
@keyframes sand-bottom-fill {
  from { height: 3px; opacity: .50; }
  to { height: 14px; opacity: .98; }
}
@keyframes hourglass-spin {
  0%, 42% { transform: rotate(0deg); }
  50%, 92% { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}
body.breach-mode #loadingOverlay {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  filter: blur(7px);
}

