/* 色は姉妹サイト共通（14番が基準）。ダークモードは出さない */
:root {
  color-scheme: light;
  --ink: #2b2b28; --ink-soft: #63655f; --line: #e3e8e2;
  --paper: #fff; --paper-soft: #f7faf6;
  --accent: #3d7a55; --accent-strong: #2f6243; --accent-soft: #e9f3eb;
  --piano: #3d7a55; --piano-soft: #e9f3eb;
  --rec: #a0742a; --rec-soft: #f6efe0;
  --hit: #f2b640;
}
html { background: #f3f6f2; }
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); line-height: 1.6;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }

.top { display: flex; align-items: baseline; gap: .75rem; padding: .75rem 16px; max-width: 1200px; margin: 0 auto; }
.brand { font-weight: 800; color: var(--accent-strong); text-decoration: none; font-size: 1.1rem; padding-block: .35rem; }
.crumb { color: var(--ink-soft); }
.crumb::before { content: "／"; margin-right: .5rem; }

main { max-width: 1200px; margin: 0 auto; padding: 0 16px 24px; }

/* 楽器のタブ＝押せる見た目（チップ） */
.inst-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.inst-tabs button {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; padding: .3rem 1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 700;
  transition: transform .08s, box-shadow .08s, background .1s;
}
.inst-tabs button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.07); }
.inst-tabs button:active:not(:disabled) { transform: none; box-shadow: none; }
.inst-tabs button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.inst-tabs button:disabled { opacity: .55; cursor: default; font-weight: 400; }
.inst-tabs small { font-size: .72rem; color: var(--ink-soft); }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); }
.dot-piano { background: var(--piano); } .dot-rec { background: var(--rec); }

