:root {
    --bg-color: #0c0c0e;
    --text-color: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.6);
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --icon-size: 84px;
    --dock-padding: 2.5rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color) url('../images/bg.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Dim Overlay */
body::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

.main-screen {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: env(safe-area-inset-top) 1.5rem env(safe-area-inset-bottom);
}

/* Top Section: Clock & Status */
.top-section {
    flex: 1;
    /* Pushes the dock to the bottom */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center the clock in the available top space */
    animation: fadeInDown 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#clock {
    font-size: clamp(4.5rem, 18vw, 8rem);
    font-weight: 800;
    letter-spacing: -4px;
    line-height: 0.9;
    text-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

#date {
    font-size: clamp(1.1rem, 4.5vw, 1.6rem);
    font-weight: 400;
    color: var(--text-dim);
    margin-top: 0.8rem;
    letter-spacing: 1px;
}

/* Bottom Section: The Dock (App Drawer) */
.bottom-section {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 4vh;
}

.dock {
    width: 100%;
    max-width: 860px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    padding: var(--dock-padding);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 2rem;
    box-shadow: 0 40px 80px -15px rgba(0, 0, 0, 0.7);
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Fallback for auto-fit when few items */
.dock[data-count="3"] {
    grid-template-columns: repeat(3, 1fr);
    max-width: 600px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.app-item:hover {
    transform: translateY(-12px);
}

.app-item:active {
    transform: scale(0.9);
}

.app-icon {
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: 22.5%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    margin-bottom: 0.8rem;
    position: relative;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.app-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 100%);
}

.app-name {
    display: block;
    width: 100%;
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
    text-align: center;
    word-break: break-word;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    :root {
        --icon-size: 70px;
        --dock-padding: 1.5rem;
    }

    .main-screen {
        padding: 1rem;
    }

    .top-section {
        justify-content: flex-start;
        padding-top: 15vh;
    }

    .dock {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        border-radius: 35px;
    }

    .app-icon {
        font-size: 2.2rem;
        margin-bottom: 0.5rem;
    }

    .app-name {
        font-size: 0.85rem;
    }
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(80px);
    }

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