/* General Styles for CRT Effect */
body {
    margin: 0;
    overflow: hidden;
    touch-action: manipulation; /* Prevents double-tap zoom */
    font-family: "Courier New", Courier, monospace;
    background: black; 
    color: #0f0;
  }
  
  h1, h2, p {
    margin: 0 0 10px;
    text-align: center;
  }
  
  button {
    font-size: 1.2rem;
    padding: 10px 20px;
    background-color: #0f0;
    color: black;
    border: none;
    cursor: pointer;
  }
  
  button:hover {
    background-color: white;
    color: black;
  }
  
  /* CRT Overlay */
  body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
      circle,
      rgba(0, 255, 0, 0.1),
      rgba(0, 0, 0, 0.8) 70%
    );
    pointer-events: none;
    mix-blend-mode: screen;
    z-index: 10;
  }
  
  body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
      0deg,
      rgba(0, 255, 0, 0.1) 0px,
      rgba(0, 0, 0, 0.2) 2px
    );
    pointer-events: none;
    mix-blend-mode: multiply;
    z-index: 20;
    animation: flicker 0.05s infinite;
  }
  
  /* Flicker Effect */
  @keyframes flicker {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.97;
    }
  }

    /* CRT overlay effects */
  /* CRT Overlay Effects */
  .crt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
      circle,
      rgba(0, 255, 0, 0.05), /* Reduced inner glow intensity */
      rgba(0, 0, 0, 0.5) 70% /* Softer shadow gradient */
    );
    pointer-events: none;
    z-index: 15;
    mix-blend-mode: screen;
  }

  .scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
      0deg,
      rgba(0, 255, 0, 0.05) 0px, /* Less visible scanlines */
      rgba(0, 0, 0, 0.1) 2px
    );
  }

  #touchdown-message span {
    display: inline-block;
    font-size: 4rem;
    font-weight: bold;
    color: #0f0;
    text-shadow: 0 0 10px #0f0, 0 0 20px #00ff00;
    opacity: 0;
    transform: translateY(0) scale(1);
    animation: wave-letter 1s ease-in-out forwards;
  }
  
  @keyframes wave-letter {
    0% {
      transform: translateY(0) scale(1);
      opacity: 1;
    }
    50% {
      transform: translateY(-20px) scale(1.5);
    }
    100% {
      transform: translateY(0) scale(1);
      opacity: 0;
    }
  }
  
  #touchdown-message {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
  }
  
  .hidden {
    display: none;
  }
  .blink {
    animation: blink-animation 1s steps(5, start) infinite;
    -webkit-animation: blink-animation 1s steps(5, start) infinite;
  }
  
  @keyframes blink-animation {
    to {
      visibility: hidden;
    }
  }
  
  @-webkit-keyframes blink-animation {
    to {
      visibility: hidden;
    }
  }

  #two-minute-warning {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 1rem;
    font-weight: bold;
    color: #0f0;
    text-shadow: 0 0 10px #0f0, 0 0 20px #00ff00;
    opacity: 0;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
    z-index: 1000;
    text-align: center; /* Center justify the text */
  }
  

  #two-minute-warning.show {
    transform: translate(-50%, -50%) scale(1);
    font-size: 4rem;
    opacity: 1;
  }

  /* Mobile responsiveness */
  @media (max-width: 768px) {
    #two-minute-warning {
      font-size: 0.8rem;
    }
  
    #two-minute-warning.show {
      font-size: 2rem;
    }
  }
  
  @media (max-width: 480px) {
    #two-minute-warning {
      font-size: 0.6rem;
    }
  
    #two-minute-warning.show {
      font-size: 1.5rem;
    }
  }

  #fourth-down-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 1rem;
    font-weight: bold;
    color: #0f0;
    text-shadow: 0 0 10px #0f0, 0 0 20px #00ff00;
    opacity: 0;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
    z-index: 1000;
    text-align: center; /* Center justify the text */
  }
 /* Fourth Down Message Animation */
