/* 暗めの地に、明るさの差で描く。真っ黒・真っ白は避け、まぶしさを抑える。
   意味は位置・太さ・字・印で伝え、色だけに乗せない。点滅のアニメーションは使わない。 */
:root {
  --bg: #17191d;       /* 濃い灰の地 */
  --panel: #22252b;
  --text: #e6e4dd;     /* 地との明るさの比 約 13.8:1 */
  --muted: #b4b7bc;    /* 地との明るさの比 約 8.8:1 */
  --line: #ecebe4;     /* 音の線 */
  --band: #9aa0a6;     /* 下の帯 */
  --rhythm: #61666e;   /* 曲だけのときの広がり。地との比 約 3.05:1（面が広いので暗めに）、拍の線との比 約 4.8:1 */
  --grid: rgba(236, 235, 228, 0.10);
  --now: #8b9098;      /* 「いま」の線。地との比 約 5.5:1 */
  --edge: #8b9098;     /* 枠・斜線。地との比 約 5.5:1、パネルとの比 約 4.8:1 */
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
}

header, main, footer { max-width: 900px; margin: 0 auto; padding: 0 16px; }

h1 { font-size: 1.6rem; margin: 16px 0 4px; }
h2 { font-size: 1rem; margin: 16px 0 4px; color: var(--muted); font-weight: normal; }
.lead { margin: 0 0 12px; color: var(--muted); }

#scope {
  display: block;
  width: 100%;
  height: 52vh;
  min-height: 260px;
  background: var(--bg);
  border: 1px solid var(--edge);
  border-radius: 8px;
}

.legend { font-size: 0.85rem; color: var(--muted); margin: 6px 0 0; }
.now-text { margin: 12px 0; min-height: 1.6em; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; }

button, .button {
  min-height: 52px;
  padding: 0 20px;
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 2px solid var(--edge);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
button:focus-visible, .number:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}
/* ファイルの入口は、見た目をボタン（label）に任せる */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-row:has(.file-input:focus-visible) .button { outline: 3px solid var(--text); outline-offset: 2px; }

.song-panel {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 10px;
}
.song-panel h2 { color: var(--text); font-weight: bold; font-size: 1.1rem; margin-top: 0; }
.hint { margin: 0 0 8px; color: var(--muted); font-size: 0.9rem; }
.file-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
.file-name { color: var(--muted); word-break: break-all; }
.number {
  width: 6em;
  min-height: 44px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--edge);
  border-radius: 8px;
  padding: 0 8px;
}
#btn-play { margin-top: 8px; }
.song-status { margin: 8px 0 0; min-height: 1.6em; }
/* 曲の時刻。数字の幅をそろえ、字が左右に揺れないようにする */
.song-time { margin: 6px 0 0; font-size: 1.6rem; font-variant-numeric: tabular-nums; color: var(--text); }

.mic-panel {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 10px;
}
.mic-label { font-size: 1.3rem; font-weight: bold; }
.mic-reason { margin: 4px 0 0; color: var(--muted); }

/* マイクが生きている印：ゆっくり動く目盛り（点滅しない） */
.mic-meter {
  height: 14px;
  margin-top: 8px;
  background: var(--bg);
  border: 1px solid var(--edge);
  border-radius: 7px;
  overflow: hidden;
}
.mic-meter-fill {
  height: 100%;
  background: var(--line);
  transform-origin: left center;
  transform: scaleX(0);
}
/* 届いていないときは目盛りに斜線を入れ、色ではなく形で知らせる */
.mic-state[data-state="none"] .mic-meter {
  background: repeating-linear-gradient(45deg, var(--bg) 0 6px, var(--edge) 6px 9px);
}

.settings { list-style: none; padding: 0; margin: 0; }
.settings-extra { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

footer { margin-top: 24px; padding-bottom: 24px; font-size: 0.85rem; color: var(--muted); }
footer p { margin: 2px 0; }
