* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html,
body {
    overflow: hidden;
    background-color: black;
}

.container {
    position: relative;
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    margin: 10px;
    background-color: #E6E7EB;
    border-radius: 5px;
    overflow: hidden;
}

.webgpu {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    outline: none;
    touch-action: none;
    cursor: grab;
}

.webgpu:active {
    cursor: grabbing;
}

.title {
    position: absolute;
    top: 24px;
    left: 32px;
    font-size: clamp(24px, 4vw, 48px);
    font-weight: bold;
    pointer-events: none;
}

.readout {
    position: absolute;
    left: 24px;
    bottom: 24px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.readout .key {
    display: inline-block;
    width: 64px;
    color: #6b6d74;
}

.panel {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 240px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    font-size: 14px;
    transition: opacity 150ms ease-in-out, transform 150ms ease-in-out;
}

.panel.hidden {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

.row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.row > span {
    display: flex;
    justify-content: space-between;
}

.row output {
    font-variant-numeric: tabular-nums;
    color: #6b6d74;
}

.row.check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.row input[type=number],
.row select {
    font-size: 14px;
    padding: 4px 6px;
    border: 1px solid #b9bbc2;
    border-radius: 4px;
    background: white;
}

input[type=range] {
    width: 100%;
    accent-color: black;
}

input[type=checkbox] {
    accent-color: black;
}

.buttons {
    display: flex;
    gap: 8px;
}

.buttons button {
    flex: 1;
    padding: 6px 0;
    font-size: 14px;
    font-weight: bold;
    color: white;
    background: black;
    border: 2px solid black;
    border-radius: 6px;
    cursor: pointer;
}

.buttons button:hover {
    color: black;
    background: white;
}

.hint {
    font-size: 12px;
    color: #6b6d74;
}

.panel-toggle {
    display: none;
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 2;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
}

.panel-toggle span {
    display: block;
    width: 22px;
    height: 3px;
    margin: 4px 0;
    background: black;
}

.gpu-error {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    font-size: 18px;
}

@media (max-width: 700px) {
    .title {
        top: 16px;
        left: 16px;
    }

    .readout {
        left: 16px;
        bottom: 16px;
    }

    .panel-toggle {
        display: block;
        top: 14px;
        right: 12px;
    }

    .panel {
        top: 56px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}
