* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

.container {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 420px;
  width: 100%;
  margin: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  text-align: center;
}

h1 {
  font-size: 1.4rem;
  color: #333;
  margin-bottom: 24px;
}

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

.mode-btn {
  padding: 8px 14px;
  border: 2px solid #ddd;
  border-radius: 20px;
  background: #fff;
  color: #555;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn:hover {
  border-color: #aaa;
}

.mode-btn.active {
  background: var(--accent, #e74c3c);
  border-color: var(--accent, #e74c3c);
  color: #fff;
  font-weight: bold;
}

.timer-display {
  font-size: 5rem;
  font-weight: bold;
  color: var(--accent, #e74c3c);
  letter-spacing: 2px;
  margin-bottom: 16px;
  line-height: 1;
}

.progress-bar-wrap {
  background: #eee;
  border-radius: 4px;
  height: 8px;
  margin-bottom: 28px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent, #e74c3c);
  width: 100%;
  transition: width 1s linear;
  border-radius: 4px;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}

.ctrl-btn {
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  background: var(--accent, #e74c3c);
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
  min-width: 120px;
}

.ctrl-btn:hover {
  opacity: 0.85;
}

.ctrl-btn.secondary {
  background: #aaa;
}

.session-info {
  font-size: 0.9rem;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#session-count {
  font-weight: bold;
  font-size: 1.1rem;
  color: #333;
}

.reset-sessions {
  border: none;
  background: none;
  color: #aaa;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.reset-sessions:hover {
  color: #555;
}

/* モード別アクセントカラー */
body.work   { --accent: #e74c3c; }
body.short  { --accent: #27ae60; }
body.long   { --accent: #2980b9; }

@media (max-width: 400px) {
  .timer-display { font-size: 4rem; }
  .ctrl-btn { padding: 12px 20px; min-width: 100px; }
}
