: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; }

/* ---- Header ---- */
.hdr {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
  flex: 0 0 auto;
}
.hdr-title { font-size: 26px; font-weight: 700; letter-spacing: 0.2px; flex: 1 1 auto; }
.hdr-hint { font-size: 15px; color: var(--text-secondary); white-space: nowrap; }
.back {
  width: 44px; height: 44px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; line-height: 1; font-weight: 700;
  background: var(--bg-tertiary); color: var(--text-primary);
  border-radius: 10px;
}

/* ---- Content / scroll ---- */
.content {
  flex: 1 1 auto; overflow-y: auto;
  padding: 16px 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
  scrollbar-width: none;
}
.content::-webkit-scrollbar { width: 0; height: 0; }

/* ---- Footer ---- */
.ftr {
  flex: 0 0 auto; padding: 12px 22px;
  background: var(--bg-primary); border-top: 1px solid var(--bg-tertiary);
}
.ftr-note { font-size: 14px; color: var(--text-muted); }

/* ---- Generic card ---- */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-align: left;
}

/* ---- Home menu ---- */
.menu { gap: 14px; }
.menu-item {
  display: flex; align-items: center; gap: 18px;
  min-height: 88px; padding: 16px 20px;
}
.menu-ico {
  width: 56px; height: 56px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--accent);
  background: var(--bg-tertiary); border-radius: 12px;
}
.menu-txt { display: flex; flex-direction: column; gap: 4px; }
.menu-name { font-size: 22px; font-weight: 600; }
.menu-sub { font-size: 15px; color: var(--text-secondary); }

/* ---- List rows (intervals/chords/circle/modes) ---- */
.row {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 16px;
  background: var(--bg-secondary); border-radius: var(--radius-md);
}
.row-lead {
  flex: 0 0 auto; min-width: 50px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 10px;
  font-size: 17px; font-weight: 700; color: var(--accent);
  background: var(--bg-tertiary); border-radius: 9px;
}
.row-main { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-name { font-size: 19px; font-weight: 600; }
.row-sub { font-size: 14px; color: var(--text-secondary); }
.row-trail { flex: 0 0 auto; font-size: 15px; color: var(--text-muted); text-align: right; }
.row-notes { font-size: 15px; color: var(--accent-secondary); font-weight: 600; letter-spacing: 0.5px; }

/* ---- Mode detail ---- */
.md-section { background: var(--bg-secondary); border-radius: var(--radius-md); padding: 16px 18px; }
.md-label { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 10px; }
.md-char { font-size: 17px; line-height: 1.5; color: var(--text-secondary); }
.scale-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.note-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 56px; padding: 8px 6px;
  background: var(--bg-tertiary); border-radius: 9px;
}
.note-deg { font-size: 12px; color: var(--accent); font-weight: 700; }
.note-name { font-size: 19px; font-weight: 600; }
.formula-line { font-size: 20px; font-weight: 700; color: var(--accent-secondary); letter-spacing: 1px; }
.play-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 14px;
  background: var(--bg-tertiary); border-radius: var(--radius-md);
  font-size: 18px; font-weight: 600; color: var(--text-primary);
}
.play-btn .pico { color: var(--accent); font-size: 22px; }

/* ---- Section divider in lists ---- */
.list-head {
  font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); padding: 6px 4px 0; font-weight: 700;
}

/* ---- Toast ---- */
.toast {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 22px; max-width: 540px;
  background: var(--bg-tertiary);
  border: 1px solid var(--accent);
  border-radius: 999px;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.3);
  font-size: 17px; font-weight: 600;
  z-index: 50;
}
.toast.hidden { display: none; }
.toast-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-secondary);
  animation: pulse 0.9s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

.row.playing, .play-btn.playing, .menu-item.playing { border-color: var(--accent-secondary); }
