:root {
    --background: #0a0e14;
    --background-secondary: rgba(255, 80, 40, 0.06);
    --primary: #ff5a1f;
    --primary-hover: #ff7a45;
    --secondary: #e03a3a;
    --secondary-hover: #ff5252;
    --success: #21bf73;
    --success-hover: #2ddf8b;
    --text-color: #ffffff;
    --text-muted: #a0a8b8;
    --card-bg: rgba(255, 255, 255, 0.03);
    
    --highlight: rgba(255, 60, 31, 0.08);
    --error: #ff4444;
    --error-hover: #ff6666;
    --bronze: #cd7f32;
    --silver: #c0c0c0;
    --gold: #ffd700;
    --border-color: rgba(255, 255, 255, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(255, 90, 31, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    /*background-color: #0a0e14;*/
    /* background: linear-gradient(135deg, #0a0e14 0%, #1a1f2e 50%, #0a0e14 100%); */
    /* color: var(--text-color); */
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 24px;
    position: relative;
    overflow-x: hidden;
    background-color: #1d1d1d;
}
/*
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, 
        var(--primary) 0%, 
        var(--highlight) 50%, 
        var(--primary) 100%);
    z-index: 1000;
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.5);
}
    */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /*background-image: 
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    */
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

#app {
    width: 100%;
    max-width: 1400px;
    position: relative;
    z-index: 1;
    
}

header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 10;
}

.rallyword {
    color: #ff0000;
    font-weight: 900;
}



header h1 {
    font-size: clamp(2.8rem, 5vw, 4rem);
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    position: relative;
    display: inline-block;
    padding: 8px 0;

}

header h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    /*background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary) 50%, 
        transparent 100%);*/
    border-radius: 2px;
}

main {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

@media (min-width: 960px) {
    main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
        gap: 28px;
        align-items: flex-start;
    }

    #driversSection,
    #roundSection,
    #finishRaceSection,
    #timesSection {
        grid-column: 1;
    }

    #resultsSection {
        grid-column: 2;
        grid-row: 1 / span 5;
        position: sticky;
        top: 24px;
    }
}

section {
    background: var(--card-bg);
    padding: 24px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--primary) 0%, 
        var(--highlight) 50%, 
        var(--primary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
/*
section:hover::before {
    opacity: 1;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}
*/
section h2 {
    margin-bottom: 20px;
    color: #7a0000;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--highlight) 0%, 
        transparent 100%);
}
/*
.finish-race-section {
    
    border: 3px solid var(--primary);
    box-shadow: 0 0 30px rgba(255, 107, 0, 0.3), var(--shadow-lg);
}
*/
/*
.finish-race-section::before {
    opacity: 1;
    height: 5px;
}
*/
.race-control-text {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 16px;
    font-size: 1.05rem;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.input-group input {
    flex: 1;
    margin-bottom: 0;
    margin-top: 15px;
}

.input-group .add-btn {
    padding: 12px 20px;
    white-space: nowrap;
    flex-shrink: 0;
    
}

.add-btn
{
    background: #003b17;
    
    padding: 2px 12px;
    font-size: 0.9rem;
}

.input-group .add-btn:hover {
    background: rgba(8, 172, 2, 0.438)
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px; 
    margin-bottom: 12px;
    /*border-radius: 10px;*/
    border: 2px solid var(--border-color);
    background: var(--background-secondary);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--secondary);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

button {
    padding: 12px 24px;
    /*border-radius: 10px;*/
    border: none;
    background: var(--success);
    color: var(--text-color);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.2s ease;
    
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}




button:active {
    transform: translateY(0);
    
}
/*
#startRoundButton {
    width: 100%;
    background: var(--secondary);
    font-size: 1.1rem;
    padding: 14px 24px;
    margin-top: 8px;
}

#startRoundButton:hover {
    background: var(--secondary-hover);
}
*/

.finish-race-btn {
    display: block;
    width: 100%;
    background: #003b17;
    font-size: 1.3rem;
    padding: 18px 32px;
    border: 3px solid #3b3b3b;
    
}

.finish-race-btn:hover{
    background: rgba(8, 172, 2, 0.438);
    border-color: #3b3b3b;
}

/*
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 25px rgba(255, 107, 0, 0.5), var(--shadow-md);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 107, 0, 0.7), var(--shadow-md);
    }
}
*/
.dsq-btn {
    background: var(--error);
    padding: 8px 16px;
    font-size: 0.85rem;
    
}
/*
.dsq-btn:hover {
    background: var(--error-hover);
}
*/
.remove-btn {
    background: var(--error);
    padding: 6px 12px;
    font-size: 0.85rem;
    
}

.remove-btn:hover {
    background: rgba(121, 5, 5, 0.336);
}

.delete-round-btn {
    background: var(--error);
    padding: 8px 14px;
    font-size: 0.9rem;
    
    margin-top: 12px;
    width: 100%;
}

.delete-round-btn:hover {
    background: rgba(121, 5, 5, 0.336);
}

ul {
    list-style: none;
    padding: 0;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.3s ease;
    
}
/*
li:hover {
    background: var(--card-bg-hover);
    border-color: var(--secondary);
    transform: translateX(4px);
}
*/
li span {
    flex: 1;
    color: var(--text-color);
}

.round-info {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-box {
    flex: 1;
    min-width: 150px;
    /* background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%); */
    padding: 12px 16px;
    
    border: 2px solid var(--highlight);
    
}

.info-box-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    margin-bottom: 4px;
}

.info-box-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-color);
    
}

