:root {
  --bg: #eff6f2;
  --surface: #f9fdfb;
  --text: #1b2520;
  --muted: #5a6e65;
  --border: #c8ddd3;
  --primary: #1f8a70;
  --primary-deep: #166a55;
  --primary-soft: #cdebe1;
  --shadow: 0 10px 22px rgba(26, 82, 63, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  height: 100vh;
  overflow: hidden;
}

body.timer-paused-invert {
  filter: invert(1) hue-rotate(180deg) saturate(0.3) contrast(1.06);
}

body.timer-paused-invert #stats-break {
  filter: invert(1) hue-rotate(180deg) saturate(3.34) contrast(0.94);
}

h1, h2, h3 { margin: 0; font-family: "Newsreader", serif; }

.container { width: min(1160px, 94vw); margin: 0 auto; }

.topbar {
  height: 70px;
  border-bottom: 1px solid var(--border);
  background: rgba(239, 246, 242, 0.94);
}

.topbar-inner { height: 100%; display: flex; align-items: center; }

.brand-wrap {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 1.2vw, 0.65rem);
}

.topbar-logo {
  width: clamp(30px, 4vw, 40px);
  height: clamp(30px, 4vw, 40px);
  object-fit: contain;
  border-radius: 8px;
  background: #f6fbf9;
  border: 1px solid #b8ddcf;
  padding: 3px;
}

.brand-title {
  color: var(--primary);
  font-family: "Manrope", sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  line-height: 1.05;
}

.kicker {
  margin: 0 0 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--primary);
}

.btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.62rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn,
.task-actions button,
.flow-mode-btn,
.sfx-btn,
.tasks-collapse-btn {
  transition: transform 0.18s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.btn:hover,
.task-actions button:hover,
.flow-mode-btn:hover,
.sfx-btn:hover,
.tasks-collapse-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.btn:active,
.task-actions button:active,
.flow-mode-btn:active,
.sfx-btn:active,
.tasks-collapse-btn:active {
  transform: translateY(0) scale(0.98);
}
.btn-primary { background: linear-gradient(130deg, var(--primary), var(--primary-deep)); color: #fff; }
.btn-secondary { border-color: #a7d5c5; background: #ecf8f3; color: #1d6652; }
.btn-stop { background: linear-gradient(130deg, #e38b5b, #cf5a3a); color: #fff; }
.btn-danger {
  border-color: #e39a9a;
  background: #fff;
  color: #b23434;
}

.app-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: calc(100vh - 70px);
  position: relative;
}

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

.app-grid.tasks-collapsed .tasks-panel {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  border-right: 0;
}

.tasks-collapse-btn {
  position: absolute;
  top: 1rem;
  left: calc(360px - 17px);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #9ecfbd;
  background: #f1fbf7;
  color: #1f735b;
  font-weight: 800;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 8px 16px rgba(31, 115, 91, 0.16);
  transition: all 0.2s ease;
}

.tasks-collapse-btn:hover {
  transform: translateY(-1px);
}

.app-grid.tasks-collapsed .tasks-collapse-btn {
  left: 0.75rem;
}

.app-grid.tasks-collapsed .timer-panel {
  align-items: center;
}

.panel { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }

.tasks-panel {
  border-radius: 0;
  border-right: 1px solid var(--border);
  border-left: 0;
  border-top: 0;
  border-bottom: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
}

.panel-head {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-list {
  margin: 0;
  padding: 0.8rem;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: auto;
  min-height: 0;
  align-items: stretch;
}

.task-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  padding: 0.65rem;
  display: grid;
  gap: 0.45rem;
  cursor: grab;
  height: fit-content;
}
.task-item.active { border-color: #67b9a2; box-shadow: 0 0 0 2px #d7efe7; }
.task-item.completed { opacity: 0.55; background: #eef2f1; }

.task-top { display: flex; justify-content: space-between; gap: 0.4rem; align-items: center; }
.task-name { font-weight: 700; }
.task-name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.task-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #79bca8;
  flex: 0 0 auto;
}
.task-dot.filled {
  background: #46a487;
  border-color: #46a487;
}
.task-meta { font-size: 0.82rem; color: var(--muted); }

.task-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.task-actions button {
  font-size: 0.72rem;
  padding: 0.33rem 0.68rem;
  border-radius: 999px;
  border: 1px solid #cbe2d9;
  background: #fbfefd;
  color: #36594d;
  cursor: pointer;
  transition: all 0.18s ease;
}

.task-actions button:hover {
  border-color: #8ec9b6;
  background: #eef8f4;
  color: #1e6b54;
  transform: translateY(-1px);
}

.task-actions button[data-action="delete"] {
  border-color: #e4c7c7;
  color: #8a4a4a;
}

.task-actions button[data-action="delete"]:hover {
  border-color: #d39f9f;
  background: #fff4f4;
  color: #7d2626;
}

.panel-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
}
.panel-footer .btn { flex: 1; }

.timer-panel {
  border-radius: 0;
  border: 0;
  padding: 0.35rem 1.8rem 1.6rem;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stats-card {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 25;
  width: min(220px, 32vw);
  background: linear-gradient(160deg, #f8fcfa, #eaf6f1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.85rem;
  text-align: left;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: width 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border-bottom: 1px solid #cfe4dc;
  padding-bottom: 0.55rem;
  margin-bottom: 0.5rem;
}

.stats-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #d8efe7;
  color: #1a6f58;
  font-size: 0.95rem;
}

.stats-title {
  margin: 0;
  font-weight: 700;
  color: #173f33;
  font-size: 0.92rem;
}

.stats-subtitle {
  margin: 0.05rem 0 0;
  color: #4f7568;
  font-size: 0.76rem;
}

.stats-card-body p {
  margin: 0.35rem 0;
  color: #32473f;
  font-size: 0.9rem;
  border: 1px solid #cfe4dc;
  background: #f5fbf8;
  border-radius: 999px;
  padding: 0.45rem 0.62rem;
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  display: none;
}

.stats-productivity-wrap {
  margin: 0.2rem 0 0.35rem;
  display: none;
}

.stats-productivity-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2efe9;
  overflow: hidden;
  border: 1px solid #c6ddd3;
}

.stats-productivity-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d14848 0%, #dcbf46 52%, #36a46d 100%);
  transition: width 0.25s ease, background-color 0.25s ease;
}

.stats-card.break-active #stats-break {
  display: inline-flex;
}

.stats-card.break-active #stats-productivity {
  display: inline-flex;
}

.stats-card.break-active .stats-productivity-wrap {
  display: block;
}

.stats-card:hover,
.stats-card:focus-visible {
  width: min(340px, 40vw);
}

.stats-card.timer-running:not(:hover):not(:focus-visible) .stats-card-body p {
  display: none;
}

.stats-card:hover .stats-card-body p,
.stats-card:focus-visible .stats-card-body p {
  display: inline-flex;
}

.stats-card:hover .stats-productivity-wrap,
.stats-card:focus-visible .stats-productivity-wrap {
  display: block;
}

.stats-card.break-active #stats-break {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgba(31, 138, 112, 0.18);
  border-color: #96d6c2;
  background: #e9f8f2;
  animation: breakPulse 1.15s ease-in-out infinite;
}

