html, body {
    margin: 0;
    padding: 0;
    background-color: #f0f0f0; 
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    overflow: hidden;
    position: fixed; /* Lock viewport to prevent mobile pull-to-refresh / scroll */
}

#scratch-window {
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #d9d9d9;
    padding: 10px;
    padding-top: 5px;
}

#scratch-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    margin-bottom: 5px;
}

#scratch-controls {
    display: flex;
    gap: 10px;
}

.icon {
    cursor: pointer;
}

#game-container {
    position: relative;
    border: 4px solid #000;
    background-color: #666666; /* Gray background similar to Scratch canvas */
    border-radius: 4px; /* Scratch has slight border radius on the black canvas wrapper */
}

#ui-layer {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    z-index: 10;
}

#top-stats {
    display: flex;
    justify-content: flex-start;
    gap: 4px;
    padding: 6px;
    pointer-events: none; /* Let clicks pass through to canvas if needed, but buttons will override */
}

.ui-button {
    pointer-events: auto;
    background: rgba(255, 140, 26, 0.85);
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.ui-button:hover {
    background: rgba(255, 150, 40, 1);
    transform: translateY(-2px);
}

.ui-button:active {
    transform: translateY(0);
}

.stat-box {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 10px;
    letter-spacing: 0.1px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    min-width: 65px;
}

.stat-box .label {
    margin-right: 6px;
    opacity: 0.8;
}

.stat-box span:not(.label) {
    color: #ffb366;
    padding: 0;
    font-size: 13px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    text-align: right;
}

#mute-indicator {
    animation: pulseMute 2s infinite ease-in-out;
    border: 1px solid rgba(255, 76, 76, 0.4);
}

@keyframes pulseMute {
    0% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.6; transform: scale(0.95); }
}

#level-complete-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 20;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(1.1); }
    to { opacity: 1; transform: scale(1); }
}

#overlay-title {
    color: #4cbf56;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px #000;
}

.score-line {
    font-size: 24px;
    margin: 5px 0;
}

.total-score {
    font-size: 36px;
    color: #ff8c1a;
    font-weight: bold;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #555;
}

#high-score-alert {
    color: #ffdf00;
    font-weight: bold;
    font-size: 20px;
    margin-top: 10px;
    animation: flash 1s infinite alternate;
}

@keyframes flash {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.8; transform: scale(1.1); }
}

.overlay-buttons {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.overlay-buttons button {
    padding: 12px 24px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s;
}

.overlay-buttons button:hover {
    transform: scale(1.05);
}

.overlay-buttons button:active {
    transform: scale(0.95);
}

#next-level-btn {
    background-color: #4cbf56;
    color: white;
}

#retry-level-btn {
    background-color: #ff8c1a;
    color: white;
}

#start-screen-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 30;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    animation: fadeIn 0.3s ease-out;
}

.icon-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: background 0.2s, transform 0.2s;
    z-index: 35;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(45deg);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

#start-title {
    color: #ff8c1a;
    font-size: 64px;
    margin-bottom: 20px;
    text-shadow: 4px 4px 6px #000;
}

.start-instructions {
    background: rgba(0,0,0,0.6);
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.start-instructions p {
    margin: 8px 0;
    width: 100%;
    text-align: left;
}

.start-instructions .overlay-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

.start-instructions .overlay-buttons button {
    background-color: #99bbff;
    color: #000;
    border: 3px solid #3355cc;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 2px 3px 0px #222;
    transition: transform 0.1s, box-shadow 0.1s;
    min-width: 140px;
}

.start-instructions .overlay-buttons button:hover {
    transform: scale(1.05);
    box-shadow: 3px 4px 0px #222;
}

.start-instructions .overlay-buttons button:active {
    transform: scale(0.95);
    box-shadow: 1px 1px 0px #222;
}

canvas {
    display: block;
}

#vehicle-select-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 30;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    animation: fadeIn 0.3s ease-out;
}

#vehicle-title {
    color: #ff8c1a;
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 4px 4px 6px #000;
}

#vehicle-select-overlay .overlay-buttons {
    flex-direction: column;
    gap: 16px;
}

#vehicle-select-overlay .overlay-buttons button {
    background-color: #99bbff;
    color: #000;
    min-width: 320px;
    padding: 20px;
    font-size: 24px;
    border: 5px solid #3355cc;
    border-radius: 16px;
    /* Original padding and font-size were 18px 60px and 28px, respectively.
       The instruction implies these are being updated to 20px and 24px. */
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 3px 4px 0px #222;
    transition: transform 0.1s, box-shadow 0.1s;
}

