/* WAZERTOWN UI v1
   The game engine is still Quixe. This stylesheet only controls the presentation.
*/

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: #d7d7d7;
}

body {
    font-family: "Perfect DOS VGA 437", monospace;
    font-size: 13px;
    line-height: 1.35;
    letter-spacing: 0;
    font-weight: normal;
    font-synthesis: none;
    -webkit-font-smoothing: none;
    text-rendering: pixelated;
}

#wz-app {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #000;
}

/* Cinematic scene */
#wz-scene {
    position: relative;
    flex: 0 0 58vh;
    width: 100%;
    min-height: 0;
    background: #000;
    overflow: hidden;
}

/* Text-only mode: collapse the cinematic area completely. */
#wz-scene.wz-graphics-off {
    flex-basis: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

#wz-scene-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 700ms ease;
    background: #000;
}

#wz-scene-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center bottom;
}

#wz-scene-shade {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(to bottom,
            rgba(0,0,0,0.05) 45%,
            rgba(0,0,0,0.30) 72%,
            rgba(0,0,0,0.98) 100%);
}

/* Story area */
#wz-story {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

#wz-story > #gameport {
    width: min(920px, calc(100% - 48px)) !important;
    margin: 0 auto !important;
    padding: 28px 0 70px !important;
    box-sizing: border-box;
}

/* Quixe remains alive, but becomes visually part of our story area. */
#gameport {
    position: relative !important;
    width: 100% !important;
    min-height: 240px;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
}

/* Quixe windows */
#windowport {
    position: relative !important;
    width: 100% !important;
    min-height: 220px;
    background: transparent !important;
}

#windowport .WindowFrame {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

#windowport .BufferWindow {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 200px;
    overflow: visible !important;
    background: transparent !important;
    color: #d7d7d7 !important;
    font-family: "Perfect DOS VGA 437", monospace !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    font-weight: normal !important;
    font-synthesis: none;
    -webkit-font-smoothing: none;
    text-rendering: pixelated;
    padding: 0 !important;
    margin: 0 !important;
}

#windowport .BufferLine {
    background: transparent !important;
    color: #d7d7d7 !important;
    font-family: "Perfect DOS VGA 437", monospace !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    font-weight: normal !important;
    -webkit-font-smoothing: none;
    text-rendering: pixelated;
}

#windowport .Input {
    font-family: "Perfect DOS VGA 437", monospace !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    letter-spacing: 0 !important;
    font-weight: normal !important;
    color: #fff !important;
    background: transparent !important;
    -webkit-font-smoothing: none;
    text-rendering: pixelated;
}

#windowport .Style_input {
    color: #fff !important;
}

/* We move figures to #wz-scene-image with JS.
   This hides them if a browser paints them for one frame before the move. */
#wz-story .BufferWindow img {
    max-width: 100%;
    height: auto;
}

/* Remove old Inform page furniture if any template elements sneak in. */
.coverimage, .links, .smalltitle, .interpretercredit {
    display: none !important;
}

/* Mobile */
@media (max-width: 700px) {
    #wz-scene {
        flex: 0 0 48vh;
        width: 100%;
        min-height: 0;
    }

    #wz-story > #gameport {
        width: calc(100% - 28px) !important;
        padding-top: 22px !important;
    }

    #windowport .BufferWindow,
    #windowport .BufferLine,
    #windowport .Input {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }
}


/* Night of the Living Dead logo */
#wz-logo {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: min(300px, 28vw);
    height: auto;
    display: block;
    pointer-events: none;
    user-select: none;
}

/* Typewriter: Quixe owns the real line; Wazertown reveals it only after
   deciding whether it should be animated. This prevents a full-text flash. */
#wz-story #windowport .BufferLine {
    visibility: hidden;
}

#wz-story #windowport .BufferLine.wz-visible,
#wz-story #windowport .BufferLine.wz-typewriter-clone {
    visibility: visible !important;
}

/* The real Quixe command input stays hidden with its BufferLine while
   the typewriter is running. Once the line is revealed, it becomes usable. */
#wz-story #windowport input,
#wz-story #windowport textarea,
#wz-story #windowport button {
    visibility: hidden !important;
    pointer-events: none !important;
    position: relative;
    z-index: 20;
}

#wz-story #windowport .BufferLine.wz-visible input,
#wz-story #windowport .BufferLine.wz-visible textarea,
#wz-story #windowport .BufferLine.wz-visible button {
    visibility: visible !important;
    pointer-events: auto !important;
}