* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: #12121c;
  color: #f2f0e9;
  line-height: 1.6;
}
header {
  padding: 20px 16px 8px;
  max-width: 880px;
  margin: 0 auto;
}
.brand { display: flex; gap: 14px; align-items: center; }
.logo { width: 56px; height: 56px; border-radius: 12px; }
h1 { font-size: 1.55rem; margin: 0; color: #e9c766; letter-spacing: .06em; }
.tagline { margin: 2px 0 0; color: #b9b6a8; font-size: .9rem; }
main { max-width: 880px; margin: 0 auto; padding: 8px 16px 32px; }
h2 { font-size: 1.15rem; border-left: 4px solid #d4af37; padding-left: 8px; }
h3 { font-size: 1rem; color: #e9c766; margin: 6px 0; }
.hidden { display: none !important; }
.sub { color: #b9b6a8; margin-top: -6px; }

/* カタログ */
.song-list { display: grid; gap: 12px; }
.song-card {
  background: #1d1d2c;
  border: 1px solid #34344a;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.song-card .t { font-weight: bold; font-size: 1.05rem; }
.song-card .s { color: #b9b6a8; font-size: .85rem; }
.price { color: #e9c766; font-weight: bold; white-space: nowrap; }
.price.free { color: #8fd18b; }
.open-btn, .play-btn {
  background: #d4af37; color: #12121c; border: none;
  border-radius: 999px; padding: 10px 22px; font-size: 1rem; font-weight: bold;
  cursor: pointer;
}
.sub-btn {
  background: transparent; color: #f2f0e9; border: 1px solid #55556e;
  border-radius: 999px; padding: 9px 18px; font-size: .95rem; cursor: pointer;
}
.upload-box {
  margin-top: 16px; background: #181826; border: 1px dashed #55556e;
  border-radius: 12px; padding: 14px 16px; text-align: center;
}
.upload-btn {
  display: inline-block; background: #2b2b40; color: #f2f0e9;
  border-radius: 999px; padding: 9px 20px; cursor: pointer; border: 1px solid #55556e;
}

/* プレイヤー */
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0; }
.tempo { display: flex; align-items: center; gap: 6px; color: #b9b6a8; }
.instrument-box { margin: 10px 0; }
.inst-label { color: #b9b6a8; font-size: .9rem; margin-right: 8px; }
.inst-btns { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.inst-btn {
  background: #2b2b40; color: #f2f0e9; border: 1px solid #55556e;
  border-radius: 999px; padding: 8px 18px; font-size: 1rem; cursor: pointer;
}
.inst-btn.active { background: #d4af37; color: #12121c; font-weight: bold; border-color: #d4af37; }

#practiceBox {
  background: #181826; border: 1px solid #34344a; border-radius: 12px;
  padding: 12px 14px; margin: 14px 0; overflow-x: auto;
}
.note-name { text-align: center; color: #e9c766; font-size: 1.05rem; min-height: 1.6em; margin: 6px 0 2px; }

/* ピアノ鍵盤 */
.piano { position: relative; height: 150px; margin: 8px auto; }
.pkey-white {
  position: absolute; top: 0; height: 150px;
  background: #f5f2ea; border: 1px solid #999; border-radius: 0 0 4px 4px;
}
.pkey-black {
  position: absolute; top: 0; height: 92px;
  background: #22222e; border: 1px solid #000; border-radius: 0 0 3px 3px; z-index: 2;
}
.pkey-white.on { background: #ffd94d; }
.pkey-black.on { background: #d4af37; }

/* ヴァイオリン指板 */
.violin-board { margin: 8px auto; max-width: 560px; }
.vstring { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.vstring .sname { width: 2.2em; text-align: center; color: #b9b6a8; font-weight: bold; }
.vtrack { position: relative; flex: 1; height: 14px; background: linear-gradient(#3a3a4e,#26262f); border-radius: 7px; }
.vdot {
  position: absolute; top: 50%; width: 26px; height: 26px; border-radius: 50%;
  background: #ffd94d; color: #12121c; font-weight: bold; font-size: .8rem;
  transform: translate(-50%,-50%); display: none; text-align: center; line-height: 26px;
  box-shadow: 0 0 10px #ffd94d;
}
.vdot.on { display: block; }

/* ハープ弦 */
.harp-wrap { display: flex; justify-content: center; align-items: flex-start; gap: 0; height: 190px; margin: 8px auto; }
.hstring { position: relative; width: 22px; }
.hstring .line { width: 3px; margin: 0 auto; background: #8a8aa0; border-radius: 2px; }
.hstring.c .line { background: #e05252; }
.hstring.f .line { background: #5277e0; }
.hstring.on .line { background: #ffd94d; box-shadow: 0 0 12px #ffd94d; width: 5px; }
.hstring .hlabel { text-align: center; font-size: .62rem; color: #b9b6a8; margin-top: 4px; }
.hstring.on .hlabel { color: #ffd94d; font-weight: bold; }

#scoreWrap { background: #fff; border-radius: 12px; padding: 10px; margin: 14px 0; overflow-x: auto; }
/* 楽譜の描画幅に下限を持たせ、狭い画面でも音符・歌詞が潰れて重ならないようにする
   （はみ出した分は #scoreWrap の横スクロールで見る） */
#score { min-width: 820px; }
#score svg { max-width: none; }

.price-box {
  background: #1d1d2c; border: 1px solid #d4af37; border-radius: 12px;
  padding: 14px 16px; margin: 14px 0;
}
.price-box .amount { font-size: 1.3rem; color: #e9c766; font-weight: bold; }
.price-box .amount.free { color: #8fd18b; }
.buy-btn {
  display: inline-block; margin-top: 8px; background: #d4af37; color: #12121c;
  border-radius: 999px; padding: 10px 24px; font-weight: bold; text-decoration: none;
}
.about { color: #cfccc0; font-size: .95rem; }
footer { text-align: center; color: #77756e; padding: 18px; font-size: .85rem; }
