/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Rajdhani:wght@400;600&display=swap');

.aperture-theme .aperture-header {
    position: relative;
    top: 0;
    z-index: 1000;
}

    .aperture-theme .aperture-header .logo-menu-bar {
        padding: 0;
    }

:root {
    --dd-bg: #0f0f12;
    --dd-surface: #17191f;
    --dd-surface-2: #1e2129;
    --dd-text: #e9edf3;
    --dd-muted: #9aa3b2;
    --dd-accent: #e31b23; /* derby red */
    --dd-accent-2: #ffb703; /* amber pop */
    --dd-line: #2a2f3a;
    --dd-row-alt: #14171d;
    --dd-row: #181b22;
    --dd-row-hover: #202633;
}

.aperture-content-pane {
    margin: 0 auto;
    max-width: 1400px !important;
    padding: 0 2rem;
    width: 100%;
}

/* Page base */
.dnnForm, .hit-panel {
    color: var(--dd-text);
}

h2 {
    font-size: 28px;
    font-family: 'Anton', Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
    letter-spacing: 0.5px;
    color: var(--dd-text);
    display: inline-flex;
    align-items: center;
    gap: .6rem;
}
/*h2::after {
        content: '';
        display: inline-block;
        width: 110px;
        height: 10px;
        background: repeating-linear-gradient(45deg, #fff 0 10px, #000 10px 20px);
        border-radius: 3px;
        margin-left: .25rem;
    }*/

/* Tabs */
.dd-tabs {
    margin: 0 0 12px 0;
    border-bottom: 1px solid var(--dd-line);
}

    .dd-tabs .tab {
        display: inline-block;
        padding: 10px 16px;
        margin-right: 6px;
        cursor: pointer;
        text-decoration: none;
        color: var(--dd-text);
        background: var(--dd-surface);
        border: 1px solid var(--dd-line);
        border-bottom: none;
        border-top-left-radius: 6px;
        border-top-right-radius: 6px;
        font-family: 'Rajdhani', 'Segoe UI', Tahoma, sans-serif;
        text-transform: uppercase;
        letter-spacing: .5px;
    }

        .dd-tabs .tab.active {
            background: linear-gradient(180deg, #222630, #1a1d25);
            border-color: var(--dd-accent);
            font-weight: 600;
            position: relative;
        }

            .dd-tabs .tab.active::after {
                content: '';
                position: absolute;
                left: 0;
                right: 0;
                bottom: -2px;
                height: 3px;
                background: linear-gradient(90deg, var(--dd-accent), var(--dd-accent-2));
            }

/* Heat block */
.heats-container {
    margin-top: 8px;
}

.heat-block {
    margin: 16px 0;
    padding: 10px 10px 14px 10px;
    background: linear-gradient(180deg, var(--dd-surface), var(--dd-surface-2));
    border: 1px solid var(--dd-line);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.heat-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-family: 'Anton', Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
    font-size: 20px;
    letter-spacing: .5px;
    color: var(--dd-text);
    margin-bottom: 10px;
    text-transform: uppercase;
}

    .heat-header span {
        color: var(--dd-muted);
        font-family: 'Rajdhani', 'Segoe UI', Tahoma, sans-serif;
        text-transform: none;
        letter-spacing: 0;
        font-weight: 600;
    }

/* Checkered strip under each heat header */
.flag-bar {
    height: 12px;
    width: 100%;
    border-radius: 3px;
    background: repeating-linear-gradient(45deg, #fff 0 10px, #000 10px 20px);
    margin: 6px 0 12px 0;
    outline: 1px solid rgba(255,255,255,.08);
}

/* Fun divider between heats */
.heat-divider {
    height: 8px;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--dd-accent) 20%, var(--dd-accent-2) 50%, var(--dd-accent) 80%, transparent);
    opacity: .35;
    filter: blur(0.3px);
    border-radius: 4px;
    margin-top: 12px;
}


.heat-dashboard {
    margin-top: 10px;
}

/* One heat at a time */
.heat-block-single {
    border-radius: 6px;
    padding: 10px 10px 16px;
    background: #111;
    color: #f5f5f5;
}

/* Heat header in upper-left */
.heat-header {
    margin-bottom: 10px;
}

.heat-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.heat-flag {
    font-size: 1.2rem;
}

.heat-name {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.heat-type {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Grid of car blocks: max 5 columns, wrap */
/* Default: desktop – 5 columns */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(80px, 1fr));
    gap: 10px;
}

/* Medium screens (tablets / smaller laptops): 3 columns */
@media (max-width: 1024px) {
    .cars-grid {
        grid-template-columns: repeat(3, minmax(80px, 1fr));
    }
}

/* Small screens (phones): 1 column */
@media (max-width: 600px) {
    .cars-grid {
        grid-template-columns: repeat(1, minmax(80px, 1fr));
    }
}

/* Car block styling */
.car-block {
    position: relative;
    border-radius: 6px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    text-align: center;
    /* This line uses the car's base color (or fallback) */
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), var(--car-color, #222);
    box-shadow: 0 0 0 1px #333;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}


/* Big car number */
.car-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.05;
    margin-bottom: 30px; /* keep your spacing */
}