#timesSection {
    margin-bottom: 24px;
    border: 2px solid var(--secondary);
}

#timesList {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#timesList > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: var(--background-secondary);
    
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/*#timesList > div:hover {
    background: var(--card-bg-hover);
    border-color: var(--secondary);
}
*/
#timesList strong {
    font-size: 1.05rem;
    color: var(--secondary);
    min-width: 120px;
}

#timesList input[type="text"] {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 0.05em;
}

#finishRoundButton {
    margin-top: 20px;
    width: 100%;
    background: var(--primary);
    font-size: 1.1rem;
}
/*
#finishRoundButton:hover {
    background: var(--primary-hover);
}
*/
#resultsSection {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--background-secondary);
}

#resultsSection::-webkit-scrollbar {
    width: 8px;
}

#resultsSection::-webkit-scrollbar-track {
    background: var(--background-secondary);
    
}

#resultsSection::-webkit-scrollbar-thumb {
    background: var(--primary);
    
}
/*
#resultsSection::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}
*/
#resultsSection h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
}

#results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#results > div {
    background: var(--background-secondary);
    
    padding: 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    
}
/*
#results > div:hover {
    border-color: var(--primary);
}
*/
.round-header {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stage-box,
.car-box {
    flex: 1;
    min-width: 140px;
    padding: 10px 14px;
    
    border: 2px solid;
    text-align: center;
}

.stage-box {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.15) 0%, rgba(0, 217, 255, 0.05) 100%);
    border-color: var(--secondary);
}

.car-box {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.15) 0%, rgba(255, 204, 0, 0.05) 100%);
    border-color: var(--highlight);
}

.stage-box-label,
.car-box-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.stage-box-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #FFF;
    text-transform: uppercase;
}

.car-box-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #FFF;
    text-transform: uppercase;
}

