html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: linear-gradient(
    135deg,
    #0a0a18 0%,
    #111122 30%,
    #1a1a2e 50%,
    #0d0d1a 100%
  );
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

#deadline {
  width: 581px;
  max-width: 100%;
  height: 158px;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 15px rgba(190, 0, 42, 0.7));
}

#deadline svg {
  width: 100%;
}

#progress-time-fill {
  animation-name: progress-fill;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* Death */
#death-group {
  animation-name: walk;
  animation-timing-function: ease;
  animation-iteration-count: infinite;
  transform: translateX(0);
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

#death-arm {
  animation: move-arm 3s ease infinite;
  transform-origin: -60px 74px;
}

#death-tool {
  animation: move-tool 3s ease infinite;
  transform-origin: -48px center;
}

/* Designer */
#designer-arm-grop {
  animation: write 1.5s ease infinite;
  transform: translate(0, 0) rotate(0deg) scale(1, 1);
  transform-origin: 90% top;
}

.deadline-days {
  color: #fff;
  text-align: center;
  width: 100px;
  margin: 0 auto;
  position: relative;
  height: 20px;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
  letter-spacing: 1px;
}

.deadline-days .inner {
  width: 100px;
  position: relative;
  top: 0;
  left: 0;
}

.mask-red,
.mask-white {
  position: absolute;
  top: 0;
  width: 100%;
  overflow: hidden;
  height: 100%;
}

.mask-red {
  left: 0;
  width: 0;
  color: #ff3366;
  animation: text-red 20s ease infinite;
  z-index: 2;
  background: transparent;
  text-shadow: 0 0 15px rgba(255, 51, 102, 0.8);
}

.mask-white {
  right: 0;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

/* Flames */
#red-flame {
  opacity: 0;
  animation: show-flames 20s ease infinite, red-flame 120ms ease infinite;
  transform-origin: center bottom;
  filter: drop-shadow(0 0 5px rgba(183, 19, 66, 0.8));
}

#yellow-flame {
  opacity: 0;
  animation: show-flames 20s ease infinite, yellow-flame 120ms ease infinite;
  transform-origin: center bottom;
  filter: drop-shadow(0 0 5px rgba(247, 181, 35, 0.8));
}

#white-flame {
  opacity: 0;
  animation: show-flames 20s ease infinite, red-flame 100ms ease infinite;
  transform-origin: center bottom;
}

/* Horror Background effects */
.horror-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.fog {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(20, 20, 40, 0.1) 0%,
    rgba(40, 40, 80, 0.3) 50%,
    rgba(20, 20, 40, 0.1) 100%
  );
  animation: fog-move 30s infinite linear;
}

.fog-layer {
  position: absolute;
  width: 200%;
  height: 100%;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" opacity="0.1"><filter id="turbulence" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency="0.01" numOctaves="3" seed="1"/><feDisplacementMap in="SourceGraphic" scale="10"/></filter><rect width="100" height="100" filter="url(%23turbulence)" fill="rgba(255,255,255,0.1)"/></svg>');
  animation: fog-layer-move 60s infinite linear;
}

.fog-layer:nth-child(1) {
  top: 0;
  animation-duration: 80s;
}

.fog-layer:nth-child(2) {
  top: 50%;
  animation-duration: 100s;
  opacity: 0.6;
}

.fog-layer:nth-child(3) {
  bottom: 0;
  animation-duration: 120s;
  opacity: 0.4;
}

.horror-pulse {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(190, 0, 42, 0.2) 0%,
    transparent 70%
  );
  animation: horror-pulse 8s infinite;
}

