* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    background: #050505;
    color: #ccc;
    font-family: "Courier New", Courier, monospace;
    touch-action: none;
}

#stage {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

canvas {
    display: block;
    border: 1px solid #333;
    box-shadow: 0 0 40px rgb(0 255 255 / 5%);
}

#ui-layer {
    position: fixed;
    right: 50%;
    bottom: 20px;
    z-index: 10;
    display: flex;
    width: min(90vw, 532px);
    transform: translateX(50%);
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 12px;
    background: rgb(0 0 0 / 90%);
    backdrop-filter: blur(5px);
    touch-action: manipulation;
}

.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

button,
input[type="text"],
input[type="file"] {
    min-height: 36px;
    border: 1px solid #333;
    border-radius: 4px;
    background: #111;
    color: cyan;
    font: inherit;
    font-size: 11px;
}

button {
    flex: 1;
    padding: 8px 10px;
    cursor: pointer;
    transition:
        border-color 0.2s,
        background 0.2s,
        color 0.2s;
}

button:hover,
button:focus-visible {
    border-color: cyan;
    background: #222;
    outline: none;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.active-btn {
    border-color: cyan;
    background: cyan;
    color: black;
    font-weight: bold;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    background: #000;
    text-align: center;
}

input[type="file"] {
    width: 100%;
    padding: 8px;
    color: #888;
}

.hidden {
    display: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#physics-info {
    min-height: 30px;
    padding-top: 10px;
    margin-top: 5px;
    border-top: 1px solid #333;
    color: #00ff00;
    font-family: monospace;
    font-size: 10px;
    letter-spacing: 1px;
    text-align: center;
}

@media (max-width: 600px) {
    #stage {
        align-items: flex-start;
        padding: 12px 8px 260px;
    }

    #ui-layer {
        bottom: 10px;
        width: min(95vw, 532px);
        padding: 10px;
    }

    button {
        padding: 10px 5px;
    }
}
