@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

:root {
  --primary-color: #052842;
  --secondary-color: #e9456c;
  --accent-color: #ffcc00;
  --background-color: #0a1a2a;
  --text-color: #ffffff;
  --shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
  --border-radius: 0px;
  --pixel-border: 4px solid var(--secondary-color);
}

/* Pixelation effect */
@keyframes pixelate {
  0% {
    transform: scale(1.01);
    filter: blur(0.5px);
  }
  50% {
    transform: scale(1);
    filter: blur(0);
  }
  100% {
    transform: scale(1.01);
    filter: blur(0.5px);
  }
}

@keyframes glitch {
  0% {
    text-shadow: 2px 2px var(--secondary-color);
  }
  25% {
    text-shadow: -2px 2px var(--accent-color);
  }
  50% {
    text-shadow: 2px -2px var(--secondary-color);
  }
  75% {
    text-shadow: -2px -2px var(--accent-color);
  }
  100% {
    text-shadow: 2px 2px var(--secondary-color);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

body {
  font-family: "Press Start 2P", cursive;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  text-transform: uppercase;
  background-image: linear-gradient(
    45deg,
    var(--background-color) 25%,
    #091724 25%,
    #091724 50%,
    var(--background-color) 50%,
    var(--background-color) 75%,
    #091724 75%,
    #091724 100%
  );
  background-size: 20px 20px;
}

.pixel-container {
  max-width: 800px;
  margin: 20px auto;
  background-color: var(--primary-color);
  padding: 20px;
  box-shadow: var(--shadow);
  border: var(--pixel-border);
  image-rendering: pixelated;
  animation: pixelate 5s infinite ease-in-out;
}

h1,
h2,
h3 {
  color: var(--accent-color);
  text-shadow: 2px 2px var(--secondary-color);
  letter-spacing: 2px;
  animation: glitch 5s infinite linear;
}

.pixel-btn {
  background-color: var(--secondary-color);
  color: white;
  border: 4px solid #c73757;
  box-shadow: 4px 4px 0 #000;
  padding: 10px 20px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  font-size: 14px;
  font-family: "Press Start 2P", cursive;
  position: relative;
  image-rendering: pixelated;
  text-transform: uppercase;
}

.pixel-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
  background-color: var(--accent-color);
  color: var(--primary-color);
}

.pixel-btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0px 0px 0 #000;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  text-shadow: 2px 2px var(--primary-color);
  position: relative;
  padding: 2px 4px;
}

a:hover {
  color: var(--secondary-color);
  animation: pulse 0.5s infinite;
}

a:after {
  content: "";
  position: absolute;
  width: 0;
  height: 4px;
  bottom: 0;
  left: 0;
  background-color: var(--secondary-color);
  transition: width 0.3s;
}

a:hover:after {
  width: 100%;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: var(--pixel-border);
  background-color: var(--primary-color);
  color: var(--text-color);
  font-family: "Press Start 2P", cursive;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s;
  font-size: 10px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: inset 4px 4px 0 rgba(0, 0, 0, 0.3), 0 0 0 2px var(--accent-color);
}

/* Loading animation */
@keyframes loading {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 0%;
  }
}

.loading {
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color),
    var(--accent-color),
    var(--secondary-color),
    var(--primary-color)
  );
  background-size: 400% 100%;
  animation: loading 2s infinite linear;
}

/* Pixelated border */
.pixel-border {
  position: relative;
}

.pixel-border:before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: transparent;
  border: 4px solid var(--secondary-color);
  clip-path: polygon(
    0% 0%,
    25% 0%,
    25% 4%,
    50% 4%,
    50% 0%,
    75% 0%,
    75% 4%,
    100% 4%,
    100% 25%,
    96% 25%,
    96% 50%,
    100% 50%,
    100% 75%,
    96% 75%,
    96% 100%,
    75% 100%,
    75% 96%,
    50% 96%,
    50% 100%,
    25% 100%,
    25% 96%,
    0% 96%,
    0% 75%,
    4% 75%,
    4% 50%,
    0% 50%,
    0% 25%,
    4% 25%,
    4% 0%
  );
}

@media (max-width: 768px) {
  .pixel-container {
    padding: 10px;
    margin: 10px;
  }
}