.horror-pulse:nth-child(1) {
  width: 200px;
  height: 200px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.horror-pulse:nth-child(2) {
  width: 300px;
  height: 300px;
  top: 60%;
  right: 10%;
  animation-delay: 2s;
}

.horror-pulse:nth-child(3) {
  width: 150px;
  height: 150px;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

.horror-pulse:nth-child(4) {
  width: 250px;
  height: 250px;
  top: 30%;
  right: 20%;
  animation-delay: 6s;
}

/* Ghostly floating elements */
.ghost-element {
  position: absolute;
  z-index: 0;
  opacity: 0.3;
  filter: blur(2px);
}

.ghost-element:nth-child(1) {
  width: 80px;
  height: 120px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 70%
  );
  top: 20%;
  left: 5%;
  animation: ghost-float 25s ease-in-out infinite;
}

.ghost-element:nth-child(2) {
  width: 60px;
  height: 100px;
  background: radial-gradient(
    ellipse at center,
    rgba(200, 200, 255, 0.15) 0%,
    transparent 70%
  );
  top: 70%;
  right: 10%;
  animation: ghost-float 30s ease-in-out infinite reverse;
}

.ghost-element:nth-child(3) {
  width: 100px;
  height: 80px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 200, 200, 0.1) 0%,
    transparent 70%
  );
  bottom: 30%;
  left: 15%;
  animation: ghost-float 20s ease-in-out infinite;
}

.ghost-element:nth-child(4) {
  width: 70px;
  height: 110px;
  background: radial-gradient(
    ellipse at center,
    rgba(200, 255, 255, 0.1) 0%,
    transparent 70%
  );
  top: 40%;
  right: 5%;
  animation: ghost-float 35s ease-in-out infinite reverse;
}

/* Progress trail enhancements */
#progress-trail path {
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
}

/* Designer enhancements */
#designer-body {
  filter: drop-shadow(0 0 3px rgba(254, 255, 254, 0.7));
}

#designer-head {
  filter: drop-shadow(0 0 3px rgba(254, 255, 254, 0.7));
}

#designer-arm {
  filter: drop-shadow(0 0 2px rgba(254, 255, 254, 0.7));
}

#designer-pen {
  filter: drop-shadow(0 0 2px rgba(254, 255, 254, 0.7));
}

/* Enhanced progress bar glow */
#progress-time-fill {
  filter: drop-shadow(0 0 8px rgba(190, 0, 42, 0.8));
}

/* Enhanced death character */
#death {
  filter: drop-shadow(0 0 5px rgba(190, 0, 42, 0.9));
}

/* Enhanced designer character */
#designer-group {
  filter: drop-shadow(0 0 5px rgba(254, 255, 254, 0.5));
}

/* Animations */
@keyframes progress-fill {
  0% {
    x: -100%;
  }
  100% {
    x: -3%;
  }
}

@keyframes walk {
  0% {
    transform: translateX(0);
  }
  6% {
    transform: translateX(0);
  }
  10% {
    transform: translateX(100px);
  }
  15% {
    transform: translateX(140px);
  }
  25% {
    transform: translateX(170px);
  }
  35% {
    transform: translateX(220px);
  }
  45% {
    transform: translateX(280px);
  }
  55% {
    transform: translateX(340px);
  }
  65% {
    transform: translateX(370px);
  }
  75% {
    transform: translateX(430px);
  }
  85% {
    transform: translateX(460px);
  }
  95% {
    transform: translateX(520px);
    opacity: 1;
  }
  100% {
    transform: translateX(520px);
    opacity: 1;
  }
}

@keyframes move-arm {
  0% {
    transform: rotate(0);
  }
  5% {
    transform: rotate(0);
  }
  9% {
    transform: rotate(40deg);
  }
  80% {
    transform: rotate(0);
  }
}

@keyframes move-tool {
  0% {
    transform: rotate(0);
  }
  5% {
    transform: rotate(0);
  }
  9% {
    transform: rotate(50deg);
  }
  80% {
    transform: rotate(0);
  }
}

@keyframes write {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1, 1);
  }
  16% {
    transform: translate(0px, 0px) rotate(5deg) scale(0.8, 1);
  }
  32% {
    transform: translate(0px, 0px) rotate(0deg) scale(1, 1);
  }
  48% {
    transform: translate(0px, 0px) rotate(6deg) scale(0.8, 1);
  }
  65% {
    transform: translate(0px, 0px) rotate(0deg) scale(1, 1);
  }
  83% {
    transform: translate(0px, 0px) rotate(4deg) scale(0.8, 1);
  }
}

