:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
#app { width: 100%; height: 100%; position: relative; }
.screen { width: 100%; height: 100%; position: absolute; top: 0; left: 0; display: flex; flex-direction: column; }
.screen.hidden { display: none; }
.focusable { transition: all 0.15s ease; border: 2px solid transparent; cursor: pointer; outline: none; }
.focusable:focus { border-color: var(--focus-ring); box-shadow: 0 0 20px var(--focus-glow); }
.hidden { display: none !important; }

/* ---------- HOME ---------- */
#home {
  justify-content: center;
  align-items: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(0,212,255,0.10), transparent 60%),
    radial-gradient(ellipse at 50% 90%, rgba(122,92,255,0.10), transparent 60%);
}
.home-inner {
  width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}
.brand { text-align: center; }
.brand-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 26px;
}
.brand-dots span {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: block;
  animation: bob 3.2s ease-in-out infinite;
}
.brand-dots span:nth-child(1) { background: var(--accent-secondary); animation-delay: 0s; }
.brand-dots span:nth-child(2) { background: var(--accent); animation-delay: .4s; }
.brand-dots span:nth-child(3) { background: #7a5cff; animation-delay: .8s; }
.brand-dots span:nth-child(4) { background: #ff4ecd; animation-delay: 1.2s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: .6; }
  50% { transform: translateY(-12px); opacity: 1; }
}
.title {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(90deg, #00ffaa, #00d4ff, #7a5cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle {
  margin-top: 12px;
  font-size: 20px;
  color: var(--text-secondary);
  letter-spacing: 2px;
}
.menu {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

/* ---------- BUTTONS ---------- */
.btn {
  width: 100%;
  min-height: 88px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-primary {
  background: linear-gradient(135deg, rgba(0,212,255,0.22), rgba(0,255,136,0.18));
  border-color: rgba(0,212,255,0.35);
}
.btn-wide { width: 100%; }

/* ---------- BARS ---------- */
.bar {
  min-height: 80px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--bg-tertiary);
}
.bar h2 { font-size: 30px; font-weight: 700; }
.bar-bottom {
  border-bottom: none;
  border-top: 1px solid var(--bg-tertiary);
  padding: 16px 28px;
  margin-top: auto;
}

/* ---------- FLOW ---------- */
#flow { background: #000; }
#canvas {
  position: absolute;
  inset: 0;
  width: 600px;
  height: 600px;
  display: block;
}
.flow-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}
.flow-readout {
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--text-secondary);
  opacity: .85;
}
.readout-palette { color: var(--text-primary); font-weight: 600; }
.readout-sep { margin: 0 10px; color: var(--text-muted); }
.control-bar {
  display: flex;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(to top, rgba(10,10,15,0.92), rgba(10,10,15,0));
}
.ctrl {
  flex: 1;
  min-height: 64px;
  border-radius: 10px;
  background: rgba(30,30,46,0.85);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctrl-back { color: var(--accent); }

/* ---------- PRESETS ---------- */
.preset-list {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 24px;
}
.preset {
  min-height: 78px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
}
.swatch {
  width: 92px;
  height: 46px;
  border-radius: 8px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.preset-meta { display: flex; flex-direction: column; gap: 3px; }
.preset-name { font-size: 22px; font-weight: 600; }
.preset-desc { font-size: 15px; color: var(--text-secondary); }
.preset.active .preset-name::after {
  content: " ●";
  color: var(--accent-secondary);
  font-size: 14px;
  vertical-align: middle;
}

/* ---------- ABOUT ---------- */
.about-body {
  flex: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.about-body p { max-width: 520px; }
.about-row { color: var(--text-primary); display: flex; align-items: center; gap: 14px; }
.key {
  display: inline-block;
  min-width: 78px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
}
.muted { color: var(--text-muted); font-size: 16px; margin-top: 8px; }
