/* css/imaging.css - the imaging console (/imaging/). The galaxy map fills the page; the order
   panel, view buttons and readouts sit on top of it as plain text, with no frames. */

.ic { --i-ink: #f5deb3; --i-amber: #fbbf24; --i-dim: rgba(251, 191, 36, .6); --i-faint: rgba(251, 191, 36, .32);
  --i-rule: rgba(251, 191, 36, .16); --i-red: #f87171; --i-earth: #5eead4;
  position: relative; height: 100vh; min-height: 640px; overflow: hidden; background: #000;
  color: var(--i-ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 13px; }

/* The map, edge to edge, under everything. */
.ic-stage { position: absolute; inset: 0; }
.ic-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.ic-stage canvas:active { cursor: grabbing; }
.ic-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px); }

/* The order panel: text over a dark fade, so the galaxy shows through at its edge. */
.ic-panel { position: absolute; z-index: 2; top: 0; bottom: 0; left: 0; width: min(420px, 38vw); box-sizing: border-box;
  padding: 104px 28px 56px 32px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--i-faint) transparent;
  background: linear-gradient(to right, rgba(0, 0, 0, .88) 0, rgba(0, 0, 0, .78) 75%, rgba(0, 0, 0, 0)); }
.ic-title { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; color: var(--i-amber); font-size: 11px; letter-spacing: .16em;
  text-shadow: 0 0 8px rgba(251, 191, 36, .45); }
.ic-cursor { width: 8px; height: 13px; background: var(--i-amber); animation: ic-blink 1.1s steps(1) infinite; }
@keyframes ic-blink { 50% { opacity: 0; } }

.ic-sec { position: relative; padding: 18px 0; }
.ic-sec + .ic-sec { border-top: 1px dashed var(--i-rule); }
.ic-sec h2 { margin: 0 0 12px; font-size: 11px; font-weight: 600; letter-spacing: .18em; color: var(--i-amber); }
.ic-sec h2 i { font-style: normal; color: var(--i-faint); margin-right: 10px; }
.ic-dim { margin: 0; color: var(--i-dim); }

.ic button { font: inherit; color: inherit; cursor: pointer; }
.ic button:focus-visible, .ic input:focus-visible { outline: 1px solid var(--i-amber); outline-offset: 3px; }
.ic canvas:focus-visible { outline: none; }

/* Target search: a prompt line, no box. */
.ic-search { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--i-faint); }
.ic-search:focus-within { border-bottom-color: var(--i-amber); }
.ic-prompt { color: var(--i-amber); }
.ic-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--i-ink); font: inherit; font-size: 14px; caret-color: var(--i-amber); }
.ic-search input:focus, .ic-search input:focus-visible { outline: none; }
.ic-search input::placeholder { color: var(--i-faint); }
.ic-clear { padding: 0 0 0 10px; border: 0; background: none; color: var(--i-dim); font-size: 11px; letter-spacing: .14em; }
.ic-clear:hover { color: var(--i-amber); }
.ic-list { position: absolute; left: 0; right: 0; z-index: 3; margin: 0; padding: 4px 0; list-style: none; background: rgba(0, 0, 0, .94);
  border-bottom: 1px solid var(--i-faint); }
