:root {
  color-scheme: dark;
  --accent: #b66bff;
  --accent-soft: #e08ce8;
  --panel: #080611;
  --button: #150d20;
  --button-2: #0b0711;
  --text: #fffaff;
  --muted: #c7bacd;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #000; color: var(--text); }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden; }
button, select, input { font: inherit; }
button { color: var(--text); }

.app-shell { min-height: 100vh; background: #000; }
.stage { position: relative; width: 100%; height: 100vh; min-height: 560px; overflow: hidden; background: #000; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.hidden { display: none !important; }

.brand { position: absolute; left: 24px; top: 22px; z-index: 20; user-select: none; text-shadow: 0 2px 18px rgba(0,0,0,.9); }
.brand small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .32em; color: #c8bdcc; }
.brand strong { display: block; margin-top: 5px; font-size: 14px; letter-spacing: .16em; color: var(--text); }

.top-actions { position: absolute; right: 18px; top: 18px; z-index: 35; display: flex; gap: 9px; }
.icon-button, .small-button {
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: linear-gradient(180deg, var(--button), var(--button-2));
  color: var(--text) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.065), 0 10px 28px rgba(0,0,0,.34);
  cursor: pointer;
  outline: none;
}
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.small-button { width: 34px; height: 34px; border-radius: 10px; }

.panel {
  border: 1px solid color-mix(in srgb, var(--accent) 18%, rgba(255,255,255,.06));
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 20px 55px rgba(0,0,0,.34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.intro-panel, .detail-panel {
  position: absolute; z-index: 25; right: 20px; top: 82px; bottom: 20px;
  width: min(390px, 38vw); min-width: 320px; border-radius: 24px; padding: 24px;
}
.intro-panel { display: flex; flex-direction: column; justify-content: space-between; }
.intro-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.avatar-box { width: 50px; height: 50px; display: grid; place-items: center; overflow: hidden; border-radius: 13px; border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent); background: #171022; color: #f0d7fb; font-weight: 800; font-size: 18px; }
.avatar-box img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { margin-top: 20px; font-size: 10px; font-weight: 800; letter-spacing: .3em; color: var(--accent-soft); }
.intro-panel h1 { margin: 11px 0 0; color: var(--text); font-size: clamp(28px, 3.3vw, 38px); letter-spacing: .035em; }
.profile-title { margin-top: 7px; font-size: 12px; font-weight: 750; letter-spacing: .14em; color: color-mix(in srgb, var(--accent-soft) 72%, white); }
.intro-copy { margin-top: 28px; color: #eee7f1; font-size: 14px; line-height: 1.85; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 26px; }
.quick-button, .orbit-node, .detail-action {
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  background: linear-gradient(145deg, var(--button), var(--button-2));
  color: var(--text) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 10px 25px rgba(0,0,0,.28);
  cursor: pointer;
  outline: none;
}
.quick-button { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border-radius: 12px; text-align: left; }
.quick-button .nav-icon, .orbit-node .nav-icon { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 16%, #130b1a); color: #f1d8ff; border: 1px solid rgba(255,255,255,.05); }
.nav-icon img { width: 18px; height: 18px; object-fit: contain; }
.quick-button strong, .orbit-node strong { display: block; color: var(--text) !important; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.quick-button small, .orbit-node small { display: block; margin-top: 3px; color: var(--muted) !important; font-size: 9px; }

.primary-button { min-height: 50px; margin-top: 22px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, #160b1c), #180e22); color: #fff !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 34px rgba(0,0,0,.35); cursor: pointer; font-weight: 800; letter-spacing: .15em; }

.settings-panel { position: absolute; right: 18px; top: 72px; z-index: 36; width: 260px; padding: 15px; border-radius: 16px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--accent-soft); font-size: 10px; font-weight: 800; letter-spacing: .26em; }
.setting-row, .setting-column { display: flex; gap: 14px; margin-top: 18px; color: #e7ddeb; font-size: 13px; }
.setting-row { align-items: center; justify-content: space-between; }
.setting-column { flex-direction: column; }
.setting-column select { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); background: #100a18; color: #fff; }

.orbit-layer { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
.orbit-node {
  position: absolute; left: 50%; top: 50%; display: flex; align-items: center; gap: 10px;
  min-width: 126px; min-height: 52px; padding: 7px 13px; border-radius: 13px; text-align: left;
  transform: translate(-50%, -50%); transform-origin: center; will-change: left, top, transform, opacity;
  pointer-events: auto;
}
.orbit-node .copy { display: block; color: var(--text) !important; }
.orbit-node strong { text-shadow: 0 1px 10px rgba(255,255,255,.10); }

.detail-panel h2 { margin: 20px 0 0; color: var(--text) !important; font-size: 25px; letter-spacing: .055em; }
.detail-panel p { margin-top: 14px; color: #eee7f1 !important; font-size: 14px; line-height: 1.85; }
.detail-icon { margin-top: 28px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 15px; border: 1px solid rgba(255,255,255,.08); background: color-mix(in srgb, var(--accent) 15%, #130b1c); color: #f0d5ff; font-size: 22px; }
.detail-icon img { width: 26px; height: 26px; object-fit: contain; }
.detail-actions { display: grid; gap: 10px; margin-top: 24px; }
.detail-action { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px; border-radius: 11px; font-size: 12px; font-weight: 750; letter-spacing: .07em; }

.toast { position: absolute; z-index: 60; left: 50%; bottom: 22px; transform: translateX(-50%); max-width: min(520px, 86vw); border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(9,7,17,.94); padding: 11px 14px; color: #eee8f1; font-size: 12px; box-shadow: 0 12px 34px rgba(0,0,0,.34); }

.loading-screen { position: absolute; inset: 0; z-index: 100; display: grid; place-items: center; background: #000; transition: opacity .65s ease; }
.loading-content { text-align: center; }
.loading-orbit { width: 58px; height: 58px; margin: 0 auto 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,.07); background: conic-gradient(from 0deg, transparent 0 40%, rgba(186,92,235,.16) 55%, rgba(226,124,224,.82) 77%, transparent 100%); animation: loadingSpin 1.15s linear infinite; }
.loading-orbit span { display: block; width: 36px; height: 36px; margin: 10px; border-radius: 50%; background: #000; }
.loading-title { color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .30em; }
.loading-text { margin-top: 12px; color: #a99daf; font-size: 11px; letter-spacing: .13em; }
.loading-bar { width: 180px; height: 2px; margin: 18px auto 0; background: rgba(255,255,255,.08); overflow: hidden; }
.loading-bar i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-soft)); transition: width .28s ease; }
@keyframes loadingSpin { to { transform: rotate(360deg); } }

button { transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
button:active { transform: scale(.975); }
button:focus-visible, select:focus-visible { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-soft) 72%, white); }
@media (hover:hover) and (pointer:fine) {
  .icon-button:hover, .small-button:hover, .quick-button:hover, .primary-button:hover, .orbit-node:hover, .detail-action:hover {
    border-color: color-mix(in srgb, var(--accent-soft) 52%, transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.075), 0 13px 36px rgba(0,0,0,.38);
  }
}

@media (max-width: 720px) {
  .stage { min-height: 640px; }
  .brand { left: 14px; top: 16px; }
  .top-actions { right: 12px; top: 12px; }
  .intro-panel, .detail-panel { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; min-width: 0; max-height: 58%; overflow: auto; padding: 18px; }
  .orbit-node { min-width: 98px; min-height: 46px; padding: 6px 9px; }
  .orbit-node small { display: none; }
  .orbit-node .nav-icon { width: 26px; height: 26px; flex-basis: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-orbit { animation: none; }
  * { scroll-behavior: auto !important; }
}
