/* ネムリノイズ — Meta Ray-Ban Display (600x600, 加算式ディスプレイ)
   このアプリだけは「抑制」そのものがビジュアルアイデンティティ。
   深く沈んだインディゴ/ネイビーのみを使い、彩度の高いアクセントカラーは一切使わない。
   #000000 はグラス上で透明になるため、画面全体を塗りつぶさず、
   必要な面だけがごく控えめに光って見える設計。カタログの中で最も暗く、最も静かな一枚。 */

:root {
  --bg-page: #000000;          /* ページ背景。加算式ディスプレイでは透明 */

  --bg-surface: #0a0d18;       /* コントロールの通常面（ごく暗いインディゴ） */
  --bg-surface-focus: #171d38; /* フォーカス時の面 */
  --bg-surface-selected: #1d2748; /* 選択中タブの面 */

  --indigo: #2B3A67;           /* このアプリのキーカラー（暗いネイビー） */
  --indigo-soft: #4a5690;      /* ブリージングサークルなどの淡いインディゴ */

  --text-primary: #B8C2E6;     /* 主要テキスト。他アプリの白より明度を落とす */
  --text-secondary: #7C87AD;
  --text-muted: #4E5878;

  --focus-ring: #7A8AC4;
  --focus-glow: rgba(122, 138, 196, 0.30);

  --radius-md: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg-page); /* 純黒 = 加算式ディスプレイでは透明。現実の視界が透ける */
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

button {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
}

#app {
  position: relative;
  width: 600px;
  height: 600px;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 22px 24px 24px;
  gap: 12px;
}

/* ---------- タイトル ---------- */

.app-title {
  flex: 0 0 22px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--text-secondary);
}

/* ---------- ブリージングサークル（アンビエントビジュアル） ----------
   ノイズの波形には同期させない。それ自体のゆっくりした周期で動く、
   常に控えめな明滅。再生中のみ動き、停止中は低輝度のまま静止する。 */

.breath-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.breath-circle {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(90, 108, 168, 0.30) 0%,
    rgba(43, 58, 103, 0.16) 55%,
    rgba(43, 58, 103, 0) 76%);
  opacity: 0.24;
  transform: scale(0.85);
  transition: opacity 900ms ease, transform 900ms ease;
  will-change: transform, opacity;
}

.breath-circle.active {
  animation: breathe 9s ease-in-out infinite;
}

.breath-circle.active.paused {
  animation-play-state: paused;
}

@keyframes breathe {
  0%, 100% { opacity: 0.24; transform: scale(0.85); }
  50%      { opacity: 0.48; transform: scale(1.04); }
}

/* ---------- アンビエントシーン（雨と風のチルな情景） ----------
   ブリージングサークルの上に重ねる canvas。ゆっくり漂う光の粒（風）は常に
   静かに動き続け、雨音風タブを選んでいる間だけ細い雨の筋がフェードで重なる。 */

.scene-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* ---------- 共通フォーカス表現 ---------- */

.focusable {
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease;
}

.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 16px var(--focus-glow);
  transform: scale(0.97);
}

/* ---------- ノイズタイプ タブ行 ---------- */

.tab-row {
  flex: 0 0 60px;
  display: flex;
  gap: 8px;
}

.tab-btn {
  flex: 1;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 4px;
}

.tab-btn.selected {
  background: var(--bg-surface-selected);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(122, 138, 196, 0.25);
}

.tab-btn:focus {
  background: var(--bg-surface-focus);
}

/* ---------- 再生 / 停止 ---------- */

.play-btn {
  flex: 0 0 76px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-btn:focus {
  background: var(--bg-surface-focus);
}

.play-btn #play-btn-label {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
}

/* 再生中: くっきり反転させず、キーカラーの暗いネイビーで塗るだけに留める
   （このアプリは明るい面積を増やさないことが方針） */
.play-btn.playing {
  background: var(--indigo);
}

.play-btn.playing:focus {
  background: #344581;
}

/* ---------- スリープタイマー ---------- */

.timer-chip {
  flex: 0 0 56px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.timer-chip:focus {
  background: var(--bg-surface-focus);
}

.timer-chip-label {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 1px;
}

.timer-chip-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.timer-remaining {
  flex: 0 0 18px;
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  visibility: hidden;
}

.timer-remaining.visible {
  visibility: visible;
}
