/* On a phone the header stays one row: the galaxy button on the left,
   the other buttons on the right. The mobile map height reads --header-h
   at runtime, so the header height is accounted for automatically. */
@media (max-width: 480px) {
  /* padding-top 8px, atlas button shrinks to 64px further below --
     8 + 72/2 = 44px. */
  header { padding: 8px 60px 8px 10px; --hdr-line-y: 44px; }
  /* SC-HEADER-CLEARANCE: the 72px Capture button hangs 36px below the 44px
     divider line here (cosmos-base.css holds the 50px default). */
  :root { --nav-hang: 36px; }
  header nav { gap: 6px; }
  header nav button { padding: 4px 8px; font-size: 10.5px; letter-spacing: 0.3px; }
}
/* ── Capture button + Galaxy button (SC-HEADER-ORDER, owner 2026-09-03) ── */
/* Capture is first and the largest control (100px, the size --hdr-line-y and
   --nav-hang in cosmos-base.css are computed from), with extra room to its
   right so it never crowds the Galaxy button. Galaxy is second at 70px.
   Both share the same look and hover/active behavior. */
header nav .nav-capture,
header nav .nav-atlas {
  width: 100px;
  height: 100px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-panel);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  flex-shrink: 0;
}
/* The System button is third in the left group (standard round size); its
   margin-right: auto pushes the remaining buttons to the right. */
header nav button[data-view="reveal"] { margin-right: auto; }
/* Owner 2026-09-03: no extra margin -- the nav's 8px gap alone spaces
   Capture, Galaxy and System evenly. */
header nav .nav-capture svg { width: 54px; height: 54px; }
header nav .nav-atlas { width: 70px; height: 70px; }
header nav .nav-atlas svg { width: 36px; height: 36px; }
header nav .nav-atlas { position: relative; }
.atlas-mode-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-panel, #0d1526);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
/* The list sub-icon is always shown. Grey means the map is up; lit (the
   same accent as the button) means the list view is up. */
header nav .nav-atlas.active .atlas-mode-badge.lit { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 8px rgba(245, 158, 11, 0.35); }
/* See cosmos-base.css for why this applies only under (hover: hover): a
   touch tap can never leave the button afterward, so on a phone this
   would just stick on -- and it reads as the same lit ring as .active
   below, so a merely-tapped galaxy button looked selected forever. */
@media (hover: hover) {
  header nav .nav-capture:hover,
  header nav .nav-atlas:hover {
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.4);
  }
}
header nav .nav-capture.active,
header nav .nav-atlas.active {
  background: linear-gradient(rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.08)), var(--bg-panel);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.35);
}
header nav .nav-capture svg, header nav .nav-atlas svg { display: block; }
@media (max-width: 480px) {
  header nav .nav-capture { width: 72px; height: 72px; margin-right: 6px; }
  header nav .nav-capture svg { width: 40px; height: 40px; }
  header nav .nav-atlas { width: 54px; height: 54px; }
  header nav .nav-atlas svg { width: 28px; height: 28px; }
}
/* ── Round nav buttons (Probe, Profile, Ship) ───────────── */
header nav .nav-round {
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--bg-panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Applies only under (hover: hover); see cosmos-base.css. Without this a tapped
   icon (the Ship button included -- it opens an overlay, not a view, so
   it never gets .active from showView() at all) stayed lit on a phone
   with the same accent border and glow the real selected button carries. */
@media (hover: hover) {
  header nav .nav-round:hover {
    color: var(--text-secondary);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
  }
}
header nav .nav-round.active {
  border-color: var(--accent);
  color: var(--accent);
  background: linear-gradient(rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.08)), var(--bg-panel);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.1);
}
header nav .nav-round svg { display: block; width: 28px; height: 28px; }
/* Owner 2026-09-03: the Ship Interior button matches the Capture button's
   size and sits a little up and to the right, nearer the options gear. */
header nav button[data-view="ship"] { width: 100px; height: 100px; }
header nav button[data-view="ship"] svg { width: 54px; height: 54px; }
@media (max-width: 480px) {
  header nav .nav-round { width: 48px; height: 48px; }
  header nav .nav-round svg { width: 24px; height: 24px; }
  header nav button[data-view="ship"] { width: 72px; height: 72px; }
  header nav button[data-view="ship"] svg { width: 40px; height: 40px; }
}
/* SC-SYSTEM-SCREEN: the System button with nothing to open (no system
   loaded and an empty atlas) is dimmed; js/app.js's syncSystemButton sets
   aria-disabled and its click handler ignores the press. */
header nav button[aria-disabled="true"] { opacity: 0.4; cursor: default; }
/* SC-ARRIVAL-MESSAGE: the Journal control flashes from an arrival until the
   Journal opens (js/arrival-message.js adds and removes nav-flash). The
   control is #ship-journal-open inside the Ship Interior; the header rule
   stays for any nav button given the class. One cycle every 2 s (opacity
   dips and a ring swells once per cycle), well under the
   one-cycle-per-second limit. With reduced motion the ring holds steady. */
