* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial Black', Arial, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
}

#canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    touch-action: none;
}

#hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: none;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 10;
}

#score-container {
    text-align: left;
}

#score {
    font-size: 2em;
    font-weight: bold;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    color: #FFD700;
}

#high-score {
    font-size: 1em;
    color: #FFA500;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#lives {
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#size-indicator {
    font-size: 1.5em;
    font-weight: bold;
    color: #FF6B35;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-align: right;
}

#controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    justify-content: center;
    z-index: 10;
}

.game-button {
    background: linear-gradient(135deg, #FF6B35 0%, #F7931E 100%);
    border: 4px solid #fff;
    border-radius: 20px;
    padding: 20px 40px;
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.6),
                inset 0 -4px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    pointer-events: all;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.8),
                inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

.game-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4),
                inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.game-button.clicked {
    animation: pulse 0.3s ease-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#size-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    transform: scaleX(var(--cooldown, 0));
    transform-origin: left;
    transition: transform 0.1s linear;
}

.button-icon {
    font-size: 1.2em;
    margin-right: 10px;
}

.button-text {
    position: relative;
    z-index: 1;
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 3em;
    margin-bottom: 30px;
    text-align: center;
    background: linear-gradient(135deg, #FFD700 0%, #FF6B35 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.5);
}

.instructions {
    background: rgba(255, 107, 53, 0.1);
    border: 2px solid #FF6B35;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    max-width: 600px;
}

.instructions p {
    font-size: 1.2em;
    margin: 10px 0;
    text-align: left;
}

.instructions strong {
    color: #FFD700;
}

#start-high-score,
#game-over-high-score {
    font-size: 1.5em;
    color: #FFD700;
    margin: 20px 0;
}

#death-message {
    font-size: 2em;
    color: #FF6B35;
    margin: 20px 0;
    text-align: center;
}

#final-score {
    font-size: 1.8em;
    margin: 10px 0;
}

.footer {
    position: absolute;
    bottom: 20px;
    font-size: 0.9em;
    color: #888;
}

.footer a {
    color: #FF6B35;
    text-decoration: none;
}

.footer a:hover {
    color: #FFD700;
}

@media (max-width: 768px) {
    .screen h1 {
        font-size: 2em;
    }
    
    .instructions {
        padding: 20px;
    }
    
    .instructions p {
        font-size: 1em;
    }
    
    #score {
        font-size: 1.5em;
    }
    
    #size-indicator {
        font-size: 1.2em;
    }
    
    .game-button {
        padding: 15px 30px;
        font-size: 1.2em;
    }
}