html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: #e6e6e6;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial;
}

#ui {
    position: fixed;
    top: 12px;
    left: 12px;
    color: #e6e6e6;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    user-select: none;
}

#ui .row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 6px 0;
}

#ui label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.95;
}

#ui input[type="number"] {
    width: 92px;
}

#ui input[type="range"] {
    width: 160px;
}

#ui button {
    cursor: pointer;
    background: #111;
    color: #e6e6e6;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 12px;
}

#ui .title {
    font-weight: 600;
    letter-spacing: 0.2px;
    font-size: 13px;
}

#ui .small {
    font-size: 11px;
    opacity: 0.85;
}

#ui .pad {
    padding: 4px 7px;
}

#ui .icon-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 0;
    font-size: 14px;
}

#diag {
    font-size: 11px;
    opacity: 0.95;
}

canvas {
    display: block;
    touch-action: none;
}

#err {
    position: fixed;
    right: 12px;
    top: 12px;
    max-width: 46ch;
    color: #ffdede;
    background: rgba(64, 0, 0, 0.65);
    border: 1px solid rgba(255, 120, 120, 0.55);
    border-radius: 12px;
    padding: 8px 10px;
    display: none;
    font-size: 12px;
}