body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

#canvas-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #111;
}

#artwork-scaler {
    position: relative;
    width: 1200px;
    height: 600px;
    /* transform-origin: center center; */
    /* Scaler logic handled by JS or CSS zoom if needed, but we used fluid canvas */
}

canvas {
    display: block;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    box-sizing: border-box;

    /* Classic 90s Bevel Frame */
    border: 4px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    border-right-color: #404040;
    border-bottom-color: #404040;

    /* Depth effects */
    box-shadow:
        inset 4px 4px 0px #000000,
        inset -4px -4px 0px #c0c0c0,
        15px 15px 30px rgba(0, 0, 0, 0.6);
}

/* UI Elements - Match main navigation */
.retro-btn {
    position: fixed;
    z-index: 998;
    padding: 6px 10px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    color: lightgrey;
    background-color: #000000;
    border-top: 3px solid #ff69b4;
    border-left: 3px solid #ff69b4;
    border-right: 3px solid #8b3a62;
    border-bottom: 3px solid #8b3a62;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    text-transform: uppercase;
    outline: none;
    user-select: none;
    touch-action: manipulation;
    overflow: hidden;
}

/* Gold embossed text for buttons */
.retro-btn span {
    position: relative;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg,
            #f5e6a3 0%,
            #d4af37 25%,
            #b8860b 50%,
            #d4af37 75%,
            #f5e6a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.9)) drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.7));
    font-weight: bold;
}

/* Marble canvas for buttons */
.retro-btn .btn-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.9;
    mix-blend-mode: screen;
    filter: brightness(1.2);
    pointer-events: none;
}

/* Active/Pressed state - red/black marble */
.retro-btn:active,
.retro-btn.active {
    border-top: 3px solid #000000;
    border-left: 3px solid #000000;
    border-right: 3px solid #ff69b4;
    border-bottom: 3px solid #ff69b4;
    box-shadow: inset 2px 2px 0px #000000;
}

.retro-btn.active .btn-canvas {
    filter: hue-rotate(-120deg) saturate(2) brightness(0.8) contrast(1.3);
}

/* Marble canvas for loading window */
.loader-marble {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.9;
    mix-blend-mode: screen;
    pointer-events: none;
}

/* Buttons now positioned inside #chess2d-container via flex layout */

#fullscreenBtn {
    top: 20px;
    right: 20px;
}

@media (max-width: 1500px),
(hover: none) {
    #fullscreenBtn {
        display: none !important;
    }
}

#keysDisplay {
    position: fixed;
    bottom: 20px;
    left: 20px;
    color: #0f0;
    font-size: 12px;
    pointer-events: none;
}

/* Loading Screen */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-in-out;
}

.retro-window {
    background-color: #000000;
    border-top: 3px solid #ff69b4;
    border-left: 3px solid #ff69b4;
    border-right: 3px solid #8b3a62;
    border-bottom: 3px solid #8b3a62;
    padding: 8px;
    width: 600px;
    box-sizing: border-box;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
}

@media (max-width: 600px) {
    .retro-window {
        width: 100%;
    }
}

.retro-header {
    font-weight: bold;
    margin-bottom: 6px;
    text-align: left;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    position: relative;
    z-index: 2;
    /* Gold gradient text */
    background: linear-gradient(180deg,
            #f5e6a3 0%,
            #d4af37 25%,
            #b8860b 50%,
            #d4af37 75%,
            #f5e6a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.9)) drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.7));
}

.retro-bar-container {
    height: 20px;
    background-color: #000000;
    border: 2px solid #ff69b4;
    padding: 2px;
    text-align: left;
    position: relative;
    z-index: 2;
}

.retro-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(180deg, #ff69b4 0%, #ff1493 50%, #ff69b4 100%);
    transition: width 0.1s linear;
}