:root {
  --primary-color: #ff3366;
  --secondary-color: #ff9933;
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-color: #f1f5f9;
  --muted-text: #94a3b8;
  --accent-color: #38bdf8;
  --ball-bg: #334155;
  --ball-text: #fff;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding: 20px;
}

.app-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  padding: 30px 20px;
  text-align: center;
  border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 1px;
}

header h1 span {
  color: #fff;
  opacity: 0.8;
  font-weight: 300;
}

header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

section {
  padding: 20px 30px;
}

h2, h3 {
  margin-bottom: 15px;
  color: var(--text-color);
}

.stats-overview {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-card {
  flex: 1;
  min-width: 250px;
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: var(--radius);
  text-align: center;
}

.number-balls {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ball-bg);
  color: var(--ball-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.2), 0 4px 6px rgba(0,0,0,0.3);
  transition: transform 0.2s, background 0.3s;
  cursor: pointer;
}

.ball:hover {
  transform: translateY(-2px);
  background: var(--accent-color);
}

.ball.selected {
  background: var(--primary-color);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.6), inset 0 -3px 0 rgba(0,0,0,0.4);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fixed-numbers-selector .number-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.strategy-selector select, 
.row-count input {
  width: 100%;
  padding: 12px;
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  margin-top: 5px;
}

.strategy-selector select:focus, 
.row-count input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  padding: 15px;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(255, 51, 102, 0.4);
  transition: all 0.3s ease;
  font-family: inherit;
  margin-top: 10px;
}

.primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 51, 102, 0.6);
}

.primary-btn:active {
  transform: translateY(1px);
}

.results-section {
  background: rgba(0, 0, 0, 0.2);
  min-height: 200px;
}

.generated-row {
  background: var(--bg-color);
  padding: 15px;
  border-radius: var(--radius);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideIn 0.4s ease forwards;
  border-left: 4px solid var(--accent-color);
}

.generated-row .balls-row {
  display: flex;
  gap: 10px;
}

.generated-row .ball {
  cursor: default;
}

.generated-row .ball.fixed {
  background: var(--primary-color);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.empty-state {
  text-align: center;
  color: var(--muted-text);
  padding: 40px 0;
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .generated-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
