:root {
    --color-space: #0a0a1f;
    --color-cosmic: #6b46c1;
    --color-nebula: #9333ea;
    --color-star: #f5f3ff;
    --color-accent: #a78bfa;
    --font-display: 'Orbitron', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-display);
    background: var(--color-space);
    color: var(--color-star);
    min-height: 100vh;
    overflow-x: hidden;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent);
    background-size: 200% 200%;
    animation: stars 120s linear infinite;
    opacity: 0.5;
    z-index: 0;
}

@keyframes stars {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 4rem;
    animation: spin 20s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-text h1 {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-nebula), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.3rem;
    margin: 1rem 0;
    text-shadow: 0 0 20px rgba(147, 51, 234, 0.5);
}

.subtitle {
    font-size: 0.9rem;
    letter-spacing: 0.2rem;
    color: var(--color-accent);
}

.canvas-section {
    background: rgba(10, 10, 31, 0.8);
    border: 2px solid var(--color-cosmic);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 0 40px rgba(107, 70, 193, 0.5);
}

#fractalCanvas {
    display: block;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(147, 51, 234, 0.6);
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.control-panel {
    background: rgba(107, 70, 193, 0.1);
    border: 1px solid var(--color-cosmic);
    border-radius: 12px;
    padding: 1.5rem;
}

.control-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fractal-types, .color-schemes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fractal-btn, .color-btn {
    font-family: var(--font-display);
    font-size: 0.9rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 6px;
    color: var(--color-star);
    cursor: pointer;
    transition: all 0.3s;
}

.fractal-btn:hover, .color-btn:hover {
    background: rgba(167, 139, 250, 0.2);
    border-color: var(--color-accent);
    transform: translateX(4px);
}

.fractal-btn.active, .color-btn.active {
    background: var(--color-cosmic);
    border-color: var(--color-nebula);
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.5);
}

.settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.setting-item label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--color-accent);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(167, 139, 250, 0.2);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--color-nebula);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.8);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-cosmic), var(--color-nebula));
    color: white;
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(147, 51, 234, 0.8);
}

.btn-secondary {
    background: rgba(167, 139, 250, 0.2);
    border: 1px solid var(--color-accent);
    color: var(--color-star);
}

.btn-secondary:hover {
    background: rgba(167, 139, 250, 0.3);
}

.info {
    background: rgba(107, 70, 193, 0.1);
    border: 1px solid var(--color-cosmic);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.info h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.info p {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
}

.controls-info {
    background: rgba(107, 70, 193, 0.2);
    border: 1px solid var(--color-cosmic);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.controls-info h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls-info ul {
    list-style: none;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.7);
}

.controls-info li {
    padding-left: 1.5rem;
    position: relative;
}

.controls-info li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--color-nebula);
}

.controls-info strong {
    color: var(--color-star);
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--color-cosmic);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-nebula);
    box-shadow: 0 0 30px rgba(147, 51, 234, 0.6);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateX(400px);
    transition: transform 0.3s;
    z-index: 1000;
}

.toast.show { transform: translateX(0); }

@media (max-width: 768px) {
    .container { padding: 1rem; }
    .logo-text h1 { font-size: 2rem; }
    .controls { grid-template-columns: 1fr; }
    .action-buttons { flex-direction: column; }
}
