/* Shared frame. Tokens, the viewport, and the boot curtain. Mode screens live in their own stylesheets. */
:root {
  --bg: #07080f;
  --ink: #e8eef6;
  --muted: #93a0b5;
  --line: rgba(126, 196, 214, 0.32);
  --panel: rgba(8, 18, 28, 0.88);
  --nft: #ff4fd8;
  --transfer: #7ee0ff;
  --mint: #c6f56a;
  --swap: #ffc14a;
  --bridge: #c9a6ff;
  --allowance: #9bb0c9;
  --burn: #ff2a2a;
  --keyboard: 0px;
  --search-h: 52px;
  --dock-h: 108px;
  --lower: 120px;
  --lists-top: 72px;
  --meters-drop: 120px;
  --above-sheets: 0px;
  --panel-bottom: 120px;
  --sheet-stack: 52dvh;
  --controls-bottom: 130px;
  --frame-x: max(16px, 3.4vw);
  --frame-y: max(16px, 5.8vh);
  color-scheme: dark;
}

.minute-mark {
  position: fixed;
  top: calc(var(--frame-y) + 8px);
  left: 50%;
  z-index: 36;
  transform: translateX(-50%);
  color: var(--swap);
  font: 700 42px/1 "Segoe UI", sans-serif;
  text-shadow: 0 0 18px rgba(255, 193, 74, 0.95);
  pointer-events: none;
}

.minute-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.minute-countdown {
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.01em;
  line-height: 22px;
  white-space: nowrap;
  pointer-events: none;
}

.minute-countdown::after {
  content: " ·";
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  height: var(--app-height, 100dvh);
  background: var(--bg);
  color: var(--ink);
  font-family: "Sora", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#space {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  height: var(--app-height, 100dvh);
  display: block;
  touch-action: none;
}

.frame-loop {
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  height: var(--app-height, 100dvh);
  object-fit: fill;
  pointer-events: none;
  -webkit-mask-image: url("../backdrop/frame-mask.png?v=1");
  mask-image: url("../backdrop/frame-mask.png?v=1");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

#boot {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px;
  background:
    radial-gradient(ellipse at center, rgba(18, 28, 42, 0.72), rgba(5, 7, 10, 0.98) 62%);
  color: var(--ink);
  text-align: center;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.7s ease;
}

body:has(#boot) .topbar,
body:has(#boot) .bottom-chrome,
body:has(#boot) .view-controls,
body:has(#boot) .minute-mark,
body:has(#boot) #lists,
body:has(#boot) #inventory,
body:has(#boot) #settings,
body:has(#boot) #council,
body:has(#boot) #admin,
body:has(#boot) #wallet-panel,
body:has(#boot) #dispatch,
body:has(#boot) #tracked,
body:has(#boot) #ship-search,
body:has(#boot) #diag {
  visibility: hidden;
  pointer-events: none;
}

#boot.is-opening {
  opacity: 0;
}

.boot-meter {
  width: min(240px, 70vw);
  height: 2px;
  margin-top: 14px;
  background: rgba(232, 238, 246, 0.16);
}

.boot-meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--swap);
  transition: width 0.45s ease;
}

.boot-detail {
  max-width: 36rem;
  min-height: 2.6em;
  margin: 8px 0 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

#boot.boot-solid {
  -webkit-mask-image: none;
  mask-image: none;
  background:
    radial-gradient(ellipse at center, rgba(18, 28, 42, 0.72), rgba(5, 7, 10, 0.96) 62%);
}

#boot.is-fault .boot-quote {
  height: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
}

#boot.is-fault .boot-line {
  max-width: 34rem;
  justify-content: center;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-align: center;
}

#boot.is-fault .boot-detail {
  max-width: 36rem;
  color: var(--swap);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.boot-breach {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 86, 32, 0.95) 0 28%, rgba(255, 193, 74, 0.18) 70%);
  cursor: pointer;
  box-shadow: 0 0 18px rgba(255, 80, 30, 0.5);
}

.boot-breach svg {
  width: 26px;
  height: 26px;
  fill: #ffc14a;
  filter: drop-shadow(0 0 6px rgba(255, 50, 20, 0.85));
}

.boot-breach-card {
  width: min(440px, 88vw);
  margin-top: 12px;
  padding: 12px 14px;
  text-align: left;
  background: rgba(8, 10, 14, 0.94);
  border: 1px solid rgba(255, 193, 74, 0.45);
}

.boot-breach-raw {
  max-height: 9em;
  margin: 0;
  overflow: auto;
  color: #e7eef6;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.boot-breach-card button {
  margin-top: 10px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 193, 74, 0.55);
  background: transparent;
  color: var(--swap);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.boot-sigil {
  position: relative;
  width: 168px;
  height: 168px;
  flex: none;
}

.boot-bracket {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(255, 193, 74, 0.85);
}

.boot-bracket.tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.boot-bracket.tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
.boot-bracket.bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; }
.boot-bracket.br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.boot-ring {
  position: absolute;
  inset: 28px;
  border: 1px solid rgba(126, 224, 255, 0.55);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(126, 224, 255, 0.18);
}

.boot-ring.inner {
  inset: 48px;
  border-color: rgba(255, 193, 74, 0.45);
  border-style: dashed;
  box-shadow: none;
  animation: boot-spin 18s linear infinite;
}

.boot-sweep {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 68%, rgba(126, 224, 255, 0.05) 78%, rgba(126, 224, 255, 0.9) 100%);
  -webkit-mask: radial-gradient(circle, transparent 61%, #000 64%, #000 78%, transparent 81%);
  mask: radial-gradient(circle, transparent 61%, #000 64%, #000 78%, transparent 81%);
  animation: boot-spin 3.6s linear infinite;
}

.boot-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--swap);
  transform: rotate(45deg);
  box-shadow: 0 0 14px var(--swap), 0 0 28px rgba(255, 193, 74, 0.45);
}

.boot-kicker {
  margin: 22px 0 0;
  color: var(--swap);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.boot-quote {
  max-width: 34rem;
  min-height: 4.6em;
  margin: 10px 0 0;
  color: var(--ink);
  font-family: "Sora", sans-serif;
  font-size: clamp(16px, 2.1vw, 22px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.boot-quote.is-in {
  opacity: 1;
  transform: none;
}

.boot-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.boot-spin {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(232, 238, 246, 0.28);
  border-top-color: var(--swap);
  border-radius: 50%;
  animation: boot-spin 0.7s linear infinite;
}

@keyframes boot-spin {
  to { transform: rotate(360deg); }
}

@media (max-height: 720px) {
  .boot-sigil { width: 120px; height: 120px; }
  .boot-bracket { width: 16px; height: 16px; }
  .boot-ring { inset: 20px; }
  .boot-ring.inner { inset: 34px; }
  .boot-sweep { inset: 20px; }
  .boot-kicker { margin-top: 14px; }
  .boot-quote { min-height: 3.4em; font-size: 16px; }
  .boot-detail { min-height: 2.2em; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-spin,
  .boot-sweep,
  .boot-ring.inner { animation: none; }
  .boot-quote { opacity: 1; transform: none; transition: none; }
  #boot,
  .boot-meter span { transition: none; }
}

button, input { -webkit-tap-highlight-color: transparent; }

