:root {
  --primary-color: #4f46e5;
  --secondary-color: #ec4899;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --ball-shadow: rgba(0, 0, 0, 0.1);
  --border-color: rgba(255, 255, 255, 0.8);
  --dot-color: #e2e8f0;
}

body.dark-mode {
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --ball-shadow: rgba(0, 0, 0, 0.4);
  --border-color: rgba(255, 255, 255, 0.05);
  --dot-color: #1e293b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-color);
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
  position: relative;
}

.controls {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.lang-select {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  appearance: none;
  -webkit-appearance: none;
}

.theme-toggle {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.container {
  background-color: var(--card-bg);
  padding: 3rem;
  border-radius: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 600px;
  text-align: center;
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
}

header {
  margin-bottom: 2rem;
}

.latest-result {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 1.5rem;
  margin-bottom: 2.5rem;
  transition: all 0.3s ease;
}

.latest-result h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.winning-numbers {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.winning-placeholder {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.win-ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  box-shadow: 0 4px 6px -1px var(--ball-shadow);
}

.bonus-label {
  align-self: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 0.2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.highlight {
  color: var(--primary-color);
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  color: var(--text-muted);
}

.lotto-display {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  min-height: 80px;
}

.ball {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  box-shadow: 0 10px 15px -3px var(--ball-shadow), inset 0 2px 4px rgba(255, 255, 255, 0.2);
  transform: translateY(0);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px dashed #cbd5e1;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #94a3b8;
  font-weight: 700;
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.generate-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-weight: 700;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 20px -5px rgba(79, 70, 229, 0.4);
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -5px rgba(79, 70, 229, 0.5);
}

.generate-btn:active {
  transform: translateY(0);
}

footer {
  margin-top: 3rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Ball Colors */
.color-1 { background: #ef4444; } /* Red */
.color-2 { background: #f59e0b; } /* Orange */
.color-3 { background: #10b981; } /* Green */
.color-4 { background: #3b82f6; } /* Blue */
.color-5 { background: #8b5cf6; } /* Purple */
.color-6 { background: #64748b; } /* Grey */

@media (max-width: 480px) {
  .container { padding: 2rem 1.5rem; }
  .ball, .placeholder { width: 50px; height: 50px; font-size: 1rem; }
  h1 { font-size: 2rem; }
}
