body {
    margin: 0;
    overflow: hidden;
    background-color: #87CEEB;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 15px;
    padding: 30px;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.title {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 2px;
    pointer-events: auto;
    cursor: pointer;
    display: inline-block;
    transition: opacity 0.2s;
}

.title:hover {
    opacity: 0.8;
}

.strike {
    text-decoration: line-through;
    text-decoration-thickness: 3px;
    text-decoration-color: rgba(255, 0, 0, 0.7);
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 100;
    backdrop-filter: blur(5px);
}

#pause-overlay h1 {
    font-size: 48px;
    margin-bottom: 10px;
    letter-spacing: 5px;
    font-weight: 300;
}

.btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    margin-top: 20px;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.customization-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 280px;
    backdrop-filter: blur(10px);
}

.customization-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.customization-label {
    font-size: 14px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.customization-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 16px;
    outline: none;
    width: 100%;
}

.customization-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
}

.color-picker-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: 140px;
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.8);
}

.color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transform: scale(1.15);
}

#cockpit-ui {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 20px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.cockpit-grid {
    display: grid;
    grid-template-columns: auto auto auto;
    grid-template-rows: auto auto;
    column-gap: 25px;
    row-gap: 8px;
}

.cockpit-module {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.cockpit-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    width: 35px;
    text-align: right;
}

.cockpit-value {
    font-size: 14px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    color: #FFD700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
    min-width: 60px;
}

#station-name {
    font-weight: bold;
    color: #FFD700;
    display: inline-block;
    width: 120px;
}

.station-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    touch-action: none;
}

.station-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.station-btn.active {
    background: #FFD700;
    color: #000;
    border-color: #FFD700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

#yt-container {
    position: absolute;
    bottom: 100px;
    right: 30px;
    width: 220px;
    height: 124px;
    background: #111;
    border: 4px solid #222;
    border-bottom-width: 8px;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 0, 0, 1);
    overflow: hidden;
    display: none;
    z-index: 49;
    transition: opacity 0.3s;
}

#debug-menu {
    position: absolute;
    top: 70px;
    left: 30px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    display: none;
    z-index: 100;
    pointer-events: auto;
}

#debug-menu button {
    background: #444;
    color: white;
    border: none;
    padding: 5px 10px;
    margin: 2px;
    cursor: pointer;
    border-radius: 4px;
}

#debug-menu button.active {
    background: #FFD700;
    color: black;
}

/* Screen glare effect over the video */
#yt-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.2) 100%);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
    border-radius: 4px;
}

/* Mobile Controls Redesign */
#mobile-controls {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    display: none;
    gap: 10px;
    z-index: 60;
}

.mobile-btn {
    flex: 1;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.mobile-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    opacity: 0.9;
}

.mobile-btn:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

.mobile-btn.active {
    background: #FFD700;
    color: #000;
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    #mobile-controls {
        display: flex;
    }
}

#crash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(40, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 200;
    backdrop-filter: blur(8px);
}

#crash-overlay h1 {
    font-size: 64px;
    color: #ff4444;
    margin-bottom: 20px;
    letter-spacing: 10px;
}

#online-players {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    width: 180px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#online-players.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#online-title {
    font-size: 10px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

.player-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 4px;
    color: #eee;
}

.player-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.player-info {
    display: flex;
    gap: 8px;
    align-items: center;
}

.player-dist {
    font-family: monospace;
    font-size: 11px;
    color: #FFD700;
    min-width: 45px;
    text-align: right;
}

.player-dir {
    font-family: monospace;
    font-size: 11px;
    color: #aaa;
    min-width: 25px;
    text-align: right;
}

.player-self {
    color: #fff;
    font-weight: bold;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1a1a2e 0%, #0f0f1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

.loading-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 40px 60px;
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
}

.loading-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 20px 0;
    overflow: hidden;
}

#loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 0 10px rgba(79, 172, 254, 0.8);
    transition: width 0.4s ease;
}

#loading-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

#begin-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.2);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}