/* Starfield — cold void, warm events. The map is the page; chrome floats over it. */

:root {
  --void:      #0A0C17;
  --field:     #12162A;
  --panel:     #161B33;
  --hairline:  #262C4A;
  --ink:       #E4E8F5;
  --ink-dim:   #8790AD;
  --heat:      #F0B429;   /* events: meteors, gold rain */
  --cool:      #5FD3E8;   /* your holdings, verified state */
  --bad:       #E86A6A;

  --sheet-radius: 18px;
  --tap: 44px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--ink);
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.num, .coords, .balance, .proof dd, .breakdown dd, .cta__price, .ticker__hash {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ------------------------------------------------------------ status strip */

.strip {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 46px;
  padding: 0 14px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(10,12,23,.92), rgba(10,12,23,0));
  z-index: 20;
  pointer-events: none;
}

.strip__left, .strip__right { display: flex; align-items: center; gap: 8px; }

.mark {
  width: 9px; height: 9px;
  background: var(--heat);
  box-shadow: 0 0 10px rgba(240,180,41,.8);
}

.strip__name { font-weight: 600; letter-spacing: .01em; }

.coords { font-size: 12px; color: var(--ink-dim); margin-left: 4px; }

.balance { font-weight: 500; font-size: 14px; }
.balance__unit { font-size: 11px; color: var(--ink-dim); }

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bad);
  transition: background .3s;
}
.dot[data-online="1"] { background: var(--cool); }

/* --------------------------------------------------- event ticker (accent) */

.ticker {
  position: fixed;
  top: calc(52px + env(safe-area-inset-top));
  right: 12px;
  width: min(300px, calc(100vw - 24px));
  background: rgba(22,27,51,.88);
  backdrop-filter: blur(14px);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  z-index: 18;
  overflow: hidden;
}

.ticker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-bottom: 1px solid var(--hairline);
}

.ticker__head h2 { margin: 0; font-size: 13px; font-weight: 600; }

.ticker__toggle {
  background: none;
  border: 0;
  color: var(--ink-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
}

.ticker__list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 46vh;
  overflow-y: auto;
}
.ticker[data-collapsed="1"] .ticker__list { display: none; }

.ticker__empty { padding: 14px 13px; color: var(--ink-dim); font-size: 13px; }

.slot {
  padding: 11px 13px;
  border-bottom: 1px solid rgba(38,44,74,.6);
  display: grid;
  gap: 5px;
  cursor: pointer;
}
.slot:last-child { border-bottom: 0; }
.slot:hover { background: rgba(255,255,255,.03); }

.slot__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

.slot__label { font-size: 13px; font-weight: 500; }
.slot--sealed .slot__label { color: var(--ink-dim); }
.slot--revealed .slot__label { color: var(--heat); }

.slot__eta { font-size: 12px; color: var(--ink-dim); font-family: 'JetBrains Mono', monospace; }

.ticker__hash {
  font-size: 11px;
  color: var(--ink-dim);
  word-break: break-all;
  line-height: 1.4;
}

.slot__target {
  font-size: 12px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.slot__verify {
  font-size: 11px;
  color: var(--cool);
  border: 1px solid rgba(95,211,232,.35);
  border-radius: 5px;
  padding: 2px 6px;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

/* --------------------------------------------------------- selection sheet */

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--panel);
  border-top: 1px solid var(--hairline);
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translateY(0);
  transition: transform .22s cubic-bezier(.2,.8,.3,1);
}
.sheet[hidden] { display: block; transform: translateY(105%); pointer-events: none; }

.sheet__close {
  position: absolute;
  top: 10px; right: 12px;
  width: var(--tap); height: var(--tap);
  background: none; border: 0;
  color: var(--ink-dim);
  font-size: 26px; line-height: 1;
  cursor: pointer;
}

.sheet__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.sheet__coords { font-size: 19px; font-weight: 600; }
.sheet__state { font-size: 12px; color: var(--ink-dim); }
.sheet__state[data-taken="1"] { color: var(--heat); }

.breakdown { margin: 0 0 15px; display: grid; gap: 7px; }
.breakdown > div { display: flex; justify-content: space-between; align-items: baseline; }
.breakdown dt { font-size: 13px; color: var(--ink-dim); }
.breakdown dd { margin: 0; font-size: 13px; }

.palette { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }

.swatch {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.swatch:focus-visible { outline: 2px solid var(--cool); outline-offset: 2px; }

.renew {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--ink-dim);
  margin-bottom: 14px;
  cursor: pointer;
}
.renew input { width: 17px; height: 17px; accent-color: var(--cool); }

.cta {
  width: 100%;
  min-height: var(--tap);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: var(--heat);
  color: #17130A;
  border: 0;
  border-radius: 11px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.cta:disabled { background: var(--hairline); color: var(--ink-dim); cursor: not-allowed; }
.cta:focus-visible { outline: 2px solid var(--cool); outline-offset: 2px; }
.cta__price { font-size: 14px; }

/* ------------------------------------------------------------------- modal */

.modal {
  position: fixed; inset: 0;
  background: rgba(6,8,15,.72);
  backdrop-filter: blur(3px);
  z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.modal[hidden] { display: none; }

.modal__body {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 22px;
  max-width: 460px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
}

.modal__close {
  position: absolute; top: 8px; right: 10px;
  width: var(--tap); height: var(--tap);
  background: none; border: 0; color: var(--ink-dim);
  font-size: 26px; cursor: pointer;
}

.modal__body h3 { margin: 0 0 8px; font-size: 17px; }
.modal__lede { margin: 0 0 16px; font-size: 13px; color: var(--ink-dim); line-height: 1.5; max-width: 62ch; }

.proof { margin: 0 0 16px; display: grid; gap: 10px; }
.proof dt { font-size: 12px; color: var(--ink-dim); margin-bottom: 3px; }
.proof dd { margin: 0; font-size: 12px; word-break: break-all; line-height: 1.45; }

.verdict {
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
}
.verdict[data-ok="1"] { background: rgba(95,211,232,.12); color: var(--cool); border: 1px solid rgba(95,211,232,.3); }
.verdict[data-ok="0"] { background: rgba(232,106,106,.12); color: var(--bad); border: 1px solid rgba(232,106,106,.3); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 420px) {
  .ticker { width: calc(100vw - 24px); }
  .ticker__list { max-height: 34vh; }
}
