* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --primary: #8b5cf6; --primary-hover: #7c3aed; --background: #f8fafc; --card-bg: #fff; --text: #1e293b; --text-muted: #64748b; --border: #e2e8f0; --radius: 12px; --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1); }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--background); color: var(--text); line-height: 1.6; }
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1rem; }
header { text-align: center; margin-bottom: 2rem; }
header h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.subtitle { color: var(--text-muted); font-size: 1.1rem; }
.badges { display: flex; justify-content: center; gap: 0.75rem; margin-top: 1rem; }
.badge { padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.85rem; font-weight: 600; }
.badge-green { background: rgba(34,197,94,0.15); color: #16a34a; }
.badge-blue { background: rgba(59,130,246,0.15); color: #2563eb; }
.badge-purple { background: rgba(139,92,246,0.15); color: #7c3aed; }
.generator-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; margin-bottom: 3rem; }
.mode-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn { flex: 1; min-width: 80px; padding: 0.75rem 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); background: var(--background); border: 2px solid var(--border); border-radius: 8px; cursor: pointer; }
.tab-btn:hover { border-color: var(--primary); color: var(--primary); }
.tab-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.input-panel { display: none; margin-bottom: 1.5rem; }
.input-panel.active { display: block; }
.range-inputs { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.input-group { flex: 1; min-width: 100px; }
.input-group label { display: block; font-weight: 600; margin-bottom: 0.5rem; font-size: 0.9rem; }
.input-group input, .input-group select { width: 100%; padding: 0.75rem; border: 2px solid var(--border); border-radius: 8px; font-size: 1rem; }
.input-group input:focus { outline: none; border-color: var(--primary); }
.option-checkbox { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.dice-options { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dice-btn { padding: 0.75rem 1rem; font-weight: 600; background: var(--background); border: 2px solid var(--border); border-radius: 8px; cursor: pointer; }
.dice-btn:hover, .dice-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.lottery-presets { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.preset-btn { padding: 0.5rem 1rem; font-size: 0.85rem; background: var(--background); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.preset-btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { width: 100%; padding: 1rem; font-size: 1.1rem; font-weight: 600; color: white; background: var(--primary); border: none; border-radius: 8px; cursor: pointer; }
.btn-primary:hover { background: var(--primary-hover); }
.output-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.output-header { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.output-header label { font-weight: 600; }
.copy-btn { padding: 0.5rem 1rem; font-weight: 600; color: var(--primary); background: white; border: 2px solid var(--primary); border-radius: 6px; cursor: pointer; }
.copy-btn:hover { background: var(--primary); color: white; }
.result-display { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; padding: 1.5rem; background: var(--background); border-radius: 8px; min-height: 60px; align-items: center; }
.result-number { font-size: 2rem; font-weight: 700; color: var(--primary); padding: 0.5rem 1rem; background: white; border-radius: 8px; box-shadow: var(--shadow); }
.dice-result { font-size: 1.5rem; padding: 0.5rem; }
.dice-total { width: 100%; text-align: center; margin-top: 0.5rem; font-weight: 600; color: var(--text-muted); }
.lottery-ball { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), #ec4899); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 700; }
.sequence-result { font-family: monospace; font-size: 1.25rem; word-break: break-all; }
.result-history { margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); }
.features { margin-bottom: 3rem; }
.features h2, .faq h2 { text-align: center; font-size: 1.75rem; margin-bottom: 2rem; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.feature { background: var(--card-bg); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.feature-icon { font-size: 2rem; }
.feature h3 { font-size: 1rem; margin: 0.5rem 0; }
.feature p { color: var(--text-muted); font-size: 0.85rem; }
.faq { margin-bottom: 3rem; }
.faq-item { background: var(--card-bg); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 1rem; }
.faq-item h4 { margin-bottom: 0.5rem; }
.faq-item p { color: var(--text-muted); font-size: 0.9rem; }
.faq-item code { background: var(--background); padding: 0.2rem 0.4rem; border-radius: 4px; }
footer { text-align: center; color: var(--text-muted); padding: 2rem 0; }
@media (max-width: 600px) { .features-grid { grid-template-columns: repeat(2, 1fr); } .mode-tabs { flex-direction: column; } .lottery-ball { width: 40px; height: 40px; font-size: 1rem; } }



/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    font-size: 1.25rem;
    transition: transform 0.2s, background 0.3s;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

/* Dark Mode - Variable Overrides */
[data-theme="dark"] {
    --background: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body {
    background: #0f172a;
    color: #f1f5f9;
}

[data-theme="dark"] .container {
    color: #f1f5f9;
}

[data-theme="dark"] .generator-card,
[data-theme="dark"] .feature,
[data-theme="dark"] .faq-item {
    background: #1e293b;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #334155;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #64748b;
}

[data-theme="dark"] .tab-btn {
    background: #0f172a;
    color: #94a3b8;
    border-color: #334155;
}

[data-theme="dark"] .tab-btn:hover {
    color: #f1f5f9;
}

[data-theme="dark"] code {
    background: #0f172a;
    color: #f1f5f9;
}

[data-theme="dark"] .badge {
    background: #1e293b;
}

[data-theme="dark"] .subtitle,
[data-theme="dark"] .faq-item p,
[data-theme="dark"] .feature p {
    color: #94a3b8;
}

[data-theme="dark"] footer {
    color: #64748b;
}

[data-theme="dark"] .theme-toggle {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
