/* メトロノームサイト（INZと同じ色の系統：オレンジ×こげ茶×生成り） */
:root {
  --bg: #fffaf0; --card: #fff; --ink: #3a2f2a; --sub: #85776d; --line: #f0e3d0;
  --main: #f08a3c; --main-d: #d96b1c; --main-l: #fff0e2; --green: #3fae64; --green-l: #e7f7ec;
  --radius: 18px; --shadow: 0 3px 12px rgba(120, 70, 30, .10);
  color-scheme: light;
}
/* 黒系（ヘッダーの切替ボタン。html[data-theme=dark]。選んだ色は localStorage に覚える） */
html[data-theme="dark"] {
  --bg: #16120f; --card: #241d18; --ink: #f2e9df; --sub: #b0a294; --line: #3e342c;
  --main-l: #3b2a1b; --green-l: #1c3324; --shadow: 0 3px 12px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
html[data-theme="dark"] .m-play.on { background: #000; }
html[data-theme="dark"] .m-dot.N.now { background: #b8693a; }
html[data-theme="dark"] .cf-msg.ok { color: #9fe0b4; }
html[data-theme="dark"] .cf-msg.ng { background: #4a221b; color: #ffb4a3; }
.theme-btn { margin-left: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 6px 15px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 38px; }
* { box-sizing: border-box; }
/* ボタンを続けてタップしたときの「ダブルタップで拡大」を止める（指2本の拡大はそのまま使える） */
html, body, button, a, input, select { touch-action: manipulation; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Meiryo", sans-serif; font-weight: 500; line-height: 1.75; }
a { color: var(--main-d); }
.hd { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--card); border-bottom: 3px solid var(--main); position: sticky; top: 0; z-index: 20; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 19px; color: var(--ink); text-decoration: none; }
.logo span { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--main); color: #fff; font-size: 18px; }
.hd nav a { margin-left: 12px; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--ink); }
main { max-width: 860px; margin: 0 auto; padding: 14px 14px 40px; }
.crumb { font-size: 13px; color: var(--sub); margin: 4px 2px 10px; }
.crumb a { color: var(--sub); }
h1 { font-size: 24px; margin: 8px 2px 6px; line-height: 1.4; }
h1 small { display: block; font-size: 14px; color: var(--sub); font-weight: 700; }
h2 { font-size: 20px; margin: 30px 0 10px; padding-left: 12px; border-left: 6px solid var(--main); }
h3 { font-size: 17px; margin: 22px 0 6px; }
.lead { color: var(--sub); margin: 0 2px 12px; }
.txt { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 20px 18px; margin-top: 18px; }
.txt table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 15px; }
.txt th, .txt td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.txt th { background: var(--main-l); }
.note { font-size: 13px; color: var(--sub); }
/* 出典などの長いURLがスマホ幅ではみ出さないように折り返す（10/11 コラムの kotobank のURLで横スクロールが出ていた） */
main a { overflow-wrap: anywhere; }
/* アフィリエイト枠（PR表記つき・ページの一番下に1つ） */
.pr-box { margin: 28px 0 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--main-l); font-size: 15px; }
.pr-box b { display: inline-block; margin-left: 8px; }
.pr-box p { margin: 8px 0 0; }
.pr-box a { font-weight: 700; }
.pr-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--sub); border: 1px solid var(--sub); border-radius: 4px; padding: 0 5px; line-height: 1.6; vertical-align: 1px; }