/* 設定の列 */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .6rem .8rem; background: var(--paper); border: 1px solid var(--line); border-radius: .75rem; margin-bottom: .75rem; }
.seg { display: inline-flex; align-items: center; gap: .25rem; }
.seg-label { font-size: .8rem; color: var(--ink-soft); margin-right: .2rem; }
.seg button, .big-btn {
  min-height: 2.25rem; padding: .2rem .7rem; border: 1px solid var(--line); background: var(--paper-soft);
  border-radius: .5rem; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.seg output { min-width: 2.2rem; text-align: center; font-weight: 700; }
.vol { display: inline-flex; align-items: center; gap: .3rem; }
.vol input { width: 7rem; accent-color: var(--accent); }
.big-btn { margin-left: auto; font-weight: 700; border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }

/* 本体 */
.stage {
  display: grid; grid-template-columns: 1fr; gap: .75rem; padding: 1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: .75rem;
}
.now { text-align: center; }
.now-name { font-size: clamp(2.6rem, 9vw, 5rem); font-weight: 800; line-height: 1.1; color: var(--accent-strong); min-height: 1.1em; }
.now-sub { color: var(--ink-soft); font-size: .95rem; min-height: 1.6em; }

body[data-inst="recorder"] .now-name { color: var(--rec); }
body[data-inst="recorder"] .stage { grid-template-columns: minmax(150px, 220px) 1fr; grid-template-areas: "fing now" "fing kbd" "hint hint"; align-items: center; }
body[data-inst="recorder"] .fing { grid-area: fing; }
body[data-inst="recorder"] .now { grid-area: now; }
body[data-inst="recorder"] .kbd-wrap { grid-area: kbd; }
body[data-inst="recorder"] .hint { grid-area: hint; }
body:not([data-inst="recorder"]) .only-rec { display: none !important; }
body:not([data-inst="piano"]) .only-piano { display: none !important; }

.fing { margin: 0; text-align: center; }
.fing svg { width: 100%; max-height: 60vh; }
.fing figcaption { font-size: .8rem; color: var(--ink-soft); }
.fing .body { fill: #fbf6ea; stroke: #b99a5e; stroke-width: 2; }
.fing .hole { stroke: #5a4520; stroke-width: 2.5; fill: #fff; transition: fill .05s; }
.fing .hole.closed { fill: #3a2c12; }
.fing .half { fill: #3a2c12; }
.fing .lbl { font-size: 13px; fill: var(--ink-soft); text-anchor: middle; }
.fing .thumb-lbl { font-size: 12px; fill: var(--ink-soft); }
.fing.unverified .hole.closed, .fing.unverified .half { fill: #b0a080; }

/* 鍵盤 */
.kbd-wrap { overflow-x: auto; padding-bottom: .25rem; }
.kbd { position: relative; height: clamp(150px, 26vw, 240px); min-width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; }
.key {
  position: absolute; top: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding-bottom: .4rem; cursor: pointer; font-size: clamp(.7rem, 1.4vw, .95rem); line-height: 1.15;
}
.key.w { height: 100%; background: #fff; border: 1px solid #cfd6ce; border-top: none; border-radius: 0 0 .5rem .5rem; z-index: 1; box-shadow: inset 0 -6px 0 #eef2ed; }
.key.b { height: 60%; background: #34352f; color: #fff; border-radius: 0 0 .35rem .35rem; z-index: 2; box-shadow: inset 0 -5px 0 #1d1e1a; }
.key.on.w { background: #fff3d2; box-shadow: inset 0 -2px 0 var(--hit); }
.key.on.b { background: #7a5a12; box-shadow: inset 0 -2px 0 var(--hit); }
.key .nm { font-weight: 700; }
.key.w .nm { color: var(--accent-strong); }
body[data-inst="recorder"] .key.w .nm { color: var(--rec); }
.key .kc {
  margin-top: .25rem; font-size: .78em; min-width: 1.6em; padding: 0 .25em; border-radius: .3rem;
  border: 1px solid currentColor; opacity: .55; font-family: ui-monospace, Consolas, monospace;
}
.key.out { opacity: .35; cursor: default; }
body[data-keys="off"] .key .kc { display: none; }
body[data-names="none"] .key .nm { display: none; }

.hint { margin: 0; font-size: .85rem; color: var(--ink-soft); text-align: center; }

.lat { margin-top: .75rem; font-size: .9rem; background: var(--paper); border: 1px solid var(--line); border-radius: .75rem; padding: .5rem .9rem; }
.lat summary { cursor: pointer; padding-block: .35rem; }
.lat .small { font-size: .8rem; color: var(--ink-soft); }

.foot { max-width: 1200px; margin: 0 auto; padding: 0 16px 32px; font-size: .8rem; color: var(--ink-soft); }

/* プロジェクタ用：設定を隠し、音名・運指・鍵盤を画面いっぱいに */
body.big { background: #fff; }
body.big .top, body.big .inst-tabs, body.big .lat, body.big .foot, body.big .hint { display: none; }
body.big main { max-width: none; padding: 8px 16px; }
body.big .tools { padding: .3rem .6rem; }
body.big .tools > :not(.big-btn) { display: none !important; }
body.big .stage { border: none; min-height: calc(100vh - 70px); align-content: center; }
body.big .now-name { font-size: clamp(4rem, 14vw, 11rem); }
body.big .now-sub { font-size: 1.4rem; }
body.big .kbd { height: clamp(200px, 32vh, 360px); }
body.big .key { font-size: clamp(1rem, 2vw, 1.6rem); }
body.big[data-inst="recorder"] .stage { grid-template-columns: minmax(220px, 34vh) 1fr; }
body.big .fing svg { max-height: 82vh; }

@media (max-width: 640px) {
  body[data-inst="recorder"] .stage { grid-template-columns: 110px 1fr; grid-template-areas: "fing now" "kbd kbd" "hint hint"; }
  .big-btn { margin-left: 0; }
}
.credits summary { cursor: pointer; padding-block: .35rem; }
.credits ul { margin: .25rem 0 0; padding-left: 1.2rem; }
.credits a { color: var(--accent); }

/* SakuLife のサイト一覧（14番の正本の文面） */
.sister { margin-bottom: 1rem; }
.sister h2 { font-size:.85rem; margin:0 0 .4rem; color:var(--ink-soft); }
.sister ul { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:.1rem 1rem; }
.sister a { display:inline-block; padding-block:.35rem; color:var(--accent); font-weight:700; text-decoration:none; margin-right:.5rem; }
.sister a:hover { color:var(--accent-strong); text-decoration:underline; }
.sister span { font-size:.78rem; color:var(--ink-soft); }
