/* ZIBADIS Sphere Grid — shares the Dark Gold design language with Living Entity */
:root {
  --bg:    #050607;
  --glass: rgba(14,13,10,.72);
  --text:  #f4eee0;
  --muted: #9c9588;
  --line:  rgba(255,255,255,.095);
  --line-gold: rgba(201,162,61,.28);
  --gold:  #c9a23d;
  --gold-2: #ead28b;
  --tense: #e05c5c;
  --shadow: 0 24px 70px rgba(0,0,0,.52);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; margin: 0; overflow: hidden;
  background: var(--bg); color: var(--text); font-family: var(--font);
}

.app {
  position: fixed; inset: 0; min-height: 100svh; overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(201,162,61,.10), transparent 40%),
    linear-gradient(180deg, #050607 0%, #07090a 52%, #050607 100%);
}

#webgl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#webgl:active { cursor: grabbing; }

.glass {
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.panel { position: absolute; top: 136px; width: 260px; padding: 16px; z-index: 3; }
.panel.left { left: 22px; }
.panel.right { right: 22px; }
.panel h2 { margin: 0 0 12px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

.legend-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.legend-dot.calm { background: var(--gold); }
.legend-dot.tense { background: var(--tense); }
.legend-count { font-size: 11px; color: var(--gold-2); letter-spacing: .08em; text-transform: uppercase; margin-top: 10px; }

.hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0; }

.detail-name { font-size: 15px; color: var(--gold-2); letter-spacing: .02em; margin-bottom: 2px; }
.detail-kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; }
.detail-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 4px 0; border-top: 1px solid var(--line); }
.detail-row b { color: var(--text); font-weight: 500; }
.detail-id { margin-top: 10px; font-size: 10px; color: rgba(244,238,224,.28); font-family: "SFMono-Regular", "JetBrains Mono", Consolas, monospace; word-break: break-all; }

.pulse-btn {
  appearance: none; width: 100%; border: 1px solid var(--line-gold); cursor: pointer;
  padding: 10px 13px; margin: 14px 0 6px; background: rgba(201,162,61,.1);
  color: var(--gold-2); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  transition: border-color .2s, background .2s;
}
.pulse-btn:hover { border-color: var(--gold); background: rgba(201,162,61,.18); }
.pulse-btn:disabled { opacity: .5; cursor: default; }
.pulse-status { font-size: 11px; color: var(--muted); text-align: center; min-height: 14px; }

.caption {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  padding: 10px 18px; z-index: 3; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-2); white-space: nowrap;
}

.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  height: 46px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.09);
  background: rgba(5,6,7,.96); backdrop-filter: blur(18px); gap: 12px;
}
.z-brand { display: flex; align-items: center; gap: 9px; min-width: 0; overflow: hidden; }
.z-mark { width: 18px; height: 18px; background: linear-gradient(135deg,#c9a23d,#b47a32); flex-shrink: 0; display: inline-block; }
.z-os { font-size: .67rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(244,238,224,.45); white-space: nowrap; }
.z-sep { color: rgba(255,255,255,.18); padding: 0 2px; }
.z-app-name { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: #c9a23d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-back { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(244,238,224,.38); text-decoration: none; border: 1px solid rgba(255,255,255,.08); padding: 5px 12px; transition: .2s; white-space: nowrap; flex-shrink: 0; }
.z-back:hover { color: #c9a23d; border-color: rgba(201,162,61,.32); }

@media (max-width: 980px) {
  .panel { width: 220px; top: 60px; }
  .panel.left { left: 12px; }
  .panel.right { right: 12px; }
}
@media (max-width: 720px) {
  .panel.right { display: none; }
  .panel.left { width: auto; right: 12px; }
}
