@charset "UTF-8";

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

body {
  font-family: 'Hiragino Sans', 'Yu Gothic', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  isolation: isolate;
  color: #fff;
  background: #080512;
}

body::before {
  content: '';
  position: fixed;
  z-index: -1;
  inset: -55%;
  background: conic-gradient(
    #ff3158,
    #ff9f1c,
    #fff13b,
    #46e06e,
    #22d8d8,
    #397bff,
    #a44bff,
    #ff3158
  );
  filter: blur(78px) saturate(1.8) brightness(1.2);
  opacity: 0.62;
  animation: rainbow-spin 18s linear infinite, rainbow-glow 2.8s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  z-index: -1;
  inset: -35%;
  background: repeating-conic-gradient(
    from 0deg,
    transparent 0deg 10deg,
    rgba(255, 228, 92, 0.16) 11deg 12deg,
    transparent 13deg 24deg
  );
  opacity: 0.52;
  animation: light-wheel 14s linear infinite;
}

@keyframes rainbow-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rainbow-glow {
  from {
    opacity: 0.48;
  }
  to {
    opacity: 0.78;
  }
}

@keyframes light-wheel {
  to {
    transform: rotate(-360deg);
  }
}

header {
  text-align: center;
  margin-bottom: 2rem;
  color: #fff6b0;
  text-shadow: 0 0 8px #fff, 0 0 18px #ffcf32, 0 0 38px #ff3c00;
}

main {
  padding: 2rem;
  border-radius: 16px;
  border: 2px solid #ffd84a;
  background: linear-gradient(145deg, rgba(27, 11, 43, 0.96), rgba(7, 5, 20, 0.94));
  color: #fff;
  box-shadow: 0 0 12px #ffcf32, 0 0 32px rgba(255, 46, 95, 0.75), inset 0 0 24px rgba(124, 43, 255, 0.35);
  text-align: center;
  min-width: 300px;
  margin: 0 20px;
}

#drawButton {
  font-size: 1.3rem;
  padding: 12px 30px;
  background: linear-gradient(180deg, #fff264 0%, #ff9c16 48%, #f52950 100%);
  color: #31051b;
  font-weight: 900;
  border: 2px solid #fff5a6;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 10px #fff05a, 0 0 24px #ff4d21, 0 5px 0 #a7193b;
  margin-bottom: 2rem;
  animation: button-flash 1.1s ease-in-out infinite alternate;
}

#drawButton:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0 16px #fff, 0 0 36px #ff4d21, 0 5px 0 #a7193b;
}

#drawButton:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 0 20px #fff05a, 0 0 36px #ff4d21;
}

@keyframes button-flash {
  from {
    filter: brightness(0.95);
  }
  to {
    filter: brightness(1.2);
  }
}

#resultDisplay {
  font-size: 1.5rem;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #160a27, #070611);
  color: #fff36b;
  border: 2px solid #ffcf32;
  text-shadow: 0 0 8px #fff, 0 0 20px #ff5d00;
  box-shadow: inset 0 0 18px rgba(255, 35, 115, 0.38), 0 0 14px rgba(255, 207, 50, 0.75);
  animation: result-pulse 1.6s ease-in-out infinite alternate;
}

@keyframes result-pulse {
  from {
    box-shadow: inset 0 0 12px rgba(255, 35, 115, 0.3), 0 0 8px rgba(255, 207, 50, 0.55);
  }
  to {
    box-shadow: inset 0 0 24px rgba(255, 35, 115, 0.58), 0 0 22px rgba(255, 207, 50, 0.95);
  }
}

footer {
  position: fixed;
  bottom: 20px;
  font-size: 0.9rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  #drawButton,
  #resultDisplay {
    animation: none;
  }
}

@media (min-width: 601px) {
  header h1 {
    font-size: 2.5rem;
  }
  
  main {
    margin: 0;
    padding: 3rem;
  }
  
  #drawButton {
    font-size: 1.5rem;
    padding: 15px 40px;
  }
  
  #resultDisplay {
    font-size: 2rem;
  }
}