.result-row,
.results-row {
    padding: 12px 16px;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 8px 0;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
/*
.result-row:hover,
.results-row:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}
*/
.first {
    background: linear-gradient(135deg, var(--gold) 0%, #ffed4e 100%);
    color: #000000;
    border-color: #ffd700;
    
    
}

.second {
    background: linear-gradient(135deg, var(--silver) 0%, #e0e0e0 100%);
    color: #000000;
    border-color: #c0c0c0;
    
}

.third {
    background: linear-gradient(135deg, var(--bronze) 0%, #e09856 100%);
    color: #000000;
    border-color: #cd7f32;
    
}

.toggle-standings-btn {
    width: 100%;
    background: #312400;
    margin-top: 16px;
    font-size: 1rem;
    padding: 12px 24px;
}
/*
.toggle-standings-btn:hover {
    background: var(--secondary-hover);
}
*/
.overall-standings-container {
    margin-top: 24px;
    border: 3px solid var(--highlight);
}

.overall-standings-container.hidden {
    display: none;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    
    border: 3px solid var(--highlight);
    animation: slideUp 2s ease-out;
    display: flex;
    flex-direction: column;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--highlight) 100%);
    padding: 24px;
    text-align: center;
    border-bottom: 3px solid var(--highlight);
}

.modal-header h2 {
    font-size: 2.5rem;
    color: var(--text-color);
    margin: 0;
    
    
}

.modal-header h2::after {
    display: none;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--background-secondary);
    
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary);
}

.final-standings {
    background: var(--background-secondary);
    padding: 20px;
    border: 2px solid var(--border-color);
}

