:root {
  --bg: #0b1020;
  --bg2: #151d37;
  --card: rgba(23, 31, 58, 0.82);
  --border: rgba(255, 255, 255, 0.1);
  --text: #edf2ff;
  --muted: #9fb0d4;
  --accent: #7c9cff;
  --accent-2: #8ef0d0;
  --done: #6f7b99;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --button-secondary-bg: rgba(255,255,255,0.09);
  --button-secondary-border: rgba(255,255,255,0.08);
  --input-bg: rgba(8, 12, 24, 0.55);
  --task-bg: rgba(255,255,255,0.045);
  --task-border: rgba(255,255,255,0.06);
}

body[data-theme="light"] {
  --bg: #eef3ff;
  --bg2: #dce6ff;
  --card: rgba(255, 255, 255, 0.82);
  --border: rgba(22, 30, 58, 0.12);
  --text: #18213b;
  --muted: #5d6b8e;
  --accent: #4b6fff;
  --accent-2: #00b894;
  --done: #8e98b3;
  --shadow: 0 24px 70px rgba(72, 96, 160, 0.18);
  --button-secondary-bg: rgba(24, 33, 59, 0.06);
  --button-secondary-border: rgba(24, 33, 59, 0.1);
  --input-bg: rgba(255,255,255,0.9);
  --task-bg: rgba(255,255,255,0.7);
  --task-border: rgba(24, 33, 59, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(124, 156, 255, 0.22), transparent 35%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

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

.timer-card,
.tasks-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.timer-card {
  padding: 28px 28px 24px;
  text-align: center;
  margin-bottom: 24px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.timer-label {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0;
}

.theme-toggle {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  border: 1px solid var(--button-secondary-border);
  background: var(--button-secondary-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

.theme-toggle:active {
  transform: scale(0.98);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(124, 156, 255, 0.5);
  outline-offset: 3px;
}

.timer-display {
  font-size: clamp(64px, 14vw, 136px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.05em;
  margin: 0 0 18px;
}

.duration-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.duration-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.duration-input {
  width: 104px;
  border: 1px solid var(--button-secondary-border);
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.duration-input:focus {
  border-color: rgba(124, 156, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.16);
}

.duration-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

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

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #a38bff);
  color: white;
}
.btn-secondary {
  background: var(--button-secondary-bg);
  color: var(--text);
  border: 1px solid var(--button-secondary-border);
}
.timer-hint {
  color: var(--muted);
  font-size: 14px;
  margin-top: 14px;
}

.tasks-card {
  padding: 24px;
}

.input-label,
.section-title {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}

.task-input {
  width: 100%;
  border: 1px solid var(--button-secondary-border);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--text);
  padding: 16px 18px;
  font: inherit;
  font-size: 16px;
  margin-bottom: 22px;
  outline: none;
}
.task-input:focus {
  border-color: rgba(124, 156, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(124, 156, 255, 0.16);
}

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

.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 40px;
}

.task-item {
  background: var(--task-bg);
  border: 1px solid var(--task-border);
  border-radius: 16px;
  padding: 14px 16px;
}

.task-row {
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.task-check {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-2);
  flex: 0 0 auto;
}

.task-text {
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}

.completed .task-item {
  opacity: 0.6;
}
.completed .task-text {
  text-decoration: line-through;
  color: var(--done);
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 20px, 920px);
    padding-top: 20px;
  }

  .timer-card,
  .tasks-card {
    border-radius: 20px;
  }

  .tasks-columns {
    grid-template-columns: 1fr;
  }

  .theme-toggle {
    width: 56px;
    height: 56px;
    font-size: 26px;
  }
}
