* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at 50% 35%, #252525 0%, #121212 55%, #080808 100%);
    font-family: Arial, Helvetica, sans-serif;
}

.machine {
    width: min(680px, calc(100vw - 28px));
    padding: 26px;
    background: #050505;
    border: 2px solid #252525;
    border-radius: 12px;
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.78),
        inset 0 0 30px rgba(255, 255, 255, 0.025);
}

.machine-label {
    margin: 0 0 13px 3px;
    color: #727272;
    font-size: 10px;
    letter-spacing: 4px;
    user-select: none;
}

.screen-frame {
    padding: 14px;
    overflow: hidden;
    background: #0b0b0b;
    border: 2px solid #292929;
    border-radius: 8px;
    box-shadow:
        inset 0 0 26px rgba(0, 0, 0, 0.95),
        0 1px 0 rgba(255, 255, 255, 0.03);
}

:fullscreen body {
    background: #000;
}

:fullscreen .machine {
    width: 100vw;
    height: 100vh;
    max-width: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

:fullscreen .screen-frame {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

:fullscreen canvas {
    width: auto;
    height: 100%;
    max-width: 100%;
    image-rendering: pixelated;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
    border-radius: 3px;
    image-rendering: pixelated;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 22px;
}

button {
    width: 112px;
    height: 42px;
    color: #c9c9c9;
    background: #151515;
    border: 1px solid #393939;
    border-radius: 6px;
    font-size: 12px;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.75),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

button:hover {
    background: #1d1d1d;
}

button:active {
    transform: translateY(1px);
}

.status-panel {
    display: grid;
    grid-template-columns: auto auto;
    gap: 3px 10px;
    color: #686868;
    font-size: 9px;
    letter-spacing: 1.6px;
    text-align: right;
}

.status-panel strong {
    color: #a5a070;
    font-weight: normal;
}

@media (max-width: 520px) {
    .machine {
        padding: 16px;
    }

    .screen-frame {
        padding: 9px;
    }

    .controls {
        align-items: flex-end;
    }
}
