@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --bg-1: #0b1020;
    --bg-2: #1b2233;
    --frame: #121720;
    --frame-edge: #2b313a;
    --glow: #ffb300;
    --screen-border: #0c0f14;
    --screen-shadow: rgba(0, 0, 0, 0.65);
}

* {
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(1200px 700px at 10% -10%, #2a3c5e 0%, transparent 60%),
        radial-gradient(900px 500px at 110% 0%, #3a2a5e 0%, transparent 55%),
        linear-gradient(160deg, var(--bg-1), var(--bg-2));
    margin: 0;
    padding: 24px;
    overflow: hidden;
    touch-action: none;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100vw;
    font-family: 'Press Start 2P', monospace;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.05) 0,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px,
            transparent 4px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.04) 0,
            rgba(255, 255, 255, 0.04) 1px,
            transparent 1px,
            transparent 6px
        );
    opacity: 0.15;
    pointer-events: none;
}

.stage {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cabinet {
    position: relative;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(160deg, #1f2630 0%, #0f131a 60%, #141a22 100%);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.6),
        inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.cabinet::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.cabinet::after {
    content: "";
    position: absolute;
    inset: -40px;
    border-radius: 30px;
    background: radial-gradient(circle at 50% 20%, rgba(255, 183, 77, 0.35), transparent 55%);
    opacity: 0.6;
    filter: blur(2px);
    z-index: -1;
    animation: cabinetPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cabinetPulse {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.98);
    }
    50% {
        opacity: 0.6;
        transform: scale(1);
    }
}

canvas {
    display: block;
    background-color: #70c5ce;
    width: min(92vw, 520px);
    height: auto;
    max-height: 86vh;
    aspect-ratio: 2 / 3;
    border: 3px solid var(--screen-border);
    border-radius: 12px;
    box-shadow:
        0 18px 40px var(--screen-shadow),
        inset 0 0 0 2px rgba(255, 255, 255, 0.08);
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    touch-action: none;
}

@media (max-width: 540px) {
    body {
        padding: 12px;
    }

    .cabinet {
        padding: 12px;
        border-radius: 16px;
    }

    canvas {
        width: 94vw;
        max-height: 82vh;
    }
}
