.life-page {
    min-height: 80vh;
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}

.life-container {
    width: 100%;
    max-width: 1000px;
}

.life-title {
    text-align: center;
    margin-bottom: 50px;
}

.date-form {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.date-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-field label {
    font-weight: 600;
}

.date-field input,
.date-field select {
    padding: 10px 12px;
    height: 42px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    box-sizing: border-box;
}

.date-field select {
    min-width: 160px;
    cursor: pointer;
}

#startButton {
    padding: 11px 25px;
    border: none;
    border-radius: 6px;
    background: #333;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

    #startButton:hover {
        background: #555;
    }

.error-message {
    min-height: 24px;
    margin-bottom: 20px;
    text-align: center;
    color: #dc3545;
}

.timeline-section {
    display: none;
    margin-top: 50px;
}

.timeline-dates {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.timeline-wrapper {
    padding: 20px 0;
}

.timeline {
    position: relative;
    width: 100%;
    height: 14px;
    display: flex;
    border-radius: 7px;
    overflow: visible;
}

.timeline-elapsed {
    height: 100%;
    width: 0;
    background: #dc3545;
    border-radius: 7px 0 0 7px;
}

.timeline-remaining {
    height: 100%;
    flex: 1;
    background: #198754;
    border-radius: 0 7px 7px 0;
}

.timeline-point {
    position: absolute;
    top: 50%;
    left: 0;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    background: white;
    border: 5px solid #343a40;
    border-radius: 50%;
    box-sizing: border-box;
}

.countdown {
    margin-top: 50px;
    text-align: center;
}

.countdown-title {
    font-size: 18px;
    color: #666;
    margin-bottom: 10px;
}

.countdown-value {
    font-size: 36px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.statistics {
    display: flex;
    justify-content: center;
    gap: 80px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.stat-label {
    color: #777;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 20px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .date-form {
        flex-direction: column;
        align-items: stretch;
    }

    #startButton {
        margin-top: 5px;
    }

    .countdown-value {
        font-size: 24px;
    }

    .statistics {
        gap: 30px;
    }
}

.birthday-markers {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.birthday-marker {
    position: absolute;
    top: 0;
    height: 14px;
    width: 1px;
    background: white;
    transform: translateX(-50%);
}

.time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10px, 10px));
    gap: 3px;
    width: 100%;
}

.time-cell {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: rgba(25, 135, 84, 0.22);
    box-sizing: border-box;
    transition: background-color 0.3s ease, opacity 0.3s ease, transform 0.2s ease;
}

    .time-cell.passed {
        background: #dc3545;
    }

    .time-cell.current {
        background: #dc3545;
    }

    .time-cell.flashing {
        animation: minute-flash 1s infinite;
    }

@keyframes minute-flash {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.35;
        transform: scale(0.85);
    }
}

.period-grid {
    margin-top: 32px;
}

.period-grid-title {
    font-size: 13px;
    font-weight: 600;
    color: #777;
    margin-bottom: 10px;
}

.five-minute-grid {
    grid-template-columns: repeat(15, 10px);
}
