@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@700&display=swap');

:root {
  --glow-color: hsl(186 100% 69%);
  --bg-color: #f0f0f0;
  --container-bg: #ffffff;
  --text-color: #1a1a1a;
  --ball-bg-start: #ffffff;
  --ball-bg-end: #e6e6e6;
  --ball-text: #1a1a1a;
  --shadow-color: rgba(0,0,0,0.1);
  --title-color: #1a1a1a;
  --title-shadow: rgba(0, 0, 0, 0.2);
}

body.dark-theme {
  --bg-color: #1a1a1a;
  --container-bg: #2a2a2a;
  --text-color: #ffffff;
  --ball-bg-start: #3a3a3a;
  --ball-bg-end: #1a1a1a;
  --ball-text: #ffffff;
  --shadow-color: rgba(0,0,0,0.5);
  --title-color: #ffffff;
  --title-shadow: rgba(255, 255, 255, 0.8);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
}

#theme-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid var(--glow-color);
  background: var(--container-bg);
  color: var(--text-color);
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9em;
  transition: all 0.3s ease;
}

#theme-btn:hover {
  background: var(--glow-color);
  color: #000;
}

.container {
    text-align: center;
    background: var(--container-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color), 0 0 20px rgba(255,255,255,0.05);
    transition: all 0.3s ease;
    width: 90%;
    max-width: 600px;
    margin: 60px 20px;
}

h1 {
    color: var(--title-color);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px var(--title-shadow);
    transition: all 0.3s ease;
}

.numbers-display {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.plus-sign {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 0 0.5rem;
}

.number-ball.bonus {
    border: 2px solid var(--glow-color);
    box-shadow: 0 0 15px var(--glow-color);
}

.number-ball {
    width: clamp(40px, 10vw, 60px);
    height: clamp(40px, 10vw, 60px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1rem, 3vw, 1.8rem);
    font-weight: bold;
    color: var(--ball-text);
    background: linear-gradient(145deg, var(--ball-bg-start), var(--ball-bg-end));
    box-shadow: 0 8px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.number-ball:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 20px var(--shadow-color);
}

.glowing-btn {
  position: relative;
  color: var(--glow-color);
  cursor: pointer;
  padding: 0.35em 1em;
  border: 0.15em solid var(--glow-color);
  border-radius: 0.45em;
  background: none;
  perspective: 2em;
  font-size: clamp(1rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.5em;
  -webkit-box-shadow: inset 0px 0px 0.5em 0px var(--glow-color), 0px 0px 0.5em 0px var(--glow-color);
  -moz-box-shadow: inset 0px 0px 0.5em 0px var(--glow-color), 0px 0px 0.5em 0px var(--glow-color);
  box-shadow: inset 0px 0px 0.5em 0px var(--glow-color), 0px 0px 0.5em 0px var(--glow-color);
  animation: border-flicker 2s linear infinite;
  text-transform: uppercase;
}

.glowing-txt {
  margin-right: -0.4em;
  -webkit-text-shadow: 0 0 0.125em hsl(0 0% 100% / 0.3), 0 0 0.45em var(--glow-color);
  -moz-text-shadow: 0 0 0.125em hsl(0 0% 100% / 0.3), 0 0 0.45em var(--glow-color);
  text-shadow: 0 0 0.125em hsl(0 0% 100% / 0.3), 0 0 0.45em var(--glow-color);
  animation: text-flicker 3s linear infinite;
}

.faulty-letter {
  opacity: 0.5;
  animation: faulty-flicker 2s linear infinite;
}

.glowing-btn::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  opacity: 0.7;
  filter: blur(1em);
  transform: translateY(120%) rotateX(95deg) scale(1, 0.35);
  background: var(--glow-color);
  pointer-events: none;
}

.glowing-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  z-index: -1;
  background-color: var(--glow-color);
  box-shadow: 0 0 2em 0.2em var(--glow-color);
  transition: opacity 100ms linear;
}

.glowing-btn:hover {
  color: rgba(0, 0, 0, 0.8);
  text-shadow: none;
  animation: none;
}

.glowing-btn:hover .glowing-txt {
  animation: none;
}

.glowing-btn:hover .faulty-letter {
  animation: none;
  text-shadow: none;
  opacity: 1;
}

.glowing-btn:hover:before {
  filter: blur(1.5em);
  opacity: 1;
}

.glowing-btn:hover:after {
  opacity: 1;
}

@keyframes faulty-flicker {
  0% { opacity: 0.1; }
  2% { opacity: 0.1; }
  4% { opacity: 0.5; }
  19% { opacity: 0.5; }
  21% { opacity: 0.1; }
  23% { opacity: 1; }
  80% { opacity: 0.5; }
  83% { opacity: 0.4; }
  87% { opacity: 1; }
}

@keyframes text-flicker {
  0% { opacity: 0.1; }
  2% { opacity: 1; }
  8% { opacity: 0.1; }
  9% { opacity: 1; }
  12% { opacity: 0.1; }
  20% { opacity: 1; }
  25% { opacity: 0.3; }
  30% { opacity: 1; }
  70% { opacity: 0.7; }
  72% { opacity: 0.2; }
  77% { opacity: 0.9; }
  100% { opacity: 0.9; }
}

@keyframes border-flicker {
  0% { opacity: 0.1; }
  2% { opacity: 1; }
  4% { opacity: 0.1; }
  8% { opacity: 1; }
  70% { opacity: 0.7; }
  100% { opacity: 1; }
}

@media (max-width: 480px) {
  .container {
    padding: 1.5rem;
  }
  .numbers-display {
    gap: 0.5rem;
  }
  .glowing-btn {
    letter-spacing: 0.3em;
  }
}
