/* 인터벌 운동 타이머 전용 스타일 */

nav { max-width: 820px; }
main { max-width: 820px; }

/* 프리셋 바 */
.presets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.95rem;
}
.presets-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-sub);
  margin-right: 0.2rem;
}
.preset-btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface);
}

/* 설정 카드 */
.settings-card {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.95rem;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.set-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.set-field.work {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.05);
}
.set-field.rest {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.05);
}
.set-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-sub);
  min-width: 60px;
}
.set-field input[type="number"] {
  flex: 1;
  width: 50px;
  min-width: 0;
  padding: 0.35rem 0.4rem;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  -moz-appearance: textfield;
}
.set-field input[type="number"]::-webkit-outer-spin-button,
.set-field input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.set-field input:focus {
  border-color: var(--primary);
}
.set-unit {
  font-size: 0.78rem;
  color: var(--text-sub);
  white-space: nowrap;
}

.opt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-bottom: 0.6rem;
}
.opt-chk {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.opt-chk input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.total-line {
  font-size: 0.85rem;
  color: var(--text-sub);
  text-align: right;
}
.total-line strong {
  color: var(--text);
  font-weight: 700;
  margin-left: 0.25rem;
}

/* 실행 영역 */
.run-stage {
  padding: 2rem 1.5rem 1.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  margin-bottom: 1.5rem;
  text-align: center;
  transition: all 0.25s;
}

.run-stage.phase-prep {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
}
.run-stage.phase-work {
  background: rgba(34, 197, 94, 0.1);
  border-color: #22c55e;
}
.run-stage.phase-rest, .run-stage.phase-setrest {
  background: rgba(59, 130, 246, 0.08);
  border-color: #3b82f6;
}
.run-stage.phase-done {
  background: rgba(102, 126, 234, 0.1);
  border-color: var(--primary);
}

.phase-tag {
  display: inline-block;
  padding: 0.4rem 1.1rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-sub);
  border: 1px solid var(--border);
  margin-bottom: 0.85rem;
}
.run-stage.phase-prep .phase-tag {
  background: #f59e0b;
  color: #fff;
  border-color: #f59e0b;
}
.run-stage.phase-work .phase-tag {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}
.run-stage.phase-rest .phase-tag, .run-stage.phase-setrest .phase-tag {
  background: #3b82f6;
  color: #fff;
  border-color: #3b82f6;
}
.run-stage.phase-done .phase-tag {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.big-time {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--text-sub);
  transition: width 0.1s linear, background 0.25s;
}
.run-stage.phase-prep .progress-fill { background: #f59e0b; }
.run-stage.phase-work .progress-fill { background: #22c55e; }
.run-stage.phase-rest .progress-fill, .run-stage.phase-setrest .progress-fill { background: #3b82f6; }
.run-stage.phase-done .progress-fill { background: var(--primary); }

.run-meta {
  font-size: 0.95rem;
  color: var(--text-sub);
  font-weight: 600;
  margin-bottom: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.run-controls {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
}

.btn-go {
  min-width: 140px;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s;
  font-family: inherit;
}
.btn-go:hover {
  filter: brightness(1.08);
}

.btn-reset {
  padding: 0.85rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--text-sub);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-reset:hover {
  border-color: var(--text-sub);
  color: var(--text);
}

@media (max-width: 480px) {
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .set-label { min-width: 0; font-size: 0.66rem; }
  .run-stage { padding: 1.5rem 1rem 1.2rem; }
}
