/* Threshold Tether - Visual Novel Overlay */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#scene-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

/* Wrapper that maintains room aspect ratio - everything scales together */
#scene-wrapper {
    position: relative;
    aspect-ratio: 3/2;
    max-height: 100%;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
}

/* Room background layer */
#room-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#room-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sprite container layer */
#sprite-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* Individual sprite containers */
.sprite {
    position: absolute;
    bottom: 0;
    height: 85%;
    width: auto;
}

#kai-sprite {
    left: 15%;
}

#lucian-sprite {
    left: 55%;
}

/* Sprite layer stacking */
.sprite-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    width: auto;
}

/* Hide empty sprite layers */
.sprite-layer[src=""] {
    display: none;
}

/* Debug toggle button */
#debug-toggle {
    position: fixed;
    bottom: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #ff69b4;
    border: 2px solid #ff69b4;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    z-index: 150;
    touch-action: manipulation;
}

#debug-toggle:active {
    background: #ff69b4;
    color: #000;
}

/* Debug panel */
#debug-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 100;
    max-width: 300px;
    border: 1px solid #ff69b4;
}

#debug-panel h3 {
    color: #ff69b4;
    margin-bottom: 10px;
    font-size: 14px;
}

#debug-panel div {
    margin-bottom: 8px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.hidden {
    display: none !important;
}

/* Loading state */
#room-bg.loading {
    opacity: 0.5;
    filter: blur(5px);
}

/* Transition effects */
#room-bg {
    transition: opacity 0.5s ease-in-out;
}

.sprite-layer {
    transition: opacity 0.3s ease-in-out;
}

/* Mood indicator (optional visual feedback) */
#mood-indicator {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 11px;
    z-index: 100;
}