/* ---- メトロノーム本体 ---- */
.metro { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 16px; position: relative; overflow: hidden; scroll-margin-top: 70px; }
.m-top { text-align: center; }
.m-bpm-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.m-bpm { font-size: 72px; font-weight: 900; line-height: 1; letter-spacing: -.02em; min-width: 3ch; }
.m-bpm-label { font-size: 15px; color: var(--sub); font-weight: 700; }
.m-tname { font-weight: 700; color: var(--main-d); margin-top: 2px; }
.m-sec { font-size: 13px; color: var(--sub); }
.m-step { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); font: inherit; font-size: 15px; font-weight: 900; color: var(--ink); cursor: pointer; }
.m-step:active { background: var(--main-l); }
input[type=range] { width: 100%; accent-color: var(--main); height: 32px; }
.m-presets, .m-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.m-chip { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; }
.m-chip.on { background: var(--main); border-color: var(--main); color: #fff; }
.m-dots { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 6px; }
.m-dot { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); background: var(--card); font: inherit; font-weight: 900; color: var(--sub); display: inline-grid; place-items: center; cursor: pointer; transition: transform .05s; }
.m-dot.A { border-color: var(--main); color: var(--main-d); }
.m-dot.M { opacity: .35; border-style: dashed; }
.m-dot.now { background: var(--main); color: #fff; transform: scale(1.12); }
.m-dot.N.now { background: #f6b98c; }
.m-count { font-size: 15px; color: var(--sub); text-align: center; min-height: 22px; }
.m-play { display: block; width: 100%; max-width: 360px; margin: 10px auto; border: 0; border-radius: 999px; background: var(--main); color: #fff; font: inherit; font-size: 22px; font-weight: 900; padding: 14px; cursor: pointer; box-shadow: 0 4px 0 var(--main-d); }
.m-play.on { background: #3a2f2a; box-shadow: 0 4px 0 #000; }
.m-row { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0; }
.m-row > b { font-size: 14px; min-width: 4em; }
.m-sig { font-size: 22px; font-weight: 900; min-width: 3ch; text-align: center; }
.m-tap { min-width: 110px; }
.m-tap.hit { background: var(--main-l); }
.m-more { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 6px; }
.m-more summary { cursor: pointer; font-weight: 700; text-align: center; color: var(--main-d); padding: 6px; }
.m-panel { background: var(--main-l); border-radius: 14px; padding: 10px 12px; margin: 10px 0; }
.m-panel label { display: inline-flex; align-items: center; gap: 4px; margin: 4px 8px; font-size: 14px; font-weight: 700; }
.m-panel input[type=number], .m-panel input[type=text], .m-panel textarea { font: inherit; font-size: 16px; padding: 4px 8px; border: 2px solid var(--line); border-radius: 10px; width: 5em; }
.m-panel textarea { width: 100%; min-height: 3.2em; }
.m-mb { margin: 8px 0 4px; text-align: center; }
.m-mb > b { display: block; font-size: 14px; }
.m-mb .m-chips { margin: 6px 0; }
.m-mb .m-mb-beat { min-width: 2.6em; }
.m-mb .m-mb-beat:not(.on) { text-decoration: line-through; opacity: .55; }
.m-mb small { display: block; font-size: 12px; opacity: .8; }
.m-share { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.m-flash { position: absolute; inset: 0; background: var(--main); opacity: 0; pointer-events: none; }
.m-flash.go { animation: fl .18s ease-out; }
.m-flash.go.strong { background: #e0592a; }
@keyframes fl { from { opacity: .45; } to { opacity: 0; } }
.m-poly { display: flex; gap: 6px; justify-content: center; margin: 6px 0; }
.m-poly-label { text-align: center; font-size: 30px; font-weight: 900; }
.m-timer-left { text-align: center; font-weight: 700; color: var(--main-d); }
/* 合奏用の大画面 */
body.stage { background: #111; }
body.stage .hd, body.stage .crumb, body.stage h1, body.stage .lead, body.stage .txt, body.stage .ft, body.stage .grid, body.stage h2 { display: none; }
body.stage main { max-width: none; padding: 0; }
body.stage .metro { border-radius: 0; min-height: 100vh; background: #111; color: #fff; display: flex; flex-direction: column; justify-content: center; }
body.stage .m-bpm { font-size: 22vw; }
body.stage .m-dot { width: 9vw; height: 9vw; font-size: 4vw; background: #222; }
body.stage .m-dot.now { background: var(--main); }
body.stage #m-stage-count { display: block; font-size: 30vw; font-weight: 900; text-align: center; line-height: 1; }
#m-stage-count { display: none; }

/* 一覧のカード */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.card { display: block; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; text-decoration: none; color: var(--ink); }
.card b { display: block; font-size: 16px; }
.card small { color: var(--sub); font-size: 12px; }
.bpm-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.bpm-grid a { display: inline-block; min-width: 46px; text-align: center; padding: 4px 6px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; }
.play-inline { border: 2px solid var(--main); background: var(--card); color: var(--main-d); border-radius: 999px; padding: 2px 12px; font: inherit; font-weight: 900; cursor: pointer; }
.ft { text-align: center; font-size: 13px; color: var(--sub); padding: 24px 14px 40px; border-top: 1px solid var(--line); margin-top: 30px; }
.ft a { color: var(--sub); margin: 0 6px; }
.m-sounds { flex-wrap: nowrap; align-items: flex-start; }
.m-sounds > b { min-width: 3.2em; padding-top: 6px; }
.m-sounds .m-chips { flex: 1; justify-content: flex-start; margin: 0; }
/* 振り子 */
.m-pend { position: relative; height: 150px; width: 200px; margin: 10px auto 0; }
.m-pend-arm { position: absolute; left: 50%; bottom: 12px; width: 6px; height: 130px; margin-left: -3px; background: var(--ink); border-radius: 3px; transform-origin: 50% 100%; }
.m-pend-arm i { position: absolute; left: 50%; top: 22px; width: 26px; height: 18px; margin-left: -13px; background: var(--main); border-radius: 5px; }
.m-pend-base { position: absolute; left: 50%; bottom: 0; width: 70px; height: 16px; margin-left: -35px; background: var(--line); border-radius: 8px 8px 4px 4px; }
/* 音量ミキサー */
.m-mix label { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.m-mix input[type=range] { flex: 1; height: 28px; }
.m-mix span { min-width: 3.2em; text-align: right; font-size: 13px; }
.m-kmap label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0; font-weight: 400; font-size: 13px; }
.m-kmap label b { font-size: 18px; min-width: 1.4em; }
.m-kmap .m-kvol { display: flex; align-items: center; gap: 6px; width: 100%; padding-left: 2em; }
.m-kmap .m-kvol input { flex: 1; height: 28px; }
.m-kmap .m-kvol span { min-width: 3.2em; text-align: right; }
.m-kmap select { font: inherit; font-size: 16px; padding: 6px 8px; min-height: 40px; border: 2px solid var(--line); border-radius: 10px; margin-left: auto; max-width: 100%; }
/* セットリスト・練習記録 */
.m-set-form { display: flex; gap: 6px; margin: 8px 0; }
.m-set-form input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 6px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.m-set-list { list-style: none; padding: 0; margin: 6px 0; }
.m-set-list li { display: flex; align-items: center; gap: 6px; padding: 7px 4px; border-bottom: 1px dashed var(--line); }
.m-set-list li a { flex: 1; font-weight: 700; }
.m-set-list small { color: var(--sub); }
.m-set-btn { border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; width: 34px; height: 30px; font: inherit; cursor: pointer; }
.m-log-nums { display: flex; justify-content: space-around; text-align: center; margin: 8px 0; }
.m-log-nums b { display: block; font-size: 22px; }
.m-log-nums small { color: var(--sub); }
.m-log-bars { display: flex; gap: 8px; height: 110px; align-items: flex-end; padding: 0 6px; }
.m-log-bars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.m-log-bars i { display: block; width: 100%; min-height: 2px; background: var(--main); border-radius: 4px 4px 0 0; }
.m-log-bars small { font-size: 12px; color: var(--sub); }
/* リズム判定ゲーム */
.jg { text-align: center; padding-top: 10px; }
.jg-lead { text-align: left; }
.jg-row { margin: 8px 0; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
#judge-app { margin-top: 0; margin-bottom: 18px; }
.jg-ng { color: #d0452b !important; font-weight: 700; font-size: 15px !important; }
html[data-theme="dark"] .jg-ng { color: #ff8a70 !important; }
.jg-mic { background: #fde8e4; color: #6b2a1c; border-radius: 12px; padding: 8px 14px; margin: 8px 0; }
html[data-theme="dark"] .jg-ng { color: #d0452b !important; font-weight: 700; font-size: 15px !important; }
html[data-theme="dark"] .jg-ng { color: #ff8a70 !important; }
.jg-mic { background: #4a221b; color: #ffd2c6; }
.jg-row select { font: inherit; font-size: 16px; padding: 4px 8px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.jg-btn { display: inline-block; border: 0; border-radius: 999px; background: var(--main); color: #fff; font: inherit; font-size: 19px; font-weight: 900; padding: 12px 26px; cursor: pointer; box-shadow: 0 4px 0 var(--main-d); margin: 6px 0; }
.jg-btn.ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: none; font-size: 16px; }
.jg-state { font-size: 14px; color: var(--sub); min-height: 22px; margin: 6px 0; }
.jg-meter { position: relative; height: 64px; margin: 14px 4px 4px; background: var(--main-l); border-radius: 12px; overflow: hidden; }
.jg-zone { position: absolute; left: 37.5%; width: 25%; top: 0; bottom: 0; background: var(--green-l); }
.jg-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #3fae64; }
.jg-marks i { position: absolute; top: 14px; width: 4px; height: 36px; margin-left: -2px; border-radius: 2px; opacity: .8; }
.jg-marks i.ok { background: #3fae64; } .jg-marks i.mid { background: var(--main); } .jg-marks i.ng { background: #d0452b; }
.jg-l, .jg-r { position: absolute; bottom: 2px; font-size: 11px; color: var(--sub); } .jg-l { left: 8px; } .jg-r { right: 8px; }
.jg-last { font-size: 24px; font-weight: 900; min-height: 36px; }
.jg-last.ok { color: #3fae64; } .jg-last.mid { color: var(--main-d); } .jg-last.ng { color: #d0452b; }
.jg-result { text-align: left; background: var(--main-l); border-radius: 14px; padding: 10px 16px; margin: 10px 0; }
.jg-score { text-align: center; font-size: 20px; } .jg-score b { font-size: 52px; }
.jg-rank { display: inline-block; margin-left: 8px; padding: 2px 14px; border-radius: 10px; background: var(--ink); color: var(--bg); font-weight: 900; font-size: 28px; }
.jg-btn.ghost.done { border-color: #3fae64; color: #2e8b4e; background: var(--green-l); }
.jg-cal { text-align: left; margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 6px; }
.jg-cal summary { cursor: pointer; font-weight: 700; color: var(--main-d); }
/* SNSの共有ボタン */
.shares { text-align: center; margin: 16px 0 4px; }
.shares b { display: block; font-size: 14px; color: var(--sub); margin-bottom: 6px; }
.shares div { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.share { display: inline-block; border: 0; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; font-weight: 900; color: #fff; text-decoration: none; cursor: pointer; }
.share-x, .share-threads { background: #111; box-shadow: inset 0 0 0 1px #555; }
.share-line { background: #06c755; }
.share-facebook { background: #1877f2; }
.share-native, .share-copy { background: var(--card); color: var(--ink); border: 2px solid var(--line); }
/* お問い合わせ・役立つサイト */
.cf label { display: block; font-weight: 700; margin: 12px 0; }
.cf input[type=text], .cf input[type=email], .cf select, .cf textarea { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
.cf .req { font-style: normal; font-size: 11px; color: #fff; background: var(--main); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.cf .hp { position: absolute; left: -9999px; }
.cf-btn { display: block; width: 100%; max-width: 320px; margin: 14px auto 6px; border: 0; border-radius: 999px; background: var(--main); color: #fff; font: inherit; font-size: 18px; font-weight: 900; padding: 12px; cursor: pointer; box-shadow: 0 4px 0 var(--main-d); }
.cf-msg { padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.cf-msg.ok { background: var(--green-l); color: #1f6e3c; }
.cf-msg.ng { background: #fde8e4; color: #a33a22; }
.usite { border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.usite:target { background: var(--main-l); border-radius: 12px; padding: 4px 12px 8px; }
.usite h2 { border-left: 0; padding-left: 0; font-size: 18px; }
.usite-pic { display: block; max-width: 420px; margin: 4px 0 8px; }
.usite-pic img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
.ft br + a { margin-top: 6px; display: inline-block; }
@media (max-width: 560px) {
  .hd nav a { display: none; }
  .m-bpm { font-size: 64px; }
  h1 { font-size: 21px; }
}
