body {
  font-family: Arial, sans-serif;
  text-align: center;
  padding: 0;
  margin: 0;
  background-color: #0f1218;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
}

main {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  position: relative;
  min-height: 300px;
}

h1 {
  font-size: 22px;
  margin-bottom: 20px;
  text-align: center;
  width: 100%;
}

p {
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
  width: 100%;
}

/* Hide "tap anywhere" text on desktop */
.mobile-only {
  display: none;
}

/* Show "tap anywhere" text only on iOS devices */
@supports (-webkit-touch-callout: none) {
  .mobile-only {
    display: inline;
  }
}

#fallbackText {
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 100;
  pointer-events: none;
}

#fallbackText p {
  margin-bottom: 5px;
}

/* More specific rule to override any inline display:none */
#fallbackText[style*="display: block"],
#fallbackText.visible {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: flex !important;
}

#manualRedirect {
  margin-top: 10px;
  z-index: 10;
  background: rgba(255, 61, 1, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(255, 61, 1, 0.25);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#manualRedirect:hover {
  background: rgba(255, 61, 1, 0.25);
  box-shadow: 0 0 30px rgba(255, 61, 1, 0.4);
  transform: translateY(-2px);
}

#manualRedirect:before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.7) 50%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  animation: glassmorphismShine 3s infinite;
  pointer-events: none;
}

@keyframes glassmorphismShine {
  0% {
    transform: rotate(45deg) translateX(-200%);
  }
  100% {
    transform: rotate(45deg) translateX(200%);
  }
}

/* iOS Safari specific styles */
@supports (-webkit-touch-callout: none) {
  #fallbackText {
    padding: 0;
    border-radius: 0;
    background-color: transparent;
    box-shadow: none;
    cursor: pointer;
    bottom: 30px;
    display: flex !important;
    z-index: 100;
    min-height: auto;
  }
  
  #fallbackText p {
    font-size: 16px;
    font-weight: 400;
    color: white;
    text-shadow: none;
    margin: 10px 0;
  }
  
  .mobile-only {
    display: inline;
    font-weight: bold;
    color: #ff3d01;
  }
  
  #manualRedirect {
    display: none; /* Hide button on iOS */
  }
}

/* iOS Mobile specific styles - separate from desktop Safari */
@media (max-width: 767px) {
  @supports (-webkit-touch-callout: none) {
    #fallbackText {
      width: 90%;
      max-width: 300px;
      margin: 0 auto;
    }
  }
}

button {
  font-size: 16px;
  padding: 10px 20px;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  touch-action: manipulation;
}

button:hover {
  background-color: #005fa3;
}

/* Make button easier to tap on mobile */
button:active {
  transform: scale(0.98);
}

.loader {
  transform: rotateZ(45deg);
  perspective: 1000px;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  color: #fff;
  margin: 0 auto 30px;
  position: relative;
  z-index: 5;
}

.loader:before,
.loader:after {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: inherit;
  height: inherit;
  border-radius: 50%;
  transform: rotateX(70deg);
  animation: 1s spin linear infinite;
}

.loader:after {
  color: #FF3D00;
  transform: rotateY(70deg);
  animation-delay: .4s;
}

/* Mobile Adjustments */
@media screen and (max-width: 480px) {
  main {
    padding: 20px 15px 90px;
    min-height: 280px;
  }
  
  h1 {
    font-size: 20px;
    margin-bottom: 15px;
  }
  
  p {
    font-size: 15px;
  }
  
  button {
    padding: 12px 25px;
    width: auto;
    min-width: 120px;
  }
  
  .loader {
    width: 40px;
    height: 40px;
    margin-bottom: 25px;
  }
  
  #fallbackText {
    bottom: 20px;
  }
}

/* Fix for iOS Safari 100vh issue */
@supports (-webkit-touch-callout: none) {
  body, html {
    height: -webkit-fill-available;
  }
  body {
    min-height: -webkit-fill-available;
  }
}

@keyframes spin {
  0%,
  100% {
    box-shadow: .2em 0px 0 0px currentcolor;
  }
  12% {
    box-shadow: .2em .2em 0 0 currentcolor;
  }
  25% {
    box-shadow: 0 .2em 0 0px currentcolor;
  }
  37% {
    box-shadow: -.2em .2em 0 0 currentcolor;
  }
  50% {
    box-shadow: -.2em 0 0 0 currentcolor;
  }
  62% {
    box-shadow: -.2em -.2em 0 0 currentcolor;
  }
  75% {
    box-shadow: 0px -.2em 0 0 currentcolor;
  }
  87% {
    box-shadow: .2em -.2em 0 0 currentcolor;
  }
}
