* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0d0d0d;
    font-family: sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-content: center;
    border: 0.3rem solid #1a1a1a;
    border-radius: 3rem;
    padding: 1rem;
    background-color: #1a1a1a;
}

h1 {
    font-size: 3.5rem;
    text-align: center;
    padding: 1rem;
    margin-bottom: 2rem;
    color: #fff;
    border-bottom: 2px solid #1a1a1a;
    background-color: #0d0d0d;
    border-radius: 1rem;
}

.box {
    display: flex;
    justify-content: space-around;
}

.clock {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 1rem;
    width: 8rem;
    height: 8rem;
    color: #fff;
    background-color: #1a1a1a;
    position: relative;
    border-radius: 1rem;
    font-size: 2rem;
    overflow: hidden;
}

.clock p {
    font-size: 1rem;
    margin-top: 0.5rem;
}

.clock::before,
.clock::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(0deg, transparent, #2370f5);
    z-index: 0;
    transform-origin: bottom right;
    animation: animate 5s linear infinite;
    border-radius: 1rem; /* Ensure corners are smooth */
}

.clock::after {
    background: linear-gradient(0deg, transparent, #b91fdc);
    animation-delay: -3s;
}

@keyframes animate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.front-clock {
    text-align: center;
    padding-top: 1rem;
    background-color: #0d0d0d;
    width: 95%;
    height: 95%;
    border-radius: 1rem;
    z-index: 1;
    position: relative;
}

.am-pm {
    font-size: 1rem;
    margin-top: 0.3rem;
    color: #ffcc00;
    text-transform: uppercase;
}
