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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    image-rendering: pixelated;
    -webkit-font-smoothing: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a1a2e;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.score-panel {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 25px;
    border-radius: 8px;
    border: 3px solid #555;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
}

.score-label {
    font-size: 12px;
    color: #aaa;
    margin-bottom: 2px;
}

.score-value {
    font-size: 20px;
    font-weight: bold;
    color: #ffcc00;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 40px;
    background: #2a2a4a;
    border: 4px solid #555;
    border-radius: 12px;
    max-width: 90%;
}

.game-title {
    font-size: 36px;
    color: #ffcc00;
    margin-bottom: 20px;
    text-shadow: 3px 3px 0 #000;
}

.game-instructions {
    font-size: 16px;
    color: #ddd;
    margin-bottom: 10px;
}

.final-score, .best-score {
    font-size: 24px;
    color: #fff;
    margin-bottom: 15px;
}

.final-score span, .best-score span {
    color: #ffcc00;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 8px;
    transition: transform 0.1s;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: #4CAF50;
    color: white;
    border: 3px solid #2E7D32;
}

.btn-primary:hover {
    background: #66BB6A;
}

.btn-secondary {
    background: #757575;
    color: white;
    border: 3px solid #616161;
}

.btn-secondary:hover {
    background: #9E9E9E;
}

@media (max-width: 600px) {
    .score-panel {
        gap: 15px;
        padding: 8px 15px;
    }
    
    .score-label {
        font-size: 10px;
    }
    
    .score-value {
        font-size: 16px;
    }
    
    .game-title {
        font-size: 24px;
    }
    
    .game-instructions {
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 16px;
    }
}