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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameWrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

canvas {
    display: block;
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    outline: none;
}

/* Bouton plein écran */
#fullscreenBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 22px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#fullscreenBtn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

/* Fullscreen : le wrapper remplit tout */
#gameWrapper:fullscreen,
#gameWrapper:-webkit-full-screen {
    background: #000;
    width: 100vw;
    height: 100vh;
}

#gameWrapper:fullscreen canvas,
#gameWrapper:-webkit-full-screen canvas {
    max-width: 100vw;
    max-height: 100vh;
}

/* Cacher le bouton fullscreen en plein écran (on peut sortir avec Esc/F) */
#gameWrapper:fullscreen #fullscreenBtn,
#gameWrapper:-webkit-full-screen #fullscreenBtn {
    opacity: 0;
    pointer-events: none;
}
