body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #fef6f0, #fbeee6);
  color: #4a3227;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.app-header {
  padding: 24px 0 8px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

main {
  width: 100%;
  max-width: 480px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(163, 90, 58, 0.1);
}

.mode-switch {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.mode-btn {
  border: none;
  background: #f5e6dd;
  color: #a35a3a;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.mode-btn:hover {
  background: #f0d8c8;
}

.mode-btn.active {
  background: #e8734a;
  color: #fff;
}

.timer-display {
  text-align: center;
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 16px 0;
  color: #e8734a;
  font-variant-numeric: tabular-nums;
}

.timer-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.timer-controls button {
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}

.timer-controls button:active {
  transform: scale(0.96);
}

#start-btn {
  background: #e8734a;
  color: #fff;
}

#start-btn:hover {
  background: #d9603a;
}

#pause-btn, #reset-btn {
  background: #f5e6dd;
  color: #a35a3a;
}

#pause-btn:hover, #reset-btn:hover {
  background: #f0d8c8;
}

#stats-section h2 {
  margin-top: 0;
}

.stats-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  flex: 1;
  background: #fdf3ec;
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: #e8734a;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: #a35a3a;
  margin-top: 4px;
}

.stats-chart {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 110px;
  margin-bottom: 20px;
  padding: 0 4px;
}

.chart-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.chart-bar {
  width: 18px;
  background: #e8734a;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}

.chart-label {
  font-size: 0.68rem;
  color: #a35a3a;
  text-transform: capitalize;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fdf3ec;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.history-type {
  font-weight: 600;
  color: #e8734a;
}

.history-time {
  color: #a35a3a;
  font-size: 0.78rem;
}

.history-empty {
  justify-content: center;
  color: #c9a794;
  background: none;
}
