* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  cursor: pointer;
  color-scheme: light only;
  padding-bottom: 4rem;
  margin: 0;
}

@media (max-width: 600px) {
  body {
    justify-content: flex-start;
    height: auto;
    overflow-y: auto;
    min-height: 100vh;
  }
}

#canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Prevents canvas from intercepting events */
}

#header,
#reason-section,
#button-section,
#another-site-section {
  position: relative;
  z-index: 2;
  text-align: center;
  will-change: transform, opacity;
}

#header {
  margin-bottom: 20px;
}

#header.animate-header {
  opacity: 0;
  animation: slideDownHeader 1s ease-out forwards;
}

@keyframes slideDownHeader {
  from {
    opacity: 0;
    transform: translateY(-50px); /* Slide down from above */
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#header h1 {
  font-size: clamp(32px, 10vw, 64px);
  color: #ff0000;
  margin: 0;
  text-shadow: 0 0 1px #fff;
}

#header h1.glow {
  animation: glowAnger 1s infinite alternate;
}

@keyframes glowAnger {
  from {
    text-shadow: 0 0 1px #000000;
    transform: scale(1);
  }
  to {
    text-shadow: 1px 1px 2px #000000;
    transform: scale(1.02);
  }
}

#reasons,
#reason-display {
  font-size: clamp(18px, 5vw, 28px);
  color: #000;
  margin: 0 0 10px;
  font-weight: bold;
  text-shadow: 0 0 1px #fff;
  display: block;
  text-wrap: balance;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#target {
  position: relative;
  z-index: 2;
  text-align: center;
  cursor: grab;
  transition: transform 0.3s ease-in-out;
  user-select: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: visible !important;
  will-change: transform, opacity;
}

#target.animate-target {
  opacity: 0;
  animation: fadeInTarget 1s ease-out forwards 0.5s;
}

@keyframes fadeInTarget {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#target img {
  width: clamp(32px, 5vw, 64px);
  height: clamp(32px, 5vw, 64px);
}

#target a {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  opacity: 1 !important;
  visibility: visible !important;
  margin: 3rem 2.5rem;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: calc(100% - 5rem);
  gap: 10px;
}

#target a span {
  margin-left: 0;
  font-size: clamp(24px, 7vw, 48px);
  text-decoration: underline;
  text-shadow: 0 0 1px #fff;
}

#target.wobble {
  animation: wobble 1s ease-in-out;
  transform-origin: right center;
}

#target.wobble,
#target.wobble a {
  visibility: visible !important;
  opacity: 1 !important;
}

@keyframes wobble {
  0% {
    transform: translate(0, 0) rotate(0);
  }
  10% {
    transform: translate(-2px, -20px) rotate(-2deg);
  }
  20% {
    transform: translate(2px, 0) rotate(2deg);
  }
  30% {
    transform: translate(-1px, -15px) rotate(-1deg);
  }
  40% {
    transform: translate(1px, 0) rotate(1deg);
  }
  50% {
    transform: translate(0, -10px) rotate(0);
  }
  60%,
  80%,
  100% {
    transform: translate(0, 0) rotate(0);
  }
  70% {
    transform: translate(0, -5px) rotate(0);
  }
  90% {
    transform: translate(0, -2px) rotate(0);
  }
}

#reason-section {
  max-width: 80%;
  margin: auto;
}

#reason-section.animate-reason {
  opacity: 0;
  animation: fadeInReason 1s ease-out forwards 1s;
}

@keyframes fadeInReason {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#button-section {
  margin-top: 20px;
}

#button-section.animate-button {
  opacity: 0;
  animation: fadeInButton 1s ease-out forwards 1.5s;
}

@keyframes fadeInButton {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#fuck-button {
  font-size: clamp(16px, 4vw, 24px);
  padding: 10px 20px;
  background: #ff0000;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 5px 5px 0 #000;
}

#fuck-button:hover {
  background: #cc0000;
}

#fuck-button:active {
  box-shadow: 1px 1px 0 #000;
  transform: scale(0.95);
}

#footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 600px;
  width: 100%;
  margin-top: 1rem;
  padding: 0 20px;
  box-sizing: border-box;
}

.is-index #footer {
  display: none;
}

.is-non-index #footer {
  display: flex;
}

#built-by,
#more-from-me,
#legal-disclaimer {
  font-size: clamp(10px, 2vw, 12px);
  color: #333;
  margin: 0;
  text-wrap: balance;
}

#legal-disclaimer {
  text-align: center;
}

#built-by a,
#more-from-me a {
  text-decoration: none;
  margin: 0 3px;
}

#more-from-me p {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#form-section {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 20px auto;
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
  display: none; /* Hidden by default */
}

#form-section.animate-form {
  opacity: 0;
  animation: slideUpForm 1s ease-out forwards 0.5s; /* Animation for form appearance */
}

@keyframes slideUpForm {
  from {
    opacity: 0;
    transform: translateY(50px); /* Slide up from below */
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#form-section p {
  font-size: clamp(16px, 3vw, 24px);
  color: #333;
  margin-bottom: 20px;
  text-wrap: pretty;
}

#form-section label,
#form-section span {
  display: block;
  text-align: left;
  margin-bottom: 5px;
  font-weight: bold;
}

#form-section input {
  display: block;
  width: 100%;
  margin-bottom: 15px;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  height: 42px;
  background: #fff;
  color: #000;
  overflow-x: auto;
  white-space: nowrap;
}

#form-section select {
  display: block;
  width: 100%;
  margin-bottom: 15px;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  height: 42px;
  background: #fff;
  color: #000;
}

#generated-url {
  display: block;
  width: 100%;
  margin-bottom: 15px;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  min-height: 42px;
  background: #f9f9f9;
  color: #000;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
  overflow: visible;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

#button-wrapper {
  display: flex;
  justify-content: center;
  gap: 10px;
}

#copy-button,
#go-button {
  font-size: 16px;
  padding: 10px 20px;
  background: #ff0000;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 5px 5px 0 #000;
}

#copy-button:hover,
#go-button:hover {
  background: #cc0000;
}

#copy-button:active,
#go-button:active {
  box-shadow: 1px 1px 0 #000;
  transform: scale(0.95);
}

#another-site-section {
  margin-top: 3rem;
}

#another-site-section.animate-another {
  opacity: 0;
  animation: fadeInButton 1s ease-out forwards 2s;
}

#another-site-button {
  text-decoration: none;
}

#another-site-button:visited {
  color: blue;
}

#another-site-button:hover {
  text-decoration: underline;
}

.info-section {
  text-align: center;
  margin-top: 6rem;
  z-index: 2;
  position: relative;
  max-width: 600px;
  width: 100%;
  padding: 0 0.5rem;
}

.info-section > * {
  margin: 0.5rem 0;
}

.is-non-index #info-section,
.is-non-index #reasons {
  display: none;
}

.main-wrapper {
  margin: 0 0.5rem;
}

@media (max-width: 600px) {
  body {
    justify-content: flex-start;
    min-height: 100vh;
  }

  #header h1 {
    margin-top: 4rem;
  }

  #footer {
    flex-direction: column;
    align-items: center;
  }

  #legal-disclaimer {
    margin-top: 10px;
    text-align: center;
    text-wrap: wrap;
  }

  #button-wrapper {
    flex-direction: row;
    gap: 10px;
  }

  #more-from-me {
    text-wrap: wrap;
  }
}
