/* Pixelated styles for retro feel */

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

body {
    font-family: 'Press Start 2P', cursive, sans-serif;
    background: linear-gradient(to bottom, #f9c9ff, #a7fcff);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 400px; /* Slightly narrower */
    height: 100%;
    max-height: 800px; /* Taller for better smartphone display */
    margin: 0 auto;
    background-color: #e9eeff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    aspect-ratio: 9/16; /* Smartphone aspect ratio */
}

.game-header {
    width: 100%;
    padding: 10px;
    text-align: center;
    background-color: #f8b6ff;
    border-bottom: 4px solid #c284d8;
}

h1 {
    font-size: 1.5rem;
    color: #6a11cb;
    text-shadow: 2px 2px 0 #ff88ee;
    margin-bottom: 8px;
}

.score-container, .high-score-container {
    font-size: 0.8rem;
    color: #6a11cb;
}

.mute-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: 2px solid #c284d8;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}

.mute-button:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.9);
}

canvas {
    display: block;
    width: 100%;
    height: calc(100% - 80px);
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    border: 4px solid #c284d8;
    z-index: 10; /* Make sure it's on top */
    min-width: 220px;
}

.game-message h2 {
    font-size: 1.2rem;
    color: #6a11cb;
    margin-bottom: 10px;
}

.game-message p {
    font-size: 0.8rem;
    color: #6a11cb;
    margin-bottom: 5px;
}

.instructions {
    font-size: 0.7rem;
    color: #8844aa;
}

.credits {
    position: absolute;
    bottom: 5px;
    right: 8px;
    font-size: 0.6rem;
    color: rgba(106, 17, 203, 0.6);
    z-index: 5;
    font-family: monospace;
    pointer-events: none;
}

/* Media queries for responsiveness */
@media (max-width: 400px) {
    .game-container {
        border-radius: 0;
        max-height: 100vh;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-height: 800px) {
    h1 {
        font-size: 1.2rem;
    }
    
    .score-container, .high-score-container {
        font-size: 0.7rem;
    }
}

@media (orientation: landscape) {
    .game-container {
        aspect-ratio: 4/3;
        max-height: 90vh;
        max-width: 75vh;
    }
}