/* DCOSMOS-SHIP: the ship builder window (modal over the game).
   The builder itself lives in an isolated same-origin iframe
   (assets/ship-generator.html) with its own three.js — this file only
   styles the frame around it. */

.ship-overlay {
  position: fixed;
  top: var(--header-h, 96px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: rgba(4, 8, 16, 0.86);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ship-overlay[hidden] { display: none; }

.ship-overlay-inner {
  position: relative;
  width: 100%;
  height: min(820px, 100%);
  display: flex;
  flex-direction: column;
  background: #05070c;
  border: 1px solid rgba(120, 160, 220, 0.25);
  border-radius: 14px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}
/* Portrait phones and tablets keep the old comfortable card width — the
   1200px cap only ever mattered as a ceiling on very wide windows, and
   dropping it there is what let the landscape gutters through. Below the
   ship overlay's own phone breakpoint (max-width: 640px) the card already
   goes edge to edge, so this only applies to the portrait tablet band
   in between. */
@media (min-width: 641px) and (orientation: portrait) {
  .ship-overlay-inner { width: min(1200px, 100%); }
}

.ship-overlay-inner iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  display: block;
  background: #05070c;
}


/* On phones the builder's panel is dense — give it the whole screen. */
@media (max-width: 640px) {
  .ship-overlay { padding: 0; }
  .ship-overlay-inner { width: 100%; height: 100%; border-radius: 0; border: 0; }
}

/* ── First-run welcome from the dock officer ── */
.ship-welcome {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(4, 8, 16, 0.9);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ship-welcome[hidden] { display: none; }

.ship-welcome-card {
  width: min(400px, 100%);
  background: linear-gradient(180deg, #0d1526, #080d18);
  border: 1px solid rgba(120, 160, 220, 0.28);
  border-radius: 16px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
  padding: 28px 26px 24px;
  text-align: center;
}
.ship-welcome-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(159, 208, 255, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.ship-welcome-avatar svg { display: block; }
.ship-welcome-name {
  color: #9fd0ff;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.ship-welcome-text {
  color: #dbe6f5;
  font-size: 15px;
  line-height: 1.5;
  margin: 0 0 20px;
}
.ship-welcome-go {
  width: 100%;
  padding: 13px 18px;
  background: linear-gradient(180deg, #2f6db0, #245a94);
  border: 1px solid rgba(159, 208, 255, 0.35);
  border-radius: 10px;
  color: #eaf3ff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.ship-welcome-go:hover { background: linear-gradient(180deg, #397dc6, #2b689f); }

/* ── Ship window: the Save button floats over the builder's own viewport,
   just left of its gear control. No header bar holds it any more. */
.ship-lockin {
  min-height: 40px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2f6db0, #245a94);
  border: 1px solid rgba(159, 208, 255, 0.4);
  border-radius: 9px;
  color: #eaf3ff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.ship-lockin:hover { background: linear-gradient(180deg, #397dc6, #2b689f); }
.ship-lockin:disabled { opacity: 0.85; cursor: default; }
/* Floats on top of the 3D viewport. js/ship-screen.js measures the
   builder's gear button through the iframe and sets left/top so this
   sits immediately to its left, on every open, resize, and text change.
   The values below are only a brief starting position before that first
   measurement lands. The dark ring behind the blue fill is what keeps the
   button readable over a bright ship rendered right underneath it. */
.ship-lockin-float {
  position: fixed;
  z-index: 5;
  top: calc(var(--header-h, 96px) + 26px);
  left: calc(100% - 76px);
  box-shadow: 0 0 0 8px rgba(4, 8, 16, 0.35), 0 6px 20px rgba(0, 0, 0, 0.55);
}

/* ── Profile: account controls (danger zone) ── */
.profile-danger .danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(120, 160, 220, 0.12);
}
.profile-danger .danger-row:first-of-type { border-top: 0; }
.danger-info { min-width: 0; }
.danger-label { color: #dbe6f5; font-size: 14px; font-weight: 600; }
.danger-desc { color: #8ea3bd; font-size: 12px; line-height: 1.4; margin-top: 2px; }
.btn-reset-intro, .btn-reset-account {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-reset-intro {
  background: rgba(30, 44, 70, 0.7);
  border: 1px solid rgba(120, 160, 220, 0.35);
  color: #cfe3ff;
}
.btn-reset-intro:hover { background: rgba(44, 62, 96, 0.85); }
.btn-reset-account {
  background: rgba(80, 24, 30, 0.5);
  border: 1px solid rgba(220, 90, 90, 0.5);
  color: #ffc9c9;
}
.btn-reset-account:hover { background: rgba(120, 32, 40, 0.7); }

/* ── Reusable confirmation dialog ── */
.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(4, 8, 16, 0.9);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-overlay[hidden] { display: none; }
.confirm-card {
  width: min(380px, 100%);
  background: linear-gradient(180deg, #0d1526, #080d18);
  border: 1px solid rgba(120, 160, 220, 0.28);
  border-radius: 14px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
  padding: 24px 22px 20px;
}
.confirm-card.confirm-danger-mode { border-color: rgba(220, 90, 90, 0.45); }
.confirm-title { color: #eaf3ff; font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.confirm-text { color: #b9c7db; font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-cancel, .confirm-ok {
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.confirm-cancel {
  background: rgba(30, 44, 70, 0.7);
  border: 1px solid rgba(120, 160, 220, 0.3);
  color: #cfe3ff;
}
.confirm-cancel:hover { background: rgba(44, 62, 96, 0.85); }
.confirm-ok {
  background: linear-gradient(180deg, #2f6db0, #245a94);
  border: 1px solid rgba(159, 208, 255, 0.35);
  color: #eaf3ff;
}
.confirm-ok:hover { background: linear-gradient(180deg, #397dc6, #2b689f); }
.confirm-danger-mode .confirm-ok {
  background: linear-gradient(180deg, #c0392b, #97271c);
  border-color: rgba(255, 140, 140, 0.5);
  color: #ffffff;
}
.confirm-danger-mode .confirm-ok:hover { background: linear-gradient(180deg, #d0442f, #a82c20); }

/* ── One-time notice: the game has changed ── */
.regen-notice {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 8, 16, 0.9);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.regen-notice[hidden] { display: none; }
.regen-notice-card {
  width: min(400px, 100%);
  background: linear-gradient(180deg, #0d1526, #080d18);
  border: 1px solid rgba(120, 160, 220, 0.28);
  border-radius: 16px;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
  padding: 26px 24px 22px;
}
.regen-notice-title { color: #eaf3ff; font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.regen-notice-text { color: #b9c7db; font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.regen-notice-actions { display: flex; flex-direction: column; gap: 10px; }
.regen-notice-keep, .regen-notice-start {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.regen-notice-keep {
  background: rgba(30, 44, 70, 0.7);
  border: 1px solid rgba(120, 160, 220, 0.3);
  color: #cfe3ff;
}
.regen-notice-keep:hover { background: rgba(44, 62, 96, 0.85); }
.regen-notice-start {
  background: linear-gradient(180deg, #2f6db0, #245a94);
  border: 1px solid rgba(159, 208, 255, 0.35);
  color: #eaf3ff;
}
.regen-notice-start:hover { background: linear-gradient(180deg, #397dc6, #2b689f); }