.ic-list li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0 6px 20px; cursor: pointer; }
.ic-list li b { font-weight: 600; min-width: 74px; color: var(--i-amber); }
.ic-list li span { color: var(--i-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-list li[aria-selected="true"], .ic-list li:hover { background: rgba(251, 191, 36, .1); }
.ic-list li[aria-selected="true"]::before { content: ">"; position: absolute; left: 4px; color: var(--i-amber); }

.ic-quick { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; }
.ic-quick button { padding: 2px 0; border: 0; background: none; color: var(--i-dim); font-size: 12px; letter-spacing: .06em; }
.ic-quick button:hover, .ic-quick button[aria-pressed="true"] { color: var(--i-amber); }
.ic-quick button[aria-pressed="true"]::before { content: "> "; }

.ic-read { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 16px 0 0; font-size: 12px; }
.ic-read dt { color: var(--i-faint); letter-spacing: .1em; }
.ic-read dd { margin: 0; color: var(--i-ink); }

/* Telescopes: a lit block marks the chosen one. */
.ic-rigs { display: flex; flex-direction: column; }
.ic-rigs button { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; text-align: left; border: 0; background: none; }
.ic-rigs button:hover .what b { color: var(--i-amber); }
.ic-rigs .mark { width: 8px; height: 8px; margin-top: 4px; border: 1px solid var(--i-dim); }
.ic-rigs button[aria-checked="true"] .mark { background: var(--i-amber); border-color: var(--i-amber); box-shadow: 0 0 8px rgba(251, 191, 36, .6); }
.ic-rigs .what b { display: block; font-weight: 600; color: var(--i-ink); }
.ic-rigs .what small { display: block; color: var(--i-dim); font-size: 11.5px; margin-top: 2px; }
.ic-rigs .price { color: var(--i-amber); white-space: nowrap; }

/* Your own telescope (/universe/): a few words to press, and a form of plain underlined numbers. */
.ic-own { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.ic-own .ic-clear { padding: 0; }
.ic-own .ic-clear:disabled { opacity: .35; cursor: default; }
.ic-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 14px; }
.ic-form[hidden] { display: none; }
.ic-form .wide { grid-column: 1 / -1; margin-top: 0; }
.ic-form label { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 10.5px; letter-spacing: .12em; color: var(--i-faint); }
.ic-form label span { display: flex; align-items: baseline; gap: 6px; border-bottom: 1px solid var(--i-faint); color: var(--i-dim); }
.ic-form label span:focus-within, .ic-form label > input:focus, .ic-form select:focus { border-bottom-color: var(--i-amber); }
.ic-form input, .ic-form select { min-width: 0; width: 100%; padding: 3px 0; border: 0; border-radius: 0; background: none; color: var(--i-ink); font: inherit; font-size: 13px; letter-spacing: 0;
  -moz-appearance: textfield; appearance: textfield; }
.ic-form label > input, .ic-form select { border-bottom: 1px solid var(--i-faint); }
.ic-form select { appearance: auto; -moz-appearance: auto; color-scheme: dark; cursor: pointer; }
.ic-form select option { background: #000; color: var(--i-ink); }
.ic-form input:focus, .ic-form input:focus-visible, .ic-form select:focus-visible { outline: none; }
.ic-form input::placeholder { color: var(--i-faint); }
.ic-form input::-webkit-outer-spin-button, .ic-form input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ic-field { margin: 0; font-size: 12px; letter-spacing: .06em; color: var(--i-amber); }

/* Filters: words that light up when on. */
.ic-filters { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ic-filters button { padding: 3px 0; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--i-faint); letter-spacing: .06em; }
.ic-filters button:hover { color: var(--i-ink); }
.ic-filters button[aria-pressed="true"] { color: var(--i-amber); border-bottom-color: var(--i-amber); text-shadow: 0 0 8px rgba(251, 191, 36, .4); }

.ic-hours { display: flex; align-items: center; gap: 14px; }
.ic-hours input { flex: 1; accent-color: var(--i-amber); }
.ic-degrees { display: inline-flex; align-items: baseline; color: var(--i-amber); }
.ic-degrees input { flex: none; width: 52px; padding: 2px 0; border: 0; border-bottom: 1px solid var(--i-faint); background: none; color: var(--i-amber); font: inherit; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.ic-degrees input::-webkit-outer-spin-button, .ic-degrees input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ic-degrees input:focus { outline: none; border-bottom-color: var(--i-amber); }
.ic-small { margin-top: 10px; font-size: 11.5px; }
/* The framing stick: a round pad with a knob that springs back to the middle. */
.ic-pad-row { display: flex; align-items: center; gap: 18px; }
.ic-pad { position: relative; flex: none; width: 104px; height: 104px; border: 1px solid var(--i-faint); border-radius: 50%; cursor: grab; touch-action: none;
  background: radial-gradient(circle, rgba(251, 191, 36, .07), rgba(251, 191, 36, 0) 70%); }
.ic-pad.is-held { cursor: grabbing; border-color: var(--i-amber); }
.ic-pad.is-off { opacity: .35; cursor: default; }
.ic-pad:focus-visible { outline: 1px solid var(--i-amber); outline-offset: 4px; }
.ic-pad .x, .ic-pad .y { position: absolute; background: var(--i-rule); pointer-events: none; }
.ic-pad .x { left: 10px; right: 10px; top: 50%; height: 1px; }
.ic-pad .y { top: 10px; bottom: 10px; left: 50%; width: 1px; }
.ic-pad .knob { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; pointer-events: none;
  background: var(--i-amber); box-shadow: 0 0 12px rgba(251, 191, 36, .55); transition: transform .18s; }
.ic-pad.is-held .knob { transition: none; }
.ic-pad-read { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.ic-pad-read b { font-weight: 600; font-size: 12px; letter-spacing: .08em; color: var(--i-amber); }
.ic-pad-read .ic-small { margin: 0; }
.ic-pad-read .ic-clear { padding: 0; }
.ic-hours output { min-width: 44px; text-align: right; color: var(--i-amber); }

.ic-total { display: flex; justify-content: space-between; align-items: baseline; letter-spacing: .14em; font-size: 11px; color: var(--i-dim); }
.ic-total b { font-size: 22px; letter-spacing: .02em; color: var(--i-amber); text-shadow: 0 0 10px rgba(251, 191, 36, .4); }

/* Readouts over the map. */
.ic-tools { position: absolute; z-index: 2; top: 104px; right: 32px; display: flex; gap: 18px; }
.ic-tools button { padding: 3px 0; border: 0; border-bottom: 1px solid transparent; background: none; color: var(--i-dim); font-size: 11px; letter-spacing: .14em; }
.ic-tools button:hover:not(:disabled) { color: var(--i-amber); }
.ic-tools button[aria-pressed="true"] { color: var(--i-amber); border-bottom-color: var(--i-amber); }
.ic-tools button:disabled { opacity: .35; cursor: default; }
.ic-legend { position: absolute; z-index: 2; top: 134px; right: 32px; display: flex; gap: 16px; font-size: 11px; letter-spacing: .12em; pointer-events: none; }
.ic-legend .earth { color: var(--i-earth); }
.ic-legend .target { color: var(--i-red); }
.ic-foot { position: absolute; z-index: 2; left: calc(min(420px, 38vw) + 8px); right: 32px; bottom: 18px; display: flex; justify-content: space-between; gap: 20px;
  font-size: 11px; letter-spacing: .1em; color: var(--i-faint); pointer-events: none; white-space: pre; }

@media (max-width: 900px) {
  .ic { height: auto; min-height: 0; overflow: visible; display: flex; flex-direction: column; }
  .ic-stage { position: relative; height: 64vh; min-height: 380px; }
  .ic-stage::before { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 80px; pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), #000); }
  .ic-panel { position: static; width: auto; padding: 8px 16px 40px; overflow: visible; background: none; }
  .ic-tools { top: 82px; right: 16px; left: 16px; justify-content: flex-end; gap: 14px; }
  .ic-legend { top: 108px; right: 16px; }
  .ic-foot { left: 16px; right: 16px; top: calc(64vh - 30px); bottom: auto; }
  .ic-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ic-cursor { animation: none; }
}

/* Words that sit over the map stay readable over its bright parts. */
.ic-tools button, .ic-legend, .ic-foot { text-shadow: 0 0 2px #000, 0 0 4px #000, 0 0 8px #000, 0 0 14px #000; }
.ic-tools button { color: rgba(251, 191, 36, .9); }
.ic-foot { color: rgba(251, 191, 36, .6); }
