 :root {
            --navy: #000080;
            --marathon-red: #e31e24;
            --light-gray: #f8f9fa;
        }

        body {
            background-color: #f0f2f5;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            margin: 0;
            padding: 20px;
            display: flex;
            justify-content: center;
        }

        .card {
            background: white;
            padding: 25px;
            border-radius: 15px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
            width: 100%;
            max-width: 900px;
        }

        .bottom-logo {
            text-align: center;
            margin-bottom: 20px;
        }

        .bottom-logo img {
            height: 60px;
            width: auto;
        }

        h2 {
            color: var(--navy);
            text-align: center;
            margin: 0 0 10px 0;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .subtitle {
            text-align: center;
            color: #666;
            margin-bottom: 25px;
            font-size: 0.95rem;
        }

        /* Table Styling */
        .table-wrapper {
            border-radius: 10px;
            border: 1px solid #e0e0e0;
            overflow: hidden;
            margin-bottom: 20px;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            background: white;
        }

        th {
            background-color: var(--navy);
            color: white;
            padding: 15px;
            text-align: left;
            font-size: 0.8rem;
            text-transform: uppercase;
        }

        td {
            padding: 14px 15px;
            border-bottom: 1px solid #eee;
            color: #333;
            font-size: 0.95rem;
        }

        tr:last-child td {
            border-bottom: none;
        }

        /* Visual distinction for the person finishing soonest */
        tr.next-up {
            background-color: #fff9db;
        }

        .km-pill {
            background: var(--marathon-red);
            color: white;
            padding: 4px 12px;
            border-radius: 50px;
            font-weight: bold;
            font-size: 0.85rem;
            display: inline-block;
        }

        .time-cell {
            font-weight: 700;
            color: var(--navy);
            display: flex;
            align-items: center;
            gap: 5px;
        }

        /* Buttons */
        .button-group {
            display: flex;
            gap: 12px;
        }

        button {
            padding: 12px;
            border-radius: 8px;
            border: none;
            cursor: pointer;
            font-weight: bold;
            transition: opacity 0.2s;
        }

        #refreshBtn {
            background-color: var(--navy);
            color: white;
            flex: 2;
        }

        #backBtn {
            background-color: #6c757d;
            color: white;
            flex: 1;
        }

        #selectWinnerBtn {
            background-color: #28a745;
            color: white;
            flex: 1;
            font-size: 1.1rem;
            padding: 14px 12px;
        }

        button:hover {
            opacity: 0.9;
        }
        button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Status Messages */
        .status-msg {
            text-align: center;
            padding: 40px;
            color: #888;
            font-style: italic;
        }

        .premi-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            transition: opacity 0.5s;
        }
        .premi-overlay.hidden {
            display: none;
        }
        .premi-message {
            max-width: 600px;
            padding: 40px;
            border-radius: 16px;
            background: linear-gradient(135deg, #fff3cd, #ffeaa7);
            border: 3px solid #f0c040;
            text-align: center;
            font-size: 1.5rem;
            font-weight: bold;
            color: #7a5c00;
            line-height: 1.6;
            box-shadow: 0 10px 40px rgba(0,0,0,0.3);
        }
        .premi-message.hidden {
            display: none;
        }
        .premi-countdown {
            font-size: 6rem;
            font-weight: bold;
            color: #fff;
            text-shadow: 0 0 20px rgba(0,0,0,0.5);
        }

        @media (max-width: 600px) {
            .hide-mobile { display: none; }
            td, th { padding: 10px; font-size: 0.85rem; }
            .card { padding: 15px; }
        }
        .winners-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: space-between;
}

.winner-slot {
    flex: 1;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.active-winner {
    background: #e7f3ff;
    border-color: #007bff;
}

.slot-time {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
    color: #cc0000; /* Marathon Red */
    margin-bottom: 5px;
}

.slot-name {
    font-size: 0.9rem;
    color: #333;
}
