* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    font-family: Arial, sans-serif;
}

canvas {
    display: block;
    background: #111;
}

#ui {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

#levelButtons {
    position: absolute;
    bottom: 20px;
    left: 10px;
    display: grid;
    grid-template-columns: 60px;
    grid-template-rows: repeat(5, 60px);
    gap: 5px;
    pointer-events: auto;
}

.level-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    touch-action: manipulation;
}

#menuBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 40px;
    height: 40px;
    font-size: 24px;
    background: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    pointer-events: auto;
}

#menu {
    position: absolute;
    top: 60px;
    right: 10px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px;
    border-radius: 10px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
    pointer-events: auto;
}

#menu button,
#menu input,
#menu label {
    margin: 5px 0;
}

#scoreDisplay {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    font-size: 20px;
    z-index: 10;
}

#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
    z-index: 1000;
    pointer-events: auto;
}

#startScreen button {
    font-size: 24px;
    padding: 10px 20px;
    background: #0a0;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
}

#startScreen p {
    font-size: 16px;
    margin: 10px 0;
}

#controls {
    position: absolute;
    bottom: 20px;
    right: 10px;
    display: grid;
    grid-template-columns: 60px 60px;
    grid-template-rows: 60px 60px;
    gap: 5px;
    z-index: 10;
    pointer-events: auto;
}

.ctrl-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 10px;
    color: white;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    touch-action: manipulation;
}