
*,
*::before,
*::after {
    box-sizing: border-box;
}


.ac-b {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ac-bg-svg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    filter: blur(1px) brightness(1.1);
}


.timer-centerpiece {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Changed from center to space-between */
    gap: 15px; /* Reduced gap for mobile */
    width: 100%;
    max-width: 600px;
    padding: 20px;
    min-height: 100%; /* Fill the parent */
    height: 100%;
    overflow: visible
}

#timer-dial {
    width: 50vw; /* Increased slightly for mobile visibility */
    height: 50vw;
    max-width: 300px;
    max-height: 300px;
    min-width: 120px; /* Increased from 100px */
    min-height: 120px; /* Increased from 100px */
    display: block;
    margin: 0 auto;
    flex-shrink: 1; /* Prevent shrinking */
}

.timer-remaining {
    text-align: center;
    margin: 10px 0;
    flex-shrink: 0; /* Prevent shrinking */
}

.timer-btn {
    padding: 8px 12px;
    border: 1px solid var(--secondary-color);
    background-color: var(--primary-color);
    color: var(--tertiary-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 40px;
}

.standalone-timer {
    min-height: 100vh; /* fallback for non-grid parents */
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.timer-display {
    position: relative;
    min-height: 400px; /* Reduced from 500px */
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* Allow it to grow */
}

/* Move background to pseudo-element */
.timer-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.7) 0%, rgba(200,200,200,0.5) 60%, rgba(180,180,180,0.7) 100%),
        repeating-linear-gradient(135deg, rgba(255,255,255,0.1) 0 2px, transparent 2px 40px),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.08) 0 2px, transparent 2px 40px),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 60px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 60px),
        #eaeaea;
    z-index: 0;
    margin-top: auto;
}

.timer-actions,
.timer-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 400px;
    flex-shrink: 0; /* Prevent shrinking */
    margin-top: auto; /* Push to bottom */
}

.timer-slice-active {
    filter: brightness(2) rgba(255,255,255,0.7);
    transition: filter 0.2s;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .ac-bg,
    .ac-bg-svg,
    .timer-display::before {
        display: none !important;
        background: none !important;
    }


    .ac-bg{
        margin-top: 5rem;
        width: 100vw;
        height: 100vh;
    }

     .timer-display {
        min-height: 300px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .timer-centerpiece {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 5px;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    #timer-dial {
        width: 100%;
        height: auto;
        max-width: 230px;
        max-height: 230px;
        min-width: 120px;
        min-height: 120px;
        display: block;
        margin: 0 auto 5px auto;
        aspect-ratio: 1 / 1; /* Ensures it's always a square */
    }
    
    .timer-btn {
        padding: 10px 10px; /* Smaller buttons on mobile */
        font-size: 0.8rem;
        min-width: 35px;
    }
    
    .timer-actions {
        gap: 10px; /* Tighter button spacing */
    }

}



/* Tablet and up */
@media (min-width: 769px) {
    
    .timer-display {
        min-height: 450px;
    }
    
    .timer-centerpiece {
        gap: 20px;
    }
    
    .timer-controls {
        display: flex;
    }

}
/* Large screens */
@media (min-width: 1024px) {
    .timer-display {
        min-height: 500px;
    }
    
    #timer-dial {
        width: 40vw;
        height: 40vw;
    }
}