/* ══════════════════════════════════════════════
   공부 타이머 (ver4 신규) — front-timer.css
   타이머 선택 허브 / 스톱워치 / 파이 타이머 공용
   ══════════════════════════════════════════════ */

:root {
  --gauge:  var(--mint);
  --needle: var(--navy);
}

/* ══════════ 상단 헤더 영역 (3페이지 공용) ══════════ */
.top-area {
  background: var(--white);
  position: relative;
  overflow: hidden;
  padding: 40px 24px 48px;
  text-align: center;
}

.top-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--gray-line) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: 0.3;
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto 32px;
}

/* 실제 진행 중인 화면(스톱워치·파이 타이머)에만 노출.
   단순 선택 화면(타이머 선택)은 상단 nav로 충분해 제거 */
.back-btn {
  position: absolute;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-text);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.18s;
  text-decoration: none;
}
.back-btn:hover { color: var(--navy); }

.top-nav-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  opacity: 0.55;
}

.top-heading {
  position: relative;
  z-index: 2;
  font-size: 32px;
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.top-heading .em { color: var(--mint-dark); }

.top-sub {
  position: relative;
  z-index: 2;
  font-size: 15px;
  color: var(--gray-text);
  margin-top: 10px;
}

.gradient-divider {
  height: 40px;
  background: linear-gradient(to bottom, var(--white) 0%, var(--gray-bg) 100%);
}

/* ══════════ 타이머 선택 ══════════ */
.timer-select-section {
  max-width: 700px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.timer-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.timer-card {
  display: block;
  background: var(--white);
  border-radius: 20px;
  padding: 44px 24px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.timer-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.timer-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 18px;
}
.timer-icon img { width: 100%; height: 100%; object-fit: contain; }

.timer-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 8px;
}

.timer-desc {
  font-size: 13px;
  color: var(--gray-text);
  line-height: 1.6;
  margin-bottom: 18px;
}

.timer-btn-go {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 20px;
  border-radius: 20px;
  background: var(--mint);
  color: var(--white);
}

/* ══════════ 스톱워치 ══════════ */
.stopwatch-section {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 56px 24px 72px;
  text-align: center;
}

.sw-display {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  color: var(--navy);
  background: var(--white);
  border-radius: 24px;
  padding: 48px 32px;
  width: 100%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  margin-bottom: 40px;
}

.sw-mute-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-border);
  background: var(--white);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s, background 0.18s;
}
.sw-mute-btn:hover { border-color: var(--gray-line); background: var(--gray-bg); }

.sw-time  { font-size: 68px; font-weight: 900; letter-spacing: -1px; }
.sw-centi { font-size: 30px; font-weight: 800; color: var(--gray-text); }

.sw-controls { display: flex; gap: 14px; justify-content: center; }

.sw-btn {
  flex: 1;
  max-width: 200px;
  padding: 18px;
  border-radius: 14px;
  border: none;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.18s, filter 0.18s;
}
.sw-btn:active { transform: scale(0.97); }

.sw-btn-start { background: var(--mint); color: var(--white); }
.sw-btn-start:hover { filter: brightness(0.95); }
.sw-btn-start.is-running { background: var(--navy); }

.sw-btn-reset {
  background: var(--white);
  color: var(--gray-text);
  border: 1.5px solid var(--gray-border);
}
.sw-btn-reset:hover { color: var(--navy); border-color: var(--gray-line); }
.sw-btn-reset:disabled { opacity: 0.4; cursor: not-allowed; }

/* ══════════ 파이 타이머 ══════════ */
.timer-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.timer-layout {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
}

.timer-display-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.timer-face-wrap { width: 300px; height: 300px; }
.timer-face-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }

.face-circle  { fill: var(--white); stroke: var(--gray-border); stroke-width: 2; }
.gauge-sector { fill: var(--gauge); opacity: 0.9; }
.tick-major   { stroke: var(--navy); stroke-width: 2.5; }
.tick-minor   { stroke: var(--gray-line); stroke-width: 1.5; }
.tick-num     { font-size: 15px; font-weight: 800; fill: var(--navy); text-anchor: middle; dominant-baseline: middle; font-family: inherit; }
.needle       { stroke: var(--needle); stroke-width: 3; stroke-linecap: round; }
.center-dot   { fill: var(--navy); }

.timer-digital {
  font-family: 'Consolas', 'DejaVu Sans Mono', 'Courier New', monospace;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.timer-controls { display: flex; gap: 14px; }
.timer-btn {
  padding: 16px 28px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.18s, filter 0.18s;
}
.timer-btn:active { transform: scale(0.97); }
.timer-btn-toggle { background: var(--mint); color: var(--white); }
.timer-btn-toggle:hover:not(:disabled) { filter: brightness(0.95); }
.timer-btn-toggle.is-running { background: var(--navy); }
.timer-btn-toggle:disabled { background: var(--gray-border); color: var(--gray-text); cursor: not-allowed; }
.timer-btn-reset { background: var(--white); color: var(--gray-text); border: 1.5px solid var(--gray-border); }
.timer-btn-reset:hover:not(:disabled) { color: var(--navy); border-color: var(--gray-line); }
.timer-btn-reset:disabled { opacity: 0.4; cursor: not-allowed; }

/* 설정 패널 */
.timer-settings-col {
  width: 100%;
  max-width: 320px;
  background: var(--white);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.settings-group-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--gray-text);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.quick-time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-time-btn {
  padding: 10px 0;
  border-radius: 10px;
  border: 1.5px solid var(--gray-border);
  background: var(--white);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.quick-time-btn:hover:not(:disabled) { border-color: var(--mint); background: var(--mint-light); color: var(--mint-dark); }
.quick-time-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.direct-input-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.direct-input-row input {
  width: 56px; padding: 10px 6px;
  border-radius: 10px; border: 1.5px solid var(--gray-border);
  font-size: 15px; font-weight: 700; text-align: center;
  font-family: inherit; color: var(--navy);
}
.direct-input-row input:disabled { opacity: 0.5; cursor: not-allowed; }
.direct-input-row span { color: var(--gray-text); font-weight: 700; font-size: 13px; }
.timer-btn-apply {
  margin-left: auto;
  padding: 10px 14px;
  border-radius: 10px; border: none;
  background: var(--mint-dark); color: var(--white);
  font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: filter 0.15s;
}
.timer-btn-apply:hover:not(:disabled) { filter: brightness(0.95); }
.timer-btn-apply:disabled { opacity: 0.4; cursor: not-allowed; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.toggle-row-label { font-size: 14px; font-weight: 600; color: var(--navy); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0; background: var(--gray-border);
  border-radius: 24px; cursor: pointer; transition: 0.2s;
}
.switch-track::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: var(--white); border-radius: 50%;
  transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-track { background: var(--mint); }
.switch input:checked + .switch-track::before { transform: translateX(20px); }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 600px) {
  .top-heading { font-size: 26px; }

  .timer-select-section { padding: 40px 16px 52px; }
  .timer-options { grid-template-columns: 1fr; gap: 16px; }
  .timer-card { padding: 32px 20px; }

  .stopwatch-section { padding: 40px 16px 52px; }
  .sw-display { padding: 36px 20px; }
  .sw-time { font-size: 48px; }
  .sw-centi { font-size: 22px; }
  .sw-btn { padding: 16px; font-size: 15px; }

  .timer-section { padding: 40px 16px 52px; }
  .timer-face-wrap { width: 260px; height: 260px; }
  .timer-digital { font-size: 26px; }
  .timer-btn { padding: 14px 22px; font-size: 15px; }
}
