/* ピアノ・リズム 固有の見た目（共通は ../common/base.css） */
.board-wrap { max-width: none; position: relative; }
.select {
  font: inherit; font-size: 17px; min-height: var(--tap); padding: 0 12px; max-width: 100%;
  border: 2px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
.select:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }

/* 音符が降りてくる所（canvas）。スマホでも上のバーから下のボタンまで1画面に入る高さ */
.lane-wrap { position: relative; }
#lane {
  display: block; width: 100%; height: clamp(150px, calc(100svh - 440px), 330px);
  border-radius: var(--radius) var(--radius) 0 0; background: #FBFAF6;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.board-wrap .callout { top: 38%; }

/* 鍵盤 */
.keys {
  position: relative; height: clamp(120px, 24svh, 190px); margin-top: 0;
  background: #2B2622; border-radius: 0 0 var(--radius) var(--radius); padding: 0 0 6px;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.key { position: absolute; top: 0; box-sizing: border-box; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; pointer-events: none; }
.key.white {
  height: calc(100% - 6px); background: #FFFFFF; border: 1px solid #8C857C; border-top: 0; border-radius: 0 0 6px 6px;
  color: #1F2328; padding-bottom: 8px; z-index: 1;
}
.key.black {
  height: 60%; background: #26221F; border: 1px solid #0E0C0B; border-top: 0; border-radius: 0 0 5px 5px;
  color: #F2EEE8; padding-bottom: 6px; z-index: 2;
}
.key .nm { font-weight: 700; font-size: clamp(13px, 2.6vw, 18px); line-height: 1.1; white-space: nowrap; }
.key.black .nm { font-size: 12px; }
.key .kc { font-size: 12px; color: #6B6F76; line-height: 1.2; margin-bottom: 2px; }
.key.black .kc { color: #B9B3AB; }
.key .dot { width: 12px; height: 12px; border-radius: 50%; margin-bottom: 4px; border: 1.5px solid rgba(0,0,0,.35); }
.key.white.down { background: var(--kc, #DDE8F3); }
.key.black.down { background: var(--kc, #6B6F76); }
.key.white.down .nm, .key.black.down .nm { color: #1F2328; }
.key.black.down .kc { color: #3A3D43; }
/* 次に押す鍵盤（なぞり弾き）: 色の枠と下の印 */
.key.next { box-shadow: inset 0 0 0 4px var(--kc, #2F5D8A); }
.key.white.next { background: color-mix(in srgb, var(--kc, #2F5D8A) 22%, #FFFFFF); }
.key.black.next { background: color-mix(in srgb, var(--kc, #2F5D8A) 45%, #26221F); }
.key.dim { opacity: .45; }
.key.ans-ok { box-shadow: inset 0 0 0 5px #2E7D4F; }
.key.ans-ng { box-shadow: inset 0 0 0 5px #B23A3A; }

/* 上のバー */
.hud { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; font-variant-numeric: tabular-nums; }
.hud .song { font-weight: 700; }
.hud b { font-size: 1.1rem; }
.hud .pf b { color: var(--ok); }
.hud .gd b { color: var(--accent); }
.hud .ms b { color: var(--ng); }
.hud .cb { margin-left: auto; }
.hud .cb.on b { color: var(--ok); }

/* 音当ての表示（canvas の上） */
.earbox { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; color: #1F2328; }
.earbox .ear-q { margin: 0; font-weight: 700; color: #5B616B; }
.earbox .ear-big { margin: 0; font-size: clamp(44px, 12vw, 76px); font-weight: 800; line-height: 1.2; }
.earbox .ear-big.ok { color: #2E7D4F; }
.earbox .ear-big.ng { color: #B23A3A; }
.earbox .ear-note { margin: 0; min-height: 1.75em; font-weight: 700; }

/* 一時停止 */
.pause-box {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 5;
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px 28px; text-align: center;
}
.pause-title { font-weight: 700; font-size: 1.2rem; margin: 0 0 10px; }

.result-box { z-index: 6; inset: 4% 6% auto; }
.result-box .big { margin: 0 0 4px; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-box .goal-line { margin: 0 0 8px; font-weight: 700; }
.result-box .goal-line.ok { color: var(--ok); }
.result-box .goal-line.ng { color: var(--ink-sub); }
.result-box dl { display: grid; grid-template-columns: auto auto; gap: 2px 16px; justify-content: center; margin: 0 0 8px; }
.result-box dt { color: var(--ink-sub); text-align: right; }
.result-box dd { margin: 0; text-align: left; font-weight: 700; font-variant-numeric: tabular-nums; }
.result-box .new { color: var(--ok); font-weight: 700; }
.result-box .rank { display: inline-block; min-width: 1.6em; margin-right: 8px; padding: 0 8px; border: 3px solid currentColor; border-radius: 8px; }
.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.article table { font-size: 15px; }
.article .tbl { overflow-x: auto; }
@media (max-width: 480px) {
  .stage { padding: 8px; }
  .result-box { inset: 2% 2% auto; padding: 14px; }
  .result-box h2 { font-size: 1.25rem; }
  .result-box .big { font-size: 1.35rem; }
  .hud { gap: 0 10px; font-size: .95rem; }
  .turnbar { margin-bottom: 6px; }
  .controls { margin-top: 8px; }
  .btn.icon { padding: 0 10px; }
  #play .linkbtn { display: none; } /* スマホ幅ではボタンを1行に（遊び方はページの下にある） */
}
/* 上のバーの高さを一定に（No.93。数字は一番長い文が画面の幅（360px・375px 以上・641px 以上）で何行になるか。--tb-rt はふりがなの分。base.css・turnbar.js） */
.turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
@media (min-width: 641px) { .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
:root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2; --tb-rt: 0px; --tb-st-rt: 0px; }
@media (min-width: 375px) { :root:lang(en) .turnbar { --tb-msg-lines: 2; --tb-st-lines: 2; } }
@media (min-width: 641px) { :root:lang(en) .turnbar { --tb-msg-lines: 1; --tb-st-lines: 1; } }
/* 上のバーの高さ ここまで */
