#game-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Top HUD (Anodized Steel Control Strip) */
.top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: linear-gradient(180deg, #1d2025 0%, #13161a 100%);
  border-bottom: 1px solid #090a0c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.55);
  flex-shrink: 0;
  height: 54px;
}
.brand-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.85px;
  color: var(--text-main);
  white-space: nowrap;
}
.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #bdd4cc 0%, var(--cyan) 68%, #3c5951 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 0 6px rgba(143, 184, 173, 0.45);
}
.zone-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}
.zone-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
  background: linear-gradient(180deg, #25282e 0%, #1a1d22 100%);
  border: 1px solid var(--border-steel);
  color: var(--text-dim);
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.zone-tab.active {
  background: linear-gradient(180deg, #2d3433 0%, #202625 100%);
  border-color: var(--cyan);
  color: #f0f2f4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.zone-tab.locked {
  opacity: 0.42;
  cursor: not-allowed;
}
.zone-tab.completed {
  border-color: var(--green);
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.timer-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 3px;
  background: #0d0f12;
  border: 1px solid var(--border-bright);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.85);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #dbe4e0;
  min-width: 96px;
  justify-content: center;
}
.timer-pill.warning { border-color: var(--amber); color: var(--amber); }
.timer-pill.overtime {
  border-color: var(--crimson);
  background: rgba(110, 22, 22, 0.28);
  color: #e67c7c;
  animation: pulse-red 1.4s infinite;
}
.progress-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 3px;
  background: #0f1114;
  border: 1px solid var(--border-steel);
  color: var(--text-main);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.72);
}
.hud-btn {
  padding: 5px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* M.A.R.A. Intercom Strip */
.mara-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 16px;
  background: linear-gradient(180deg, #17191d 0%, #111316 100%);
  border-top: 1px solid var(--border-steel);
  border-bottom: 1px solid var(--border-steel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  min-height: 52px;
}
.mara-eye-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #3c424b;
  background: radial-gradient(circle at 35% 35%, #22262c 0%, #0b0d0f 100%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.85), 0 1px 2px rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.mara-eye-btn:hover {
  border-color: var(--crimson);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.85), 0 0 8px rgba(184, 59, 59, 0.42);
}
.mara-eye-btn.glitch {
  animation: eye-glitch 0.35s ease;
}
.mara-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 112px;
  flex-shrink: 0;
}
.mara-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  color: var(--crimson);
}
.mara-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.mara-bars span {
  width: 3px;
  height: 4px;
  background: var(--cyan);
  border-radius: 1px;
  transition: height 0.15s ease;
}
.mara-bars.speaking span {
  animation: voice-bar 0.55s infinite alternate;
  background: var(--crimson);
}
.mara-bars.speaking span:nth-child(2) { animation-delay: 0.1s; }
.mara-bars.speaking span:nth-child(3) { animation-delay: 0.25s; }
.mara-bars.speaking span:nth-child(4) { animation-delay: 0.15s; }
.mara-bars.speaking span:nth-child(5) { animation-delay: 0.3s; }
.mara-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
  color: #d6dce2;
  font-style: italic;
}

/* Main Scene Viewport (Photorealistic Camera Stage) */
.scene-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #08090b;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 6px 12px;
}
.scene-stage {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1460px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#room-svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  border: 1px solid #2b3038;
  border-radius: 2px;
  background: #08090b;
  box-shadow: var(--shadow-lg);
  display: block;
}
#room-svg.uv-cursor { cursor: crosshair; }

/* Subtle Photorealistic Hover Highlight (clean unobstructed view at rest) */
.hotspot {
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}
.hotspot .hs-frame {
  opacity: 0;
  transition: opacity 0.16s ease;
  pointer-events: none;
}
.hotspot:hover .hs-frame {
  opacity: 0.9;
}
.hotspot:hover {
  filter: brightness(1.16) drop-shadow(0 0 6px rgba(242, 236, 218, 0.34));
}
.hotspot.item-target:hover {
  filter: brightness(1.22) drop-shadow(0 0 9px rgba(199, 147, 70, 0.72));
}
.hotspot.solved-spot {
  filter: drop-shadow(0 0 4px rgba(91, 168, 118, 0.42));
}
.uv-only-secret {
  transition: opacity 0.2s ease;
}
.uv-only-secret.hidden-uv {
  opacity: 0;
  pointer-events: none;
}
.uv-only-secret.visible-uv {
  opacity: 1;
  pointer-events: all;
  cursor: pointer;
}