.car-number-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.car-driver {
    margin-top: 6px;
    font-size: 1rem; /* requested */
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.95;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.car-counter {
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Tiny meta area; can be hidden or styled smaller */
.car-meta {
    position: absolute;
    bottom: 4px;
    left: 6px;
    font-size: 0.7rem;
    opacity: 0.7;
    text-align: left;
}

    .car-meta .heat-driver,
    .car-meta .heat-counter {
        display: block;
        line-height: 1.1;
        margin-top: 2px;
        font-size: 0.65rem;
        opacity: 0.85;
    }

/* Hit flash effect (re-use your existing CSS or tweak) */
.car-block.hit-updated,
tr.hit-updated {
    background: #3a8f3a;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.6);
    transform: scale(1.03);
}

/* Summary + Hit button */
.summary {
    font-family: 'Rajdhani', 'Segoe UI', Tahoma, sans-serif;
    font-size: 18px;
    letter-spacing: .3px;
    color: var(--dd-text);
}

    .summary .value {
        font-weight: 700;
    }

.hitButton {
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #ff3b3b, var(--dd-accent));
    color: #fff;
    font-size: 56px;
    font-family: 'Anton', Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
    letter-spacing: 1px;
    border: 3px solid rgba(255,255,255,.15);
    box-shadow: 0 10px 24px rgba(227,27,35,.35), inset 0 0 18px rgba(255,255,255,.15);
    transition: transform .05s ease, box-shadow .05s ease;
}

.hitButton:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 6px 16px rgba(227,27,35,.45), inset 0 0 22px rgba(255,255,255,.25);
}

.hitButton:disabled, .hitButton[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(1);
    box-shadow: none;
    transform: none;
    background: radial-gradient(circle at 30% 30%, #666, #333);
    border-color: rgba(255,255,255,.08);
}

/* Ensure HIT text color flips correctly when enabled/disabled */
.hitButton {
    color: #fff !important;
}

.hitButton:disabled,
.hitButton[disabled] {
    color: rgba(255, 255, 255, 0.45) !important;
}

/* DNN info panels */
.dnnFormMessage {
    background: #11151c;
    color: var(--dd-muted);
    border: 1px solid var(--dd-line);
}

.heat-hits.hit-updated {
    animation: hitFlash 0.5s ease-out;
}

@keyframes hitFlash {
    from {
        background-color: #ffec99;
    }

    to {
        background-color: inherit;
    }
}

.dd-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* allows stacking on very narrow screens */
    margin-bottom: 10px;
}

.dd-header-left {
    flex: 0 0 auto;
}

.dd-header-right {
    flex: 0 0 auto;
    text-align: right;
    font-size: 12px;
    color: #fff;
}
/* Row of filters above the dashboard */
.dashboard-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px; /* row/column gaps */
    align-items: flex-end;
    margin-bottom: 16px;
}

/* Let 4 items fit more often */
.dashboard-filter-item {
    flex: 1 1 200px; /* was 220px */
}

/* 4th column: fixed width, don't grow/shrink */
.dashboard-filter-actions {
    flex: 0 0 260px; /* fixed column width */
    max-width: 260px;
}

/* stack buttons and keep them from squeezing */
.dashboard-filter-actions-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    /* make buttons take full width of the column */
    .dashboard-filter-actions-inner .dd-btn {
        width: 100%;
        white-space: nowrap; /* keep button text on one line */
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

/* Optional: if you have no .sr-only helper already */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Make the dropdowns span the full width of their column */
.dashboard-filter-item .ref-select {
    width: 100%;
    max-width: 100%;
}

/* Optional: on very small widths, give them full width stacked look */
@media (max-width: 600px) {
    .dashboard-filter-item {
        flex: 1 1 100%;
    }
}


.car-timer {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

    .car-timer .timer-value {
        min-width: 2ch;
        display: inline-block;
        text-align: right;
    }

    .car-timer .timer-unit {
        font-size: 0.75rem;
        margin-left: 2px;
    }

/* Disabled / eliminated car */
.car-block.car-disabled {
    opacity: 0.25;
    filter: grayscale(0.9);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
}

.heat-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.heat-left {
    flex: 2 1 0;
}

.heat-right {
    flex: 1 1 0;
}

@media (max-width: 600px) {
    /* Stack left/right, no flex row */
    .heat-layout {
        display: block; /* instead of flex */
        width: 100% !important;
    }

    .heat-left,
    .heat-right {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important; /* ignore any flex-basis from other CSS */
    }

    .heat-right {
        margin-top: 8px; /* little separation below the grid */
    }
}


.results-panel {
    background: rgba(0,0,0,0.35);
    border-radius: 8px;
    padding: 10px 12px;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05);
}

.results-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.9;
}

