/* Dock Mode screens. The relaunch clock, Exit Dock, and the ship sheet while the berth is open. */

.dock-source {
  position: fixed;
  width: 2px;
  height: 2px;
  left: 0;
  bottom: 0;
  opacity: 0;
  pointer-events: none;
}

#dock-clock {
  position: fixed;
  z-index: 34;
  left: calc(var(--frame-x) + 18px + env(safe-area-inset-left));
  bottom: calc(var(--dock-h) + 28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  padding: 12px 16px 14px;
  border: 1px solid rgba(255, 193, 74, 0.55);
  border-radius: 16px;
  background: rgba(8, 14, 22, 0.86);
  color: #f3f7fb;
  pointer-events: none;
}

#dock-clock[hidden] { display: none; }

#dock-clock-title {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(231, 238, 246, 0.72);
  font: 600 11px/1.3 Sora, sans-serif;
}

#dock-clock-time {
  font: 600 28px/1 Sora, sans-serif;
  color: #fff;
  transition: color 0.4s ease;
}

#dock-clock.is-warn {
  border-color: rgba(255, 193, 74, 0.95);
  box-shadow: 0 0 18px rgba(255, 170, 60, 0.35);
}

#dock-clock.is-warn #dock-clock-time {
  color: #ffc14a;
}

#dock-clock.is-zero #dock-clock-time {
  color: #fff1d0;
  animation: dock-clock-zero 0.32s steps(1) infinite;
}

@keyframes dock-clock-zero {
  0% { color: #fff1d0; text-shadow: 0 0 12px #ffc14a; }
  50% { color: #ffc14a; text-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  #dock-clock-time { transition: none; }
  #dock-clock.is-zero #dock-clock-time { animation: none; color: #ffc14a; }
}

#dock-exit {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 193, 74, 0.9);
  border-radius: 16px;
  background: rgba(28, 18, 8, 0.92);
  color: #ffe7bf;
  cursor: pointer;
  pointer-events: auto;
}

#dock-exit i {
  font-style: normal;
  font-size: 18px;
  line-height: 1;
}

#dock-exit span {
  font: 700 11px "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#dock-exit[hidden] { display: none; }

#inventory.dock-eye {
  z-index: 36;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-end;
  padding:
    calc(72px + var(--frame-y) + env(safe-area-inset-top))
    calc(78px + var(--frame-x) + env(safe-area-inset-right))
    calc(var(--dock-h) + 12px + env(safe-area-inset-bottom))
    calc(36px + var(--frame-x) + env(safe-area-inset-left));
  background: transparent;
  pointer-events: none;
}

#inventory.dock-eye .sheet-card {
  pointer-events: auto;
  flex: 0 1 auto;
  align-self: stretch;
  width: min(460px, 42vw);
  max-height: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 22px 20px 16px;
  border: 1px solid rgba(120, 196, 214, 0.55);
  border-radius: 28px;
  background: rgba(8, 14, 22, 0.86);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  overflow: auto;
}

@media (max-width: 800px) {
  #inventory.dock-eye {
    align-items: stretch;
    justify-content: stretch;
    flex-direction: column;
    padding:
      calc(var(--frame-y) + 52px + env(safe-area-inset-top))
      var(--frame-x)
      calc(var(--dock-h) + 44px + env(safe-area-inset-bottom) + var(--keyboard))
      var(--frame-x);
  }

  #inventory.dock-eye .sheet-card {
    flex: 1 1 0;
    width: 100%;
    height: auto;
    max-height: none;
    min-height: 0;
    border-radius: 18px;
    padding: 18px 16px 20px;
    background: rgba(8, 14, 22, 0.86);
  }

  #dock-clock {
    left: calc(var(--frame-x) + 12px);
    bottom: calc(var(--dock-h) + 18px + env(safe-area-inset-bottom));
  }

  #dock-clock-time { font-size: 22px; }
}
