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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

nav {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    sticky: top 0;
    z-index: 100;
}

.nav-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.nav-btn.active {
    background: #667eea;
    color: white;
}

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

.content-section {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.5s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 0.5rem;
}

.explanation {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

.explanation h3 {
    color: #764ba2;
    margin-bottom: 0.5rem;
}

.explanation p {
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #555;
}

.explanation p:last-child {
    margin-bottom: 0;
}

.controls {
    background: #f0f0f0;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.control-group {
    margin: 1rem 0;
}

.control-group label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.5rem;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #764ba2;
    transform: scale(1.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.control-group select {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background: white;
}

button {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

button:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

.hint {
    font-style: italic;
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

canvas {
    display: block;
    margin: 0 auto;
    border: 2px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: #000;
    max-width: 100%;
    height: auto;
}

footer {
    text-align: center;
    padding: 2rem;
    color: white;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .content-section {
        padding: 1rem;
    }

    .content-section h2 {
        font-size: 1.5rem;
    }

    canvas {
        width: 100% !important;
        height: auto !important;
    }
}
