:root {
  --bg: #1e1e2e;
  --surface: rgba(49,50,68,0.6);
  --outline: rgba(255,255,255,0.08);
  --text: #cdd6f4;
  --accent: #f5c2e7;
  --radius: 8px;
}

body {
  margin: 0;
  font-family: system-ui;
  background: var(--bg);
  color: var(--text);
}

/* topbar */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 6px 12px;
  backdrop-filter: blur(16px);
  background: var(--surface);
  border-bottom: 1px solid var(--outline);
}

.title {
  text-align: left;
  font-weight: 700;
}

.flat {
  background: transparent;
  border: none;
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 10px;
}

.flat:hover {
  background: rgba(255,255,255,0.05);
}

/* widget content */
#content {
  max-width: 900px;
  margin: 24px auto;
  padding: 20px;
  backdrop-filter: blur(18px);
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
}

/* background grid */
#bgfx {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
}

/* kando */
#launcher {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

#launcher.active {
  opacity: 1;
  pointer-events: auto;
}

/* blurred backdrop */
#launcher::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(20px);
  background: rgba(0, 0, 0, 0.35);
}

.kando-item {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.6;
  transition: transform 0.12s ease, opacity 0.12s ease;
  color: var(--text);
  user-select: none;
}

.kando-item.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.2);
  color: var(--accent);
}

#kando-atom {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.6;
  pointer-events: none;
}

/* markdown bold -> accent color */
#content strong {
  color: var(--accent);
}

/* ===== CAVA visualizer ===== */
#cava {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.25;
  pointer-events: none;
}

/* keep topbar content above */
.topbar > *:not(canvas) {
  position: relative;
  z-index: 1;
}

/* ===== audio modal ===== */
#audio-consent {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  z-index: 1000;
}

#audio-consent.hidden {
  display: none;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  max-width: 300px;
}

.modal button {
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #000;
}