@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --background: #0a0a0f;
  --color: #fafafa;
  --neon-pink: #ff0080;
  --neon-cyan: #00ffff;
  --neon-yellow: #ffff00;
  --neon-blue: #0080ff;
  --neon-purple: #8000ff;
  --gradient-primary: linear-gradient(135deg, #ff0080 0%, #00ffff 100%);
  --gradient-secondary: linear-gradient(45deg, #8000ff 0%, #ffff00 100%);
  --glow-pink: 0 0 20px #ff0080, 0 0 40px #ff0080, 0 0 60px #ff0080;
  --glow-cyan: 0 0 20px #00ffff, 0 0 40px #00ffff, 0 0 60px #00ffff;
  --glow-yellow: 0 0 20px #ffff00, 0 0 40px #ffff00, 0 0 60px #ffff00;
}

html,
body {
  font-family: Arial;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh; /* Use viewport height for proper mobile adaptation */
  min-height: 100vh; /* Ensure minimum height */
  background: black;
  overflow: hidden;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--background);
  font-family: "Press Start 2P", sans-serif;
  position: relative; /* Ensure proper positioning */
  /* font-family: "game-paused", sans-serif; */
  /* background-image: url("https://files.amberblocks.com/thumbnail/chnbzaa92ook5tnj/posts/pgffx2g7pvsmnbjj/f6csn4y6u9oec9y16jf3r2xn6tncvdvs/mo-hinh-pump-fun.jpg"); */
  /* background-size: cover; */
}

/* .pixel-button {
  color: #fff;
  text-align: center;
  padding: 20px 40px;
  display: flex;
  align-self: center;
  margin: 70px 0;
  text-decoration: none;
}

.pixel-button:hover {
  opacity: 0.5;
} */

.pixel-button {
  /* Remove default button styles */
  border: none;
  background: none;
  outline: none;
  cursor: pointer;

  /* Custom pixel button styles */
  text-align: center;
  padding: 20px 40px;
  display: flex;
  align-self: center;
  margin: 30px 0;
  position: relative;
  text-decoration: none;
  color: white;
  font-size: 24px;
  font-weight: bold;
  font-family: "Press Start 2P", sans-serif;
  opacity: 1;
  border-radius: 8px;
  transition: all 0.3s ease-in-out;
}

.pixel-button:hover {
  opacity: 0.5;
}

.pixel-button::before,
.pixel-button::after {
  content: "";
  position: absolute;
  font-size: 24px;
  font-weight: bold;
  transition: transform 0.2s ease-in-out, left 0.2s ease-in-out,
    right 0.2s ease-in-out;
}

.pixel-button::before {
  content: "[";
  left: -20px;
}

.pixel-button::after {
  content: "]";
  right: -20px;
}

.pixel-button:hover::before {
  left: -50px;
}

.pixel-button:hover::after {
  right: -50px;
}

.image-container img {
  margin: 0 auto;
  margin-bottom: 100px;
}

.container {
  color: var(--color);
  font-size: 1.5rem;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.container p {
  opacity: 0.5;
}

.right {
  text-align: right;
  width: 100%;
}

.stack {
  display: grid;
  grid-template-columns: 1fr;
  padding: 30px 0;
}

.stack span {
  font-weight: bold;
  grid-row-start: 1;
  grid-column-start: 1;
  font-size: 4rem;
  color: var(--neon-pink);
  /* text-shadow: var(--glow-pink); */
  --stack-height: calc(100% / var(--stacks) - 1px);
  --inverse-index: calc(calc(var(--stacks) - 1) - var(--index));
  --clip-top: calc(var(--stack-height) * var(--index));
  --clip-bottom: calc(var(--stack-height) * var(--inverse-index));
  clip-path: inset(var(--clip-top) 0 var(--clip-bottom) 0);
  animation: stack 340ms cubic-bezier(0.46, 0.29, 0, 1.24) 1 backwards
      calc(var(--index) * 120ms),
    glitch 2s ease infinite 2s alternate-reverse;
}

.stack span:nth-child(odd) {
  --glitch-translate: 8px;
}
.stack span:nth-child(even) {
  --glitch-translate: -8px;
}

.image-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

.image-container img {
  width: 160px;
  height: 100%;
  object-fit: cover;
  /* transition: transform 0.2s ease-out; */
}

@keyframes stack {
  0% {
    opacity: 0;
    transform: translateX(-50%);
    text-shadow: -15px 3px 0 var(--neon-cyan), 2px -3px 0 var(--neon-pink);
  }
  60% {
    opacity: 0.5;
    transform: translateX(50%);
  }
  80% {
    transform: none;
    opacity: 1;
    text-shadow: 15px -3px 0 var(--neon-cyan), -2px 3px 0 var(--neon-pink);
  }
  100% {
    text-shadow: none;
  }
}

@keyframes glitch {
  0% {
    text-shadow: -15px 3px 0 var(--neon-cyan), 2px -3px 0 var(--neon-pink);
    transform: translate(var(--glitch-translate));
  }
  2% {
    text-shadow: 15px -3px 0 var(--neon-cyan), -2px 3px 0 var(--neon-pink);
  }
  4%,
  100% {
    text-shadow: none;
    transform: none;
  }
}

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw; /* Use viewport width */
  height: 100vh; /* Use viewport height */
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 1s ease-out;
  z-index: 2;
}

