* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 20px;
  color: #4a90d9;
}

h2 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: #555;
}

/* 追加フォーム */
.add-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.form-row input[type="text"] {
  flex: 1;
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}

.form-row input[type="number"] {
  width: 56px;
  padding: 8px 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  text-align: center;
}

.sep {
  font-size: 1.1rem;
  font-weight: bold;
  color: #888;
}

.form-row button {
  padding: 8px 16px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.form-row button:hover {
  background: #3579c4;
}

/* リスト */
.list-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#totalTime {
  font-size: 0.85rem;
  color: #888;
}

.btn-text {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 2px 4px;
}

.btn-text:hover {
  text-decoration: underline;
}

#slideList {
  list-style: none;
}

#slideList li {
  display: flex;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px solid #f0f0f0;
  gap: 8px;
}

#slideList li:last-child {
  border-bottom: none;
}

.slide-num {
  width: 22px;
  text-align: right;
  font-size: 0.8rem;
  color: #aaa;
  flex-shrink: 0;
}

.slide-title {
  flex: 1;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-dur {
  font-size: 0.88rem;
  color: #4a90d9;
  font-weight: bold;
  flex-shrink: 0;
}

.del-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}

.del-btn:hover {
  color: #e74c3c;
}

.drag-handle {
  cursor: grab;
  color: #ccc;
  font-size: 1rem;
  flex-shrink: 0;
}

/* 練習開始ボタン */
.start-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.btn-practice {
  padding: 12px 40px;
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
}

.btn-practice:hover:not(:disabled) {
  background: #27ae60;
}

.btn-practice:disabled {
  background: #b2dfcc;
  cursor: not-allowed;
}

/* タイマーセクション */
.timer-section {
  background: #fff;
  border-radius: 10px;
  padding: 20px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  text-align: center;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 10px;
}

.slide-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
  min-height: 1.5em;
}

.timer-display {
  font-size: 3.5rem;
  font-weight: bold;
  letter-spacing: 2px;
  color: #4a90d9;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.timer-display.over {
  color: #e74c3c;
}

/* バー */
.time-bar-wrap {
  background: #eee;
  border-radius: 4px;
  height: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.time-bar {
  height: 100%;
  background: #4a90d9;
  width: 100%;
  transition: width 0.5s linear, background 0.3s;
  border-radius: 4px;
}

.time-bar.over {
  background: #e74c3c;
}

/* タイマーボタン */
.timer-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.timer-controls button {
  padding: 10px 20px;
  border: none;
  border-radius: 7px;
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: bold;
}

#startBtn {
  background: #4a90d9;
  color: #fff;
}

#startBtn:hover {
  background: #3579c4;
}

#startBtn.running {
  background: #e67e22;
}

#startBtn.running:hover {
  background: #cf6d17;
}

#nextBtn {
  background: #8e44ad;
  color: #fff;
}

#nextBtn:hover {
  background: #7d3c98;
}

#resetBtn {
  background: #ecf0f1;
  color: #555;
}

#resetBtn:hover {
  background: #dce0e1;
}

/* 完了メッセージ */
.finish-msg {
  font-size: 1.1rem;
  color: #2ecc71;
  font-weight: bold;
  padding: 12px;
}

@media (max-width: 420px) {
  .timer-display {
    font-size: 2.8rem;
  }

  .form-row {
    gap: 4px;
  }

  .form-row input[type="number"] {
    width: 48px;
  }
}
