html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    /* Evita que o scroll apareça caso a curvatura saia um pouco da tela */
    overflow: hidden;
    user-select: none;
}

#desktop {
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-desktop);
    position: relative;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 1;
    border-radius: 20px; 
    box-shadow: inset 0 0 60px rgba(0,0,0,0.3), 0 0 15px rgba(0,0,0,0.8);
    --crt-opacity: 0.08; 
}

#desktop::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    z-index: 10;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    opacity: var(--crt-opacity);
}

/* 5. Flicker (Piscar da tela) bem sutil */
@keyframes crt-flicker {
    0% { opacity: 0.99; }
    50% { opacity: 1; }
    100% { opacity: 0.995; }
}

#desktop {
    animation: crt-flicker 0.15s infinite;
}

/* Reflexo de vidro e Vinheta lateral */
#desktop::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(
        circle at center, 
        rgba(255,255,255,0.03) 0%, 
        rgba(0,0,0,0.25) 100%
    );
    z-index: 1000;
    pointer-events: none;
}

#window-manager {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    grid-template-rows: repeat(auto-fill, 90px);
    grid-auto-flow: column;
    gap: 10px;
    padding: 35px; /* Padding maior para os ícones não ficarem sob a curva do canto */
    height: calc(100vh - 40px); 
    width: 100vw;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    pointer-events: none;
}

/* Estilo do Slider dentro do Menu de Contexto/Start */
.crt-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px !important;
}

.crt-control span {
    font-size: 10px;
    font-weight: bold;
    opacity: 0.8;
}

#crt-slider {
    width: 100%;
    height: 4px;
    cursor: pointer;
    accent-color: var(--k-black, #000); /* Cor do slider acompanha o tema */
}

.desktop-icon {
    pointer-events: auto;
    cursor: pointer;
}

.layer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}