/* body */

body {
  margin: 0;
  font-family: "Hiragino Maru Gothic ProN", "Rounded Mplus 1c", sans-serif;
  background: linear-gradient(135deg, #d6f0ff, #f0fbff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

/* bodyスマホ */
@media (max-width: 768px) {
  body {
    justify-content: flex-start;
    padding: 15px 20px; 
  }
}


/* カード */
.card {
  width: calc(100% - 40px);
  max-width: 540px;
  background: white;
  border-radius: 20px;

  padding: 32px 20px 40px;

  margin: 0 auto;

  box-shadow: 0 20px 40px rgba(0, 150, 200, 0.15);
}

/* カードスマホ */
@media (max-width: 768px) {
  .card {
    width: calc(100% - 24px); /* ←ここ超重要 */
    margin: 0 12px;           /* ←左右余白つくる */
    max-width: none;
  }
}


/* ヘッダー */
.header {
  padding: 20px;
  font-size: 20px;
  font-weight: bold;
  color: #3aaed8;
  margin-bottom: 10px;
}

/* メイン */
.main {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 30px; /* ← 全体の余白の核 */
}

.header h1{
  text-align: center;
  margin: 0;
}

/* BPM行 */
.bpm-row {
  position: relative;
  width: 100%;
  height: 80px; /* ← 高さ確保 */
}

/* BPMの数字 */
.bpm-area {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);

  display: flex;          
  align-items: baseline;
  gap: 2px;                /* ← ここで間隔調整 */

  font-size: 64px;
  font-weight: bold;
  color: #333;
}

/* BPMの文字 */
.unit {
  font-size: 20px;     /* ← 小さくする */
  color: #666;
}

/* 再生ボタン */
.play-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  background: #7fd8ff;
  color: white;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(0, 150, 200, 0.3);
}

/* 鼓動 */
.play-btn.beat {
transform: translateY(-50%) scale(1.05);
  box-shadow: 
    0 0 0 0 rgba(0, 150, 200, 0.4),
    0 6px 15px rgba(0, 150, 200, 0.3);
  animation: pulse 0.15s;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 150, 200, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(0, 150, 200, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 150, 200, 0);
  }
}

/* コントロール */
.control {
  display: flex;
  align-items: center;
  gap: 16px; /* ← ボタンとスライダーの余白UP */
  margin-top: 10px;
}

/* ＋ − 丸ボタン */
.minus, .plus {
  width: 50px;
  height: 50px;
  border-radius: 50%; /* ← 完全に丸 */
  background: #e6f7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 150, 200, 0.2);
  transition: all 0.15s;
}

/* 押した時 */
.minus:active, .plus:active {
  transform: scale(0.9);
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* スライダー */
input[type="range"] {
  flex: 1;
  height: 15px;
  border-radius: 3px;
  background: var(--slider-color, #cceeff);
}

/* つまみ */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--thumb-color, #7fd8ff);
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}


/* =========================
   現在の拍表示
========================= */
.beat-display {
  font-size: 28px;
  font-weight: bold;
  color: #333;

  margin-top: 12px;
  margin-bottom: 6px;

  text-align: center;
}



/* =========================
   拍ドット（●○○○）
========================= */
.beat-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 14px;
}

.beat-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;

  background: #d0e7f2; /* 未選択 */
  transition: all 0.15s;
}

/* 通常拍 */
.beat-dot.active {
  background: #7fd8ff;
  transform: scale(1.2);

  box-shadow:
    0 0 6px rgba(127, 216, 255, 0.6);
}

/* 強拍（1拍目） */
.beat-dot.accent {
  background: #ffd84d; /* 電球イエロー */

  transform: scale(1.4);

  /* 発光✨ */
  box-shadow:
    0 0 6px rgba(255, 216, 77, 0.8),
    0 0 12px rgba(255, 216, 77, 0.6),
    0 0 20px rgba(255, 216, 77, 0.4);
}



/* =========================
   拍セレクター全体
========================= */
.beat-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  margin-top: 20px;
}

/* 数字の並び */
.beat-selector {
  display: flex;
  gap: 8px;
}

/* =========================
   拍ボタン
========================= */
.beat-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%; /* ←丸！ */

  border: none;
  background: #e8f3f8; /* 未選択 */
  color: #7aaec4;

  font-weight: bold;
  font-size: 16px;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: all 0.2s;
}

/* 選択中 */
.beat-btn.active {
  background: #7fd8ff;
  color: white;
  box-shadow: 0 4px 10px rgba(0,150,200,0.3);
  transform: scale(1.1);
}

/* 押した時 */
.beat-btn:active {
  transform: scale(0.9);
}


/* =========================
   矢印ボタン
========================= */
.arrow {
  background: none;
  border: none;

  font-size: 22px;
  color: #7aaec4;

  cursor: pointer;

  padding: 8px;
  transition: all 0.2s;

  margin: 0 4px;
}

/* ホバーでちょい強調 */
.arrow:hover {
  color: #3aaed8;
}

/* 押したとき */
.arrow:active {
  transform: scale(0.85);
}




/* サウンド */
.sound-panel {
  max-width: 540px;
  width: calc(100% - 40px);
  margin-top: 24px;
  background: #f0fbff;
  padding: 20px;
  border-radius: 16px;
}

.sound-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.sound {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: #e6f7ff;
  color: #3aaed8;
  cursor: pointer;
}

.sound.active {
  background: #7fd8ff;
  color: white;
}