.final-standings h3 {
    font-size: 1.8rem;
    color: #FFF;
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.final-result-row {
    padding: 16px 20px;
    font-size: 1.2rem;
    font-weight: 800;
    margin: 12px 0;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
}
/*
.final-result-row:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}
*/
.final-result-position {
    font-size: 1.4rem;
    font-weight: 900;
}

.final-result-name {
    text-align: left;
    font-size: 1.3rem;
}

.final-result-time {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.final-result-total {
    font-size: 1.3rem;
    font-weight: 900;
}

.final-result-diff {
    font-size: 0.95rem;
    opacity: 0.8;
    font-weight: 600;
}

.modal-footer {
    padding: 20px 24px;
    background: var(--background-secondary);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.modal-button-group {
    display: flex;
    gap: 12px;
    width: 100%;
    flex-wrap: wrap;
}

.continue-race-btn {
    background: var(--secondary);
    font-size: 1.1rem;
    padding: 14px 24px;
    flex: 1;
    min-width: 200px;
}

.continue-race-btn:hover {
    background: var(--secondary-hover);
}

.close-modal-btn {
    background: var(--success);
    font-size: 1.2rem;
    padding: 14px 32px;
    flex: 1;
    min-width: 200px;
}

.close-modal-btn:hover {
    background: var(--success-hover);
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@media (max-width: 959px) {
    body {
        padding: 16px;
    }

    header h1 {
        font-size: 2.4rem;
    }

    section {
        padding: 20px;
    }

    section h2 {
        font-size: 1.4rem;
    }

    #resultsSection {
        max-height: none;
    }

    .modal-header h2 {
        font-size: 2rem;
    }

    .final-result-row {
        font-size: 1.1rem;
        padding: 12px 16px;
    }
}

@media (max-width: 640px) {
    header h1 {
        font-size: 2rem;
        letter-spacing: 0.05em;
    }

    section {
        padding: 16px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input {
        margin-bottom: 10px;
    }

    #timesList > div {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }

    #timesList strong {
        min-width: auto;
    }

    button {
        font-size: 0.95rem;
        padding: 10px 20px;
    }

    .round-header {
        flex-direction: column;
    }

    .stage-box,
    .car-box {
        min-width: 100%;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 1.6rem;
    }

    .modal-body {
        padding: 16px;
    }

    .finish-race-btn {
        font-size: 1.1rem;
        padding: 14px 24px;
    }

    .race-control-text {
        font-size: 0.95rem;
    }

    .modal-button-group {
        flex-direction: column;
    }
    
    .continue-race-btn,
    .close-modal-btn {
        width: 100%;
        min-width: 100%;
    }
    
    .final-result-row {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .final-result-time {
        align-items: center;
    }
}

@media print {
    body {
        background: white;
        color: black;
    }

    section {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    button {
        display: none;
    }

    .modal {
        position: relative;
        background: white;
    }
}

footer {
    margin-top: auto;
    padding-top: 40px;
    width: 100%;
}

.note {
    font-size: 0.8rem;
    font-family: sans-serif;
    color: gray;
    text-align: center;
    grid-column: 2; 
}

.github-hosting {
    position: fixed;
    bottom: 5px;
    left: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
}

.github-text {
    margin-left: 20px;
    margin-bottom: 20px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7); 
    user-select: none;
    cursor: default;
}

.github-hosting a {
    display: inline-block;
}

.github-hosting a:hover .github-icon {
    transform: scale(1.12);
}

.github-icon {
    width: 35px;
    height: 35px;
    filter: grayscale(100%);
    transition: filter 0.3s, transform 0.3s;
    margin-left: 10px;
    margin-bottom: 10px;
}

.github-icon:hover {
    filter: grayscale(0%);
}


.result-row.first,
.result-row.first *,
.results-row.first,
.results-row.first *,
.final-result-row.first,
.final-result-row.first *,
.final-result-row.first .final-result-position,
.final-result-row.first .final-result-name,
.final-result-row.first .final-result-time,
.final-result-row.first .final-result-total,
.final-result-row.first .final-result-diff {
    color: #000000 !important;
}

.result-row.second,
.result-row.second *,
.results-row.second,
.results-row.second *,
.final-result-row.second,
.final-result-row.second *,
.final-result-row.second .final-result-position,
.final-result-row.second .final-result-name,
.final-result-row.second .final-result-time,
.final-result-row.second .final-result-total,
.final-result-row.second .final-result-diff {
    color: #000000 !important;
}

.result-row.third,
.result-row.third *,
.results-row.third,
.results-row.third *,
.final-result-row.third,
.final-result-row.third *,
.final-result-row.third .final-result-position,
.final-result-row.third .final-result-name,
.final-result-row.third .final-result-time,
.final-result-row.third .final-result-total,
.final-result-row.third .final-result-diff {
    color: #000000 !important;
}

.result-row:not(.first):not(.second):not(.third),
.result-row:not(.first):not(.second):not(.third),
.final-result-row:not(.first):not(.second):not(.third)
{
    color: #ffffff !important;
}

.final-result-row:not(.first):not(.second):not(.third) *
{
    color: #ffffff !important;
}









div[class*=box]
{
    height: 33.33%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}


.btn {
    line-height: 50px;
    height: 50px;
    text-align: center;
    width: 250px;
    cursor: pointer;
}

.btn-one {
    color: #FFF;
    transition: all 0.3s;
    position: relative;
    background-color: rgba(0, 204, 255, 0.3);
}
.btn-one span {
    transition: all 0.3s;
}
.btn-one::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: calc(100% + 10px);
    z-index: 1;
    opacity: 0;
    transition: all 0.3s;
    border-top-width: 2px;
    border-bottom-width: 2px;
    border-top-style: solid;
    border-bottom-style: solid;
    border-top-color: var(--highlight);
    border-bottom-color: var(--highlight);
    transform: scale(0.1, 1);
}
.btn-one:hover span {
    letter-spacing: 2px;
}
.btn-one:hover::before {
    opacity: 1; 
    transform: scale(1, 1); 
}
.btn-one::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: all 0.3s;
    background-color: rgba(0, 0, 0, 0.014);
}
.btn-one:hover::after {
    opacity: 0; 
    transform: scale(0.1, 1);
}




@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to{
        transform: translateY(35px);
        opacity: 1;
    }
    to {
        transform: translateY(0);
        opacity:1;
    }
}



.reset-all-btn 
{
    width: 100%;
    background: var(--error);
    font-size: 0.95rem;
    grid-column: 3;
    justify-self: end;
    width: 37.5%;
    
}

.reset-all-btn:hover
{
    background: rgba(121, 5, 5, 0.336);
}

.footer-bottom
{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    margin-bottom: 10px;
}


/* ── Stage & Car Selector Modal ── */

.selection-display {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--background-secondary);
    border: 2px solid var(--border-color);
    
    margin-bottom: 12px;
    overflow: hidden;
    min-height: 56px;
}

