.stopwatch-display {
    font-family: 'Time Traveler', sans-serif;
    font-size: clamp(60px, 12vw, 120px);
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
    margin: 6px 0 12px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.1em;
    font-variant-numeric: tabular-nums;
}


.stopwatch-display span {
    display: inline-block;
    min-width: 1.2em; /* Ensure minimum width for alignment */
    text-align: center;
}

#swMilliseconds {
    font-size: 0.7em; /* Make milliseconds smaller */
    color: var(--muted);
    min-width: 1.5em; /* Adjust width for 2 digits */
}

/* --- Stopwatch Controls --- */
.stopwatch-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Define secondary button style if not already global */
.secondary-btn {
    background-color: var(--chip);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 12px 20px;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.secondary-btn:hover:not(:disabled) {
    background-color: var(--card);
}
.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* --- Laps Section --- */
.laps-section {
    margin-top: 50px;
     /* max-width: 400px; /* Center the section */
    margin-left: auto;
    margin-right: auto;
}
.laps-section h2 { /* Style the "Laps" title */
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 15px;
    text-align: center; /* Center title if desired */
}

.laps-section.hidden {
    display: none;
}

/* Container style for the laps list */
#lapsList.laps-list { /* Increased specificity slightly */
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 100%; /* Limit height and allow scrolling */
    overflow-y: auto;
    background-color: var(--card); /* Container background */
    border: 1px solid var(--border); /* Container border */
    border-radius: 12px; /* Container rounded corners */
    padding: 10px; /* Padding inside the container */
    box-shadow: var(--shadow); /* Add shadow */
}

/* Individual lap item styling */
.lap-item {
    display: grid;
    grid-template-columns: auto 1fr auto; /* Number | Difference | Time */
    gap: 15px; /* Space between columns */
    align-items: center; /* Vertically align items */
    padding: 10px 5px; /* Vertical padding inside item, horizontal comes from container */
    font-size: 16px;
    border-bottom: 1px solid var(--chip); /* Separator line */
    /* Remove container styles from individual items */
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
}
.lap-item:last-child {
    border-bottom: none;
}

.lap-item .lap-number {
    color: var(--muted);
    font-weight: 700;
}

.lap-item .lap-difference {
    font-size: 14px;
    font-weight: 700;
    text-align: center; /* Center the difference text */
}
.lap-diff-faster { color: #4ade80; } /* Green */
.lap-diff-slower { color: #f87171; } /* Red */
.lap-diff-first { color: var(--muted); } /* Muted */

.lap-item .lap-time {
    font-weight: 700;
    color: var(--fg);
    font-variant-numeric: tabular-nums;
    text-align: right; /* Align time to the right */
}

/* Style the empty list message (if JS were to add one) */
#lapsList li.empty-message {
    padding: 15px;
    text-align: center;
    color: var(--muted);
    border-bottom: none;
}

/* Optional: Add custom scrollbar for laps list */
#lapsList.laps-list::-webkit-scrollbar { width: 8px; }
#lapsList.laps-list::-webkit-scrollbar-track { background: var(--chip); border-radius: 10px;}
#lapsList.laps-list::-webkit-scrollbar-thumb { background-color: var(--accent-color); border-radius: 10px; border: 2px solid var(--chip); }