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

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.status {
    font-size: 16px;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #f0f0f0;
    display: inline-block;
}

.status.won {
    background: #4ade80;
    color: white;
    animation: celebrate 0.5s ease-in-out;
}

.status.lost {
    background: #f87171;
    color: white;
    animation: shake 0.5s ease-in-out;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat {
    font-size: 14px;
    padding: 8px 15px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 2px solid #ddd;
}

#difficulty, #theme {
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

#canvas-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    position: relative;
}

#canvas {
    border: 4px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    padding: 12px 20px;
    border: 3px solid #333;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #333;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #333;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #333;
}

.btn.active {
    background: #4ade80;
    color: white;
}

.instructions {
    margin: 20px 0;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.instructions summary {
    cursor: pointer;
    font-size: 12px;
    margin-bottom: 10px;
    user-select: none;
}

.instructions ul {
    list-style: none;
    font-size: 10px;
    line-height: 1.8;
    margin-left: 20px;
}

.instructions li:before {
    content: "→ ";
    margin-right: 5px;
}

.loading {
    text-align: center;
    padding: 40px;
    font-size: 14px;
    color: #667eea;
    display: none;
}

.pixel-loader {
    animation: pulse 1s ease-in-out infinite;
}

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

footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
    font-size: 10px;
    color: #666;
}

footer a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #764ba2;
}

@media (max-width: 768px) {
    h1 {
        font-size: 18px;
    }
    
    .stat, .btn {
        font-size: 10px;
        padding: 8px 12px;
    }
    
    #difficulty, #theme {
        font-size: 8px;
    }
    
    .instructions {
        font-size: 9px;
    }
}