@keyframes text-red {
  0% {
    width: 0%;
  }
  100% {
    width: 98%;
  }
}

@keyframes show-flames {
  0% {
    opacity: 0;
  }
  74% {
    opacity: 0;
  }
  80% {
    opacity: 1;
  }
  99% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes red-flame {
  0% {
    transform: translateY(-30px) scale(1, 1);
  }
  25% {
    transform: translateY(-30px) scale(1.1, 1.1);
  }
  75% {
    transform: translateY(-30px) scale(0.8, 0.7);
  }
  100% {
    transform: translateY(-30px) scale(1, 1);
  }
}

@keyframes yellow-flame {
  0% {
    transform: translateY(-30px) scale(0.8, 0.7);
  }
  50% {
    transform: translateY(-30px) scale(1.1, 1.2);
  }
  100% {
    transform: translateY(-30px) scale(1, 1);
  }
}

@keyframes horror-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.3;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.1;
  }
}

@keyframes designer-killed {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  20% {
    transform: translateY(-10px) rotate(-5deg);
    opacity: 0.9;
  }
  40% {
    transform: translateY(5px) rotate(5deg);
    opacity: 0.8;
  }
  60% {
    transform: translateY(-15px) rotate(-10deg);
    opacity: 0.6;
  }
  80% {
    transform: translateY(20px) rotate(15deg);
    opacity: 0.3;
  }
  100% {
    transform: translateY(100px) rotate(30deg);
    opacity: 0;
  }
}

/* Fixed ghost attack animation */
@keyframes ghost-attack {
  0% {
    transform: translateX(520px) scale(1);
  }
  20% {
    transform: translateX(520px) translateY(-10px) scale(1.2);
  }
  40% {
    transform: translateX(520px) translateY(5px) scale(1.1);
  }
  60% {
    transform: translateX(520px) translateY(-5px) scale(1.3);
  }
  80% {
    transform: translateX(520px) translateY(0) scale(1.1);
  }
  100% {
    transform: translateX(520px) scale(1);
  }
}

@keyframes ghost-tool-attack {
  0% {
    transform: rotate(0);
  }
  20% {
    transform: rotate(60deg);
  }
  40% {
    transform: rotate(40deg);
  }
  60% {
    transform: rotate(70deg);
  }
  80% {
    transform: rotate(50deg);
  }
  100% {
    transform: rotate(0);
  }
}

/* Ghost floating animation */
@keyframes ghost-float {
  0% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.2;
  }
  25% {
    transform: translateY(-30px) translateX(20px) scale(1.1);
    opacity: 0.3;
  }
  50% {
    transform: translateY(10px) translateX(-10px) scale(0.9);
    opacity: 0.25;
  }
  75% {
    transform: translateY(-20px) translateX(-20px) scale(1.05);
    opacity: 0.35;
  }
  100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.2;
  }
}

/* Fog animations */
@keyframes fog-move {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-20px);
  }
}

@keyframes fog-layer-move {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Background particle animation */
@keyframes particle-move {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(20px);
    opacity: 0;
  }
}

/* Enhanced glow effect */
.glow {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(
      circle at 30% 30%,
      rgba(190, 0, 42, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 70%,
      rgba(100, 0, 100, 0.1) 0%,
      transparent 50%
    );
  z-index: -1;
  animation: glow-pulse 10s infinite alternate;
}

@keyframes glow-pulse {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.7;
  }
}

/* Horror text effect */
.horror-text {
  position: absolute;
  top: 10%;
  left: 0;
  width: 100%;
  text-align: center;
  color: rgba(251, 7, 27, 0.995);
  font-family: "Creepster", cursive;
  font-size: 24px;
  letter-spacing: 5px;
  text-transform: uppercase;
  animation: horror-text-flicker 5s infinite;
  z-index: 0;
}

@keyframes horror-text-flicker {
  0%,
  19%,
  21%,
  23%,
  25%,
  54%,
  56%,
  100% {
    opacity: 0.1;
    text-shadow: 0 0 5px rgba(247, 39, 39, 0.938);
  }
  20%,
  24%,
  55% {
    opacity: 0.3;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.97);
  }
}
