: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;
  --gold: #ffcc44;
  --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;
  -webkit-font-smoothing: antialiased;
}

#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; }
.hidden { display: none !important; }

.focusable {
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer; outline: none;
  scroll-margin: 20px;
}
.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
  transform: translateY(-1px);
}

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  background: var(--bg-primary);
  border-bottom: 1px solid #26263a;
  min-height: 78px;
  flex-shrink: 0;
}
.topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: 0.2px; }
.brand .sub { font-size: 14px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }

.iconbtn {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 24px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.iconbtn.on { color: var(--gold); }

/* ---- Scroll content ---- */
.content {
  flex: 1; overflow-y: auto;
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-padding: 20px;
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: #2c2c40; border-radius: 3px; }

/* ---- Home cards ---- */
.card {
  display: flex; align-items: center; gap: 16px;
  min-height: 84px; padding: 0 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.card-ico {
  width: 50px; height: 50px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--accent);
}
.card-txt { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.card-title { font-size: 19px; font-weight: 600; }
.card-sub { font-size: 13px; color: var(--text-secondary); }
.card-arrow { font-size: 26px; color: var(--text-muted); }

/* ---- List rows ---- */
.row {
  display: flex; flex-direction: column; gap: 6px;
  min-height: 84px; padding: 14px 18px; justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.row-rn { font-size: 22px; font-weight: 700; letter-spacing: 0.5px; }
.row-chords { font-size: 15px; color: var(--accent); font-weight: 600; letter-spacing: 0.4px; }
.empty { color: var(--text-secondary); font-size: 16px; line-height: 1.5; padding: 12px 4px; }

/* ---- Detail ---- */
#detail-content { display: flex; flex-direction: column; height: 100%; }
.detail-h { font-size: 24px; font-weight: 700; flex: 1; letter-spacing: 0.4px; }
.detail-scroll {
  flex: 1; overflow-y: auto;
  padding: 20px 22px 28px;
  display: flex; flex-direction: column; gap: 18px;
  scroll-padding: 20px;
}
.detail-scroll::-webkit-scrollbar { width: 6px; }
.detail-scroll::-webkit-scrollbar-thumb { background: #2c2c40; border-radius: 3px; }

.badge {
  align-self: flex-start;
  font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--accent-secondary);
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 5px 12px; border-radius: 999px;
}

.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.chip {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 84px; padding: 14px 16px;
  background: var(--bg-tertiary);
  border: 2px solid #2c2c44;
  border-radius: var(--radius-md);
  transition: border-color 0.1s ease, box-shadow 0.1s ease, transform 0.1s ease;
}
.chip-name { font-size: 26px; font-weight: 700; }
.chip-rn { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.chip.playing {
  border-color: var(--accent);
  box-shadow: 0 0 22px var(--focus-glow);
  transform: translateY(-3px) scale(1.04);
}
.chip.playing .chip-name { color: var(--accent); }

.form {
  font-size: 14px; color: var(--text-secondary); text-align: center;
  background: var(--bg-secondary); border-radius: 10px; padding: 12px 14px;
  line-height: 1.5; letter-spacing: 0.3px;
}

.keyrow { display: flex; align-items: center; justify-content: center; gap: 16px; }
.keybtn {
  width: 60px; height: 56px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary); color: var(--text-primary);
  font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.keylabel { font-size: 20px; color: var(--text-secondary); min-width: 110px; text-align: center; }
.keylabel b { color: var(--text-primary); font-size: 24px; font-weight: 700; }

.playbtn {
  min-height: 60px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #00d4ff, #00a0cc);
  color: #04141c; font-size: 20px; font-weight: 700; letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.playbtn:focus { color: #04141c; }

.desc { font-size: 17px; line-height: 1.55; color: var(--text-primary); }
.famous { font-size: 15px; line-height: 1.5; color: var(--text-secondary); }
.famous span {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px;
}

/* ---- Reference ---- */
.ref-block {
  background: var(--bg-secondary); border-radius: var(--radius-md);
  padding: 16px 18px; flex-shrink: 0;
}
.ref-block h2 { font-size: 18px; margin-bottom: 8px; color: var(--accent); }
.ref-block p { font-size: 15px; color: var(--text-secondary); line-height: 1.5; }
.ref-block ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ref-block li { font-size: 15px; color: var(--text-secondary); line-height: 1.4; }
.ref-block li b { color: var(--text-primary); }
