/* TERA OPTIONS — platform boot screen. Shown until the price feed, account and charts are ready. */
.boot {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #0d1d33 0%, #07111f 62%, #050c17 100%);
  color: var(--c-text);
  transition: opacity 620ms var(--ease-out), visibility 0s linear 620ms, filter 620ms var(--ease-out);
}
.boot.is-done { opacity: 0; visibility: hidden; filter: blur(6px); pointer-events: none; }

/* ambient light + grid */
.boot-glow { position: absolute; width: 760px; height: 760px; border-radius: 50%; left: 50%; top: 44%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(49, 95, 234, 0.22) 0%, rgba(56, 189, 248, 0.08) 38%, transparent 68%);
  animation: bootBreathe 4.8s var(--ease-in-out) infinite; }
.boot-grid { position: absolute; inset: 0; opacity: 0.5;
  background-image: linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(60% 55% at 50% 45%, #000 0%, transparent 75%); mask-image: radial-gradient(60% 55% at 50% 45%, #000 0%, transparent 75%); }
@keyframes bootBreathe { 50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.75; } }

.boot-inner { position: relative; display: grid; justify-items: center; gap: 26px; padding: 24px; text-align: center;
  animation: bootIn 700ms var(--ease-out) both; transition: transform 620ms var(--ease-out); }
.boot.is-done .boot-inner { transform: scale(1.06); }
@keyframes bootIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } }

/* ring */
.boot-ring { position: relative; width: 148px; height: 148px; }
.boot-ring svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.boot-ring .track { fill: none; stroke: rgba(148, 163, 184, 0.12); stroke-width: 3; }
.boot-ring .bar { fill: none; stroke: url(#bootGrad); stroke-width: 3.5; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.55)); }
.boot-ring .ticks { fill: none; stroke: rgba(148, 163, 184, 0.16); stroke-width: 1; stroke-dasharray: 1 6.2; }
/* the orbiting comet: a short bright arc that keeps turning while we wait */
.boot-orbit { position: absolute; inset: -8px; border-radius: 50%; animation: bootSpin 1.6s linear infinite;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 300deg, rgba(56, 189, 248, 0.0) 300deg, rgba(56, 189, 248, 0.55) 356deg, transparent 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)); }
@keyframes bootSpin { to { transform: rotate(360deg); } }
.boot.is-ready .boot-orbit { opacity: 0; transition: opacity 300ms; }

.boot-logo { position: absolute; inset: 0; display: grid; place-items: center; }
.boot-logo svg { width: 54px; height: 54px; filter: drop-shadow(0 8px 24px rgba(49, 95, 234, 0.35)); }
/* the mark's raised arm drops level and steps back up, like a price ticking up */
.boot-logo .step { animation: bootStep 1.8s var(--ease-in-out) infinite; }
@keyframes bootStep { 0%, 30% { transform: translateY(0); } 45% { transform: translateY(12px); } 60% { transform: translateY(-1.5px); } 68%, 100% { transform: translateY(0); } }
.boot.is-ready .boot-logo .step { animation: none; }

.boot-pct { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); font: 600 12px/1 var(--font-display); letter-spacing: 0.08em; color: var(--c-text-3); font-variant-numeric: tabular-nums; }

/* brand + status */
.boot-brand { direction: ltr; margin-top: 18px; font: 700 15px/1 var(--font-wordmark); letter-spacing: 0.12em; color: var(--c-text); }
.boot-brand b { color: inherit; font-weight: inherit; }
.boot-status { position: relative; height: 20px; min-width: 260px; margin-top: -12px; overflow: hidden; }
.boot-status span { position: absolute; inset: 0; font-size: 13px; color: var(--c-text-2); transition: transform 420ms var(--ease-out), opacity 420ms var(--ease-out); }
.boot-status span.out { transform: translateY(-14px); opacity: 0; }
.boot-status span.in { transform: translateY(14px); opacity: 0; }

.boot-steps { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.boot-steps li { width: 26px; height: 3px; border-radius: 3px; background: rgba(148, 163, 184, 0.16); overflow: hidden; position: relative; }
.boot-steps li::after { content: ''; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; opacity: 0; background: linear-gradient(90deg, var(--c-accent), var(--c-cyan)); transition: transform 520ms var(--ease-out), opacity 200ms; }
.boot-steps li.on::after { transform: scaleX(1); opacity: 1; }

/* failure */
.boot-err { display: grid; gap: 14px; justify-items: center; max-width: 360px; }
.boot-err[hidden] { display: none; }
.boot-err b { font-size: 16px; }
.boot-err p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--c-text-2); }
.boot-err code { background: rgba(148, 163, 184, 0.1); border: 1px solid rgba(148, 163, 184, 0.2); border-radius: 5px; padding: 1px 6px; color: var(--c-text); }
.boot.is-error .boot-orbit { display: none; }
.boot.is-error .boot-ring .bar { opacity: 0; }
.boot.is-error .boot-ring .track { stroke: rgba(240, 82, 90, 0.35); }
.boot.is-error .boot-logo svg * { animation: none; }
.boot.is-error .boot-status, .boot.is-error .boot-steps, .boot.is-error .boot-pct { display: none; }

/* the platform settles in behind the fading boot screen */
body.booting .topbar, body.booting .layout { opacity: 0; }
body.booted .topbar, body.booted .layout { animation: platformIn 700ms var(--ease-out) both; }
body.booted .layout { animation-delay: 80ms; }
@keyframes platformIn { from { opacity: 0; transform: translateY(8px); } }

/* touch screens: the boot screen fades without blurring a full-screen layer */
@media (pointer: coarse) {
  .boot.is-done { filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  .boot-glow, .boot-orbit, .boot-inner, .boot-logo .step { animation: none; }
  .boot-orbit { display: none; }
  .boot, .boot-inner, .boot-status span { transition-duration: 1ms; }
  body.booted .topbar, body.booted .layout { animation: none; }
}
