body {
    background-color: #2c3e50;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    margin: 0;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

body.mobile-mode {
    overflow: hidden; 
    touch-action: none;
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

#main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    border: 8px solid #fff;
    background: #87CEEB; 
    transform-origin: center center; 
    flex-shrink: 0;
}

body.mobile-mode #game-container {
    border: none;
}
body.mobile-mode #help-hint {
    display: none;
}

#help-hint {
    margin-top: 15px;
    font-size: 0.8em;
    color: #bdc3c7;
    text-shadow: 1px 1px 0 #000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.key {
    display: inline-block;
    padding: 2px 6px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    background-color: #34495e;
    color: #fff;
    font-family: monospace;
    font-weight: bold;
    box-shadow: 0 2px 0 #000;
    margin: 0 2px;
    font-size: 0.9em;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    backdrop-filter: blur(4px);
}

h1 { 
    font-size: 3em; 
    color: #ffcc00; 
    text-shadow: 4px 4px 0 #d35400; 
    margin-bottom: 20px; 
    line-height: 1.2;
}

p { font-size: 0.8em; line-height: 1.5; max-width: 80%; color: #fff; }

button {
    font-family: 'Press Start 2P', cursive;
    font-size: 1em;
    padding: 15px 30px;
    margin-top: 20px;
    background-color: #3498db;
    color: #fff;
    border: 4px solid #2980b9;
    box-shadow: 0 6px 0 #1f618d;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

button:hover { 
    transform: translateY(-2px); 
    background-color: #5dade2; 
}
button:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #1f618d;
}

.menu-options { margin-top: 30px; }
.menu-options button { 
    background-color: #e67e22; 
    border-color: #d35400; 
    box-shadow: 0 4px 0 #a04000;
    font-size: 0.7em; 
    padding: 10px 20px; 
    margin: 0 10px; 
}
.menu-options button:active { box-shadow: 0 2px 0 #a04000; }

#hud {
    position: absolute; top: 15px; left: 15px; width: calc(100% - 30px);
    display: flex; justify-content: space-between;
    font-size: 0.8em; color: #003366; 
    text-shadow: 2px 2px 0 rgba(255,255,255,0.8);
    pointer-events: none; z-index: 5;
    font-weight: bold;
}
#mode-indicator { color: #d35400; text-shadow: 1px 1px 0 #fff; }

.modal { 
    position: fixed; z-index: 100; left: 0; top: 0; 
    width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.85); 
    display: none; 
    justify-content: center; align-items: center; 
}
.modal-content { 
    background-color: #34495e; 
    padding: 30px; 
    border: 4px solid #fff; 
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    width: 50%; 
    text-align: center; 
    position: relative; 
    color: #ecf0f1;
}
.help-content { width: 70%; text-align: left; }
.help-section { margin-bottom: 20px; border-bottom: 1px solid #7f8c8d; padding-bottom: 10px; }
.help-section h3 { color: #f1c40f; font-size: 0.9em; margin-bottom: 10px; }
.help-section p { font-size: 0.7em; color: #ecf0f1; max-width: 100%; margin: 5px 0; }

.close-button { 
    position: absolute; top: 10px; right: 20px; 
    font-size: 28px; cursor: pointer; color: #e74c3c;
}

#leaderboard-list { text-align: left; padding-left: 40px; line-height: 1.8; color: #f1c40f; }

#skier-options { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }
.skier-option { 
    font-size: 2.5em; cursor: pointer; padding: 10px; 
    border: 3px solid transparent; 
    transition: transform 0.2s;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}
.skier-option:hover { transform: scale(1.2); background: rgba(255,255,255,0.2); }
.skier-option.selected { 
    border-color: #f1c40f; 
    background: rgba(241, 196, 15, 0.2);
}

#mobile-btn {
    position: fixed; top: 10px; left: 10px; z-index: 2000;
    background: #3498db; color: white; border: 2px solid white;
    font-family: 'Press Start 2P', cursive; font-size: 10px;
    padding: 10px; cursor: pointer; box-shadow: 0 4px 0 #1f618d;
}
body.mobile-mode #mobile-btn { display: none; }

#mobile-controls {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 3000; display: none; 
    justify-content: space-between; align-items: flex-end;
    padding: 20px; box-sizing: border-box;
}

body.mobile-mode #mobile-controls { display: flex; }

.mobile-control-btn {
    pointer-events: auto; width: 140px; height: 140px; 
    background: rgba(255,255,255,0.15); border: 4px solid rgba(255,255,255,0.4);
    border-radius: 50%; color: white; font-size: 60px; 
    display: flex; justify-content: center; align-items: center;
    user-select: none; backdrop-filter: blur(4px); margin-bottom: 20px;
    transition: transform 0.1s, background 0.1s;
    -webkit-tap-highlight-color: transparent; font-family: Arial, sans-serif;
}
.mobile-control-btn:active { background: rgba(255,255,255,0.4); transform: scale(0.95); }
#mobile-dpad { display: flex; gap: 15px; margin-left: 10px; margin-bottom: 10px; }
#mobile-action { margin-right: 10px; margin-bottom: 10px; }

.crt-effect { position: relative; overflow: hidden; }
.crt-effect::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%; pointer-events: none; z-index: 9999;
}
