﻿:root {
  color-scheme: light;
  --bg: #f6f8ff;
  --surface: #ffffff;
  --surface-strong: #fbfcff;
  --text: #1d2433;
  --muted: #6d7892;
  --line: #dce4f7;
  --accent: #8b8cf6;
  --accent-strong: #6466d9;
  --accent-soft: #ecebff;
  --done: #55b8c8;
  --shadow: 0 24px 70px rgba(105, 121, 190, 0.16);
}

body.dark {
  color-scheme: dark;
  --bg: #111525;
  --surface: #171c2f;
  --surface-strong: #202642;
  --text: #f7f8ff;
  --muted: #aab5d6;
  --line: #333a60;
  --accent: #b7a7ff;
  --accent-strong: #d6ceff;
  --accent-soft: #28254d;
  --done: #7fd7e8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(145deg, rgba(139, 140, 246, 0.20), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background 180ms ease, color 180ms ease;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.topbar,
.workspace,
.panel-heading,
.timer-actions,
.stats-row,
.todo-form,
.todo-item {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.35rem, 7vw, 5.5rem);
  line-height: 0.94;
}

h2 {
  font-size: 1.55rem;
}

.theme-toggle,
.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
}

.theme-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sun-icon {
  display: none;
}

body.dark .moon-icon {
  display: none;
}

body.dark .sun-icon {
  display: block;
}

.workspace {
  align-items: stretch;
  gap: 20px;
}

.timer-panel,
.todo-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
}

.timer-panel {
  flex: 1.05;
  min-width: 0;
  padding: clamp(22px, 4vw, 40px);
}

.todo-panel {
  flex: 0.95;
  min-width: 320px;
  padding: 24px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 32px;
}

.mode-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.mode-tab.active {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.timer-ring {
  position: relative;
  width: min(100%, 430px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track,
.ring-progress {
  fill: none;
  stroke-width: 8;
}

.ring-track {
  stroke: var(--line);
}

.ring-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 300ms linear;
}

.time-display {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.time-display span {
  font-size: clamp(3.5rem, 11vw, 6.5rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.time-display small,
.stats-row small {
  color: var(--muted);
  font-weight: 700;
}

.timer-actions {
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.primary-btn {
  min-width: 150px;
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(139, 140, 246, 0.28);
}

.stats-row {
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.stats-row div {
  display: grid;
  min-width: 118px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  text-align: center;
}

.stats-row span {
  font-size: 1.35rem;
  font-weight: 800;
}

.panel-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.clear-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
}

.todo-form {
  gap: 8px;
  margin-bottom: 16px;
}

.todo-form input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.todo-form input:focus {
  border-color: var(--accent);
}

.todo-form button {
  flex: 0 0 48px;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: var(--surface);
  font-size: 1.5rem;
  font-weight: 700;
}

.todo-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.todo-item {
  gap: 12px;
  min-height: 54px;
  padding: 10px 8px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.todo-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--done);
}

.todo-title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.todo-item.done .todo-title {
  color: var(--muted);
  text-decoration: line-through;
}

.delete-btn {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
}

.delete-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.empty-state {
  display: none;
  margin: 24px 0 0;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.empty-state.visible {
  display: block;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 560px);
    padding: 20px 0;
  }

  .workspace {
    flex-direction: column;
  }

  .todo-panel {
    min-width: 0;
  }

  .mode-tabs {
    grid-template-columns: 1fr;
  }
}

