@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Cinzel:wght@400;600&display=swap');

:root {
  --bg: #03050f;
  --deep: #06091a;
  --surface: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
  --star: #e8d5a3;
  --star-glow: rgba(232,213,163,0.6);
  --link: rgba(140,180,255,0.5);
  --accent: #7eb8f7;
  --text: #c9c9d4;
  --muted: #5a5a70;
  --danger: #f97070;
  --ui-w: 260px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
}

canvas {
  display: block;
  position: fixed;
  inset: 0;
  cursor: crosshair;
}

/* ── UI Panel ─────────────────────────────────── */
.ui {
  position: fixed;
  top: 0; left: 0;
  width: var(--ui-w);
  height: 100%;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  background: linear-gradient(180deg, rgba(3,5,15,0.95) 0%, rgba(3,5,15,0.7) 100%);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  z-index: 10;
}

.title { font-family: 'Cinzel', serif; font-weight: 600; font-size: 1.15rem; color: #fff; line-height: 1.3; letter-spacing: 0.12em; }
.title span { color: var(--accent); }
.subtitle { font-family: 'Space Mono', monospace; font-size: 0.6rem; color: var(--muted); margin-top: 10px; line-height: 1.7; }

.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.control-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.control-group label {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.15em;
}
.control-group span {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  width: 100%;
}
.btn:hover {
  background: rgba(126,184,247,0.1);
  border-color: var(--accent);
  color: #fff;
}
.btn.active {
  background: rgba(126,184,247,0.15);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-accent {
  background: rgba(126,184,247,0.2);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-accent:hover {
  background: rgba(126,184,247,0.35);
  color: #fff;
}

/* ── Modal ────────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; }
.modal-box {
  background: #0a0e22;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: pop-in 0.2s ease;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.93) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-label {
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  color: #fff;
  letter-spacing: 0.1em;
}
.modal-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.modal-input:focus { border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn { flex: 1; }

/* ── Tooltip ──────────────────────────────────── */
.tooltip {
  position: fixed;
  z-index: 50;
  padding: 6px 12px;
  background: rgba(10,14,34,0.95);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.tooltip.show { opacity: 1; }

/* ── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
