:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #000;
    color: #eef3ef;
}

* {
    box-sizing: border-box;
}

html,
body,
.vm-shell,
.vm-stage {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    background: #000;
}

button {
    font: inherit;
}

[hidden] {
    display: none !important;
}

.vm-shell {
    height: 100dvh;
}

.vm-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    background: #000;
}

#screen-container {
    position: relative;
    display: grid;
    place-items: center;
    outline: none;
    touch-action: none;
}

#screen-container.is-relative-pointer-fallback {
    cursor: none;
}

.vm-stage.is-input-blocked #screen-container {
    pointer-events: none;
}

#screen-container canvas {
    display: none;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    image-rendering: pixelated;
}

#screen-container #vm3d-canvas {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    image-rendering: auto;
}

#vm3d-canvas[hidden] {
    display: none;
}

.text-screen {
    white-space: pre;
    font: 14px/14px monospace;
}

.boot-card {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    width: 100%;
    height: 100%;
    padding: 32px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.boot-card.is-hidden {
    visibility: hidden;
    opacity: 0;
}

.boot-mark {
    display: block;
    width: 24px;
    height: 24px;
    margin-bottom: 20px;
    border: 6px solid #cfe6d9;
    border-right-color: #75c79b;
    border-radius: 50%;
    animation: spin 900ms linear infinite;
}

.boot-card h1 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -0.02em;
    text-align: center;
}

.boot-card p {
    min-height: 20px;
    margin: 0 0 20px;
    color: #aab5af;
    font-size: 14px;
    text-align: center;
}

.progress {
    width: min(320px, 100%);
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.progress span {
    display: block;
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: #75c79b;
    transition: width 180ms ease;
}

.vm-controls {
    position: absolute;
    z-index: 4;
    right: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(18, 22, 21, 0.88);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    opacity: 0.18;
    backdrop-filter: blur(12px);
    transition: opacity 160ms ease;
}

.vm-stage:hover .vm-controls,
.vm-controls:focus-within {
    opacity: 1;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d5a84b;
    box-shadow: 0 0 0 3px rgba(213, 168, 75, 0.12);
}

.status-dot.is-running {
    background: #75c79b;
    box-shadow: 0 0 0 3px rgba(117, 199, 155, 0.14);
}

.status-dot.is-error {
    background: #e77c6e;
    box-shadow: 0 0 0 3px rgba(231, 124, 110, 0.14);
}

.status-label {
    margin-right: 4px;
    color: #d6ddd9;
    font-size: 12px;
}

.vm-controls button {
    padding: 6px 9px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #eef3ef;
    cursor: pointer;
    font-size: 12px;
}

.vm-controls button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.vm-controls button:disabled {
    color: #737b77;
    cursor: default;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .status-label {
        display: none;
    }

    .vm-controls {
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
    }
}
