* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

body {
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    display: block;
    background: #5b9bd5;
    border: none;
    image-rendering: pixelated;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10;
    color: #fff;
    text-align: center;
    padding: 20px;
}

.screen.hidden {
    display: none;
}

h1 {
    font-size: 56px;
    margin-bottom: 10px;
    text-shadow: 5px 5px 0px #000;
    color: #FFD700;
    letter-spacing: 3px;
}

h2 {
    font-size: 42px;
    margin-bottom: 20px;
    text-shadow: 4px 4px 0px #000;
    color: #ff4444;
}

.subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    color: #FFD700;
}

.pixel-btn {
    font-family: 'Courier New', monospace;
    font-size: 22px;
    font-weight: bold;
    padding: 15px 50px;
    background: #FFD700;
    color: #000;
    border: 4px solid #333;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 5px 5px 0px #000;
    transition: all 0.1s;
    margin: 10px;
}

.pixel-btn:hover {
    background: #FFA500;
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0px #000;
}

.pixel-btn:active {
    transform: translate(5px, 5px);
    box-shadow: 0px 0px 0px #000;
}

.instructions {
    margin-top: 30px;
    font-size: 16px;
    line-height: 2;
    color: #ccc;
}

.instructions strong {
    color: #FFD700;
    font-size: 18px;
}

#final-score, #win-score {
    font-size: 28px;
    margin: 20px 0;
    color: #FFD700;
}

#hud {
    position: fixed;
    top: 75px;
    left: 15px;
    right: 15px;
    z-index: 999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#hud > div {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 3px solid #FFD700;
    border-radius: 5px;
    text-shadow: 2px 2px 0px #000;
}

#score {
    color: #FFD700;
}

#lives {
    color: #ff6b6b;
}

#coins {
    color: #4ecdc4;
}

#mobile-controls, #mobile-controls-game {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 100;
    pointer-events: none;
}

#mobile-controls > div, #mobile-controls-game > div {
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

.control-btn {
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    padding: 20px 30px;
    background: rgba(255, 215, 0, 0.9);
    color: #000;
    border: 3px solid #333;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 3px 3px 0px #000;
    transition: none;
    border-radius: 10px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.control-btn:active {
    background: #FFA500;
    transform: scale(0.95);
    box-shadow: 1px 1px 0px #000;
}

@media (min-width: 768px) {
    #mobile-controls, #mobile-controls-game {
        display: none;
    }
}
