/* 全体のリセットと基本フォント設定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
  background: #1e1e2f;
  color: #f0f0f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.app {
  background: #2a2a3d;
  border-radius: 16px;
  padding: 32px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  text-align: center;
}

h1 {
  font-size: 24px;
  margin-bottom: 24px;
}

/* タブボタン */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.tab-button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #3a3a52;
  color: #cfcfe0;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.tab-button.active {
  background: #6c5ce7;
  color: #fff;
}

/* パネル切り替え（非表示のパネルは表示しない） */
.panel {
  display: none;
}

.panel.active {
  display: block;
}

/* 時刻表示 */
.time-display {
  font-size: 48px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  margin: 24px 0;
  letter-spacing: 2px;
}

/* 時・分・秒の入力欄 */
.time-inputs {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.time-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-input-group label {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 4px;
}

.time-input-group input {
  width: 60px;
  padding: 8px;
  border-radius: 8px;
  border: none;
  text-align: center;
  font-size: 16px;
  background: #1e1e2f;
  color: #fff;
}

/* 操作ボタン */
.controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.controls button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #6c5ce7;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.controls button:hover:not(:disabled) {
  background: #5a4bd1;
}

.controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 時間切れ時の点滅演出 */
.time-display.finished {
  color: #ff6b6b;
  animation: blink 1s infinite;
}

@keyframes blink {
  50% { opacity: 0.3; }
}

/* ラップタイムのリスト */
.lap-list {
  margin-top: 20px;
  max-height: 160px;
  overflow-y: auto;
  list-style: none;
  text-align: left;
}

.lap-list li {
  padding: 6px 12px;
  border-bottom: 1px solid #3a3a52;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}