header nav button.nav-flash { animation: navFlash 2s ease-in-out infinite; }
#ship .ship-control.nav-flash { animation: navFlash 2s ease-in-out infinite; }
@keyframes navFlash {
  0%, 100% { opacity: 1; border-color: var(--border); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  50% { opacity: 0.55; border-color: var(--accent); box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  header nav button.nav-flash { animation: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.4); }
  #ship .ship-control.nav-flash { animation: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.4); }
}
/* ── Survey Scan (DCOSMOS-SURVEYSCAN) ──────────────────────────── */
/* The SCAN toggle sits beneath the DATA button; findings list in the
   body sheet reads as banked knowledge. */
/* .btn-body-scan lives with the other canvas controls in cosmos-reveal.css */
.finding-row { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.finding-row:last-child { border-bottom: none; }
.finding-name { color: var(--accent); font-size: 12.5px; letter-spacing: 0.3px; }
.finding-name.undiscovered { color: var(--text-dim); }
.finding-blurb { color: var(--text-dim); font-size: 11.5px; line-height: 1.45; margin-top: 2px; font-style: italic; }
.finding-name.civ { color: #5ec4c4; }
/* ── DCOSMOS-PLANETNAME: the naming card + designation styling ─────────── */
/* A small centered card floating over the reveal canvas — in-app, calm,
   one input and two honest buttons. Never window.prompt. */
.name-sheet {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  z-index: 60;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  width: min(320px, calc(100% - 48px));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
}
.name-sheet[hidden] { display: none; }
.name-sheet-title {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.name-sheet input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  padding: 9px 10px;
  outline: none;
}
.name-sheet input:focus { border-color: var(--accent); }
.name-sheet-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.name-sheet-row button { padding: 7px 14px; font-size: 13px; }
/* DCOSMOS-GALEVENTS: the daily-event info card reuses .name-sheet's
   floating box exactly (owner ruling 2026-08-22) -- only its body
   paragraph needs its own rule, .name-sheet has no <p> of its own. */
.gal-event-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 4px;
}
/* The body sheet's naming affordance and the formal designation line
   shown beneath a player-given name (DCOSMOS-ROMANNUM keeps it in sight). */
.sheet-desig {
  color: var(--text-dim);
  font-size: 11.5px;
  letter-spacing: 0.6px;
  margin: -2px 0 6px 0;
}
/* The header's own rename pen (DCOSMOS-KINDWORD, owner 2026-08-22): a small
   round icon button sitting between the body's name and its kind word,
   shown only for a renamable kind (planet, moon). Opens the same name
   sheet the old standalone "Name/Rename this world/moon" line used to. */
.btn-name-world {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.btn-name-world:hover {
  color: var(--text);
  border-color: var(--accent);
}
/* ── DCOSMOS-TORCH: the flashlight button in the scanner viewfinder ──────
   SC-CAPTURE-RESKIN: floats over the top-left corner of the camera view (the
   close control floats top-right, css/cosmos-scanner.css .scanner-close),
   a 56px round hit area inset by the device's safe area. Still hidden unless
   the live camera track reports a torch (js/scanner-photo.js
   syncTorchButton). */
.scanner-torch {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  z-index: 5;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(4, 8, 16, 0.62);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.scanner-torch.on {
  background: rgba(245, 158, 11, 0.85);
  border-color: rgba(245, 158, 11, 0.9);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.55);
}
.scanner-torch[hidden] { display: none; }
/* ── Surveyor naming card (DCOSMOS-SURVEYORS) ──────── */
.surveyor-card {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
}
.surveyor-card[hidden] { display: none; }
.surveyor-card-inner {
  background: var(--bg-panel);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 28px 24px 20px;
  width: min(320px, 90vw);
  text-align: center;
}
.surveyor-title {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 16px;
}
#surveyorInput {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-data);
  font-size: 14px;
  padding: 8px 10px;
  text-align: center;
  margin-bottom: 12px;
}
#surveyorInput:focus { border-color: var(--accent); outline: none; }
.surveyor-actions {
  display: flex;
  gap: 8px;
}
.surveyor-actions button {
  flex: 1;
  padding: 8px;
  border-radius: 4px;
  font-family: var(--font-data);
  font-size: 12px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}
#surveyorGo {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
  font-weight: 600;
}
.surveyor-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}
.surveyor-profile[hidden] { display: none; }
.surveyor-profile-name {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--accent);
  white-space: nowrap;
}
.surveyor-profile-tally {
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--text-dim);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.surveyor-profile-edit {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.5;
}
/* Attention glint (js/nudge-glint.js): a soft diagonal light sweep across a
   round button, added as .glint-sweep for ~1.1s. The button clips it. */
/* No position here: the info button is absolutely placed by cosmos-reveal.css
   and a relative override threw it out of its corner. The Contracts tab is
   absolutely placed by cosmos-journal.css and is left out for the same reason. */
header nav .nav-capture { position: relative; }
header nav .nav-capture, #btnRevealInfo.btn-info-dock, #ship-journal-open, .journal-contracts-tab { overflow: hidden; }
.glint-sweep::after {
  content: "";
  position: absolute;
  top: -20%; bottom: -20%; left: -60%;
  width: 40%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0) 0%, rgba(255, 220, 150, 0.55) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: glintSweep 1.1s ease-in-out forwards;
}
@keyframes glintSweep {
  from { left: -60%; }
  to { left: 130%; }
}
/* Deliberately NOT gated on prefers-reduced-motion: Windows desktops report
   it on by default and the sweep is a one-second hint, not a motion effect. */
/* The coming-soon teaser (js/coming-soon-teaser.js): a small pill low on the screen that shows for a moment when a map marker has no world built behind it yet. */
.coming-soon { position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); z-index: 260; background: rgba(13, 21, 38, 0.95); color: #eaf3ff; border: 1px solid rgba(159, 208, 255, 0.35); border-radius: 999px; padding: 7px 14px; font-size: 14px; letter-spacing: 0.02em; pointer-events: none; opacity: 0; }
.coming-soon.coming-soon-in { animation: coming-soon-pop 2.2s ease forwards; }
@keyframes coming-soon-pop { 0% { opacity: 0; transform: translateX(-50%) translateY(6px); } 12% { opacity: 1; transform: translateX(-50%) translateY(0); } 80% { opacity: 1; } 100% { opacity: 0; } }
