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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.home-btn {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 20;
    color: #fff;
    background: rgba(0,0,0,0.6);
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    padding: 4px 10px;
    font: bold 12px monospace;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.home-btn:hover, .home-btn:active {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.7);
}

#gameCanvas {
    display: block;
    margin: 0 auto;
}

.touch-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 20px;
    pointer-events: none;
    z-index: 10;
}

.touch-controls.hidden { display: none; }

.touch-left, .touch-right {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    pointer-events: auto;
}

.touch-left { flex-direction: row; flex-wrap: wrap; width: 140px; }

.touch-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn:active, .touch-btn.pressed {
    background: rgba(255,255,255,0.4);
    border-color: rgba(255,255,255,0.8);
}

.touch-btn-small {
    width: 44px;
    height: 44px;
    font-size: 16px;
    margin-left: 6px;
}

.touch-btn-jump {
    width: 72px;
    height: 72px;
    font-size: 24px;
    background: rgba(255, 60, 60, 0.25);
    border-color: rgba(255, 60, 60, 0.6);
}

.touch-btn-jump:active, .touch-btn-jump.pressed {
    background: rgba(255, 60, 60, 0.5);
    border-color: rgba(255, 60, 60, 0.9);
}

.touch-btn-action {
    width: 56px;
    height: 56px;
    background: rgba(60, 120, 255, 0.25);
    border-color: rgba(60, 120, 255, 0.6);
}

.touch-btn-action:active, .touch-btn-action.pressed {
    background: rgba(60, 120, 255, 0.5);
    border-color: rgba(60, 120, 255, 0.9);
}
