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

body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont,
    sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000000;
  overflow: hidden;
  transition: background 0.3s ease;
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation; /* Prevent double-tap zoom */
}

.container {
  text-align: center;
  z-index: 10;
  position: relative;
  padding: 2rem;
}

.title {
  font-size: 4.5rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.3),
    0 0 60px rgba(255, 255, 255, 0.2);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
  animation: pulse 2s infinite;
}

.warning {
  font-size: 1.2rem;
  color: #888888;
  margin-bottom: 3rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chaos-button {
  position: relative;
  padding: 25px 70px;
  font-size: 1.8rem;
  font-weight: 700;
  color: #000000;
  background: #ffffff;
  border: 3px solid #000000;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 0 #000000, 0 12px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
  z-index: 5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  will-change: transform;
}

.chaos-button:hover {
  transform: translateY(2px);
  box-shadow: 0 6px 0 #000000, 0 10px 20px rgba(0, 0, 0, 0.3);
}

.chaos-button:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 #000000, 0 4px 10px rgba(0, 0, 0, 0.2);
}

.button-text {
  position: relative;
  z-index: 2;
}

.button-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: rotate 3s linear infinite;
  pointer-events: none;
}

.chaos-counter {
  margin-top: 3rem;
  font-size: 1.3rem;
  color: #ffffff;
  font-weight: 300;
  letter-spacing: 0.1em;
}

#chaosCount {
  font-size: 2.5rem;
  color: #ffffff;
  font-weight: 900;
  display: inline-block;
  min-width: 60px;
}

#particleContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  background: #ffffff;
  will-change: transform, opacity;
}

#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.9;
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  10% {
    transform: translate(-8px, -4px) rotate(-1deg);
  }
  20% {
    transform: translate(8px, 4px) rotate(1deg);
  }
  30% {
    transform: translate(-6px, 6px) rotate(-0.5deg);
  }
  40% {
    transform: translate(6px, -6px) rotate(0.5deg);
  }
  50% {
    transform: translate(-4px, 4px) rotate(-1deg);
  }
  60% {
    transform: translate(4px, -4px) rotate(1deg);
  }
  70% {
    transform: translate(-2px, 2px) rotate(-0.5deg);
  }
  80% {
    transform: translate(2px, -2px) rotate(0.5deg);
  }
  90% {
    transform: translate(-1px, 1px) rotate(-0.25deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Chaos effects */
.chaos-shake {
  animation: shake 0.4s ease-in-out;
}

.chaos-spin {
  animation: spin 0.8s linear;
}

.chaos-bounce {
  animation: bounce 0.5s ease-in-out;
}

.color-chaos-1 {
  background: #ffffff !important;
  color: #000000 !important;
}

.color-chaos-2 {
  background: #000000 !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

.color-chaos-3 {
  background: linear-gradient(135deg, #ffffff 0%, #000000 100%) !important;
  color: #000000 !important;
}

.color-chaos-4 {
  background: linear-gradient(
    45deg,
    #000000 0%,
    #ffffff 50%,
    #000000 100%
  ) !important;
  background-size: 200% 200% !important;
  color: #ffffff !important;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
  .container {
    padding: 1.5rem;
    max-width: 100%;
  }

  .title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    line-height: 1.2;
  }

  .warning {
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
  }

  .chaos-button {
    padding: 20px 40px;
    font-size: 1.3rem;
    border-width: 2px;
    border-radius: 10px;
    min-height: 60px; /* Touch-friendly minimum */
    width: 100%;
    max-width: 90%;
  }

  .chaos-counter {
    margin-top: 2rem;
    font-size: 1rem;
  }

  #chaosCount {
    font-size: 2rem;
    min-width: 50px;
  }
}

@media screen and (max-width: 480px) {
  body {
    padding: 0;
  }

  .container {
    padding: 1rem;
    width: 100%;
  }

  .title {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    padding: 0 0.5rem;
    word-break: break-word;
  }

  .warning {
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
  }

  .chaos-button {
    padding: 18px 30px;
    font-size: 1.1rem;
    border-width: 2px;
    border-radius: 8px;
    min-height: 56px;
    width: 95%;
    max-width: 95%;
    letter-spacing: 0.02em;
  }

  .button-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chaos-counter {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    padding: 0 0.5rem;
  }

  #chaosCount {
    font-size: 1.8rem;
    min-width: 45px;
  }
}

/* Tablet Styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .title {
    font-size: 3.5rem;
  }

  .chaos-button {
    padding: 22px 55px;
    font-size: 1.6rem;
  }

  .warning {
    font-size: 1.1rem;
  }
}

/* Landscape Mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
  .container {
    padding: 1rem;
  }

  .title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }

  .warning {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  .chaos-button {
    padding: 15px 35px;
    font-size: 1.2rem;
    min-height: 50px;
  }

  .chaos-counter {
    margin-top: 1rem;
    font-size: 0.95rem;
  }
}

/* Prevent text selection on mobile for better UX */
@media screen and (max-width: 768px) {
  .chaos-button {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation; /* Prevent double-tap zoom */
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .title,
  .warning,
  .chaos-counter {
    user-select: none;
    -webkit-user-select: none;
  }
}
