/* v36 — kasutaja viis uut 16:9 ruumitausta, üks seinaholo valikuaken ja fikseeritud alumine HUD. */

.game-board {
  grid-template-rows: 7.2% minmax(0, 1fr) !important;
  gap: .42cqw !important;
}

.scene {
  --screen-x: 21.1%;
  --screen-y: 14.8%;
  --screen-w: 62.2%;
  --screen-h: 54.7%;
}
.scene[data-room-owner="white"],
.scene[data-room-owner="oversoul"] {
  --screen-x: 21.1%;
  --screen-y: 14.8%;
  --screen-w: 62.2%;
  --screen-h: 54.7%;
}
.scene[data-room-owner="mantis"] {
  --screen-x: 16.8%;
  --screen-y: 11.4%;
  --screen-w: 66.5%;
  --screen-h: 59.6%;
}
.scene[data-room-owner="grey"] {
  --screen-x: 21.1%;
  --screen-y: 14.8%;
  --screen-w: 62.2%;
  --screen-h: 54.7%;
}

.scene .scene-background,
.scene.scene-cinematic .scene-background {
  object-fit: cover !important;
  object-position: center 44% !important;
  image-rendering: auto !important;
  filter: none !important;
}

/* Uutes piltides on rollitegelased juba ruumi sisse renderdatud. */
.scene[data-room-owner] .character-stage,
.scene[data-room-owner] .contact-stage,
.scene-tool-dock,
.scene-holo-layer {
  display: none !important;
}

/* Seinal jääb nähtavaks ainult üks aktiivne otsustusaken. */
.incoming-contact-panel,
.tutorial-coach {
  display: none !important;
}

.holo-console,
.scene.scene-cinematic .holo-console {
  left: var(--screen-x) !important;
  top: var(--screen-y) !important;
  width: var(--screen-w) !important;
  height: var(--screen-h) !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  gap: .24cqw !important;
  padding: .46cqw .55cqw .5cqw !important;
  overflow: hidden !important;
  border-width: 1px !important;
  border-radius: .34cqw !important;
  background:
    linear-gradient(rgba(87,221,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87,221,255,.03) 1px, transparent 1px),
    linear-gradient(145deg, rgba(2,31,59,.79), rgba(0,16,38,.86)) !important;
  background-size: .65cqw .65cqw, .65cqw .65cqw, auto !important;
  box-shadow: inset 0 0 1.05cqw rgba(93,221,255,.11), 0 0 .42cqw rgba(67,211,255,.16) !important;
  backdrop-filter: blur(4px) saturate(1.04) !important;
}
.scene[data-room-owner="mantis"] .holo-console {
  background:
    linear-gradient(rgba(201,151,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,151,255,.035) 1px, transparent 1px),
    linear-gradient(145deg, rgba(44,15,75,.80), rgba(21,6,49,.88)) !important;
  background-size: .65cqw .65cqw, .65cqw .65cqw, auto !important;
}