.selection-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    gap: 2px;
}

.selection-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
}

.selection-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
}

.selection-value.placeholder {
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
}

.selection-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    flex-shrink: 0;
}

.btn-two {
    color: #FFF;
    transition: all 0.3s;
    position: relative;
    background-color: rgba(255, 204, 0, 0.2);
}
.btn-two span {
    transition: all 0.3s;
}
.btn-two::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: calc(100% + 10px);
    z-index: 1;
    opacity: 0;
    transition: all 0.3s;
    border-top-width: 2px;
    border-bottom-width: 2px;
    border-top-style: solid;
    border-bottom-style: solid;
    border-top-color: var(--highlight);
    border-bottom-color: var(--highlight);
    transform: scale(0.1, 1);
}
.btn-two:hover span {
    letter-spacing: 2px;
}
.btn-two:hover::before {
    opacity: 1;
    transform: scale(1, 1);
}
.btn-two::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: all 0.3s;
}
.btn-two:hover::after {
    opacity: 0;
    transform: scale(0.1, 1);
}


.selector-modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.game-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
}

.game-tab {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
    transition: all 0.2s;
    margin-bottom: -2px;
}

.game-tab:hover {
    color: var(--text-color);
    background: rgba(255,255,255,0.05);
}

.game-tab.active {
    color: var(--secondary);
    border-bottom-color: var(--highlight);
    background: transparent;
}

.selector-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.selector-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.selector-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
}

.selector-col:last-child {
    border-right: none;
}

.col-title {
    padding: 14px 16px 10px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--error);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.groups-container {
    overflow-y: auto;
    flex: 1;
    padding: 10px 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--background-secondary);
    max-height: 380px;
}

.groups-container::-webkit-scrollbar { width: 6px; }
.groups-container::-webkit-scrollbar-track { background: var(--background-secondary); }
.groups-container::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

.item-group {
    margin-bottom: 12px;
}

.group-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    font-weight: 700;
    padding: 4px 8px;
    margin-bottom: 4px;
}

.select-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
}

.select-item:hover {
    background: var(--background-secondary);
    border-color: var(--border-color);
}

.select-item.selected {
    background: rgba(151, 151, 151, 0.171);
    border-color: var(--highlight);
    color: #FFF;
    font-weight: 700;
}


.other-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
}

.other-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 400px;
}


.selector-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.selector-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
}

.preview-item {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-item.has-value {
    color: var(--text-color);
}

.preview-sep {
    color: var(--border-color);
    flex-shrink: 0;
}

.selector-footer-btns {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cancel-selector-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 20px;
    font-size: 0.9rem;
}

.cancel-selector-btn:hover 
{
    border-color: var(--text-muted);
    color: var(--text-color);
}

.confirm-selector-btn 
{
    background: #a77373;
    color: #000;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 800;
}

.confirm-selector-btn:hover 
{
    background: var(--error);
}

.confirm-selector-btn:disabled 
{
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

@media (max-width: 640px) 
{
    .selector-columns {
        grid-template-columns: 1fr;
    }
    .selector-col {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 200px;
    }
    .groups-container {
        max-height: 150px;
    }
    .selector-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .selector-footer-btns {
        justify-content: stretch;
    }
    .cancel-selector-btn,
    .confirm-selector-btn {
        flex: 1;
    }
}

.group-label-toggle
{
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    user-select: none;
}

.group-label-toggle:hover
{
    background: var(--background-secondary);
}

.group-arrow 
{
    font-size: 0.6rem;
    color: var(--text-muted);
}

.group-items.hidden
{
    display: none;
}


@media (max-width: 640px)
{
.reset-all-btn
{
    width: 100px;
    font-size: 0.5rem;
}
}











