:root {
    --bg-color: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-blue: #0071e3;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --filter-cyan: #00ffff;
    --filter-magenta: #ff00ff;
    --filter-yellow: #ffff00;
    --filter-red: #ff0000;
    --filter-green: #00ff00;
    --filter-blue: #0000ff;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    animation: pageFadeIn 0.8s ease-out forwards;
}

body.fade-out {
    animation: pageFadeOut 0.5s ease-in forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

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

.breadcrumb {
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-blue);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: inline-block;
    margin-bottom: 1rem;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
}

/* --- Lab Layout --- */
.lab-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

select {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

/* --- Simulation Area --- */
.canvas-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .lab-card {
        padding: 1rem;
    }
}

/* Extra mobile rules to match simulator responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .controls {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .canvas-container {
        aspect-ratio: 4 / 3;
    }

    .legend {
        gap: 0.8rem;
        flex-direction: column;
        align-items: center;
    }

    .lab-card {
        padding: 0.75rem;
        border-radius: 16px;
    }
}