.preloader-container {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  width: 100%;
  max-width: 300px; /* Limit maximum width */
  padding: 20px; /* Add padding for mobile */
}

.preloader-container img {
  width: 100%;
  max-width: 200px; /* Limit maximum width */
  height: 80px;
  object-fit: contain; /* Use contain instead of cover */
  animation: flipAnimation 3s infinite ease-in-out;
  opacity: 0.9;
}

@keyframes flipAnimation {
  0% {
    transform: rotateY(0deg) rotateX(0deg);
  }
  25% {
    transform: rotateY(180deg);
  }
  50% {
    transform: rotateX(180deg);
  }
  75% {
    transform: rotateY(-180deg) rotateX(-180deg);
  }
  100% {
    transform: rotateY(0deg) rotateX(0deg);
  }
}

/* .socials {
  display: flex;
  margin: 0 100px 0 100px;
  justify-content: space-between;
  justify-content: space-between;
}

.socials a {
  opacity: 1;
  transition: opacity 0.15s ease-in-out;
}

.socials a:hover {
  opacity: 0.5;
} */

.socials {
  display: flex;
  align-self: center;
  gap: 15px;
  /* justify-content: space-around; */
}

.socials a {
  display: inline-block;
  transition: transform 0.15s ease-out, filter 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.socials a img {
  width: 60px;
  height: auto;
  opacity: 0.7;
  transition: opacity 0.15s ease-in-out;
}

.socials a:hover {
  transform: translateY(-8px) scale(1.1);
  filter: brightness(1.2);
}

.socials a:hover img {
  opacity: 1;
}
sup {
  vertical-align: super;
  font-size: smaller;
}

/* Subscription Form Styles */
.subscription-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 60px 0;
}

.pixel-input {
  background: transparent;
  border: 2px solid var(--color);
  color: var(--color);
  font-family: "Press Start 2P", sans-serif;
  font-size: 16px;
  padding: 15px 20px;
  width: 300px;
  text-align: center;
  outline: none;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.pixel-input::placeholder {
  color: rgba(250, 250, 250, 0.5);
  font-size: 14px;
}

.pixel-input:hover {
  border-color: var(--neon-pink);
  box-shadow: var(--glow-pink);
  text-shadow: 0 0 10px var(--neon-pink);
}

.pixel-input:focus {
  border-color: var(--neon-pink);
  box-shadow: var(--glow-pink);
  text-shadow: 0 0 10px var(--neon-pink);
}

.pixel-input.error {
  border-color: #ff0040;
  box-shadow: 0 0 20px rgba(255, 0, 64, 0.3);
  animation: shake 0.5s ease-in-out;
}

.pixel-input.success {
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.message {
  font-family: "Press Start 2P", sans-serif;
  font-size: 12px;
  text-align: center;
  height: auto;
  line-height: 20px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  position: relative;
  overflow: hidden;
}

.message.show {
  opacity: 1;
}

.message.error {
  color: #ff0040;
  text-shadow: 0 0 5px rgba(255, 0, 64, 0.5);
}

.message.success {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
  .container {
    padding: 20px;
    font-size: 1rem;
  }

  .image-container img {
    width: 120px;
    margin-bottom: 60px;
  }

  .stack span {
    font-size: 2.5rem;
  }

  .pixel-button {
    font-size: 18px;
    padding: 15px 30px;
    margin: 0;
  }

  .pixel-button::before {
    left: -15px;
  }

  .pixel-button::after {
    right: -15px;
  }

  .pixel-button:hover::before {
    left: -30px;
  }

  .pixel-button:hover::after {
    right: -30px;
  }

  .socials {
    gap: 30px;
    justify-content: center;
  }

  .socials a img {
    width: 45px;
  }

  .socials a:hover {
    transform: translateY(-4px) scale(1.05);
  }

  .subscription-form {
    margin: 40px 0;
    gap: 15px;
    position: relative;
  }

  .pixel-input {
    width: 250px;
    font-size: 14px;
    padding: 12px 16px;
  }

  .pixel-input::placeholder {
    font-size: 12px;
  }

  .message {
    font-size: 10px;
    height: auto;
    line-height: 16px;
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
  }
}

@media screen and (max-width: 480px) {
  .container {
    padding: 15px;
    font-size: 0.9rem;
  }

  .image-container img {
    width: 100px;
    margin-bottom: 40px;
  }

  .stack span {
    font-size: 2rem;
  }

  .pixel-button {
    font-size: 16px;
    padding: 12px 24px;
    margin: 40px 0;
  }

  .socials a img {
    width: 40px;
  }

  .preloader-container {
    max-width: 250px;
    padding: 15px;
  }

  .preloader-container img {
    height: 50px;
    max-width: 150px;
  }

  .pixel-input {
    width: 200px;
    font-size: 12px;
    padding: 10px 14px;
  }

  .pixel-input::placeholder {
    font-size: 10px;
  }

  .message {
    font-size: 9px;
    height: auto;
    line-height: 14px;
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
  }
}

@media screen and (max-width: 320px) {
  .container {
    padding: 10px;
  }

  .stack span {
    font-size: 1.5rem;
  }

  .pixel-button {
    font-size: 14px;
    padding: 10px 20px;
  }

  .socials a img {
    width: 35px;
  }
}
