/* ===== リセット・ベース ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

/* ===== アプリ全体 ===== */
.app {
  width: 100%;
  max-width: 480px;
  padding-bottom: 48px;
  transition: background 0.4s;
}

/* 終了時の背景 */
.app.finished {
  background: #e74c3c;
  color: #fff;
}

/* ===== ヘッダー ===== */
.header {
  background: #4a90d9;
  color: #fff;
  padding: 16px 20px;
  text-align: center;
}

.header h1 {
  font-size: 1.2rem;
  font-weight: bold;
}

.app.finished .header {
  background: #c0392b;
}

/* ===== タイマー表示 ===== */
.display-area {
  text-align: center;
  padding: 48px 20px 32px;
}

.time-display {
  font-size: 5rem;
  font-weight: bold;
  letter-spacing: 4px;
  color: #333;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.app.finished .time-display {
  color: #fff;
}

.status-msg {
  margin-top: 16px;
  font-size: 1.1rem;
  font-weight: bold;
  color: #e74c3c;
  min-height: 1.6em;
}

.app.finished .status-msg {
  color: #fff;
  font-size: 1.4rem;
}

/* ===== 入力エリア ===== */
.input-area {
  padding: 0 24px 24px;
}

.time-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.input-group input {
  width: 72px;
  height: 52px;
  font-size: 1.4rem;
  text-align: center;
  border: 2px solid #ccc;
  border-radius: 10px;
  background: #fff;
  outline: none;
  -moz-appearance: textfield;
}

.input-group input::-webkit-inner-spin-button,
.input-group input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.input-group input:focus {
  border-color: #4a90d9;
}

.input-group label {
  font-size: 0.8rem;
  color: #888;
}

.colon {
  font-size: 2rem;
  font-weight: bold;
  color: #999;
  margin-bottom: 20px;
}

/* 実行中は入力エリアを薄くする */
.input-area.locked input,
.input-area.locked .btn-preset {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== プリセットボタン ===== */
.presets {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* ===== 操作ボタン ===== */
.controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px;
}

/* ===== ボタン共通 ===== */
.btn {
  height: 52px;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn:active {
  opacity: 0.75;
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.3;
  cursor: default;
  transform: none;
}

.btn-preset {
  height: 44px;
  flex: 1;
  background: #e8f0fb;
  color: #4a90d9;
  font-size: 0.95rem;
}

.btn-start {
  background: #4a90d9;
  color: #fff;
}

.btn-pause {
  background: #f39c12;
  color: #fff;
}

.btn-reset {
  background: #ecf0f1;
  color: #555;
}

.app.finished .btn-start {
  background: #fff;
  color: #e74c3c;
}

/* ===== スマホ調整 ===== */
@media (max-width: 375px) {
  .time-display {
    font-size: 4rem;
  }

  .input-group input {
    width: 64px;
    font-size: 1.2rem;
  }
}
