* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    background: #000;
}

.layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#bg {
    background: #111;
    z-index: 1;
    /* No transition - background color changes immediately while curtain is closed */
}

#curtain {
    background: #222;
    z-index: 100;
    transform-origin: left center;
    transition: transform 1.5s ease, background-color 0.8s ease;
    transform: scaleX(0);
    pointer-events: none;
}

#curtain.closed {
    transform: scaleX(1);
}

#curtain.open {
    transform: scaleX(0);
}

#experiment-container {
    position: absolute;
    z-index: 50; /* Below curtain so curtain can cover it */
}

#experiment-container ruffle-embed,
#experiment-container ruffle-player {
    width: 100%;
    height: 100%;
    display: block;
}

#loading-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 180;
    opacity: 0;
    transition: opacity 1s ease;
    pointer-events: none;
}

#loading-bar.visible {
    opacity: 1;
}

#bar-fg {
    width: 0%;
    height: 100%;
    /* background color set dynamically in JS based on colorLoadingBar */
    transition: width 0.3s ease;
}

#menu {
    position: absolute;
    z-index: 200;
    opacity: 0;
    /* Transition set dynamically in JS */
}

#menu-button {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7); /* Default, overridden per experiment */
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease;
    user-select: none;
}

#menu-button:hover {
    transform: scale(1.3);
    background: var(--hover-bg, rgba(255, 255, 255, 0.9)); /* Use CSS variable if set */
}

#menu-items {
    position: absolute;
    pointer-events: none;
}

.menu-item {
    position: absolute;
    cursor: pointer;
    pointer-events: all;
    white-space: nowrap;
    font-size: 14px;
    color: #fff; /* Default, overridden per experiment */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); /* Default, overridden per experiment */
    transition: transform 0.3s ease;
    transform-origin: center center;
    user-select: none;
}

.menu-item:hover {
    transform: scale(2) !important;
}

#sound-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer !important;
    z-index: 250;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

#sound-toggle svg {
    transition: fill 0.5s ease;
}

#sound-toggle:hover {
    opacity: 1;
}

#sound-toggle svg path {
    width: 100%;
    height: 100%;
    display: block;
}

#sound-toggle.sound-off #sound-on-icon {
    display: none;
}

#sound-toggle.sound-off #sound-off-icon {
    display: block;
}

#sound-toggle.sound-on #sound-on-icon {
    display: block;
}

#sound-toggle.sound-on #sound-off-icon {
    display: none;
}

