@keyframes flyToStrip {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.35) translateY(-120px);
    opacity: 0.45;
  }
}

.card-fly-to-strip {
  animation: flyToStrip 400ms ease forwards;
}

@keyframes checkmark {
  0% {
    transform: scale(0);
  }
  55% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.schedule-check {
  animation: checkmark 400ms ease forwards;
}

/* ========== Награда ========== */
.reward-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rewardBgAppear 300ms ease forwards;
}

@keyframes rewardBgAppear {
  0% {
    background: rgba(0, 0, 0, 0);
  }
  100% {
    background: rgba(0, 0, 0, 0.5);
  }
}

.reward-content {
  background: white;
  border-radius: 36px;
  padding: 40px 32px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  animation: rewardPop 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.reward-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(74, 144, 217, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(232, 67, 147, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 10% 70%, rgba(67, 192, 109, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(166, 109, 212, 0.1) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

@keyframes rewardPop {
  0% {
    transform: scale(0.3) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.08) rotate(2deg);
  }
  70% {
    transform: scale(0.97) rotate(-1deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.reward-stars {
  font-size: 40px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.reward-star {
  display: inline-block;
  animation: rewardStarPop 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
  filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.5));
}

.reward-star:nth-child(1) {
  animation-delay: 100ms;
}
.reward-star:nth-child(2) {
  animation-delay: 200ms;
}
.reward-star:nth-child(3) {
  animation-delay: 300ms;
}
.reward-star:nth-child(4) {
  animation-delay: 400ms;
}
.reward-star:nth-child(5) {
  animation-delay: 500ms;
}

@keyframes rewardStarPop {
  0% {
    transform: scale(0) rotate(-60deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.5) rotate(15deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.reward-avatar {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  margin: 0 auto 16px;
  pointer-events: none;
  position: relative;
  z-index: 1;
  border: 5px solid white;
  box-shadow:
    0 0 0 5px rgba(255, 215, 0, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.15);
  animation: rewardAvatarPop 500ms 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
  object-fit: cover;
}

@keyframes rewardAvatarPop {
  0% {
    transform: scale(0.5) translateY(20px);
    opacity: 0;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.reward-text {
  font-size: 32px;
  font-weight: 800;
  position: relative;
  z-index: 1;
  opacity: 0;
  background: linear-gradient(135deg, #ff6b35, #f5a623, #43c06d, #4a90d9, #9b6fd1);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation:
    rewardTextPop 400ms 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
    rainbowShift 2s linear infinite;
}

@keyframes rewardTextPop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes rainbowShift {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

.reward-confetti {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall 2s ease-in forwards;
  opacity: 0;
}

.confetti-piece:nth-child(1) {
  left: 10%;
  background: #ff6b35;
  animation-delay: 0.1s;
}
.confetti-piece:nth-child(2) {
  left: 20%;
  background: #4a90d9;
  animation-delay: 0.2s;
  width: 8px;
  height: 12px;
}
.confetti-piece:nth-child(3) {
  left: 30%;
  background: #43c06d;
  animation-delay: 0.15s;
}
.confetti-piece:nth-child(4) {
  left: 40%;
  background: #f5a623;
  animation-delay: 0.3s;
  width: 12px;
  height: 8px;
}
.confetti-piece:nth-child(5) {
  left: 50%;
  background: #d0699e;
  animation-delay: 0.1s;
}
.confetti-piece:nth-child(6) {
  left: 60%;
  background: #9b6fd1;
  animation-delay: 0.25s;
  width: 8px;
  height: 8px;
}
.confetti-piece:nth-child(7) {
  left: 70%;
  background: #ff6b35;
  animation-delay: 0.2s;
}
.confetti-piece:nth-child(8) {
  left: 80%;
  background: #4a90d9;
  animation-delay: 0.35s;
  width: 6px;
  height: 14px;
}
.confetti-piece:nth-child(9) {
  left: 15%;
  background: #43c06d;
  animation-delay: 0.3s;
}
.confetti-piece:nth-child(10) {
  left: 85%;
  background: #f5a623;
  animation-delay: 0.15s;
}
.confetti-piece:nth-child(11) {
  left: 45%;
  background: #d0699e;
  animation-delay: 0.4s;
  width: 12px;
  height: 6px;
}
.confetti-piece:nth-child(12) {
  left: 65%;
  background: #9b6fd1;
  animation-delay: 0.05s;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: translateY(0) rotate(30deg) scale(1);
  }
  100% {
    transform: translateY(400px) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

.reward-overlay--hiding {
  animation: rewardHide 400ms ease forwards;
}

.reward-overlay--hiding .reward-content {
  animation: rewardContentHide 300ms ease forwards;
}

@keyframes rewardHide {
  0% {
    background: rgba(0, 0, 0, 0.5);
  }
  100% {
    background: rgba(0, 0, 0, 0);
  }
}

@keyframes rewardContentHide {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.8) translateY(30px);
    opacity: 0;
  }
}

.reward-animation {
  animation: rewardPop 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ========== Таймер ========== */
.timer-overlay,
.timer {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rewardBgAppear 300ms ease forwards;
}

.timer__content,
.timer-box {
  background: white;
  border-radius: 32px;
  padding: 36px;
  text-align: center;
  min-width: 290px;
  max-width: 340px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.timer__content::before,
.timer-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--color-want),
    var(--color-places),
    var(--color-schedule),
    var(--color-feelings),
    var(--color-people)
  );
}

.timer__label {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-light);
  margin-bottom: 8px;
}

.timer__time {
  font-size: 72px;
  font-weight: 800;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 8px 0;
  text-shadow: 0 2px 4px rgba(74, 144, 217, 0.15);
}

.timer-box .timer__time {
  font-size: 56px;
}

.timer__circle {
  width: 180px;
  height: 180px;
  margin: 0 auto 16px;
  position: relative;
}

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

.timer__circle-bg {
  fill: none;
  stroke: #ede8f5;
  stroke-width: 10;
}

.timer__circle-fill {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px rgba(74, 144, 217, 0.3));
}

.timer__circle-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: 800;
  color: var(--color-accent);
}

.timer__bar {
  width: 100%;
  height: 14px;
  background: #ede8f5;
  border-radius: 7px;
  margin: 16px 0;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.timer__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent), #7bc0ff);
  border-radius: 7px;
  transition: width 1s linear;
  position: relative;
}

.timer__fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.35), transparent);
  border-radius: 7px 7px 0 0;
}

.timer--warning .timer__time {
  color: var(--color-error);
  animation: timerWarningPulse 1s ease-in-out infinite;
}

.timer--warning .timer__circle-fill {
  stroke: var(--color-error);
}

.timer--warning .timer__fill {
  background: linear-gradient(90deg, var(--color-error), #ff8a80);
}

@keyframes timerWarningPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.timer__cancel {
  padding: 14px 36px;
  background: #f0ecf5;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 16px;
  border: none;
  cursor: pointer;
  color: var(--color-text-light);
  font-family: inherit;
  transition:
    transform var(--transition-fast),
    background var(--transition-fast);
}

.timer__cancel:active {
  transform: scale(0.95);
  background: #e0dce8;
}

/* ========== Скелетон ========== */
.skeleton {
  background: linear-gradient(90deg, #f0ecf5 25%, #f8f4ff 50%, #f0ecf5 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--card-radius);
}

@keyframes skeletonShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.card-skeleton {
  width: var(--card-size);
  height: calc(var(--card-size) + 40px);
  border-radius: var(--card-radius);
}

.text-skeleton {
  height: 16px;
  border-radius: 8px;
  width: 80%;
}

.text-skeleton--short {
  width: 50%;
}

.avatar-skeleton {
  width: var(--avatar-size);
  height: var(--avatar-size);
  border-radius: 50%;
}

.schedule-skeleton {
  height: 72px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.card-grid-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-size), 1fr));
  gap: 16px;
  padding: 16px;
}
