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

body {
    background: #1a0e05;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    font-family: 'Fredoka', sans-serif;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#game-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#canvas {
    display: block;
    border-radius: 4px;
    image-rendering: auto;
}

#mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    opacity: 0.7;
}

#ctrl-mid {
    display: flex;
    gap: 48px;
}

.ctrl-btn {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 2px solid #8B6914;
    background: linear-gradient(145deg, #5C3D1A, #3A2510);
    color: #D4A84B;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
}

.ctrl-btn:active {
    background: linear-gradient(145deg, #7A5220, #4A3018);
    transform: scale(0.95);
}

#footer {
    position: fixed;
    bottom: 6px;
    text-align: center;
    z-index: 100;
}

#footer a {
    color: #8B6914;
    text-decoration: none;
    font-family: 'Fredoka', sans-serif;
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

#footer a:hover {
    opacity: 1;
    text-decoration: underline;
}

@media (max-width: 768px), (pointer: coarse) {
    #mobile-controls {
        display: flex;
    }
}

@media (max-height: 500px) {
    #mobile-controls {
        flex-direction: row;
        gap: 8px;
    }
    #ctrl-mid {
        gap: 8px;
    }
    .ctrl-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}