/* General layout ---------------------------------------------------------*/
*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: system-ui, sans-serif;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 1rem 4rem;
    background: #f9fafb;
    color: #111;
    min-height: 100vh;
}

header {
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Nav buttons ------------------------------------------------------------*/
nav {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

nav button {
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: 0.4rem;
    background: #e5e7eb;
    cursor: pointer;
    font-size: 1.3rem;
    transition: background 0.2s;
}

nav button:hover {
    background: #d1d5db;
}

nav button.active {
    background: #111;
    color: #fff;
}

/* Panels -----------------------------------------------------------------*/
.panel {
    width: 100%;
    max-width: 470px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.hidden {
    display: none;
}

/* Displays ---------------------------------------------------------------*/
.big-display {
    font-size: clamp(3rem, 10vw, 5.7rem); /* 1.5x increase */
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 1.2rem 1.6rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    width: 100%;
    text-align: center;

    /* Add this to prevent layout shift */
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}


/* Timer and stopwatch controls ------------------------------------------*/
.controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.controls label {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    gap: 0.3rem;
}

.controls input {
    width: 4rem;
    padding: 0.3rem;
    text-align: center;
    font-size: 1rem;
}

.buttons-row {
    display: flex;
    gap: 0.5rem;
}

.buttons-row button {
    padding: 0.6rem 1.4rem;
    border: none;
    border-radius: 0.4rem;
    background: #111;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}

.buttons-row button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.buttons-row button:not(:disabled):hover {
    opacity: 0.8;
}

/* Lap list ---------------------------------------------------------------*/
.lap-list {
    width: 100%;
    max-height: 540px;
    overflow-y: auto;
    list-style: decimal inside;
    padding-left: 0.4rem;
}

.lap-list li {
    padding: 0.2rem 0.4rem;
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
    border-bottom: 1px dashed #e5e7eb;
}


/* Info icon in top-right */
#info-icon {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    background: #111;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    font-weight: bold;
    font-family: sans-serif;
    cursor: pointer;
    z-index: 1000;
    user-select: none;
}

/* Popup modal */
#info-popup {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1.2rem 1.4rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 0.5rem;
    max-width: 480px;
    width: 90%;
    z-index: 999;
}

#info-popup p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

#info-popup button {
    background: #111;
    color: white;
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 0.3rem;
    cursor: pointer;
}

.hidden {
    display: none;
}