.timer-empty {
  margin-top: 0.2rem;
  margin-left: auto;
  margin-right: auto;
  width: min(760px, 100%);
}

.timer-view {
  margin-top: 0.15rem;
  max-width: 760px;
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  position: relative;
  padding-top: 2.35rem;
}

.task-header-chips {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  margin-top: 0.2rem;
  margin-bottom: 1rem;
}

.task-chip {
  margin: 0;
  border: 1px solid #b8ddd0;
  border-radius: 999px;
  background: #f4fbf8;
  box-shadow: 0 8px 18px rgba(29, 103, 82, 0.14);
  padding: 0.48rem 1.15rem;
}


.timer-view .clock {
  font-family: "Manrope", sans-serif;
  font-size: clamp(2.5rem, 8vw, 6.2rem);
  margin-top: 0.45rem;
  line-height: 1;
}

#current-task-name {
  font-size: clamp(1.85rem, 4.3vw, 3.3rem);
  padding: 0.8rem 2rem;
  border-color: #8ec9b6;
  background: linear-gradient(160deg, #f6fdf9, #e6f6ef);
}

#current-task-order {
  font-size: 1rem;
  color: #2f5f50;
}

.kicker.task-chip {
  margin-bottom: 0;
  letter-spacing: 0.08em;
}

.muted { color: var(--muted); }

.progress-status {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #275f4f;
}

.progress-track {
  width: 100%;
  border-radius: 999px;
  background: #dbeee7;
  height: 14px;
  overflow: hidden;
  margin: 0.8rem 0 0.9rem;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(130deg, var(--primary), var(--primary-deep));
}

