/* v38 — kompaktsem alumine HUD, keritav tulemus ja parempoolsed laevakontakti tööaknad. */

/* Alumiste kaartide kõrgus vastab nüüd tegelikule sisule. Vabanenud ruum antakse seinaholole. */
.fixed-bottom-hud {
  left: 22.8% !important;
  right: .72cqw !important;
  bottom: .62cqw !important;
  height: 18.35% !important;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1.08fr) !important;
  gap: .5cqw !important;
}
.fixed-hud-card {
  padding: .42cqw .55cqw !important;
  border-radius: .66cqw !important;
}
.fixed-hud-heading {
  margin-bottom: .2cqw !important;
  gap: .35cqw !important;
}
.fixed-hud-heading p { margin-bottom: 0 !important; }
.fixed-hud-heading h2 {
  font-size: clamp(13px, .84cqw, 17px) !important;
  line-height: 1 !important;
}
.fixed-hud-heading > span {
  padding: .11cqw .28cqw !important;
  font-size: clamp(7px, .43cqw, 9px) !important;
}
.fixed-contact-body {
  height: calc(100% - 1.66cqw) !important;
  grid-template-columns: minmax(0, 1fr) 21.5% !important;
  gap: .42cqw !important;
  align-items: stretch !important;
}
.fixed-contact-copy {
  grid-template-rows: auto auto !important;
  align-content: start !important;
  gap: .2cqw !important;
}
.fixed-contact-grid,
.fixed-contract-grid {
  align-content: start !important;
  gap: .1cqw .4cqw !important;
}
.fixed-contact-grid dt,
.fixed-contract-grid dt {
  line-height: 1 !important;
}
.fixed-contact-grid dd,
.fixed-contract-grid dd {
  margin-top: .02cqw !important;
  line-height: 1.03 !important;
}
.fixed-contact-grid .wide dd,
.fixed-contract-grid .wide dd {
  -webkit-line-clamp: 1 !important;
}
.fixed-contact-metrics {
  gap: .18cqw !important;
}
.fixed-contact-metrics span {
  padding: .12cqw .2cqw !important;
  line-height: 1 !important;
}
.fixed-contact-metrics b {
  margin-top: .02cqw !important;
}
.fixed-contact-avatar-wrap {
  border-radius: .44cqw !important;
}
.fixed-contract-grid {
  height: calc(100% - 1.66cqw) !important;
  gap: .12cqw .48cqw !important;
}
.fixed-contract-grid div {
  padding-bottom: .07cqw !important;
}

/* Väiksem alumine HUD ei tohi jätta seinaholo põhjendamatult madalaks. */
.scene,
.scene[data-room-owner="white"],
.scene[data-room-owner="oversoul"],
.scene[data-room-owner="grey"] {
  --screen-h: 61.2%;
}
.scene[data-room-owner="mantis"] { --screen-h: 64.4%; }

/* Missiooni tulemus on ainus pikk vaade, kus kerimisriba on vajalik ja nähtav. */
.scene[data-step-type="result"] .holo-console {
  height: 65.2% !important;
}
.scene[data-step-type="result"] .interactive-area {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: .5cqw !important;
  scrollbar-width: thin !important;
  scrollbar-color: #55ddff rgba(0, 18, 39, .72) !important;
  scrollbar-gutter: stable !important;
}
.scene[data-step-type="result"] .interactive-area::-webkit-scrollbar {
  display: block !important;
  width: .55cqw !important;
  min-width: 8px !important;
}
.scene[data-step-type="result"] .interactive-area::-webkit-scrollbar-track {
  background: rgba(0, 18, 39, .72) !important;
  border-radius: 999px !important;
}
.scene[data-step-type="result"] .interactive-area::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #65e7ff, #178bc4) !important;
  border: 1px solid rgba(160, 242, 255, .72) !important;
  border-radius: 999px !important;
}
.scene[data-step-type="result"] .result-dashboard {
  height: auto !important;
  min-height: 100% !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: .52cqw !important;
}
.scene[data-step-type="result"] .result-actions {
  padding-bottom: .15cqw !important;
}