.results-places {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.results-place {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

    .results-place:last-child {
        border-bottom: none;
    }

    .results-place .place-label {
        font-weight: 600;
        opacity: 0.85;
    }

    .results-place .place-entry {
        text-align: right;
        max-width: 70%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .results-place.results-winner {
        font-weight: 700;
        color: #FFEB3B;
    }

.results-finished .results-title::after {
    content: ' – Finished';
    font-weight: 400;
    font-size: 0.85em;
    opacity: 0.85;
}

.car-block.car-caution {
    outline: 3px solid #FFEB3B;
    outline-offset: -2px;
}

/* Car is under 10 seconds – urgent warning */
.car-block.car-warning {
    outline: 3px solid #ff5252;
    outline-offset: -2px;
}

/* Small "DQ" chip at bottom-left */
.car-dq-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 0;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(183, 28, 28, 0.9);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
}

    .car-dq-btn:hover {
        background: rgba(198, 40, 40, 1);
    }

.car-block.car-disabled .car-dq-btn {
    opacity: 0.4;
    pointer-events: none;
}

/* Row that holds all the master buttons on one line */
.dashboard-button-row {
    display: flex !important;
    flex-wrap: wrap; /* wrap nicely on tiny screens */
    gap: 8px;
    align-items: center;
    justify-content: flex-start; /* or flex-start/center, your call */
    margin-top: 4px;
}

/* Base derby button style */
.dd-btn {
    font-family: 'Rajdhani', 'Segoe UI', Tahoma, sans-serif;
    font-size: 1.3rem; /* slightly larger */
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 26px !important; /* more vertical + horizontal padding */
    border-radius: 999px !important; /* fully pill-shaped */
    border: none !important;
    cursor: pointer !important;
    color: #fff !important;
    background: #333 !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
    transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

    .dd-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    }

    .dd-btn:active {
        transform: translateY(0);
        box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
    }

.mb-31 {
    margin-bottom: 31px !important;
}

/* Variants */

/* Master Start – bright green “GO” */
.dd-btn-start {
    background: linear-gradient(135deg, #43a047, #2e7d32) !important;
}

    .dd-btn-start:hover {
        background: linear-gradient(135deg, #4caf50, #2e7d32) !important;
    }

/* NEW: Stop Heat – bright red “STOP” */ .dd-btn-stop {
    background: linear-gradient(135deg, #e53935, #b71c1c) !important;
}

    .dd-btn-stop:hover {
        background: linear-gradient(135deg, #ef5350, #c62828) !important;
    }

/* Pause Heat – amber “hold up” */
.dd-btn-pause {
    background: linear-gradient(135deg, #ffb300, #f57c00) !important;
}

    .dd-btn-pause:hover {
        background: linear-gradient(135deg, #ffc107, #f57c00) !important;
    }

/* Reset Heat – dark red “danger” */
.dd-btn-reset {
    background: linear-gradient(135deg, #000000, #8e0000) !important;
    opacity: 0.9;
}

.push-right {
    margin-left: auto !important;
}

.dd-btn-reset:hover {
    opacity: 1;
}

/* Optional: when buttons are disabled/hidden, layout still looks okay */
.dd-btn[disabled] {
    opacity: 0.4;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.active-heat-banner {
    margin: 6px 0 14px 0;
    padding: 10px 14px;
    border-radius: 10px;
    text-align: center;
    font-weight: 900;
    font-size: 22px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffeb3b;
    background: linear-gradient(180deg, rgba(255,235,59,0.12), rgba(0,0,0,0.15));
    border: 2px solid rgba(255,235,59,0.35);
    box-shadow: 0 8px 18px rgba(0,0,0,0.35);
    font-family: 'Rajdhani','Segoe UI',Tahoma,sans-serif;
}

/* ===== Simple modal (Derby Dashboard) ===== */
.dd-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2147483647;
}

.dd-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
}

.dd-modal__dialog {
    position: relative;
    width: min(520px, calc(100% - 24px));
    margin: 8vh auto 0 auto;
    background: linear-gradient(180deg, var(--dd-surface), var(--dd-surface-2));
    border: 1px solid var(--dd-line);
    border-radius: 10px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.55);
    color: var(--dd-text);
    overflow: hidden;
}

.dd-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--dd-line);
}

.dd-modal__title {
    font-family: 'Rajdhani', 'Segoe UI', Tahoma, sans-serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dd-modal__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--dd-text);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

    .dd-modal__close:hover {
        opacity: 1;
    }

.dd-modal__body {
    padding: 14px;
}

.dd-modal__meta {
    display: grid;
    gap: 6px;
    font-family: 'Rajdhani', 'Segoe UI', Tahoma, sans-serif;
    margin-bottom: 14px;
}

.dd-modal__actions {
    display: flex;
    justify-content: flex-end;
}

.dd-modal__sectionTitle {
    font-family: 'Rajdhani', 'Segoe UI', Tahoma, sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 10px 0 8px 0;
    opacity: 0.9;
}

.dd-modal__userList {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dd-modal__userBtn {
    width: 100%;
    text-align: left;
    padding: 10px 14px !important;
    border-radius: 10px !important;
    font-size: 1.0rem !important;
}

.dd-modal__userBtn.dd-is-assigned {
    background: linear-gradient(135deg, #616161, #424242) !important;
    opacity: 0.95;
}

.dd-modal__userBtn.dd-is-assigned:hover {
    background: linear-gradient(135deg, #757575, #4a4a4a) !important;
}