/* Wide-screen presentation: the bridge subtitle bar, the presentation settings panel and photo mode. */

/* ---- Bridge subtitle bar ---------------------------------------------------------------------------------------
   Sits in the band the HUD reserves above the command console (battle-hud.mjs sets --callout-bottom and
   --callout-height from the measured console and drawer rectangles). It never takes a click. */
#bridge-callouts {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: var(--callout-bottom, 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(960px, calc(100% - 24px));
  height: var(--callout-height, 48px);
  padding: 0 18px;
  transform: translateX(-50%);
  border: 1px solid #416173;
  border-left: 3px solid var(--cyan);
  border-radius: 4px;
  background: #06111be6;
  box-shadow: 0 6px 20px #0008;
  color: #e8f2f8;
  font:
    500 20px/1.25 'IBM Plex Mono',
    monospace;
  pointer-events: none;
  overflow: hidden;
}
#bridge-callouts[hidden] {
  display: none;
}
#bridge-callouts.urgent {
  border-left-color: var(--red);
}
#bridge-callouts .callout-station {
  flex: 0 0 auto;
  color: #86dbe9;
  font-size: 0.7em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
#bridge-callouts.urgent .callout-station {
  color: #ffb7ae;
}
#bridge-callouts .callout-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 2559px) {
  #bridge-callouts {
    width: min(640px, calc(100% - 24px));
    padding: 0 12px;
    gap: 10px;
    font-size: 16px;
    line-height: 1.2;
  }
  #bridge-callouts .callout-station {
    max-width: 38%;
    white-space: normal;
  }
  /* Too little height left above the console: one short row (the HUD also reserves less). */
  #bridge-callouts.tight {
    font-size: 15px;
  }
  #bridge-callouts.tight .callout-station {
    white-space: nowrap;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ---- Presentation settings --------------------------------------------------------------------------------------- */
#presentation-panel {
  position: absolute;
  z-index: 8;
  top: calc(var(--hud-mission, 0px) + 48px);
  right: 14px;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100% - 28px));
  max-height: min(60vh, 560px);
  overflow: auto;
  padding: 12px;
  border: 1px solid #668596;
  border-radius: 5px;
  background: #091722f2;
  color: #dce6ef;
  font-size: 14px;
}
#presentation-panel[hidden] {
  display: none;
}
#presentation-panel .presentation-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
#presentation-panel .presentation-row select {
  flex: 1 1 auto;
  min-width: 0;
}
#presentation-panel input[type='checkbox'] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
}
#presentation-panel select,
#presentation-panel button {
  min-height: 36px;
  padding: 4px 10px;
  font-size: 14px;
}
#presentation-panel .hint {
  margin: 0;
  color: #a9bccb;
  line-height: 1.4;
}
#callout-transcript {
  margin: 0;
  padding: 0 0 0 22px;
  font:
    13px/1.45 'IBM Plex Mono',
    monospace;
  color: #cfe0ea;
}
#callout-transcript[hidden] {
  display: none;
}
#callout-transcript li {
  margin: 2px 0;
}
#callout-transcript small {
  color: #8da3b5;
}

/* ---- Photo mode ---------------------------------------------------------------------------------------------------
   The viewport becomes the whole screen; everything but the canvas, the toolbar and the exit hint is hidden. */
body.photo-mode .viewport {
  position: fixed;
  inset: 0;
  z-index: 50;
  height: auto;
  min-height: 0;
  border: 0;
  box-shadow: none;
}
body.photo-mode .viewport::after {
  display: none;
}
body.photo-mode .viewport > :not(canvas):not(#photo-toolbar):not(#photo-hint) {
  display: none !important;
}
#photo-toolbar {
  position: absolute;
  z-index: 60;
  top: 12px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  width: min(1100px, calc(100% - 24px));
  padding: 8px 12px;
  transform: translateX(-50%);
  border: 1px solid #5d8194;
  border-radius: 6px;
  background: #091722f0;
  box-shadow: 0 8px 26px #000a;
  color: #e3edf4;
  font-size: 15px;
}
#photo-toolbar[hidden],
#photo-hint[hidden] {
  display: none;
}
#photo-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
#photo-toolbar button,
#photo-toolbar select {
  min-height: 40px;
  padding: 4px 12px;
  font-size: 15px;
}
#photo-toolbar input[type='range'] {
  width: 160px;
  min-height: 40px;
  accent-color: var(--cyan);
}
#photo-toolbar output {
  min-width: 3.4ch;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
}
#photo-toolbar small {
  color: #a9bccb;
}
#photo-toolbar small:empty {
  display: none;
}
#photo-toolbar input:disabled {
  opacity: 0.45;
}
#photo-hint {
  position: absolute;
  z-index: 60;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border: 1px solid #416173;
  border-radius: 4px;
  background: #06111bcc;
  color: #cfe0ea;
  font:
    14px 'IBM Plex Mono',
    monospace;
  pointer-events: none;
}
#photo-hint.capturing {
  visibility: hidden;
}
.er-photo {
  min-height: 40px;
}
@media (min-width: 2560px) {
  #photo-toolbar {
    flex-wrap: nowrap;
    font-size: 16px;
  }
}
@media (max-width: 2559px) {
  #photo-toolbar {
    max-height: 104px;
    overflow: hidden;
  }
  #photo-toolbar input[type='range'] {
    width: 120px;
  }
}
