:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --accent: #007aff;
    --text: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    user-select: none;
}

body,
html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

#desktop {
    width: 100vw;
    height: 100vh;
    position: relative;
    padding: 20px;
}

/* Icons */
#icon-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    grid-template-rows: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    width: 100%;
    height: calc(100% - 60px);
}

.icon {
    width: 80px;
    height: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    border-radius: 8px;
    padding: 5px;
    position: relative;
}

.icon:hover {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
}

.icon-image {
    width: 48px;
    height: 48px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.icon-label {
    margin-top: 8px;
    color: white;
    font-size: 12px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Destruction Animation */
.icon.breaking {
    animation: breakIcon 0.5s forwards;
    pointer-events: none;
}

@keyframes breakIcon {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: sepia(0) brightness(1);
    }

    50% {
        transform: scale(1.2) rotate(10deg);
        filter: sepia(1) brightness(1.5);
    }

    100% {
        transform: scale(0) rotate(-20deg);
        opacity: 0;
    }
}

/* Destroyer */
.destroyer {
    position: absolute;
    width: 50px;
    height: 50px;
    z-index: 100;
    pointer-events: none;
    transition: transform 0.1s linear;
}

.destroyer-sprite {
    width: 100%;
    height: 100%;
    background-color: #ff4757;
    border-radius: 50%;
    box-shadow: 0 0 15px #ff4757;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.destroyer-sprite::after {
    content: attr(data-icon);
    font-size: 24px;
}

.destroyer.scared {
    filter: hue-rotate(90deg);
}

.destroyer.scared .destroyer-sprite::after {
    content: '😱';
    animation: jitter 0.1s infinite;
}

@keyframes jitter {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(2px, -2px);
    }

    50% {
        transform: translate(-2px, 2px);
    }

    75% {
        transform: translate(2px, 2px);
    }

    100% {
        transform: translate(-2px, -2px);
    }
}

.destroyer.attacking {
    animation: attackBump 0.3s ease-in-out;
}

@keyframes attackBump {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }
}

/* Taskbar */
#taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 1000;
}

.start-btn {
    color: white;
    cursor: pointer;
    margin-right: 20px;
    transition: color 0.2s;
}

.start-btn:hover {
    color: var(--accent);
}

#clock {
    margin-left: auto;
    color: white;
    font-size: 14px;
    font-weight: 300;
}

/* Settings Panel */
#settings-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 220px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

#settings-panel h3 {
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 18px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.7);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}

#restart-btn {
    width: 100%;
    padding: 10px;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: filter 0.2s;
}

#restart-btn:hover {
    filter: brightness(1.2);
}

.stats p {
    font-size: 13px;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.9);
}