/* The lodge terminal: drapes, chevron floor, board, counter, captions. */
.stage {
    position: relative;
    flex: 1;
    min-height: 240px;
    border-radius: 14px;
    overflow: hidden;
    background: #1a0505;
    box-shadow: 0 0 0 1px #ffffff14, 0 20px 60px #000a;
    container-type: size;
}

/* Red Room drapes: vertical folds with soft light. */
.drapes {
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, #00000099 0%, transparent 22%, transparent 60%, #000000aa 100%),
        repeating-linear-gradient(90deg,
            #4a0508 0px, #7a0c10 18px, #a3161b 34px, #7a0c10 50px, #4a0508 68px);
    animation: sway 9s ease-in-out infinite alternate;
}
.light-cone {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 55% 70% at 50% 0%, #ffd9a022 0%, transparent 70%);
    animation: flicker 7s infinite;
    pointer-events: none;
}

/* Black-and-cream zigzag floor in perspective. */
.floor {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 34%;
    perspective: 300px;
    perspective-origin: 50% 0%;
    overflow: hidden;
}
.floor-plane {
    position: absolute;
    left: -60%; right: -60%; top: 0;
    height: 260%;
    transform-origin: 50% 0%;
    transform: rotateX(62deg);
    background-color: #e9e0c8;
    background-image:
        linear-gradient(135deg, #141010 25%, transparent 25%),
        linear-gradient(225deg, #141010 25%, transparent 25%),
        linear-gradient(315deg, #141010 25%, transparent 25%),
        linear-gradient(45deg, #141010 25%, transparent 25%);
    background-position: -30px 0, -30px 0, 0 0, 0 0;
    background-size: 60px 60px;
}
.floor::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, #000000cc 0%, #00000033 40%, #00000088 100%);
}

/* Departure board. */
.board {
    position: absolute;
    top: 5%; left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: #0b0b0b;
    border: 2px solid #2a2a2a;
    border-radius: 4px;
    box-shadow: 0 6px 20px #000c, inset 0 0 12px #000;
    font-family: var(--sans);
    font-size: clamp(.6rem, 1.6cqw, .85rem);
    letter-spacing: 3px;
    color: #ffb000;
    text-shadow: 0 0 8px #ffb00088;
    white-space: nowrap;
    z-index: 2;
}
.board-text { display: inline-block; transition: transform .18s, opacity .18s; }
.board-text.flip { transform: scaleY(0); opacity: 0; }

/* Characters. */
.monster-slot, .carol-slot { position: absolute; z-index: 3; }
.monster-slot {
    left: 12%; bottom: 7%;
    height: 66%;
    aspect-ratio: 200 / 240;
}
.carol-slot {
    right: 15%; bottom: 17%;
    height: 60%;
    aspect-ratio: 200 / 240;
}
.monster-slot .char, .carol-slot .char { width: 100%; height: 100%; overflow: visible; }
.monster-slot::after, .carol-slot::after {
    content: "";
    position: absolute;
    left: 15%; right: 15%; bottom: -2%;
    height: 7%;
    background: radial-gradient(ellipse, #000000aa 0%, transparent 70%);
    z-index: -1;
}
.carol-slot::after { display: none; }

.monster-slot.enter { animation: walk-in .7s cubic-bezier(.2,.8,.3,1) backwards; }
.monster-slot.exit-good { animation: walk-out .7s ease-in forwards; }
.monster-slot.exit-bad { animation: sink-out .7s ease-in forwards; }

/* Check-in counter in front of Carol. */
.counter {
    position: absolute;
    right: 7%; bottom: 5%;
    width: 36%;
    height: 28%;
    z-index: 4;
    background:
        linear-gradient(180deg, #a0682f 0 9%, #5a3618 9% 12%, transparent 12%),
        repeating-linear-gradient(90deg, #6b4221 0 40px, #5e391c 40px 42px),
        #6b4221;
    border-radius: 6px 6px 2px 2px;
    box-shadow: 0 14px 30px #000c, inset 0 -20px 30px #0006;
}
.counter-sign {
    position: absolute;
    left: 50%; top: 32%;
    transform: translateX(-50%);
    padding: 5px 12px;
    background: #0d0606;
    border: 1px solid var(--red);
    color: #ff6b5e;
    font-family: var(--sans);
    font-size: clamp(.5rem, 1.3cqw, .75rem);
    letter-spacing: 2px;
    white-space: nowrap;
    text-shadow: 0 0 8px #ff000088;
}
.bell {
    position: absolute;
    left: 12%; top: -14%;
    width: 13%; aspect-ratio: 1.4;
    border: none;
    border-radius: 50% 50% 8% 8% / 80% 80% 8% 8%;
    background: radial-gradient(ellipse at 35% 30%, #fff3b0, #e0b030 45%, #8a6510);
    box-shadow: 0 4px 6px #0008;
    transform-origin: 50% 100%;
}
.bell::before {
    content: "";
    position: absolute;
    left: 42%; top: -18%;
    width: 16%; aspect-ratio: 1;
    border-radius: 50%;
    background: #e0b030;
}
.bell.ring { animation: ring .5s; }

/* Name plate + flavour captions. */
.caption { position: absolute; z-index: 5; bottom: 3%; max-width: 40%; }
.caption-monster { left: 3%; }
.caption-carol { right: 3%; text-align: right; }
.plate {
    display: inline-block;
    padding: 3px 10px;
    background: var(--gold);
    color: var(--ink);
    font-family: var(--sans);
    font-size: .72rem;
    letter-spacing: 2px;
    border-radius: 3px;
    margin-bottom: 4px;
}
.quirk {
    font-size: .74rem;
    font-style: italic;
    color: #ffffffb0;
    text-shadow: 0 1px 3px #000;
    line-height: 1.35;
}

/* Feedback layers. */
.stage::before, .stage::after {
    content: "";
    position: absolute; inset: 0;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
}
.stage::before { box-shadow: inset 0 0 120px 30px #ff000099; }
.stage::after { box-shadow: inset 0 0 120px 20px #7be08a77; }

@keyframes sway { to { background-position: 0 0, 14px 0; } }
@keyframes flicker {
    0%, 100% { opacity: 1; }
    91% { opacity: 1; } 92% { opacity: .3; } 93% { opacity: 1; } 95% { opacity: .5; } 96% { opacity: 1; }
}
@keyframes walk-in {
    from { transform: translateX(-140%); opacity: 0; }
}
@keyframes walk-out {
    to { transform: translateX(-160%); opacity: 0; }
}
@keyframes sink-out {
    30% { transform: scale(1.12); filter: brightness(2) saturate(2); }
    to { transform: translateY(40%) scale(.6); opacity: 0; filter: brightness(.2); }
}
@keyframes ring {
    20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); }
    60% { transform: rotate(-6deg); } 80% { transform: rotate(3deg); }
}

@media (max-width: 760px) {
    .stage { min-height: 300px; flex: none; height: 46vh; }
    .monster-slot { left: 4%; height: 58%; }
    .carol-slot { right: 8%; height: 52%; }
    .counter { width: 44%; right: 3%; }
    .caption { max-width: 46%; }
}
