/* Reset and base styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f8f9fa;
  min-height: 100vh;
}

/* Theme colors */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-light: #ffffff;
  --bg-dark: #1f2937;
  --text-light: #ffffff;
  --text-dark: #1f2937;
  --border: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme='dark'] {
  --primary: #60a5fa;
  --primary-dark: #93c5fd;
  --secondary: #9ca3af;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --bg-light: #1f2937;
  --bg-dark: #111827;
  --text-light: #f9fafb;
  --text-dark: #f3f4f6;
  --border: #374151;
  --shadow: rgba(0, 0, 0, 0.3);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Header styles */
header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--text-light);
  padding: 2rem 0;
  text-align: center;
}

header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 1rem;
  opacity: 0.9;
}

nav {
  margin-top: 1rem;
}

#themeToggle {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#themeToggle:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Main layout */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Number display */
.number-display {
  text-align: center;
  margin: 2rem 0;
}

.main-numbers {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.number-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 4px 6px var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.number-circle:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 12px var(--shadow);
}

.number-circle.small {
  width: 45px;
  height: 45px;
  font-size: 1rem;
  background: var(--warning);
}

.lucky-star-numbers {
  font-size: 1.1rem;
  color: var(--secondary);
}

/* Tabs */
.mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--bg-light);
  border-radius: 0.5rem;
  padding: 0.25rem;
  box-shadow: 0 2px 4px var(--shadow);
}

.mode-tabs button {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.mode-tabs button.active {
  background: var(--primary);
  color: var(--text-light);
}

.mode-tabs button:not(.active) {
  color: var(--secondary);
}

.mode-tabs button:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05);
}

/* Control panel */
.control-panel {
  background: var(--bg-light);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px var(--shadow);
}

.generate-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.primary-btn, .secondary-btn, .danger-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  flex: 1;
  min-width: 150px;
}

.primary-btn {
  background: var(--primary);
  color: var(--text-light);
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

.secondary-btn {
  background: var(--bg-light);
  color: var(--secondary);
  border: 1px solid var(--border);
}

.secondary-btn:hover {
  background: var(--border);
}

.danger-btn {
  background: var(--danger);
  color: var(--text-light);
}

.danger-btn:hover {
  background: #dc2626;
}

/* Personal inputs */
.personal-inputs {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 0.5rem;
  border: 1px dashed var(--border);
}

.personal-inputs h3 {
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.personal-inputs input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 1rem;
}

.personal-inputs input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Frequency display */
.frequency-display {
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--secondary);
}

.freq-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.bar-fill {
  flex: 1;
  height: 8px;
  background: var(--primary);
  border-radius: 4px;
  opacity: 0.6;
}

/* History section */
.history-section, .export-section, .info-section {
  background: var(--bg-light);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 6px var(--shadow);
}

.history-section h2,
.export-section h2,
.info-section h2 {
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 0.5rem;
  border-left: 4px solid var(--primary);
}

.combo-numbers {
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

.copy-btn {
  background: var(--success);
  color: var(--text-light);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.copy-btn:hover {
  background: #059669;
}

/* Export textarea */
#exportArea {
  width: 100%;
  min-height: 100px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  margin-bottom: 1rem;
  background: var(--bg-light);
  color: var(--text-dark);
}

/* Info section content */
.info-section h3 {
  color: var(--primary-dark);
  margin: 1.5rem 0 0.75rem 0;
  font-size: 1.25rem;
}

.info-section p {
  margin-bottom: 0.75rem;
  color: var(--secondary);
}

.info-section ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.info-section li {
  margin-bottom: 0.5rem;
}

/* Footer */
footer {
  background: var(--bg-light);
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

footer p {
  color: var(--secondary);
  font-size: 0.9rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
  }

  header {
    padding: 1.5rem 0;
    text-align: center;
  }

  .main-numbers {
    gap: 0.5rem;
  }

  .number-circle {
    width: 50px;
    height: 50px;
    font-size: 1rem;
  }

  .number-circle.small {
    width: 38px;
    height: 38px;
    font-size: 0.875rem;
  }

  .generate-controls {
    flex-direction: column;
  }

  .control-panel {
    padding: 1rem;
  }

  .history-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .info-section {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .tagline {
    font-size: 0.9rem;
  }

  .mode-tabs {
    font-size: 0.85rem;
  }

  .number-circle {
    width: 45px;
    height: 45px;
    font-size: 0.875rem;
  }

  .number-circle.small {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  header, nav, footer {
    display: none;
  }

  main {
    margin: 0;
    padding: 0;
  }

  .number-display {
    text-align: center;
    margin: 2rem 0;
  }

  .number-circle {
    box-shadow: none;
    border: 1px solid black;
  }
}

/* Animation helpers */n@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Utility classes */n.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }


/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
