﻿* {
    box-sizing: border-box;
}


.countdown {
    width: 50%;
    display: flex;
    gap: 10px;
    font-family: sans-serif;
}

.time-section {
    text-align: center;
    font-size: 30px;
}

.time-group {
    display: flex;
    gap: 5px;
}

.time-segment {
    display: block;
    font-size: 40px;
    font-weight: 900;
    width: 40px;
}

.segment-display {
    position: relative;
    height: 100%;
}

.segment-display__top,
.segment-display__bottom {
    overflow: hidden;
    text-align: center;
    width: 100%;
    height: 50%;
    position: relative;
}

.segment-display__top {
    line-height: 1.5;
    color: #eee;
    background-color: var(--color-primary);
}

.segment-display__bottom {
    line-height: 0;
    color: #fff;
    background-color: var(--color-primary);
}

.segment-overlay {
    position: absolute;
    top: 0;
    perspective: 400px;
    height: 100%;
    width: 40px;
}

.segment-overlay__top,
.segment-overlay__bottom {
    position: absolute;
    overflow: hidden;
    text-align: center;
    width: 100%;
    height: 50%;
}

.segment-overlay__top {
    top: 0;
    line-height: 1.5;
    color: #fff;
    background-color: var(--color-primary);
    transform-origin: bottom;
}

.segment-overlay__bottom {
    bottom: 0;
    line-height: 0;
    color: #eee;
    background-color: var(--color-primary);
    border-top: 2px solid var(--color-primary);
    transform-origin: top;
}

.segment-overlay.flip .segment-overlay__top {
    animation: flip-top 0.8s linear;
}

.segment-overlay.flip .segment-overlay__bottom {
    animation: flip-bottom 0.8s linear;
}

@keyframes flip-top {
    0% {
        transform: rotateX(0deg);
    }

    50%, 100% {
        transform: rotateX(-90deg);
    }
}

@keyframes flip-bottom {
    0%, 50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}