/* Väikese halli sõnumi saatja: aken paremale ja kaardid vertikaalselt, et tekst ei kitseneks. */
.scene[data-room-owner="grey"][data-step-type="coherence"] .holo-console {
  left: 52.2% !important;
  top: 12.4% !important;
  width: 44.2% !important;
  height: 63.4% !important;
  padding: .55cqw .62cqw .58cqw !important;
}
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-picker {
  height: 100% !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: .38cqw !important;
}
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-grid {
  height: 100% !important;
  min-height: 0 !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
  gap: .34cqw !important;
}
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-choice {
  min-height: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-rows: auto auto auto auto !important;
  column-gap: .48cqw !important;
  row-gap: .1cqw !important;
  align-content: center !important;
  padding: .4cqw .48cqw !important;
}
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-role-icon {
  grid-row: 1 / 5 !important;
  align-self: center !important;
  width: 2.35cqw !important;
  height: 2.35cqw !important;
}
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-choice strong,
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-choice span,
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-choice small,
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-bar {
  grid-column: 2 !important;
}
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-choice strong {
  font-size: clamp(12px, .78cqw, 15px) !important;
}
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-choice span,
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-choice small {
  font-size: clamp(9px, .57cqw, 11px) !important;
}
.scene[data-room-owner="grey"][data-step-type="coherence"] .coherence-bar {
  width: 100% !important;
  margin: .04cqw 0 !important;
}

/* Laeva lähiskänn: juhtpaneel paremal, keskosa jääb inimese sprite'ile vabaks. */
.scene[data-step-type="healthScan"] .holo-console {
  left: 51.4% !important;
  top: 11.8% !important;
  width: 45.1% !important;
  height: 64.2% !important;
  padding: .55cqw .62cqw .58cqw !important;
}
.scene[data-step-type="healthScan"] .scan-control-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
  gap: .34cqw !important;
  padding: .4cqw !important;
}
.scene[data-step-type="healthScan"] .scan-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: .28cqw !important;
}
.scene[data-step-type="healthScan"] .scan-warning,
.scene[data-step-type="healthScan"] .scan-stat,
.scene[data-step-type="healthScan"] .scan-finding {
  min-width: 0 !important;
}
.scene[data-step-type="healthScan"] .scan-warning span,
.scene[data-step-type="healthScan"] .scan-finding em {
  white-space: normal !important;
  overflow: visible !important;
}

/* Tervise- ja hirmusõnumi töövoog kasutab sama parempoolset laevakontakti tsooni. */
.scene[data-step-type="healthFearGuidance"] .holo-console {
  left: 50.8% !important;
  top: 11.8% !important;
  width: 45.7% !important;
  height: 64.2% !important;
  padding: .55cqw .62cqw .58cqw !important;
}
.scene[data-step-type="healthFearGuidance"] .choice-grid {
  grid-template-columns: 1fr !important;
  grid-auto-rows: minmax(0, 1fr) !important;
}
.scene[data-step-type="healthFearGuidance"] .guidance-grid,
.scene[data-step-type="healthFearGuidance"] .fear-channel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.scene[data-step-type="healthFearGuidance"] .choice-button {
  padding: .4cqw .48cqw !important;
}
.scene[data-step-type="healthFearGuidance"] .choice-button strong {
  font-size: clamp(11px, .73cqw, 14px) !important;
}
.scene[data-step-type="healthFearGuidance"] .choice-button span {
  font-size: clamp(9px, .57cqw, 11px) !important;
}

/* Tagasinupp jääb väiksemate kaartide kohal, mitte nende või põhitegevuse peal. */
.back-button {
  right: 1.05% !important;
  bottom: 19.55% !important;
}

@container (max-width: 980px) {
  .fixed-bottom-hud {
    left: 20.5% !important;
    height: 19.1% !important;
  }
  .fixed-contact-body { grid-template-columns: minmax(0, 1fr) 19.5% !important; }
  .scene[data-room-owner="grey"][data-step-type="coherence"] .holo-console,
  .scene[data-step-type="healthScan"] .holo-console,
  .scene[data-step-type="healthFearGuidance"] .holo-console {
    left: 49.6% !important;
    width: 47.2% !important;
  }
  .back-button { bottom: 20.2% !important; }
}
