/* ---------- Таймер: циферблат, що заштриховується від краю до центру ---------- */

.timer { display: flex; flex-direction: column; align-items: center; gap: 26px; padding-top: 6px; }

.dial {
  --task: var(--accent);
  --hatch: color-mix(in srgb, var(--task) 78%, var(--text-hi));
  --hatch-2: color-mix(in srgb, var(--task) 55%, var(--text-hi));
  position: relative;
  width: min(80vw, 330px);
  aspect-ratio: 1;
  user-select: none;
}
.dial__svg { width: 100%; height: 100%; overflow: visible; display: block; }

.dial__paper { fill: var(--paper-raised); }
.dial__tick { stroke: var(--hairline); stroke-width: 1.3; stroke-linecap: round; }
.dial__tick--major { stroke: var(--text-lo); stroke-width: 1.8; }
.dial__tick.is-past { stroke: var(--hatch); }
.dial__outline { fill: none; stroke: var(--hairline); stroke-width: 1.6; }
.dial__hatch path { stroke: var(--hatch); stroke-linecap: round; }
.dial__hatch--b path { stroke: var(--hatch-2); }
.dial__front {
  fill: none;
  stroke: var(--hatch);
  stroke-width: 2;
  stroke-dasharray: 3 5;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.dial.is-running .dial__front { opacity: .9; }
.dial__mask-hole { transition: r 1s linear; }
.dial.no-anim .dial__mask-hole { transition: none; }

/* Текст стоїть на м'якому паперовому «сяйві», а не на суцільній плашці:
   штрихи доходять до самого центру й просвічують крізь нього, а ореол
   навколо літер тримає цифри читабельними на будь-якій щільності. */
.dial__center {
  --halo: var(--paper-raised);
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 56%;
  aspect-ratio: 1.7;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--halo) 70%, transparent) 45%, color-mix(in srgb, var(--halo) 25%, transparent) 78%, transparent 100%);
  transition: transform .4s var(--ease-spring);
  pointer-events: none;
}
.dial__center > * {
  text-shadow:
    0 0 2px var(--halo), 0 0 4px var(--halo), 0 0 8px var(--halo),
    1px 1px 0 var(--halo), -1px -1px 0 var(--halo), 1px -1px 0 var(--halo), -1px 1px 0 var(--halo);
}
.dial__kind {
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-lo);
}
.dial.is-running .dial__kind { color: var(--accent); }
.dial.is-overtime .dial__kind { color: var(--danger); }
.dial__time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(40px, 12vw, 56px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 2px 0 3px;
}
.dial__task {
  display: flex; align-items: center; gap: 7px; justify-content: center;
  font-size: 13.5px; color: var(--text-mid);
  max-width: 100%;
}
.dial__task span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dial__meta { font-size: 11.5px; color: var(--text-lo); margin-top: 3px; font-family: var(--font-mono); }

/* Галочка-винагорода */
.dial__check {
  position: absolute; left: 50%; top: -22px;
  width: 44px; height: 44px;
  transform: translate(-50%, -50%) scale(.6);
  opacity: 0;
  color: var(--ok);
  pointer-events: none;
}
.dial__check path { stroke-dasharray: 40; stroke-dashoffset: 40; }
.dial.is-complete .dial__check { animation: check-pop .5s var(--ease-spring) forwards; }
.dial.is-complete .dial__check path { animation: draw 0.55s .15s var(--ease-out) forwards; }
.dial.is-celebrating .dial__svg { animation: dial-bump .7s var(--ease-spring); }
.dial.is-celebrating .dial__center { animation: plate-bump .7s var(--ease-spring); }
@keyframes check-pop { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dial-bump { 0% { transform: scale(1); } 35% { transform: scale(1.045) rotate(-1.5deg); } 100% { transform: scale(1); } }
@keyframes plate-bump { 0% { transform: translate(-50%, -50%) scale(1); } 35% { transform: translate(-50%, -50%) scale(1.08); } 100% { transform: translate(-50%, -50%) scale(1); } }

/* Хвиля штрихів після завершення — «розчерк» навколо циферблата */
.dial__burst line { stroke: var(--hatch); stroke-linecap: round; opacity: 0; }
.dial.is-celebrating .dial__burst line { animation: burst .9s var(--ease-out) forwards; animation-delay: var(--d, 0s); }
@keyframes burst {
  0% { opacity: 0; stroke-dashoffset: var(--len); }
  30% { opacity: 1; }
  100% { opacity: 0; stroke-dashoffset: calc(var(--len) * -1); }
}

/* Форма запуску */
.timer-form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.task-input { position: relative; }
.task-input .input { padding: 14px 16px; font-size: 15.5px; border-radius: var(--radius-m); }

.duration { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.duration__opt {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 9px 6px 8px;
  background: var(--paper-raised);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-m);
  color: var(--text-mid);
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.duration__opt b { font-family: var(--font-mono); font-size: 16px; font-weight: 500; color: var(--text-hi); }
.duration__opt small { font-size: 11px; color: var(--text-lo); }
.duration__opt:hover { border-color: var(--hairline); }
.duration__opt.is-active { border-color: var(--accent); background: var(--accent-wash); }
.duration__opt.is-active b { color: var(--accent); }

.running-actions { width: 100%; max-width: 420px; display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; }

/* Картка «ваш день» під таймером */
.today {
  width: 100%; max-width: 420px;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 16px 14px;
}
.today__head { display: flex; align-items: center; gap: 10px; }
.today__head .today__stats { margin-left: auto; }
.today__head .icon-btn { margin: -4px -6px -4px 0; }
.today__stats { font-size: 12.5px; color: var(--text-mid); }
.today__stats b { font-family: var(--font-mono); font-weight: 500; color: var(--text-hi); }
.today__plan {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius-m);
  background: var(--ink-1);
  font-size: 13px;
}
.today__plan-label { font-size: 11px; color: var(--text-lo); text-transform: uppercase; letter-spacing: .06em; }
.today__plan-task { font-weight: 600; color: var(--text-hi); }
.today__plan .btn { margin-left: auto; }
.today__picks { display: flex; flex-wrap: wrap; gap: 6px; }

/* Картка винагороди */
.reward {
  width: 100%; max-width: 420px;
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: var(--radius-l);
  background: var(--paper-raised);
  border: 1px solid color-mix(in srgb, var(--ok) 45%, var(--hairline-soft));
  box-shadow: var(--shadow-2);
  animation: reward-in .55s var(--ease-spring);
}
.reward::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ok) 14%, transparent) 0 1.2px, transparent 1.2px 9px);
  mask-image: linear-gradient(90deg, #000, transparent 70%);
  pointer-events: none;
}
.reward__title { position: relative; font-family: var(--font-hand); font-size: 19px; font-weight: 700; color: var(--text-hi); }
.reward__text { position: relative; font-size: 13px; color: var(--text-mid); margin-top: 4px; }
.reward__stats { position: relative; display: flex; gap: 18px; margin-top: 12px; }
.reward__stat b { display: block; font-family: var(--font-mono); font-size: 19px; font-weight: 500; color: var(--text-hi); }
.reward__stat span { font-size: 11.5px; color: var(--text-lo); }
.reward__actions { position: relative; display: flex; gap: 8px; margin-top: 14px; }
.reward__actions .btn { flex: 1; }
@keyframes reward-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

/* Конфеті-штрихи поверх усього */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
