:root {
    --menu-bar-height: 28px;
    --dock-height: 70px;
    --window-radius: 10px;
    --accent: #007aff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text",
        system-ui, sans-serif;
    color: #fff;
}

body {
    background: radial-gradient(circle at top, #4c6fff, #0b0c1f 60%);
    overflow: hidden;
}

.desktop {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Barre de menu en haut */
.menu-bar {
    height: var(--menu-bar-height);
    background: rgba(15, 15, 20, 0.75);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    font-size: 12px;
    -webkit-user-select: none;
    user-select: none;
}

.menu-left,
.menu-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-apple {
    font-size: 16px;
}

/* Zone centrale du bureau (où se trouvent les icônes et fenêtres) */
.desktop-main {
    position: relative;
    flex: 1;
    overflow: hidden;
    padding: 16px;
}

/* Dock en bas */
.dock {
    height: var(--dock-height);
    padding: 8px 16px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.9), transparent);
    backdrop-filter: blur(20px);
    -webkit-user-select: none;
    user-select: none;
}

.dock-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dock-icon img {
    width: 32px;
    height: 32px;
    pointer-events: none;
}

.dock-icon:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 14px 26px rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

/* Icônes du bureau */
.desktop-icon {
    position: absolute;
    width: 80px;
    text-align: center;
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
    padding: 4px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.12);
}

.desktop-icon img {
    width: 56px;
    height: 56px;
    display: block;
    margin: 0 auto 4px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.desktop-icon span {
    display: block;
    word-wrap: break-word;
}

/* Fenêtres d'applications */
.app-window {
    position: absolute;
    top: 18%;
    left: 50%;
    transform: translateX(-50%);
    width: min(600px, 90vw);
    max-height: 70vh;
    background: #f5f5f7;
    color: #111;
    border-radius: var(--window-radius);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.app-window.visible {
    display: flex;
}

.window-titlebar {
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    background: linear-gradient(to bottom, #e5e5ea, #c7c7cc);
    border-bottom: 1px solid #b0b0b5;
    -webkit-user-select: none;
    user-select: none;
    cursor: move;
}


.window-buttons {
    display: flex;
    gap: 6px;
    margin-right: 10px;
}

.window-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.window-btn.close {
    background: #ff5f57;
}

.window-btn.minimize {
    background: #febc2e;
}

.window-btn.maximize {
    background: #28c840;
}

.window-title {
    font-size: 12px;
    font-weight: 500;
}

.window-content {
    padding: 14px 16px 18px;
    overflow: auto;
}

.window-content h2 {
    margin-top: 0;
    font-size: 18px;
}

.window-content img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 10px;
    display: block;
}

.window-section {
    margin-bottom: 12px;
}

/* Responsive : ajuster un peu les tailles sur petits écrans */
@media (max-width: 600px) {
    .desktop-icon {
        width: 72px;
        font-size: 11px;
    }

    .desktop-icon img {
        width: 48px;
        height: 48px;
    }

    .dock-icon {
        width: 46px;
        height: 46px;
    }

    .dock-icon img {
        width: 28px;
        height: 28px;
    }
}