/* Styles pour la console GameBoy */

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

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

.gameboy-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.gameboy {
    position: relative;
    width: 300px;
    height: 400px;
    background: #555;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    padding: 20px;
    border: 8px solid #333;
}

/* Corps principal */
.gameboy::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, #444, #222);
    border-radius: 15px;
    z-index: -1;
}

/* Écran LCD */
.screen {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.lcd {
    width: 260px;
    height: 180px;
    background: #000;
    border: 8px solid #333;
    border-radius: 8px;
    padding: 8px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    position: relative;
}

.lcd::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #003300 0%, #006600 100%);
    border-radius: 4px;
    z-index: -1;
}

#gameCanvas {
    background-color: #003300;
    border: 2px solid #006600;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

/* Boutons directionnels (D-Pad) */
.dpad {
    position: absolute;
    bottom: 40px;
    left: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
    width: 80px;
    height: 80px;
}

.dpad-button {
    background: #666;
    border: 2px solid #333;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s;
    box-shadow: 0 2px 0 #333;
}

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

.dpad-button.up {
    grid-column: 2;
    grid-row: 1;
}

.dpad-button.left {
    grid-column: 1;
    grid-row: 2;
}

.dpad-button.right {
    grid-column: 3;
    grid-row: 2;
}

.dpad-button.down {
    grid-column: 2;
    grid-row: 3;
}

/* Boutons A et B */
.buttons {
    position: absolute;
    bottom: 40px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.button-a, .button-b {
    width: 50px;
    height: 50px;
    background: #ff3333;
    border: 2px solid #cc0000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s;
    box-shadow: 0 2px 0 #cc0000;
}

.button-a:active, .button-b:active {
    transform: translateY(2px);
    box-shadow: 0 0 0 #cc0000;
}

.button-a {
    background: #ff3333;
    border-color: #cc0000;
}

.button-b {
    background: #3333ff;
    border-color: #0000cc;
}

/* Boutons Start et Select */
.controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-button {
    width: 80px;
    height: 25px;
    background: #666;
    border: 2px solid #333;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s;
    box-shadow: 0 2px 0 #333;
}

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

/* Poignée latérale */
.handle {
    position: absolute;
    top: 50%;
    right: -15px;
    width: 30px;
    height: 100px;
    background: #333;
    border-radius: 15px 0 0 15px;
    transform: translateY(-50%);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Instructions */
.instructions {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instructions h2 {
    color: white;
    margin-bottom: 10px;
    font-size: 18px;
}

.instructions p {
    color: #ddd;
    font-size: 14px;
    margin: 5px 0;
}

/* Responsive design */
@media (max-width: 480px) {
    .gameboy {
        width: 280px;
        height: 380px;
    }
    
    .lcd {
        width: 240px;
        height: 160px;
    }
    
    .dpad {
        width: 70px;
        height: 70px;
    }
    
    .buttons {
        right: 15px;
    }
    
    .control-button {
        width: 70px;
        height: 20px;
        font-size: 10px;
    }
}