#vehicle-select-overlay .overlay-buttons button:hover {
    transform: scale(1.08);
    box-shadow: 5px 6px 0px #222;
}

#vehicle-select-overlay .overlay-buttons button:active {
    transform: scale(0.97);
    box-shadow: 1px 2px 0px #222;
}

#vehicle-select-overlay .overlay-buttons button.locked {
    background-color: #444;
    color: #888;
    border-color: #222;
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.7;
    position: relative;
}

#vehicle-select-overlay .overlay-buttons button.locked:hover {
    transform: none;
    box-shadow: 3px 4px 0px #222;
}

#settings-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #333333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 40;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    animation: fadeIn 0.3s ease-out;
}

#settings-title {
    color: #ff8c1a;
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 4px 4px 6px #000;
}

.settings-container {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 16px;
    width: 65%;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    pointer-events: auto; /* Ensure interaction */
}

.custom-select {
    position: relative;
    width: auto;
    min-width: 180px;
    z-index: 100 !important;
    pointer-events: auto;
}

.select-trigger {
    background: #333 url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') no-repeat right 12px center;
    background-size: 16px;
    color: white;
    border: 2px solid #555;
    padding: 10px 40px 10px 15px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.select-trigger:hover {
    border-color: #ff8c1a;
    background-color: #444;
}

.select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 2px solid #555;
    border-radius: 10px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 101;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.option {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 14px;
    color: #ccc;
    text-align: left;
}

.option:hover {
    background: #ff8c1a;
    color: white;
}

.option.selected {
    color: #ff8c1a;
    font-weight: bold;
}

.option.selected:hover {
    color: white;
}



.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 20px;
}

.setting-item label {
    flex: 1;
}

.setting-item input[type="range"] {
    flex: 1;
    margin: 0 20px;
    cursor: pointer;
}

.setting-item span {
    min-width: 50px;
    text-align: right;
    color: #99bbff;
    font-weight: bold;
}

#settings-overlay .overlay-buttons button {
    background-color: #ff8c1a;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

#settings-overlay .overlay-buttons button:hover {
    transform: scale(1.05);
}

#level-select-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #222222;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 45;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    animation: fadeIn 0.3s ease-out;
}

#level-select-title {
    color: #4cbf56;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px #000;
}

#level-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-height: 350px;
    overflow-y: auto;
    padding: 20px;
    width: 80%;
}

.level-tile {
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-tile:hover {
    background: rgba(76, 191, 86, 0.2);
    border-color: #4cbf56;
    transform: translateY(-5px);
}

.level-tile .level-name {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.level-tile .level-score {
    font-size: 12px;
    color: #ffb366;
    font-family: 'Courier New', Courier, monospace;
}

#level-select-overlay .overlay-buttons button {
    background-color: #4cbf56;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s;
}

#level-select-overlay .overlay-buttons button:active {
    transform: scale(0.95);
}

#achievements-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 50;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    animation: fadeIn 0.3s ease-out;
    padding: 40px 0;
}

#achievements-list {
    max-height: 400px;
    overflow-y: auto;
    width: 65%;
    padding: 20px;
    margin-bottom: 20px;
}

/* Custom scrollbar for premium feel */
#achievements-list::-webkit-scrollbar, #level-grid::-webkit-scrollbar {
    width: 8px;
}

#achievements-list::-webkit-scrollbar-track, #level-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#achievements-list::-webkit-scrollbar-thumb, #level-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

#achievements-list::-webkit-scrollbar-thumb:hover, #level-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

#achievements-title {
    color: #ffd700;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s;
    opacity: 0.4; /* Locked state */
    filter: grayscale(1);
    width: 100%;
    box-sizing: border-box;
}

.achievement-item.unlocked {
    opacity: 1;
    filter: none;
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

.achievement-icon {
    font-size: 32px;
}

.achievement-info {
    text-align: left;
}

.achievement-name {
    font-weight: bold;
    font-size: 18px;
    color: #ffffff;
}

.achievement-desc {
    font-size: 14px;
    color: #aaaaaa;
    margin-top: 4px;
}

#achievements-overlay .overlay-buttons button {
    background-color: #ffd700;
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

/* --- Mobile Controls (Touch UI) --- */
#mobile-controls {
    display: none; /* Hidden by default */
    position: absolute;
    bottom: 10px; /* Anchored to bottom of game-container */
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 30; /* Higher than UI layer and overlays */
}

/* Show if Media Query matches OR if Mobile UI is forced */
@media (pointer: coarse), (max-width: 900px) {
    body:not(.ui-desktop).game-playing #mobile-controls {
        display: flex;
        justify-content: space-between;
        padding: 0 20px;
    }
    
    /* Scale game for mobile */
    body:not(.ui-desktop) #scratch-window {
        transform: scale(min(1, calc(100vw / 840)));
        transform-origin: center top;
        margin-top: 10px;
    }
}