.initiation-overlay {
  margin: 0;
  padding: 0.4rem 0.7rem 0.5rem;
  border-radius: 12px;
  border: 1px solid #98d0be;
  background: linear-gradient(145deg, #f1fbf7, #ddf2ea);
  width: min(500px, 84%);
  position: absolute;
  top: -0.35rem;
  left: 50%;
  transform: translateX(-50%);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.initiation-title {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.025em;
  color: #1e6f58;
}

.initiation-text {
  margin: 0.1rem 0;
  color: #2f5a4d;
}

.initiation-time {
  margin: 0.18rem auto 0;
  color: #1f8a70;
  font-weight: 700;
  font-size: 0.92rem;
  min-width: 68px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid #89ccb5;
  background: radial-gradient(circle at 30% 30%, #ffffff, #ebf9f3);
  box-shadow: 0 8px 16px rgba(31, 138, 112, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  padding: 0.2rem 0.5rem;
}

.initiation-overlay.ticking {
  animation: initiationPulse 1.15s ease-in-out infinite;
}

.initiation-overlay.ticking:hover {
  transform: translateX(-50%) translateY(-2px) scale(1.01);
  box-shadow: 0 10px 22px rgba(31, 138, 112, 0.2);
}

.initiation-overlay.grace {
  border-color: #58a88f;
  background: repeating-linear-gradient(
    -45deg,
    #e7f8f1 0,
    #e7f8f1 12px,
    #d7f0e6 12px,
    #d7f0e6 24px
  );
  animation: initiationGrace 0.65s steps(2, end) infinite;
}

@keyframes initiationPulse {
  0%,
  100% {
    box-shadow: 0 6px 14px rgba(31, 138, 112, 0.2);
  }
  50% {
    box-shadow: 0 12px 24px rgba(31, 138, 112, 0.3);
  }
}

@keyframes initiationGrace {
  0% {
    transform: translateX(-50%);
    filter: saturate(1);
  }
  25% {
    transform: translateX(calc(-50% - 2px));
  }
  50% {
    transform: translateX(calc(-50% + 2px));
    filter: saturate(1.2);
  }
  75% {
    transform: translateX(calc(-50% - 1px));
  }
  100% {
    transform: translateX(-50%);
    filter: saturate(1);
  }
}

.controls {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: center;
}

.controls .btn {
  min-width: 130px;
  font-size: 1rem;
  padding: 0.78rem 1.05rem;
}

.task-session-times {
  margin: 0.6rem 0 0;
  font-size: 0.62rem;
  color: #2f6655;
  font-weight: 600;
}

.summary { margin-top: 1.3rem; max-width: 760px; }
.summary-card { padding: 1rem 1.2rem; border-radius: 14px; }

.hidden { display: none !important; }

.gpt-copy-toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 140;
  width: min(760px, 92vw);
  padding: 0.72rem 0.95rem;
  border-radius: 12px;
  border: 1px solid #9fceb9;
  background: rgba(246, 255, 251, 0.97);
  color: #1f5d4a;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(20, 85, 65, 0.2);
  text-align: center;
  backdrop-filter: blur(6px);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 25, 20, 0.62);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 100;
}

.modal {
  width: min(560px, 96vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
}

.start-modal {
  width: min(900px, 94vw);
  min-height: min(620px, 84vh);
  align-content: space-between;
  justify-items: center;
  text-align: center;
  gap: 1.2rem;
}

.start-modal h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.start-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-top: 0.5rem;
}

.start-actions {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

.start-actions .btn {
  min-width: 210px;
  padding: 0.95rem 1.3rem;
  font-size: 1.06rem;
}

.start-options {
  display: grid;
  gap: 0.6rem;
  justify-items: stretch;
  width: min(560px, 100%);
  margin-top: 0.35rem;
}

.start-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #2f5a4d;
  font-weight: 600;
  border: 1px solid #b8ddcf;
  background: #f3fbf7;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  width: 100%;
  justify-content: flex-start;
}

.start-check input {
  width: 18px;
  height: 18px;
  accent-color: #1f8a70;
  flex: 0 0 auto;
  margin: 0;
}

.start-check span {
  display: inline-block;
  line-height: 1.2;
  text-align: left;
}

.made-by {
  margin-top: auto;
  color: #3e6559;
  font-weight: 600;
  animation: madeByFloat 2.8s ease-in-out infinite;
}

.modal label { font-size: 0.9rem; font-weight: 600; }
.modal input:not([type="checkbox"]), .modal textarea {
  margin-top: 0.3rem;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font: inherit;
}


.duration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.duration-field {
  display: grid;
  gap: 0.25rem;
}

.duration-field input[type="number"] {
  appearance: auto;
}

.transfer-textarea {
  min-height: 220px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}


.summary-modal {
  width: min(1020px, 96vw);
  min-height: min(700px, 90vh);
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 1rem;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, #fcfffd, #eef8f3),
    repeating-linear-gradient(
      0deg,
      rgba(32, 96, 77, 0.05) 0px,
      rgba(32, 96, 77, 0.05) 1px,
      transparent 1px,
      transparent 18px
    );
  animation: receiptPop 420ms ease;
}

.summary-emoji {
  margin: 0;
  font-size: 2rem;
  animation: emojiBounce 1.4s ease-in-out infinite;
}

.summary-title {
  font-size: clamp(2rem, 4.8vw, 3.6rem);
  line-height: 1.05;
  margin: 0;
}

.task-complete-modal {
  width: min(700px, 92vw);
  text-align: center;
  gap: 0.85rem;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.96), rgba(238, 249, 243, 0.95)),
    linear-gradient(180deg, #fcfffd, #edf8f2);
  box-shadow: 0 18px 40px rgba(18, 72, 57, 0.24);
  animation: taskCompletePop 360ms ease;
}

.task-complete-emoji {
  margin: 0;
  font-size: 2.4rem;
  animation: taskCompleteFlame 1.2s ease-in-out infinite;
}

.task-complete-subtitle {
  margin: 0;
  color: #2d5f4f;
  font-weight: 700;
}

.task-complete-progress {
  margin: 0;
  color: #2b6f59;
  font-weight: 600;
}

.task-complete-quote {
  margin: 0.3rem auto 0.15rem;
  width: min(560px, 92%);
  color: #355f52;
  font-style: italic;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #cfe5dc;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
}

.task-complete-modal.fading {
  animation: taskCompleteFadeOut 420ms ease forwards;
}

.task-complete-actions {
  width: 100%;
  justify-content: center;
}

.task-complete-modal::before,
.summary-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  /* Masked padding = visible animated ring thickness */
  padding: 8px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.task-complete-modal::before {
  background: conic-gradient(
    from 0deg,
    #ff8a00,
    #ffd38f,
    #ffffff,
    #ffb347,
    #ff6a00,
    #fff1d4,
    #ff8a00
  );
  background-size: 260% 260%;
  animation: flameBorderFlow 2.4s ease-in-out infinite alternate;
}

.summary-modal::before {
  background: conic-gradient(
    from 0deg,
    #ff4d4d,
    #ff9f1c,
    #ffe66d,
    #4ecdc4,
    #5b8cff,
    #9b5de5,
    #ff4d4d
  );
  background-size: 260% 260%;
  animation: rainbowBorderFlow 2.8s ease-in-out infinite alternate;
}

.task-complete-modal > *,
.summary-modal > * {
  position: relative;
  z-index: 1;
}

.receipt-lines {
  width: min(620px, 88%);
  border: 1px dashed #9bc8b8;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.75);
}

.summary-grid {
  width: min(980px, 94%);
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(460px, 1.25fr);
  gap: 1rem;
  align-items: start;
}

.summary-grid .receipt-lines {
  width: 100%;
}

.summary-tasks {
  border: 1px dashed #9bc8b8;
  border-radius: 12px;
  padding: 0.5rem 0.58rem;
  background: rgba(255, 255, 255, 0.75);
  text-align: left;
  max-height: none;
  overflow: visible;
}

.summary-tasks h3 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: #245c4a;
}