/* Scene Badges & Tooltip */
.scene-overlay-info {
  position: absolute;
  top: 14px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  z-index: 20;
}
.zone-title-chip {
  background: rgba(16, 18, 22, 0.88);
  border: 1px solid var(--border-bright);
  border-radius: 2px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e4e8ec;
  letter-spacing: 0.5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.armed-chip {
  background: rgba(42, 29, 11, 0.94);
  border: 1px solid var(--amber);
  border-radius: 2px;
  padding: 5px 12px;
  font-size: 12px;
  color: #f0ca7d;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.uv-status-chip {
  background: rgba(34, 21, 66, 0.92);
  border: 1px solid var(--uv);
  border-radius: 2px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #dcd0fb;
}
#hover-tooltip {
  position: fixed;
  z-index: 800;
  pointer-events: none;
  background: rgba(14, 16, 19, 0.95);
  border: 1px solid var(--border-bright);
  color: #f0f2f4;
  padding: 5px 10px;
  border-radius: 2px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.78);
  display: none;
}

/* Bottom Inventory Dock */
.inventory-dock {
  height: 82px;
  background: linear-gradient(180deg, #181a1f 0%, #101215 100%);
  border-top: 1px solid var(--border-steel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  padding: 6px 14px;
  gap: 12px;
  flex-shrink: 0;
}
.inv-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  min-width: 96px;
  line-height: 1.35;
}
.inv-slots {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow-x: auto;
  padding: 4px 2px;
}
.inv-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  background: linear-gradient(180deg, #21252b 0%, #171a1f 100%);
  border: 1px solid var(--border-steel);
  border-radius: 3px;
  min-width: 155px;
  max-width: 210px;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.14s ease, background 0.14s ease;
  flex-shrink: 0;
}
.inv-item:hover {
  border-color: var(--cyan);
  background: linear-gradient(180deg, #292e36 0%, #1d2127 100%);
}
.inv-item.selected {
  border-color: var(--amber);
  background: rgba(199, 147, 70, 0.16);
  box-shadow: inset 0 0 10px rgba(199, 147, 70, 0.25);
}
.inv-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: #0d0f12;
  border: 1px solid var(--border-steel);
  border-radius: 3px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.inv-info {
  flex: 1;
  min-width: 0;
}
.inv-name {
  font-size: 12px;
  font-weight: 600;
  color: #f0f2f4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inv-zoom {
  padding: 3px 6px;
  font-size: 12px;
  border-radius: 3px;
  background: #171a1f;
  border: 1px solid var(--border-steel);
}
.inv-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}
.footer-serial {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: 3px;
  cursor: default;
  flex-shrink: 0;
}
.footer-serial:hover { color: var(--text-dim); }

/* Slide-Over Drawers */
.drawer {
  position: fixed;
  top: 54px;
  right: 0;
  bottom: 82px;
  width: 420px;
  max-width: 94vw;
  background: linear-gradient(180deg, #191c20 0%, #121418 100%);
  border-left: 1px solid var(--border-bright);
  z-index: 550;
  transform: translateX(102%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -14px 0 38px rgba(0, 0, 0, 0.8);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 12px 16px;
  background: linear-gradient(180deg, #24282f 0%, #1a1d22 100%);
  border-bottom: 1px solid var(--border-steel);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}
.hint-card {
  background: linear-gradient(180deg, #1f2329 0%, #171a1e 100%);
  border: 1px solid var(--border-steel);
  border-radius: 3px;
  padding: 12px;
  margin-bottom: 12px;
}
.hint-card h4 { margin: 0 0 8px; font-size: 13.5px; color: var(--cyan); }
.hint-step {
  margin-top: 8px;
  padding: 8px 10px;
  background: #0e1013;
  border-left: 3px solid var(--amber);
  border-radius: 2px;
  font-size: 12.5px;
  line-height: 1.5;
}
.ach-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 3px;
  background: linear-gradient(180deg, #1f2329 0%, #171a1e 100%);
  border: 1px solid var(--border-steel);
  margin-bottom: 9px;
}
.ach-card.unlocked {
  border-color: var(--amber);
  background: rgba(199, 147, 70, 0.12);
}
.ach-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toasts */
#toast-container {
  position: fixed;
  top: 112px;
  right: 18px;
  z-index: 850;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(20, 22, 26, 0.96);
  border: 1px solid var(--border-bright);
  border-left: 4px solid var(--cyan);
  color: #f0f2f4;
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.72);
  max-width: 340px;
  animation: toast-in 0.22s ease;
}
.toast.ach { border-color: var(--amber); border-left-color: var(--amber); }
.toast.warn { border-color: var(--crimson); border-left-color: var(--crimson); }

/* ============ Établi d'assemblage ============ */
.workbench-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 68px;
  height: 58px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.workbench-btn.ready { border-color: var(--amber); color: #f3cf8d; animation: wbPulse 2.4s ease-in-out infinite; }
.workbench-btn.drop-target, .inv-item.drop-target { border-color: var(--cyan); box-shadow: 0 0 0 2px var(--cyan-dim), 0 0 14px rgba(143,184,173,.45); }
.inv-item.dragging { opacity: .45; }
@keyframes wbPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(199,147,70,0); }
  50% { box-shadow: 0 0 0 3px rgba(199,147,70,.25), 0 0 14px rgba(199,147,70,.35); }
}
.wb-help { margin: 0 0 14px; font-size: 13px; color: var(--text-dim); }
.wb-plate {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #2b3036 0%, #1d2125 100%);
  border: 1px solid #0d0f12;
  box-shadow: inset 0 2px 10px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.08);
}
.wb-plate.fail { animation: wbShake .4s ease; }
@keyframes wbShake { 0%,100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.wb-op { font-size: 26px; font-weight: 300; color: var(--text-dim); }
.wb-slot, .wb-result {
  position: relative;
  height: 118px;
  border-radius: 6px;
  border: 2px dashed #4a5059;
  background: rgba(8,10,12,.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 8px;
  transition: border-color .15s, background .15s;
}
.wb-slot { cursor: pointer; }
.wb-slot.over { border-color: var(--cyan); background: var(--cyan-dim); }
.wb-slot.filled { border-style: solid; border-color: var(--border-bright); background: linear-gradient(180deg, #262a30, #181b1f); }
.wb-slot.filled:hover { border-color: #b85c5c; }
.wb-slot-x { position: absolute; top: 6px; right: 7px; color: var(--text-muted); }
.wb-slot-icon { transform: scale(1.6); height: 36px; display: flex; align-items: center; }
.wb-slot-name { font-size: 12px; font-weight: 600; color: #eef0f2; }
.wb-slot-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 1px; }
.wb-result { border-style: solid; border-color: #3a3f46; }
.wb-result.made { border-color: var(--green); background: var(--green-dim); animation: wbMade .9s ease; }
@keyframes wbMade { 0% { transform: scale(.85); box-shadow: 0 0 0 0 rgba(91,168,118,.7); } 60% { transform: scale(1.05); box-shadow: 0 0 24px 6px rgba(91,168,118,.35); } 100% { transform: none; box-shadow: none; } }
.wb-actions { display: flex; align-items: center; gap: 8px; margin: 14px 0 16px; }
.wb-msg { flex: 1; font-size: 12.5px; line-height: 1.45; min-height: 18px; }
.wb-msg.ok { color: #9fdcb3; }
.wb-msg.err { color: #ff8a8a; }
.wb-shelf-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.4px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 8px; }
.wb-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
  cursor: grab;
}
.wb-item.used { opacity: .35; cursor: default; }
.wb-item-icon { display: flex; flex-shrink: 0; }
.wb-item-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Plans de profondeur des zones interactives ---- */
.hotspot[data-depth="0"] .hs-frame { stroke-width: 1.2; stroke-opacity: .7; }
.hotspot[data-depth="0"]:hover { filter: brightness(1.1) drop-shadow(0 0 4px rgba(242, 236, 218, 0.22)); }
.hotspot[data-depth="2"] .hs-frame { stroke-width: 2.2; }
.hotspot[data-depth="2"]:hover { filter: brightness(1.2) drop-shadow(0 0 8px rgba(242, 236, 218, 0.5)); }
/* Quand on survole un objet au premier plan, l'arrière-plan s'efface légèrement */
#room-svg:has(.hotspot[data-depth="2"]:hover) .hotspot[data-depth="0"] { opacity: .55; }

/* ---- Changement de zone sans rechargement ---- */
.scene-stage.zone-leaving #room-svg { opacity: 0; filter: blur(3px) brightness(.6); transition: opacity .25s ease, filter .25s ease; }
.scene-stage.zone-entering #room-svg { animation: zoneEnter .45s ease both; }
@keyframes zoneEnter { from { opacity: 0; filter: brightness(1.6) blur(2px); } to { opacity: 1; filter: none; } }

/* ---- Contour exact au survol (remplace le cadre pointillé) ---- */
.hotspot .hs-glow { display: none; }
.hotspot:hover .hs-glow { display: inline; animation: hsGlowIn .18s ease both; }
@keyframes hsGlowIn { from { opacity: 0; } to { opacity: 1; } }
.hotspot:hover,
.hotspot[data-depth="0"]:hover,
.hotspot[data-depth="2"]:hover { filter: none; }
.hotspot:hover .hs-frame { opacity: .22; stroke-dasharray: none; }
/* (pas de propriété CSS « filter » sur .hs-glow : elle écraserait le filtre SVG de contour) */
.hotspot.item-target:hover .hs-frame { opacity: .6; stroke: #c79346; }