/* Forced Mobile UI */
body.ui-mobile.game-playing #mobile-controls {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

body.ui-mobile #scratch-window {
    transform: scale(min(1, calc(100vw / 840)));
    transform-origin: center top;
    margin-top: 10px;
}

/* Forced Desktop UI (Already handled by :not(.ui-desktop) above, but being explicit) */
body.ui-desktop #mobile-controls {
    display: none !important;
}

body.ui-desktop #scratch-window {
    transform: scale(1) !important;
}

/* --- Realistic Mobile Layout --- */
#mobile-controls {
    display: none; /* Controlled by flex in media queries */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;
    opacity: 0.65; /* Semi-transparent for better visibility */
}

#steering-wheel-container {
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 95px;
    height: 95px;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

#steering-wheel {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    border: 6px solid #555;
    background: radial-gradient(circle, #333 30%, #222 100%);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 14px rgba(0,0,0,0.7), inset 0 0 10px rgba(0,0,0,0.5);
    transition: transform 0.1s linear;
}

.wheel-spoke {
    position: absolute;
    background: #666;
    border-radius: 2px;
}
.spoke-h {
    width: 80%;
    height: 4px;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
}
.spoke-v {
    width: 4px;
    height: 80%;
    left: 50%;
    top: 10%;
    transform: translateX(-50%);
}
.wheel-center {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #444;
    border: 2px solid #666;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    z-index: 2;
    box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}

/* --- Right Controls Cluster (Shifter + Pedals) --- */
#right-controls-cluster {
    position: absolute;
    bottom: 8px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: auto;
    z-index: 31;
}

#pedals-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    pointer-events: auto;
}

.pedal-box {
    cursor: pointer;
    transition: transform 0.1s;
    touch-action: none;
    padding: 12px; /* Increase tap target size */
}

.pedal-box:active {
    transform: scale(0.9) translateY(5px);
}

#brake-pedal {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #3a1111, #5a1a1a);
    border: 2px solid #cc3333;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #ff4444;
    box-shadow: 0 0 10px rgba(204, 51, 51, 0.4), inset 0 0 8px rgba(0,0,0,0.4);
    user-select: none;
}
#brake-pedal span {
    font-size: 8px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    color: #ff6666;
    margin-top: 1px;
}

#gas-pedal {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #0a2a0a, #1a4a1a);
    border: 2px solid #33cc33;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: #44ff44;
    box-shadow: 0 0 10px rgba(51, 204, 51, 0.4), inset 0 0 8px rgba(0,0,0,0.4);
    user-select: none;
}
#gas-pedal span {
    font-size: 8px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    color: #66ff66;
    margin-top: 1px;
}

#shifter-container {
    width: 42px;
    height: 42px;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

#shifter-stick {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2a2000, #443300);
    border: 3px solid #cc8800;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    color: #ffaa00;
    box-shadow: 0 0 12px rgba(204, 136, 0, 0.4), inset 0 0 8px rgba(0,0,0,0.4);
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
}

#shifter-stick:active {
    opacity: 1;
}

.shifter-up { transform: translateY(-15px) scale(1.1) rotate(-5deg); }
.shifter-down { transform: translateY(15px) scale(0.9) rotate(5deg); }



/* Update Media Queries for new layout */
@media (pointer: coarse), (max-width: 900px) {
    body:not(.ui-desktop).game-playing #mobile-controls {
        display: flex;
    }
}

body.ui-mobile.game-playing #mobile-controls {
    display: flex;
}

/* --- Fullscreen Styles --- */
:fullscreen #scratch-window,
:-webkit-full-screen #scratch-window {
    width: 100vw;
    height: 100vh;
    border: none;
    border-radius: 0;
}

:fullscreen #game-canvas,
:-webkit-full-screen #game-canvas {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
}

/* Landscape Mode Support */
@media (orientation: landscape) and (max-height: 500px) {
    #scratch-top-bar {
        display: none; /* Hide overhead in landscape to save vertical space */
    }
    
    #scratch-window {
        padding: 0;
        margin: 0;
        width: 100vw;
        max-width: none;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    #game-container {
        width: auto;
        height: 100vh;
        aspect-ratio: 4 / 3;
    }

    #game-canvas {
        height: 100%;
        width: auto;
    }

    #steering-wheel-container {
        left: 5px;
        bottom: 10px;
    }

    #right-controls-cluster {
        right: 5px;
        bottom: 10px;
    }
}

/* Ensure canvas is responsive */
#game-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