.summary-task-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.24rem;
}

.summary-task-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: center;
  padding: 0.26rem 0.38rem;
  border-radius: 7px;
  border: 1px solid #d2e8df;
  background: #fcfffe;
}

.summary-task-main {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.summary-task-name {
  font-weight: 700;
  color: #1f5444;
  font-size: 0.8rem;
  line-height: 1.05;
  white-space: nowrap;
}

.summary-task-status {
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.summary-task-status.completed {
  color: #287150;
}

.summary-task-status.incomplete {
  color: #9a5b38;
}

.summary-task-times {
  font-size: 0.48rem;
  color: #486b5f;
  white-space: nowrap;
}

.task-complete-times {
  margin: -0.1rem 0 0.1rem;
  color: #3f6e5f;
  font-size: 0.58rem;
  font-weight: 600;
}

.summary-task-work {
  font-size: 0.68rem;
  color: #2f6955;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 840px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

.receipt-lines p {
  margin: 0;
  padding: 0.62rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dotted #bddfd2;
  text-align: left;
}

.receipt-lines p:last-child {
  border-bottom: 0;
}

.receipt-lines span {
  color: #3f6558;
  font-weight: 600;
}

.receipt-lines strong {
  color: #173c31;
  font-family: "Manrope", sans-serif;
  font-size: 1.05rem;
}

@keyframes receiptPop {
  from {
    transform: translateY(14px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes emojiBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes breakPulse {
  0%,
  100% {
    transform: scale(1.02);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes madeByFloat {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.78;
  }
  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@keyframes taskCompletePop {
  from {
    transform: translateY(16px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes taskCompleteFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

@keyframes taskCompleteFlame {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.08);
  }
}

@keyframes flameBorderFlow {
  0% { background-position: 0% 50%; filter: saturate(1); }
  100% { background-position: 100% 50%; filter: saturate(1.08); }
}

@keyframes rainbowBorderFlow {
  0% { background-position: 0% 50%; filter: saturate(1); }
  100% { background-position: 100% 50%; filter: saturate(1.1); }
}

@keyframes startStopPulse {
  0% { transform: scale(1); }
  45% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

#start-stop-btn.start-stop-click {
  animation: startStopPulse 260ms ease;
}

.modal-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.danger-row {
  width: 100%;
  border-top: 1px dashed #e1b8b8;
  margin-top: 0.25rem;
  padding-top: 0.8rem;
  display: flex;
  justify-content: center;
}

.floating-controls {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 0.55rem;
  align-items: center;
  z-index: 60;
}

.flow-mode-btn {
  border-radius: 10px;
  border: 1px solid #d8b28f;
  background: #fff8f2;
  color: #8b4c24;
  font-weight: 700;
  padding: 0.58rem 0.9rem;
  box-shadow: 0 8px 18px rgba(74, 43, 19, 0.14);
  cursor: pointer;
  transition: all 0.2s ease;
}

.flow-mode-btn:hover {
  transform: translateY(-1px);
}

.flow-mode-btn.active {
  border-color: #70c0a6;
  background: #ecfaf4;
  color: #1f735b;
  box-shadow: 0 10px 20px rgba(31, 115, 91, 0.2);
}

.motivation-btn {
  border-radius: 10px;
  border: 1px solid #c9b8de;
  background: #faf6ff;
  color: #5a3d82;
  font-weight: 700;
  padding: 0.58rem 0.9rem;
  box-shadow: 0 8px 18px rgba(90, 61, 130, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.motivation-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(90, 61, 130, 0.16);
}

.motivation-backdrop {
  z-index: 110;
}

.motivation-modal {
  width: fit-content;
  width: -moz-fit-content;
  max-width: min(920px, calc(96vw - 2rem));
  padding: 0.75rem 0.85rem;
  gap: 0.65rem;
  justify-items: center;
}

.motivation-video {
  display: block;
  width: auto;
  height: auto;
  max-width: min(920px, calc(96vw - 2rem));
  max-height: min(540px, 74vh);
  border-radius: 12px;
  background: #0d1815;
}

.motivation-actions {
  justify-content: center;
  width: 100%;
}

.sfx-btn {
  border-radius: 10px;
  border: 1px solid #9ecfbd;
  background: #f1fbf7;
  color: #1f735b;
  font-weight: 700;
  padding: 0.58rem 0.9rem;
  box-shadow: 0 8px 18px rgba(31, 115, 91, 0.14);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sfx-btn:hover {
  transform: translateY(-1px);
}

.sfx-btn.off {
  border-color: #d2c0a7;
  background: #fbf6ef;
  color: #8b6a45;
}

.sfx-panel {
  position: absolute;
  right: 15.5rem;
  bottom: 2.95rem;
  width: 240px;
  border: 1px solid #b8ddd0;
  border-radius: 12px;
  background: #f8fdfb;
  box-shadow: 0 12px 24px rgba(20, 76, 59, 0.18);
  padding: 0.65rem;
  display: grid;
  gap: 0.55rem;
}

.sfx-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.55rem;
  color: #255748;
  font-weight: 600;
  font-size: 0.88rem;
}

.sfx-slider-row {
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.sfx-slider-row input[type="range"] {
  width: 100%;
}

.sfx-slider-row strong {
  justify-self: end;
  color: #1f6a55;
}

@media (max-width: 980px) {
  body { overflow: auto; height: auto; }
  .app-grid { grid-template-columns: 1fr; height: auto; }
  .tasks-panel { min-height: 40vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .timer-panel { min-height: 60vh; }
  .tasks-collapse-btn { display: none; }
  .stats-card { position: static; width: 100%; margin-bottom: 1rem; }
  .timer-empty, .timer-view { margin-top: 0; }
  .floating-controls {
    right: 0.75rem;
    bottom: 0.75rem;
  }
  .sfx-panel {
    right: 13.8rem;
    bottom: 2.7rem;
  }
  .duration-grid {
    grid-template-columns: 1fr;
  }
  .start-actions .btn {
    width: 100%;
  }
}