.console-header {
  grid-template-columns: auto minmax(0,1fr) auto !important;
  align-items: center !important;
  gap: .38cqw !important;
  padding-bottom: .2cqw !important;
}
.console-header > div { min-width: 0; }
.step-icon {
  width: 1.85cqw !important;
  height: 1.85cqw !important;
  min-width: 23px !important;
  min-height: 23px !important;
}
.console-role { font-size: clamp(8px,.49cqw,10px) !important; }
.holo-console h2 {
  font-size: clamp(14px,1.02cqw,20px) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.risk-badge {
  padding: .17cqw .3cqw !important;
  font-size: clamp(8px,.46cqw,9px) !important;
}
.prompt-copy {
  font-size: clamp(9px,.61cqw,12px) !important;
  line-height: 1.14 !important;
}

/* Tavavaates ei ole otsustusaknas sisemisi kerimisribasid. */
.interactive-area,
.scan-control-panel,
.fear-scan-side,
.memory-filter-scroll,
.interactive-area.opening-active,
.interactive-area.memory-filter-active {
  overflow: hidden !important;
  scrollbar-width: none !important;
}
.interactive-area::-webkit-scrollbar,
.scan-control-panel::-webkit-scrollbar,
.memory-filter-scroll::-webkit-scrollbar { display: none !important; }

.interactive-area {
  height: 100% !important;
  min-height: 0 !important;
  padding: .02cqw !important;
}
.interactive-area > * { min-height: 0; max-height: 100%; }

.choice-grid {
  height: 100%;
  grid-template-columns: repeat(2,minmax(0,1fr)) !important;
  grid-auto-rows: minmax(0,1fr);
  gap: .3cqw !important;
  align-content: stretch;
}
.choice-button {
  min-height: 0 !important;
  height: 100%;
  gap: .12cqw .32cqw !important;
  padding: .34cqw .42cqw !important;
}
.choice-button strong { font-size: clamp(10px,.71cqw,14px) !important; }
.choice-button span { font-size: clamp(8px,.51cqw,10px) !important; line-height: 1.12 !important; }
.choice-button small { font-size: clamp(7px,.45cqw,9px) !important; }
.choice-icon {
  width: 1.72cqw !important;
  height: 1.72cqw !important;
  min-width: 21px !important;
  min-height: 21px !important;
}

/* Keerukad töövaated mahuvad korraga ühele seinaholole. */
.timeline-shell,
.global-timeline-shell,
.health-scan-workstation,
.fear-scan-workstation,
.memory-editor,
.memory-filter-editor,
.opening-editor,
.coherence-picker,
.health-guidance-shell,
.fear-path-shell,
.phrase-editor,
.result-dashboard {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.timeline-readout {
  grid-template-columns: 1.25fr repeat(6,minmax(0,1fr)) !important;
  gap: .2cqw !important;
}
.timeline-readout div { padding: .2cqw .26cqw !important; }
.timeline-readout span { font-size: clamp(7px,.43cqw,9px) !important; }
.timeline-readout b { font-size: clamp(9px,.57cqw,11px) !important; }
.global-timeline-shell { grid-template-rows: auto minmax(0,1fr) auto auto !important; gap: .22cqw !important; }
.timeline-canvas-wrap { min-height: 0 !important; }
.timeline-hint { font-size: clamp(7px,.43cqw,9px) !important; padding: .14cqw .24cqw !important; }
.booking-queue { gap: .2cqw !important; }
.booking-card { padding: .2cqw .25cqw !important; }
.booking-card span,.booking-card small { font-size: clamp(7px,.43cqw,9px) !important; }
.booking-card b { font-size: clamp(9px,.57cqw,11px) !important; }
.timeline-actions { gap: .26cqw !important; }
.timeline-actions strong { font-size: clamp(9px,.58cqw,11px) !important; }
.timeline-actions .primary-button { padding: .28cqw .42cqw !important; }

.health-scan-workstation {
  grid-template-columns: minmax(150px,.72fr) minmax(0,1.55fr) !important;
  gap: .34cqw !important;
}
.scan-visual-panel,
.scan-control-panel { border-radius: .44cqw !important; }
.scan-visual-panel { padding: .35cqw !important; }
.scan-control-panel { gap: .28cqw !important; padding: .34cqw !important; }
.health-body-svg { max-height: 74% !important; }
.scan-warning { padding: .28cqw .34cqw !important; gap: .28cqw !important; }
.scan-warning img { width: 1.5cqw !important; min-width: 18px !important; }
.scan-warning strong { font-size: clamp(9px,.57cqw,11px) !important; }
.scan-warning span { font-size: clamp(7px,.45cqw,9px) !important; line-height: 1.12 !important; }
.scan-stat-grid { gap: .22cqw !important; }
.scan-stat { padding: .24cqw .28cqw !important; }
.scan-stat span { font-size: clamp(7px,.43cqw,9px) !important; }
.scan-stat b { font-size: clamp(9px,.59cqw,12px) !important; }
.scan-finding { padding: .3cqw !important; gap: .12cqw !important; }
.scan-finding span { font-size: clamp(7px,.43cqw,9px) !important; }
.scan-finding strong { font-size: clamp(10px,.68cqw,13px) !important; }
.scan-finding em { font-size: clamp(7px,.45cqw,9px) !important; line-height: 1.12 !important; }
.scan-start,.scan-control-panel .primary-button { min-height: 0 !important; padding: .3cqw .42cqw !important; }

.fear-scan-workstation {
  grid-template-columns: minmax(0,1.18fr) minmax(225px,.9fr) !important;
  gap: .3cqw !important;
}
.thought-ocean-content { gap: .2cqw !important; padding: .28cqw !important; }
.thought-layer { gap: .1cqw !important; padding: .22cqw .28cqw !important; }
.thought-current { gap: .1cqw !important; }
.thought-current span { padding: .08cqw .18cqw !important; font-size: clamp(7px,.43cqw,9px) !important; }
.fear-scan-side { gap: .2cqw !important; padding: .28cqw !important; }
.fear-layer-metrics { gap: .15cqw !important; }
.fear-layer-metrics > div { padding: .2cqw .24cqw !important; }
.fear-layer-metrics span { font-size: clamp(7px,.43cqw,9px) !important; }
.fear-layer-metrics b { font-size: clamp(10px,.66cqw,13px) !important; }
.contact-fear-packet { padding: .24cqw .28cqw !important; gap: .1cqw !important; }
.fear-packet-title { font-size: clamp(8px,.52cqw,10px) !important; }
.fear-packet-fields { gap: .16cqw !important; }
.fear-packet-field { gap: .08cqw !important; }
.fear-packet-field span { font-size: clamp(6px,.39cqw,8px) !important; }
.fear-packet-field > div { padding: .18cqw .22cqw !important; font-size: clamp(7px,.46cqw,9px) !important; line-height: 1.08 !important; }

.coherence-grid { height: 100%; gap: .3cqw !important; }
.coherence-choice { gap: .18cqw !important; padding: .34cqw !important; }
.coherence-choice strong { font-size: clamp(10px,.7cqw,14px) !important; }
.coherence-choice span,.coherence-choice small { font-size: clamp(7px,.47cqw,9px) !important; }
.coherence-intro { font-size: clamp(8px,.53cqw,10px) !important; }

.memory-filter-editor { grid-template-rows: auto auto minmax(0,1fr) auto !important; gap: .24cqw !important; }
.memory-filter-instruction { padding: .22cqw .3cqw !important; }
.memory-filter-instruction strong { font-size: clamp(9px,.58cqw,11px) !important; }
.memory-filter-instruction span { font-size: clamp(7px,.44cqw,9px) !important; }
.memory-capacity { gap: .2cqw !important; }
.memory-capacity .metric-card { padding: .2cqw .25cqw !important; }
.memory-segments { grid-template-columns: repeat(3,minmax(0,1fr)) !important; grid-template-rows: repeat(3,minmax(0,1fr)); gap: .2cqw !important; height: 100%; }
.segment-toggle { min-height: 0 !important; height: 100%; gap: .07cqw !important; padding: .2cqw .24cqw !important; }
.segment-toggle strong { font-size: clamp(8px,.52cqw,10px) !important; }
.segment-toggle span,.segment-meta,.segment-status { font-size: clamp(6px,.39cqw,8px) !important; line-height: 1.05 !important; }
.memory-filter-footer { padding: .24cqw .3cqw !important; gap: .22cqw !important; }
.memory-filter-footer .memory-filter-live { min-height: 0 !important; padding: .22cqw .28cqw !important; }
.memory-filter-footer-actions { padding: .18cqw .22cqw !important; }
.memory-filter-footer-actions > span { font-size: clamp(7px,.43cqw,9px) !important; }

.interactive-area.opening-active .opening-editor {
  grid-template-rows: auto auto minmax(72px,1fr) auto auto auto !important;
  gap: .2cqw !important;
}
.interactive-area.opening-active .opening-contract-card { padding: .25cqw .32cqw !important; }
.interactive-area.opening-active .opening-contract-card em { display: none !important; }
.interactive-area.opening-active .opening-metrics { grid-template-columns: repeat(5,minmax(0,1fr)) !important; gap: .18cqw !important; }
.interactive-area.opening-active .opening-metrics .metric-card { padding: .2cqw .22cqw !important; }
.interactive-area.opening-active .opening-metrics .metric-card span { font-size: clamp(7px,.43cqw,9px) !important; }
.interactive-area.opening-active .opening-metrics .metric-card b { font-size: clamp(10px,.67cqw,13px) !important; }
.interactive-area.opening-active .opening-visual { min-height: 72px !important; max-height: none !important; }
.interactive-area.opening-active .slider-block { padding: .2cqw .28cqw !important; }
.interactive-area.opening-active .opening-guidance { padding: .18cqw .28cqw !important; font-size: clamp(7px,.45cqw,9px) !important; }
.interactive-area.opening-active .memory-summary { min-height: 0 !important; padding: .22cqw .3cqw !important; }

.result-dashboard { gap: .28cqw !important; }
.result-hero { gap: .36cqw !important; }
.result-grade { width: 3.4cqw !important; height: 3.4cqw !important; min-width: 42px !important; min-height: 42px !important; }
.result-hero h3 { font-size: clamp(14px,.95cqw,18px) !important; }
.result-hero p { font-size: clamp(8px,.52cqw,10px) !important; }
.result-actions { gap: .3cqw !important; }

/* Tagasinupp ja otsuse efekt on sama seinaholo sees, mitte eraldi hõljuvad aknad. */
.back-button {
  z-index: 28 !important;
  left: auto !important;
  right: calc(100% - var(--screen-x) - var(--screen-w) + .65%) !important;
  top: calc(var(--screen-y) + var(--screen-h) - 4.3%) !important;
  bottom: auto !important;
  padding: .2cqw .35cqw !important;
  border-radius: .28cqw !important;
  font-size: clamp(7px,.45cqw,9px) !important;
}
.effect-toast {
  z-index: 27 !important;
  left: calc(var(--screen-x) + 1%) !important;
  right: auto !important;
  bottom: calc(100% - var(--screen-y) - var(--screen-h) + .7%) !important;
  max-width: calc(var(--screen-w) - 9%) !important;
  padding: .18cqw .32cqw !important;
  border-radius: .26cqw !important;
  font-size: clamp(7px,.46cqw,9px) !important;
  background: rgba(1,23,43,.92) !important;
}

/* Fikseeritud alumine HUD: sinine kontaktisiku kaart + kuldne hingelepingu kaart. */
.fixed-bottom-hud {
  position: absolute;
  z-index: 36;
  left: 22.8%;
  right: .72cqw;
  bottom: .72cqw;
  height: 21.7%;
  display: grid;
  grid-template-columns: minmax(0,1.03fr) minmax(0,1fr);
  gap: .52cqw;
  pointer-events: none;
}
.fixed-hud-card {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: max(2px,.17cqw) solid;
  border-radius: .78cqw;
  padding: .55cqw .65cqw;
  color: #07111a;
  background: rgba(255,255,255,.965);
  box-shadow: 0 .3cqw 1.1cqw rgba(0,7,18,.42), inset 0 0 1cqw rgba(255,255,255,.78);
}
.contact-info-card { border-color: #0aa7e6; }
.contract-info-card { border-color: #ffc400; }
.fixed-hud-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5cqw;
  margin-bottom: .34cqw;
}
.fixed-hud-heading p {
  margin: 0 0 .05cqw;
  color: #078dcc;
  font-size: clamp(8px,.53cqw,10px);
  font-weight: 950;
  letter-spacing: .08em;
}
.contract-info-card .fixed-hud-heading p { color: #8a6500; }
.fixed-hud-heading h2 {
  margin: 0;
  max-width: 31cqw;
  color: #07111a;
  font-size: clamp(12px,.88cqw,17px);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fixed-hud-heading > span {
  flex: 0 0 auto;
  padding: .16cqw .34cqw;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: #087fae;
  font-size: clamp(7px,.47cqw,9px);
  font-weight: 950;
}
.contract-info-card .fixed-hud-heading > span { color: #8a6500; }

.fixed-contact-body {
  height: calc(100% - 2.1cqw);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) 24%;
  gap: .55cqw;
}
.fixed-contact-copy {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  gap: .28cqw;
}
.fixed-contact-grid,
.fixed-contract-grid {
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .18cqw .42cqw;
  align-content: start;
}
.fixed-contact-grid div,
.fixed-contract-grid div { min-width: 0; }
.fixed-contact-grid .wide,
.fixed-contract-grid .wide { grid-column: 1 / -1; }
.fixed-contact-grid dt,
.fixed-contract-grid dt {
  margin: 0;
  color: #687580;
  font-size: clamp(7px,.43cqw,9px);
  font-weight: 850;
  line-height: 1.05;
}
.fixed-contact-grid dd,
.fixed-contract-grid dd {
  margin: .05cqw 0 0;
  color: #07111a;
  font-size: clamp(8px,.54cqw,10.5px);
  font-weight: 800;
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fixed-contact-grid .wide dd,
.fixed-contract-grid .wide dd { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fixed-contact-metrics {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: .22cqw;
}
.fixed-contact-metrics span {
  min-width: 0;
  padding: .18cqw .24cqw;
  border: 1px solid rgba(10,167,230,.35);
  border-radius: .28cqw;
  color: #55717d;
  font-size: clamp(7px,.43cqw,9px);
  font-weight: 800;
}
.fixed-contact-metrics b { display: block; margin-top: .04cqw; color: #057bab; font-size: clamp(9px,.62cqw,12px); }
.fixed-contact-avatar-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border: 1px solid rgba(10,167,230,.65);
  border-radius: .55cqw;
  background: linear-gradient(180deg,rgba(226,249,255,.95),rgba(255,255,255,.98));
}
.fixed-contact-avatar-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}
.fixed-contract-grid {
  height: calc(100% - 2.1cqw);
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .22cqw .55cqw;
}
.fixed-contract-grid div {
  padding-bottom: .13cqw;
  border-bottom: 1px solid rgba(176,132,0,.18);
}
.fixed-contract-grid dt { color: #846b26; }

.game-board.minimal-hud .fixed-bottom-hud { opacity: 0; visibility: hidden; }

@container (max-width: 980px) {
  .fixed-bottom-hud { left: 20.5%; height: 22.5%; }
  .fixed-hud-card { padding: .42cqw .48cqw; }
  .fixed-contact-body { grid-template-columns: minmax(0,1fr) 21%; }
  .fixed-contact-grid dd,.fixed-contract-grid dd { font-size: clamp(7px,.49cqw,9px); }
  .prompt-copy { display: none !important; }
  .holo-console { grid-template-rows: auto minmax(0,1fr) !important; }
}

@container (max-width: 760px) {
  .fixed-bottom-hud { left: 18%; grid-template-columns: 1fr 1fr; gap: .35cqw; }
  .fixed-contact-avatar-wrap { display: none; }
  .fixed-contact-body { grid-template-columns: 1fr; }
  .fixed-contact-grid .wide,.fixed-contract-grid .wide { display: none; }
  .fixed-contact-grid,.fixed-contract-grid { grid-template-columns: 1fr 1fr; }
  .choice-grid { grid-template-columns: 1fr 1fr !important; }
}
