: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 { align-items: center; justify-content: center; }
.h-wrap { display: flex; flex-direction: column; align-items: center; width: 460px; }
.h-mark { margin-bottom: 14px; }
.h-title { font-size: 46px; font-weight: 800; letter-spacing: 0.5px; }
.h-sub { font-size: 19px; color: var(--text-secondary); margin: 10px 0 34px; }
.h-menu { display: flex; flex-direction: column; gap: 18px; width: 100%; }
.h-btn {
  height: 88px; width: 100%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 24px; font-weight: 600;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px;
}
.h-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg-primary); color: var(--accent);
  font-size: 24px;
}

/* ---------- CIRCLE ---------- */
.c-title {
  position: absolute; top: 12px; left: 0; right: 0;
  text-align: center; font-size: 22px; font-weight: 700;
  color: var(--text-secondary); z-index: 5;
}
.c-ring { position: absolute; inset: 0; }
.c-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 188px; height: 188px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--bg-tertiary), var(--bg-primary));
  border: 2px solid #2a2a3e;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; z-index: 2; padding: 0 12px;
}
.cc-key { font-size: 30px; font-weight: 800; }
.cc-rel { font-size: 17px; color: var(--accent-secondary); margin-top: 4px; }
.cc-acc { font-size: 16px; color: var(--text-secondary); margin-top: 6px; }
.cc-go { font-size: 13px; color: var(--text-muted); margin-top: 10px; letter-spacing: 0.5px; }

.chip {
  position: absolute;
  width: 86px; min-height: 58px;
  background: var(--bg-secondary);
  border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 3;
}
.chip-major { font-size: 24px; font-weight: 800; line-height: 1; }
.chip-minor { font-size: 14px; color: var(--text-secondary); margin-top: 3px; line-height: 1; }
.chip[data-side="sharp"] .chip-major { color: #cfefff; }
.chip[data-side="flat"] .chip-major { color: #ccffe6; }
.chip[data-side="none"] .chip-major { color: #fff; }

.c-hint {
  position: absolute; bottom: 12px; left: 0; right: 0;
  text-align: center; font-size: 15px; color: var(--text-muted); z-index: 5;
}

/* ---------- DETAIL ---------- */
.d-head { padding: 22px 26px 14px; border-bottom: 1px solid #22222f; }
.d-title { font-size: 38px; font-weight: 800; }
.d-sub { font-size: 18px; color: var(--accent-secondary); margin-top: 6px; }
.d-body { flex: 1; padding: 18px 26px; overflow: hidden; }
.d-acc {
  background: var(--bg-tertiary); border-radius: 10px;
  padding: 14px 18px; font-size: 19px; font-weight: 600;
  color: var(--accent); margin-bottom: 18px;
}
.d-section { margin-bottom: 18px; }
.d-label { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 10px; }
.d-notes { display: flex; gap: 8px; }
.d-note {
  flex: 1; height: 52px; background: var(--bg-secondary); border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}
.d-chords { display: flex; gap: 7px; }
.d-chord {
  flex: 1; background: var(--bg-secondary); border-radius: 9px;
  padding: 8px 2px; text-align: center;
}
.d-roman { font-size: 13px; color: var(--accent); font-weight: 700; }
.d-cname { font-size: 18px; font-weight: 700; margin-top: 4px; }
.d-nav { display: flex; gap: 12px; padding: 0 26px 6px; }
.d-btn {
  flex: 1; height: 76px; background: var(--bg-tertiary); color: var(--text-primary);
  border-radius: var(--radius-md); font-size: 19px; font-weight: 600;
}
.d-btn-accent { color: var(--accent); }
.d-foot { text-align: center; font-size: 14px; color: var(--text-muted); padding: 8px 0 14px; }

/* ---------- QUIZ ---------- */
.q-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 26px; font-size: 19px; font-weight: 700; color: var(--text-secondary);
  border-bottom: 1px solid #22222f;
}
#quizScore { color: var(--accent-secondary); }
.q-question {
  padding: 30px 30px 18px; font-size: 28px; font-weight: 700; line-height: 1.3;
  min-height: 150px; display: flex; align-items: center;
}
.q-options { display: flex; flex-direction: column; gap: 14px; padding: 0 26px; }
.q-opt {
  min-height: 70px; background: var(--bg-tertiary); color: var(--text-primary);
  border-radius: var(--radius-md); font-size: 22px; font-weight: 600;
  display: flex; align-items: center; padding: 0 24px; text-align: left;
}
.q-opt.correct { background: rgba(0,255,136,0.18); border-color: var(--accent-secondary); color: var(--accent-secondary); }
.q-opt.wrong { background: rgba(255,68,102,0.18); border-color: var(--danger); color: var(--danger); }
.q-feedback { text-align: center; font-size: 20px; font-weight: 700; padding: 16px 0 0; }
.q-feedback.ok { color: var(--accent-secondary); }
.q-feedback.no { color: var(--danger); }
.q-continue { padding: 16px 26px 22px; }
.q-cont {
  width: 100%; height: 76px; background: var(--accent); color: #04141a;
  border-radius: var(--radius-md); font-size: 22px; font-weight: 800;
}

/* ---------- RESULT ---------- */
#result { align-items: center; justify-content: center; }
.r-card {
  width: 420px; background: var(--bg-secondary); border-radius: 20px;
  padding: 40px 36px; text-align: center;
  display: flex; flex-direction: column; gap: 14px;
}
.r-title { font-size: 26px; color: var(--text-secondary); font-weight: 600; }
.r-score { font-size: 64px; font-weight: 800; color: var(--accent); }
.r-best { font-size: 19px; color: var(--accent-secondary); margin-bottom: 16px; }
.r-btn {
  height: 80px; background: var(--bg-tertiary); color: var(--text-primary);
  border-radius: var(--radius-md); font-size: 22px; font-weight: 700;
}
.r-btn-accent { background: var(--accent); color: #04141a; }

/* ---------- HELP ---------- */
.hp-head { padding: 24px 26px 16px; font-size: 28px; font-weight: 800; border-bottom: 1px solid #22222f; }
.hp-body { flex: 1; padding: 20px 26px; display: flex; flex-direction: column; gap: 14px; }
.hp-item {
  background: var(--bg-secondary); border-radius: 10px; padding: 14px 16px;
  font-size: 18px; line-height: 1.4; color: var(--text-secondary);
}
.hp-item b { color: var(--text-primary); }
.hp-tag {
  display: inline-block; min-width: 96px; margin-right: 8px;
  color: var(--accent); font-weight: 700; font-size: 15px;
}
.hp-nav { padding: 0 26px 26px; }
.hp-nav .d-btn { width: 100%; }
