/* repel-crow: スコープは #app-repel-crow に限定 */

#app-repel-crow {
  max-width: 720px;
}

/* ============================================================
   マスター起動/停止ボタン
   - 停止中: hazard オレンジグラデ（静的）
   - 起動中: 同じグラデ + サイズ拡大 + 周囲のグロー脈動
   ============================================================ */
#app-repel-crow #master-toggle {
  background: linear-gradient(135deg, #ff7a1a 0%, #ff4500 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border: 2px solid #ff4500;
  border-radius: 0.5rem;
  font-size: 1.05rem;
  padding: 0.9rem 1.25rem;
  letter-spacing: 0.08em;
  transition: border-color 0.25s, font-size 0.25s, padding 0.25s,
              box-shadow 0.25s, letter-spacing 0.25s, filter 0.2s;
}

#app-repel-crow #master-toggle:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(255, 69, 0, 0.35);
}
#app-repel-crow #master-toggle:active {
  transform: scale(0.98);
}

/* 起動中: サイズ拡大 + 周囲のオレンジグロー脈動 */
#app-repel-crow #master-toggle.is-running {
  font-size: 1.15rem;
  padding: 1.1rem 1.5rem;
  letter-spacing: 0.1em;
  animation: master-pulse 1.4s ease-in-out infinite;
}

@keyframes master-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0.25rem rgba(255, 69, 0, 0.45),
                0 0 22px 4px rgba(255, 69, 0, 0.35);
  }
  50% {
    box-shadow: 0 0 0 0.75rem rgba(255, 69, 0, 0.12),
                0 0 36px 10px rgba(255, 69, 0, 0.65);
  }
}

/* 過剰な動きを抑える設定の人にはグロー脈動を停止 */
@media (prefers-reduced-motion: reduce) {
  #app-repel-crow #master-toggle.is-running {
    animation: none;
    box-shadow: 0 0 0 0.35rem rgba(255, 69, 0, 0.35),
                0 0 24px 6px rgba(255, 69, 0, 0.4);
  }
}

#app-repel-crow .nav-pills .nav-link {
  font-size: 0.9rem;
}

/* ============================================================
   音プリセット選択（カード型チェックリスト）
   - タブ（nav-pills）と階層を明確に分けるため別デザイン
   - active 時も text-secondary が読めるよう薄い背景に
   ============================================================ */
#app-repel-crow .sound-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#app-repel-crow .sound-card-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  background: var(--bs-body-bg);
  transition: background-color 0.15s, border-color 0.15s;
  margin-bottom: 0;
}
#app-repel-crow .sound-card-label:hover {
  border-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.04);
}

#app-repel-crow .check-mark {
  font-size: 1.35rem;
  color: var(--bs-secondary-color);
  flex-shrink: 0;
  line-height: 1;
}
#app-repel-crow .check-mark .check-on { display: none; }
#app-repel-crow .check-mark .check-off { display: inline; }
#app-repel-crow .btn-check:checked + .sound-card-label .check-mark { color: var(--bs-primary); }
#app-repel-crow .btn-check:checked + .sound-card-label .check-on { display: inline; }
#app-repel-crow .btn-check:checked + .sound-card-label .check-off { display: none; }

#app-repel-crow .btn-check:checked + .sound-card-label {
  border-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), 0.08);
}

#app-repel-crow .preset-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
#app-repel-crow .preset-title {
  font-weight: 600;
  color: var(--bs-body-color);
  font-size: 0.95rem;
}
#app-repel-crow .preset-desc {
  font-size: 0.8rem;
  color: var(--bs-secondary-color); /* テーマ追随で常に読める */
  line-height: 1.3;
}

/* キーボードフォーカス時の輪郭 */
#app-repel-crow .btn-check:focus-visible + .sound-card-label {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

/* ============================================================
   視覚モード起動ボタン（こちらは単発アクションで OK）
   ============================================================ */
#app-repel-crow .visual-launch {
  padding: 1rem 0.5rem;
  font-size: 0.85rem;
  line-height: 1.3;
}
#app-repel-crow .visual-launch i {
  color: var(--bs-primary);
}

/* ============================================================
   全画面ビジュアルオーバーレイ
   ============================================================ */
#repel-visual-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: none;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
#repel-visual-overlay.is-active {
  display: block;
}

#repel-visual-overlay .visual-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#repel-visual-overlay .exit-hint {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
  pointer-events: none;
  z-index: 2;
}

/* 巨大目玉 */
.eye-svg {
  width: 80vmin;
  height: 80vmin;
  animation: eye-pulse 1.6s ease-in-out infinite;
}
@keyframes eye-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.eye-iris {
  transform-origin: center;
  animation: eye-look 3.2s ease-in-out infinite;
}
@keyframes eye-look {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(40px, -20px); }
  40%  { transform: translate(-40px, 20px); }
  60%  { transform: translate(30px, 30px); }
  80%  { transform: translate(-30px, -30px); }
  100% { transform: translate(0, 0); }
}
.eye-lid {
  transform-origin: center;
  animation: eye-blink 4.5s ease-in-out infinite;
}
@keyframes eye-blink {
  0%, 92%, 100% { transform: scaleY(0); }
  95%, 97%      { transform: scaleY(1); }
}

/* フクロウシルエット */
.owl-svg {
  width: 70vmin;
  height: 70vmin;
  animation: owl-hover 2.5s ease-in-out infinite;
}
@keyframes owl-hover {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-20px) rotate(1deg); }
}
.owl-eye {
  animation: owl-glow 1.3s ease-in-out infinite;
}
@keyframes owl-glow {
  0%, 100% { fill: #ffcc00; opacity: 1; }
  50%      { fill: #ff3300; opacity: 0.85; }
}

/* 高速フラッシュ */
#repel-visual-overlay.mode-flash {
  animation: flash-strobe 0.12s steps(2) infinite;
}
@keyframes flash-strobe {
  0%   { background: #fff; }
  100% { background: #000; }
}

/* レーザー風（緑点が走る） */
.laser-dot {
  position: absolute;
  top: 0;
  left: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, #00ff66 0%, #00aa44 40%, transparent 75%);
  box-shadow: 0 0 30px #00ff66, 0 0 60px #00ff66;
  will-change: transform;
}

/* タイマー残り表示 */
#countdown-pill {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
