/* Room layout — tokens/fonts come from css/sangeet-theme.css (canonical: shared/). */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

a { color: var(--terra); }
a:hover { color: var(--terra-soft); }

h1 { font-family: var(--font-display); font-size: 2.2rem; line-height: 1.15; margin: 0 0 10px; font-weight: 600; }
h2 { font-size: 1.5rem; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 3px solid var(--ochre); display: inline-block; }
h3 { font-size: 1.1rem; color: var(--terra); margin: 22px 0 8px; }
.lead { font-size: 1.1rem; color: #4a3728; }
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin: 16px 0;
}
.note {
  border-left: 5px solid var(--ochre); background: #fbf1da;
  padding: 12px 16px; border-radius: 8px; margin: 16px 0; color: #5a4a34;
}
.tip { border-left-color: var(--green); background: #eef3e7; }
/* --- Action language (repo-wide) ---------------------------------------
   .btn.play  = this button makes sound / starts playback  → green, leading ▶
   .btn.nav   = this button goes to another page           → terra, trailing →
   Plain .btn / .btn.ghost stay neutral for everything else (Stop, Connect,
   Reveal, Reset, etc.) so a play triangle is never forced where it is nonsense.
   Note: use ONE of {ghost, play, nav} per button (same specificity). */
.btn.play {
  background: transparent; color: #2c6e49; border: 1.5px solid #b6d8bf;
}
.btn.play:hover { background: #eef6ef; border-color: #2c6e49; color: #22593a; }
.btn.play::before {
  content: "\25B6"; font-size: .78em; margin-right: 8px; line-height: 1;
  position: relative; top: -0.03em;
}
/* A .btn.play that has become its own Stop toggle: neutral look, ■ (set via
   textContent by js/sangeet-play-toggle.js) instead of the leading ▶. */
.btn.play.is-stop { color: var(--ink); border-color: var(--line); background: transparent; }
.btn.play.is-stop:hover { color: var(--terra); border-color: var(--terra); background: transparent; }
.btn.play.is-stop::before { content: none; }
/* Icon-only ghost toggles (the ▶ in reference tables) while they are playing. */
.btn.ghost.is-stop { color: var(--terra); border-color: var(--terra); }
.btn.nav { background: var(--terra); color: #fff; border: none; }
.btn.nav:hover { background: var(--terra-soft); color: #fff; }
.btn.nav::after { content: "\2192"; margin-left: 8px; font-weight: 700; }
/* Disabled state (e.g. Circle-of-fifths play buttons before a key is picked). */
.btn[disabled], .btn.is-disabled {
  opacity: .45; cursor: not-allowed; pointer-events: none;
}
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

/* Keyboard */
.pkey-board {
  position: relative; user-select: none; margin: 12px 0 8px;
  touch-action: none;
}
.pkey-whites { display: flex; width: 100%; }
.pkey.white {
  flex: 1; height: 140px; margin: 0 1px; border: 1px solid #b8b0a4;
  border-radius: 0 0 8px 8px; background: linear-gradient(#fff, #f2eee8);
  cursor: pointer; position: relative; padding: 0;
}
.pkey.white:hover { background: #fff8ec; }
.pkey.white.on, .pkey.white.glow {
  background: linear-gradient(#ffe7a8, #f0c45a);
}
.pkey-blacks { position: absolute; left: 0; right: 0; top: 0; height: 88px; pointer-events: none; }
.pkey.black {
  position: absolute; height: 88px; pointer-events: auto;
  border: none; border-radius: 0 0 5px 5px;
  background: linear-gradient(#3a3a3a, #151515); cursor: pointer; z-index: 2; padding: 0;
}
.pkey.black:hover { background: linear-gradient(#555, #222); }
.pkey.black.on, .pkey.black.glow { background: linear-gradient(#c4783a, #8a4e1c); }

/* Hand-colored glow: right = gold, left = blue, both = split (drills / exercises / theory / hanon). */
.pkey.white.glow.hand-R { background: linear-gradient(#ffe7a8, #f0c45a); box-shadow: 0 0 9px 1px rgba(226, 160, 60, .55); }
.pkey.black.glow.hand-R { background: linear-gradient(#c4783a, #8a4e1c); box-shadow: 0 0 8px 1px rgba(226, 160, 60, .6); }
.pkey.white.glow.hand-L { background: linear-gradient(#cfe6f7, #8fc0e6); box-shadow: 0 0 9px 1px rgba(47, 111, 159, .5); }
.pkey.black.glow.hand-L { background: linear-gradient(#3f74a0, #23425f); box-shadow: 0 0 8px 1px rgba(47, 111, 159, .6); }
.pkey.white.glow.hand-both {
  background: linear-gradient(#cfe6f7, #8fc0e6) left / 50% 100% no-repeat,
              linear-gradient(#ffe7a8, #f0c45a) right / 50% 100% no-repeat;
  box-shadow: 0 0 9px 1px rgba(120, 150, 170, .5);
}
.pkey.black.glow.hand-both {
  background: linear-gradient(#3f74a0, #23425f) left / 50% 100% no-repeat,
              linear-gradient(#c4783a, #8a4e1c) right / 50% 100% no-repeat;
  box-shadow: 0 0 8px 1px rgba(120, 150, 170, .55);
}
.pkey.next.white.nx-R { background: linear-gradient(#ffd27a, #f0a83a); box-shadow: inset 0 0 0 3px #d98a2b; }
.pkey.next.black.nx-R { box-shadow: inset 0 0 0 2px #f0b060; }
.pkey.next.white.nx-L { background: linear-gradient(#bfe0fb, #7ab6e6); box-shadow: inset 0 0 0 3px #2f6f9f; }
.pkey.next.black.nx-L { box-shadow: inset 0 0 0 2px #6fb0e0; }
.finger-badge.bh-R { color: var(--accent); }
.finger-badge.bh-L { color: #2f6f9f; }
.pkey.black .finger-badge.bh-R { color: #ffe0b8; }
.pkey.black .finger-badge.bh-L { color: #9fd0ff; }
.finger-badge.half-l { left: 0; right: 50%; font-size: .72rem; }
.finger-badge.half-r { left: 50%; right: 0; font-size: .72rem; }
.pkey.black .finger-badge.half-l,
.pkey.black .finger-badge.half-r { font-size: .62rem; }
.pkey-label {
  position: absolute; left: 0; right: 0; bottom: 8px;
  text-align: center; font-size: 0.65rem; font-weight: 700; color: #6a736c;
  pointer-events: none;
}
.pkey.black .pkey-label { color: #ddd; bottom: 6px; font-size: 0.55rem; }

.card table { border-collapse: collapse; width: max-content; max-width: 100%; margin: 8px 0; font-size: 0.95rem; }
.card th, .card td { text-align: left; padding: 6px 10px; border-bottom: 1px solid #eadfce; }
.card th { color: var(--accent); font-weight: 800; }

/* Scale follow-along: finger numbers sit BELOW the note names on the scale keyboard. */
/* Note names: bold and higher up the key. */
#scale-kb .pkey-label { bottom: 24px; font-weight: 800; }
#scale-kb .pkey.black .pkey-label { bottom: 22px; }
/* Finger numbers: normal weight, tucked underneath the note name near the bottom edge. */
.finger-badge {
  position: absolute; left: 0; right: 0; bottom: 6px; text-align: center;
  font-size: 0.9rem; font-weight: 500; color: var(--accent); pointer-events: none;
}
.pkey.black .finger-badge { color: #ffe0b8; bottom: 5px; font-size: 0.78rem; }
/* Two-hand fingering: left hand in blue, right hand in gold, on the scale keyboard. */
.finger-badge .fh.lh { color: #2f6f9f; }
.finger-badge .fh.rh { color: var(--accent); }
.finger-badge .sep { opacity: .45; font-weight: 400; margin: 0 1px; }
.pkey.black .finger-badge .fh.lh { color: #9fd0ff; }
.pkey.black .finger-badge .fh.rh { color: #ffe0b8; }
.lh-key { color: #2f6f9f; }
.rh-key { color: var(--accent); }
.pkey.next.white { background: linear-gradient(#ffd27a, #f0a83a); box-shadow: inset 0 0 0 3px var(--warm); }
.pkey.next.black { box-shadow: inset 0 0 0 2px var(--warm); }
.pkey.next { animation: pkeyPulse 1s ease-in-out infinite; }
.pkey.done.white { background: linear-gradient(#d7f0e4, #b6e0cd); }
.pkey.done .finger-badge { color: var(--accent-soft); }
@keyframes pkeyPulse { 0%, 100% { filter: none; } 50% { filter: brightness(1.12); } }

/* Shared full practice-keyboard lab shell (SangeetPracticeKeyboard). */
.spk-lab .spk-kb .pkey-label { bottom: 24px; font-weight: 800; }
.spk-lab .spk-kb .pkey.black .pkey-label { bottom: 22px; }
.spk-lab .legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .85rem; margin: 6px 2px 0; }
.spk-lab .legend b { color: var(--accent); }
.spk-lab .legend b.rh-key { color: var(--accent); }
.spk-lab .legend b.lh-key { color: #2f6f9f; }
.spk-lab .fing-line { font-family: ui-monospace, Consolas, monospace; color: var(--warm); margin: 2px 0 0; }
.spk-lab .score-line { font-family: ui-monospace, Consolas, monospace; color: var(--muted); font-size: .82rem; margin: 6px 0 0; }
.spk-lab .score-line .blk { display: inline-block; padding: 1px 6px; border: 1px solid #e7ddcd; border-radius: 8px; margin: 2px 4px 2px 0; }
.spk-lab .score-line .blk .sw { color: var(--accent); font-weight: 800; }
.spk-lab .score-cap { color: var(--muted); font-size: .76rem; margin: 4px 0 0; }
.spk-lab .loop-count { font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: var(--accent); min-width: 3.5em; }
.spk-lab .hand-pick { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: .92rem; }
.spk-lab .hand-pick label { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 700; }
.spk-lab .live-input { gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.spk-lab .spk-extra { margin: 8px 0; }
.spk-lab .spk-hint { color: var(--muted); }

.tsig-pat {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0;
}
.tsig-beat {
  min-width: 48px; min-height: 48px; padding: 8px 10px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-weight: 800; text-align: center; background: #fffdf8;
}
.tsig-beat.on { background: var(--ochre); border-color: var(--terra); }
.tsig-beat.strong { border-color: var(--terra); }
.tsig-beat .sub { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); }
.tsig-frac {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 2.2rem; font-weight: 800; line-height: 1; margin-right: 4px; vertical-align: middle;
}
.tsig-frac b { font-size: 1.15rem; font-style: normal; }
.tsig-frac i {
  display: block; width: 1.35em; height: 2px; background: var(--ink); margin: 3px 0; font-style: normal;
}
.card table.with-play { max-width: 760px; }
.card table.with-play .feel-cell { width: 1%; white-space: nowrap; padding-right: 0; }

.nv-ruler {
  display: flex; height: 42px; border: 2px solid var(--line); border-radius: 10px;
  overflow: hidden; background: #fffdf8; margin: 10px 0 6px;
}
.nv-cell {
  flex: var(--w, 1); min-width: 0;
  border-right: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800; background: #fff6d6;
}
.nv-cell:last-child { border-right: none; }
.nv-cell.rest { background: #f4eee4; color: var(--muted); font-weight: 700; }
.nv-cell.empty { background: #fffdf8; color: var(--muted); font-weight: 600; }
.nv-cell.on { background: var(--ochre); border-color: var(--terra); }
.nv-count {
  display: flex; font-size: .72rem; font-weight: 700; color: var(--muted);
  letter-spacing: .02em; margin: 0 0 10px;
}
.nv-count span { flex: 1; text-align: center; }
.nv-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.nv-add .btn { font-size: .85rem; padding: 7px 12px; }
.nv-left { font-weight: 800; margin: 6px 0 0; }
.nv-left.ok { color: #1a7a4e; }
.nv-left.over { color: #c43b2a; }

@media (max-width: 820px) {
  
  h1 { font-size: 1.75rem; }
  .pkey.white { height: 110px; }
  .pkey.black { height: 70px; }
}

/* Solo-lab chart playhead (shared pattern with string rooms) */
.gtab-wrap { overflow-x: auto; max-width: 100%; }
.gtab-inner { position: relative; display: inline-block; width: fit-content; }
.gtab-inner .gym-tab { margin: 0; overflow: visible; }
.gtab-playhead {
  position: absolute; top: 8px; bottom: 8px; width: 1.6em;
  background: var(--terra); opacity: 0.28; border-radius: 3px;
  pointer-events: none; display: none; z-index: 1; transition: left 0.07s linear;
}
.gtab-inner.is-playing .gtab-playhead { display: block; }
