.back-bar {
    display: flex;
    padding: 16px 16px 0;
    text-align: left;
}

.back-button {
    display: inline-block;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888;
    text-decoration: none;
    border: 1px solid #333;
    transition: color 0.1s, border-color 0.1s;
}

.back-button:hover {
    color: #00ff80;
    border-color: #00ff80;
}

.life-intro {
    margin: 0;
    padding: 0 16px 16px;
    color: #888;
}

.life-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    text-align: left;
}

.life-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

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

.field-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888;
}

.life-input {
    padding: 12px 16px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 16px;
    color: #ccc;
    background: #141414;
    border: 1px solid #333;
    outline: none;
    transition: border-color 0.1s;
}

.life-input:focus {
    border-color: #00ff80;
}

.life-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #ccc;
    cursor: pointer;
    user-select: none;
}

.life-check input {
    width: 16px;
    height: 16px;
    accent-color: #ff0040;
    cursor: pointer;
}

.life-button {
    align-self: flex-start;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #111;
    background: #fff;
    border: 1px solid #fff;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.life-button:hover {
    background: #00ff80;
    border-color: #00ff80;
    color: #111;
}

.life-note {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.life-error {
    margin: 0;
    min-height: 1.2em;
    font-size: 13px;
    color: #ff0040;
}

.life-results[hidden] {
    display: none;
}

.life-birthday {
    margin: 0;
    padding: 16px;
    border-bottom: 1px solid #333;
    font-size: 13px;
    letter-spacing: 1px;
    color: #00ff80;
}

.confetti {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.confetti.is-active {
    display: block;
}

.life-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 32px 16px 16px;
}

.life-percent {
    font-size: 80px;
    line-height: 1;
    font-weight: 700;
    color: #00ff80;
    text-shadow: 0 0 20px rgba(0, 255, 128, 0.4);
    font-variant-numeric: tabular-nums;
}

.life-percent-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
}

.life-estimate {
    font-size: 12px;
    color: #666;
}

.life-bar {
    position: relative;
    display: flex;
    width: calc(100% - 32px);
    height: 32px;
    margin: 16px;
    box-sizing: border-box;
    border: 1px solid #333;
    background: #141414;
    overflow: hidden;
}

.life-seg {
    height: 100%;
    width: 0;
    flex: 0 0 auto;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.life-seg.is-lived {
    background: #00ff80;
    box-shadow: inset 0 0 12px rgba(0, 255, 128, 0.5);
}

.life-seg.is-over {
    background: repeating-linear-gradient(
        45deg,
        #00ff80,
        #00ff80 4px,
        #0a0a0a 4px,
        #0a0a0a 8px
    );
}

.life-seg.is-remaining {
    background: #333;
}

.life-seg.is-lost {
    background: #ff0040;
    box-shadow: inset 0 0 12px rgba(255, 0, 64, 0.5);
}

.life-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    z-index: 2;
    transform: translateX(-1px);
}

.life-marker[hidden] {
    display: none;
}

.life-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding: 0 16px 16px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-item[hidden] {
    display: none;
}

.swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 1px solid #333;
}

.swatch.is-lived {
    background: #00ff80;
}

.swatch.is-over {
    background: repeating-linear-gradient(
        45deg,
        #00ff80,
        #00ff80 3px,
        #0a0a0a 3px,
        #0a0a0a 6px
    );
}

.swatch.is-remaining {
    background: #333;
}

.swatch.is-lost {
    background: #ff0040;
}

.life-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    padding: 0 16px 16px;
}

.life-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border: 1px solid #333;
    background: #141414;
    text-align: left;
}

.life-stat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #888;
}

.life-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.life-stat-value.is-good {
    color: #00ff80;
}

.life-stat-value.is-bad {
    color: #ff0040;
}

.life-compare {
    margin: 0;
    padding: 0 16px 24px;
    font-size: 13px;
    line-height: 1.7;
    color: #888;
    text-align: center;
}

@media (max-width: 768px) {
    .life-grid {
        grid-template-columns: 1fr;
    }

    .life-button {
        width: 100%;
        align-self: stretch;
    }

    .life-percent {
        font-size: 56px;
    }

    .life-bar {
        height: 24px;
    }
}