#fourth-down-message.show {
  transform: translate(-50%, -50%) scale(1);
  font-size: 4rem;
  opacity: 1;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  #fourth-down-message {
    font-size: 0.8rem;
  }
  
  #fourth-down-message.show {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  #fourth-down-message {
    font-size: 0.6rem;
  }
  
  #fourth-down-message.show {
    font-size: 1.5rem;
  }
}
 
  /* Container: centered, with a fade transition.
       Note: we set the default visible opacity in the element state,
       and override it with a more specific rule when the element has the "hidden" class. */
       #sack-message {
        position: fixed;
        font-size: 4rem;
        font-weight: bold;
        color: #0f0;
        text-shadow: 0 0 10px #0f0, 0 0 20px #00ff00;
        /* Initially, set the element to visible here; its hidden state will be applied via the .hidden class */
        opacity: 1;
        top: 40%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        gap: 0.5rem;           /* Adjust gap between letters as needed */
        flex-wrap: nowrap;      /* All letters on one line */
        justify-content: center;
        align-items: center;
        z-index: 1000;         /* Sits above other content */
        transition: opacity 0.5s ease-out;
      }
  
      /* Hidden state: use a more specific selector so it overrides the default state */
      #sack-message.hidden {
        opacity: 0;
        pointer-events: none;
      }
  
      /* Style each letter */
      #sack-message span {
        position: relative;
        display: inline-block;
        font-size: 3rem;       /* Responsive sizing using rem units */
        line-height: 1;
      }
  
      /* Action lines behind each letter */
      #sack-message span::before {
        content: "";
        position: absolute;
        width: 3px;
        height: 50px;               /* Adjust if needed; you could also use relative units */
        background-color: #0f0;     /* CRT green glow */
        left: 50%;
        bottom: 100%;
        opacity: 0.8;
        transform: translateX(-50%);
        animation: speed-lines 0.4s ease-out forwards;
        animation-play-state: paused; /* Start paused */
      }
  
      /* Class to trigger the pseudo-element animation */
      #sack-message span.animate-lines::before {
        animation-play-state: running;
      }
  
      /* Sack-fall animation for each letter with extra bounce effect */
      @keyframes sack-fall {
        0% {
          opacity: 0;
          transform: translateY(-150px) rotate(-15deg) scale(1.5);
        }
        60% {
          opacity: 1;
          transform: translateY(10px) rotate(5deg) scale(1);
        }
        /* Extra bounce effect */
        80% {
          transform: translateY(-1px) rotate(-1deg) scale(1.05);
        }
        100% {
          opacity: 1;
          transform: translateY(0) rotate(0) scale(1);
        }
      }
  
      /* Speed lines animation */
      @keyframes speed-lines {
        0% {
          height: 60px;
          opacity: 1;
        }
        100% {
          height: 0px;
          opacity: 0;
        }
      }
  
      /* Responsive font-size adjustment for small screens */
      @media (max-width: 480px) {
        #sack-message span {
          font-size: 2rem;
        }
      }




      /* Container for the Fumble animation */
#fumble-message {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  font-size: 4rem;
  font-weight: bold;
  color: #0f0;
  text-shadow: 0 0 10px #0f0, 0 0 20px #00ff00;
  transition: opacity 0.5s ease-out;
  opacity: 1; /* Default visible state */
}

/* Hidden state (more specific) */
#fumble-message.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Style for each letter */
#fumble-message span {
  position: relative;
  display: inline-block;
  font-size: 3rem;
  line-height: 1;
}

/* Optional: Action lines behind each letter */
#fumble-message span::before {
  content: "";
  position: absolute;
  width: 3px;
  height: 50px;
  background-color: #0f0;
  left: 50%;
  bottom: 100%;
  opacity: 0.8;
  transform: translateX(-50%);
  animation: speed-lines 0.6s ease-out forwards;
  animation-play-state: paused;
}

/* Trigger the pseudo-element animation */
#fumble-message span.animate-lines::before {
  animation-play-state: running;
}

/* Chaotic bounce animation for FUMBLE! */
@keyframes fumble-bounce {
  0% {
    opacity: 0;
    transform: translate(0, -200px) rotate(0deg) scale(0.5);
  }
  20% {
    opacity: 1;
    transform: translate(80px, 60px) rotate(30deg) scale(1.2);
  }
  40% {
    transform: translate(-100px, 80px) rotate(-40deg) scale(0.8);
  }
  60% {
    transform: translate(60px, -50px) rotate(20deg) scale(1.1);
  }
  80% {
    transform: translate(-30px, 30px) rotate(-10deg) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

/* Speed lines animation */
@keyframes speed-lines {
  0% {
    height: 80px;
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    height: 80px;
    opacity: 0.7;
    transform: translateY(-10px);
  }
  100% {
    height: 0;
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Responsive adjustment for smaller screens */
@media (max-width: 480px) {
  #fumble-message span {
    font-size: 2rem;
  }
}
/* Container for the interception message */
#interception-message {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  font-size: 4rem;
  font-weight: bold;
  color: #0f0; /* Blue for interception */
  text-shadow: 0 0 10px #0f0, 0 0 20px #00ff00;
  transition: opacity 0.5s ease-out;
  opacity: 1; /* Initially visible; hidden state will override */
}

/* Hidden state: more specific so it overrides the default */
#interception-message.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Each letter styling */
#interception-message span {
  position: relative;
  display: inline-block;
  font-size: 3rem;
  line-height: 1;
}

/* Interception keyframes */
@keyframes interception-flyin {
  0% {
    transform: translateX(-150%) skewY(0deg);
    opacity: 0;
  }
  50% {
    transform: translateX(0) skewY(15deg);
    opacity: 1;
  }
  65% {
    transform: translateX(0) skewY(-8deg);
  }
  80% {
    transform: translateX(0) skewY(5deg);
  }
  100% {
    transform: translateX(0) skewY(0deg);
  }
}

/* Responsive styles for mobile devices */
@media (max-width: 600px) {
  #interception-message {
    font-size: 2.5rem; /* Reduced container font-size */
    gap: 0.25rem;      /* Reduced gap between letters */
    top: 50%;          /* Slightly adjust vertical centering if needed */
  }
  
  #interception-message span {
    font-size: 2rem;   /* Smaller font for individual letters */
  }
}