@import url('https://fonts.googleapis.com/css2?family=Iosevka+Charon:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');

:root {
    --navy: #06283a;
    --navy2: #0a3448;
    --teal: #0c5060;
    --lime: #a4ef38;
    --lime2: #6acb1d;
    --cream: #f5e9c8;
    --white: #fff;
    --ink: #10232a;
    --red: #ff534f;
    --yellow: #ffd447;
    --muted: #a7c0c5
}



* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden
}

body {
    font-family: "Iosevka Charon", monospace;
    background: #031a24;
    color: #fff
}

button,
input {
    font: inherit
}

.game {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 620px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #083545
}

@media (min-width: 951px) {
    .game {
        min-height: 0;
        overflow: hidden
    }
}

/* keep full-screen layers pinned while .game scrolls */
#scene > .lobby,
#scene > .inside,
#scene > .ending-screen,
.start,
.timeout-popup,
.asset-loader {
    position: fixed
}

.start {
    overflow-y: auto
}

.sound-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10000;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 2px solid rgba(245, 233, 200, .75);
    border-radius: 50%;
    background: rgba(6, 40, 58, .88);
    color: var(--cream);
    box-shadow: 0 4px 0 rgba(0, 0, 0, .2);
    cursor: pointer;
    font-size: 19px;
    line-height: 1;
}

.home-link {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 10000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 2px solid rgba(245, 233, 200, .75);
    border-radius: 24px;
    background: rgba(6, 40, 58, .88);
    color: var(--cream);
    box-shadow: 0 4px 0 rgba(0, 0, 0, .2);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
    background: var(--teal);
    transform: translateY(-1px);
}

.home-link:focus-visible {
    outline: 3px solid var(--lime);
    outline-offset: 3px;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
    background: var(--teal);
    transform: translateY(-1px);
}

.sound-toggle:focus-visible {
    outline: 3px solid var(--lime);
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pixel {
    image-rendering: pixelated
}

/* lobby / elevator scenery */
.lobby {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #082d3a, #0c4655 55%, #052530)
}

.lobby:before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, .2), transparent 18%, transparent 82%, rgba(0, 0, 0, .25)), repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0 3px, transparent 3px 6px)
}

.ceiling {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 78px;
    background: #092c38;
    border-bottom: 5px solid #021c26
}

.ceiling-light {
    position: absolute;
    top: 15px;
    left: 6%;
    right: 6%;
    height: 30px;
    background: var(--cream);
    clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
    box-shadow: 0 5px 0 #caa75e
}

.wall-panel {
    position: absolute;
    top: 74px;
    bottom: 0;
    width: 22%;
    background: linear-gradient(90deg, #082f3c, #0e4352 45%, #082f3c);
    border-left: 2px solid #155a66;
    border-right: 2px solid #155a66;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, .18)
}

.wall-panel.left {
    left: 0
}

.wall-panel.right {
    right: 0
}

.door {
    position: absolute;
    top: 82px;
    bottom: 0;
    width: 27%;
    background: linear-gradient(90deg, #0a3140, #123f4c, #0a3140);
    border: 3px solid #155b67
}

.door.left {
    left: 22%
}

.door.right {
    right: 22%
}

.door:after {
    content: "";
    position: absolute;
    inset: 45px 26px 30px;
    border: 2px solid #1b6572;
    background: linear-gradient(160deg, rgba(33, 91, 102, .55), rgba(2, 26, 34, .3))
}

.lift-gap {
    position: absolute;
    top: 82px;
    bottom: 0;
    left: 49%;
    width: 2%;
    background: #071e27;
    box-shadow: 0 0 0 2px #02151c
}

.call {
    position: absolute;
    top: 110px;
    right: 25%;
    width: 52px;
    height: 78px;
    border: 2px solid #49717a;
    background: #092732;
    padding: 6px;
    display: grid;
    gap: 5px;
    z-index: 2
}

.call div {
    border: 2px solid #6e969d;
    height: 22px;
    display: grid;
    place-items: center
}

.call .on {
    color: #1b3210;
    background: var(--lime)
}

.sign {
    position: absolute;
    left: 1%;
    top: 175px;
    background: #f05c30;
    color: #fff;
    padding: 12px 8px 14px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.3;
    border: 2px solid #8b311c;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, .2);
    z-index: 2;
    transform: rotate(-1deg)
}

/* inside elevator */
.inside {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #0a3342, #0f4554 20%, #083646 50%, #0f4554 80%, #0a3342)
}

.inside:before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0 5%, rgba(255, 255, 255, .035) 5% 6%, transparent 6% 94%, rgba(255, 255, 255, .035) 94% 95%, transparent 95%)
}

.lift-inside {
    background: #082d3a
}

.lift-inside img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position:center top;
    image-rendering: auto
}

.lift-entry {
    animation: lift-entry-in .9s cubic-bezier(.2, .8, .2, 1) both;
    transform-origin: center center
}

@keyframes lift-entry-in {
    from {
        opacity: 0;
        transform: scale(1.08)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

.panel-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #092b37;
    border-bottom: 3px solid #174e5b
}

.inside-light {
    position: absolute;
    top: 14px;
    left: 15%;
    right: 15%;
    height: 22px;
    background: var(--cream);
    clip-path: polygon(2% 0, 98% 0, 100% 100%, 0 100%)
}

.rail {
    position: absolute;
    left: 7%;
    right: 7%;
    top: 110px;
    height: 8px;
    background: #0d242c;
    border: 2px solid #2c6d74
}

/* characters */
.character-group {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.char {
    position: absolute;
    bottom: -4px;
    width: 270px;
    height: 410px;
    z-index: 6;
    pointer-events: none;
    z-index: 99;
}

.char.left {
    left: 3%
}

.char.right {
    right: 3%
}

.char.center {
    left: 50%;
    transform: translateX(-50%);
    bottom: 0
}

.char img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    filter: drop-shadow(5px 6px 0 rgba(0, 0, 0, .28))
}

.lobby-image {
    background-color: #082d3a;
    background-image: url("../images/main-bg.png");
    background-position: top center;
    background-size: 100% auto;
    background-origin: border-box;
    background-clip: border-box;
    background-repeat: no-repeat;

}

.lobby-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position:center top;
    image-rendering: pixelated
}

.lift_lobby{
    position: relative;
    
}
.lift_lobby .without-door, .lift_lobby .door-shadow{
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 4;
    }
    .lift_lobby .door-shadow{
        z-index: 5;
            mix-blend-mode: soft-light;
    }
.lift_lobby .doors{
        display: inline-block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 2;
    }
.lift_lobby .doors > img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform ease-in-out 2.2s 0.5s;
}
.lift_lobby .doors > img.left-door{
    transform: translateX(-10%);
}
.lift_lobby .doors > img.right-door{
    transform: translateX(10%);
}
.close-door .lift_lobby .doors > img.left-door, .close-door .lift_lobby .doors > img.right-door{
    transform: translateX(0);
}


.asset-char img {
    display: block;
    object-fit: cover
}


/* pixel speech */
.bubble {
    position: absolute;
    z-index: 7;
    left: auto;
    right: auto;
    top: auto;
    width: min(300px, 28vw);
    min-height: 220px;
    max-width: 300px;
    background: url("../images/speech-bubble.svg") center / 100% 100% no-repeat;
    color: #111;
    border: 0;
    box-shadow: none;
    padding: 40px 32px 65px;
    font-size: 16px;
    line-height: 1.4;
    white-space: pre-line;
    overflow-wrap: anywhere;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px 18px 16px 16px;
    overflow: hidden;
    transform-origin: 50% 88%;
    animation: bubble-pop .3s steps(3, end) both;
    image-rendering: pixelated;
    z-index: 99;
}

@keyframes bubble-pop {
    0% {
        opacity: 0;
        transform: scale(.72)
    }

    70% {
        opacity: 1;
        transform: scale(1.04)
    }

    100% {
        opacity: 1;
        transform: scale(1)
    }
}

.bubble.left {
    left: 16%;
    top: 18%
}

.bubble.left:after {
    right: 28px
}

.bubble.right {
    right: 16%;
    top: 16%
}

.bubble.right:after {
    left: 28px
}

.bubble.thought {
    border-radius: 18px 18px 16px 16px
}

.bubble.round {
    border-radius: 18px 18px 16px 16px
}

.ending-bubble {
    left: 58%;
    right: auto;
    top: 8%;
}

/* center UI */
.ui {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    transform: translateX(-50%) translateY(0) scale(1);
    width: min(580px, 48vw);
    z-index: 5;
    display: flex;
    flex-direction: column;
    transform-origin: center top;
}

.ui.lift-panel-enter {
    animation: lift-panel-enter .55s cubic-bezier(.2, .8, .2, 1) both
}

@keyframes lift-panel-enter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(0) scale(.95)
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1)
    }
}

.panel {
    flex: 1;
    min-height: 0;
    background: linear-gradient(180deg, #062a3d, #073047);
    border: 3px solid transparent;
    border-image-source: url("../images/wave-border.png");
    border-image-slice: 0 5;
    border-image-width: 0 4px;
    border-image-repeat: stretch repeat;
    outline: 4px solid #3B748E;
    padding: 0 24px 0;
    display: flex;
    flex-direction: column;
    position: relative
}


.stage {
    text-align: center;
    color: #a6ef38;
    font-weight: 900;
    font-size: 16px;
    padding:6px 0;
}

.screen {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    padding: 30px;
    margin: 0;
    background-color: #062a3d;
    background-image: url("../images/dialog-bg.svg");
    background-position: center center;
    background-size: 100% 100%;
    background-origin: border-box;
    background-clip: border-box;
    background-repeat: no-repeat;
    position: relative;
}

.screen_header {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 52px;
    flex: 0 0 52px;
    color: var(--lime);
    font-weight: 900;
    line-height: 1;
    z-index: 1
}

.lift-arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    height: 31px;
    margin-top: 1px
}

.lift-arrows span {
    display: block;
    width: 10px;
    height: 10px;
    border-left: 2px solid var(--lime);
    border-top: 2px solid var(--lime);
    transform: rotate(45deg);
    animation: lift-arrow 1.2s steps(4, end) infinite;
    opacity: .35
}

.lift-arrows span:nth-child(2) {
    animation-delay: .18s
}

.lift-arrows span:nth-child(3) {
    animation-delay: .36s
}

@keyframes lift-arrow {
    0% {
        opacity: 0;
        transform: translateY(9px) rotate(45deg)
    }

    35% {
        opacity: 1;
        transform: translateY(0) rotate(45deg)
    }

    100% {
        opacity: 0;
        transform: translateY(-9px) rotate(45deg)
    }
}

.current-floor {
    font-size: 18px;
    margin-top: 4px
}

.screen_footer{
    position: sticky;
    bottom: 0;
    display:flex;
    justify-content:space-between;
    margin-top:auto;
    width:100%;
    z-index: 2;
    background: rgba(6, 42, 61, .94)
}

.screen::-webkit-scrollbar {
    width: 8px
}

.screen::-webkit-scrollbar-thumb {
    background: #376676;
    border: 2px solid #062a3d
}

.screen::-webkit-scrollbar-track {
    background: rgba(7, 48, 71, .7)
}

.screen-content{
    display:flex;
    flex-direction:column;
    gap:12px;
    align-items: center;
    margin-top: auto;
    width: 100%;
    flex: 0 0 auto
}


.title {
    font-size: 22px;
    line-height: 1.4;
    font-weight: 900;
    color: #fff
}

.sub {
    font-size: 16px;
    margin-bottom: 18px
}

.copy {
    font-size: 15px;
    line-height: 1.5;
    max-width: 500px;
    color: #e7f1f2;
    white-space: pre-line
}

.mission {
    color: var(--lime);
    font-weight: 900;
    font-size: 18px;
    margin-top: 12px
}

.timer {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content:center;
    color: #ff554f;
    font-weight: 900;
    font-size: 15px;
    margin-top: 16px
}

.coins {
    font-size: 14px;
    color: #fff
}

.coin {
    display: inline-grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--yellow);
    color: #7b5b00;
    font-weight: 900;
    margin-right: 5px;
    border: 2px solid #c29700
}

.coin,
.timer-icon {
    width: 19px;
    height: 19px;
    object-fit: contain;
    image-rendering: pixelated;
    vertical-align: middle
}

.timer-icon {
    width: 18px;
    height: 18px
}

.completion-stars {
    display: block;
    object-fit: contain;
    image-rendering: pixelated
}

.go {
    margin-top: 18px;
    color: #17320d;
    border: 3px solid #3b8b0c;
    border-radius: 18px;
    padding: 10px 30px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 0 #386b0d;
    background: #6ACB1D;
    margin-bottom: 4px;
    background: linear-gradient(0deg,rgba(106, 203, 29, 1) 0%, rgba(164, 239, 56, 1) 50%, rgba(106, 203, 29, 1) 100%);
}

.go:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #386b0d;
    background: #A4EF38;
    background: linear-gradient(0deg,rgba(164, 239, 56, 1) 0%, rgba(106, 203, 29, 1) 50%, rgba(164, 239, 56, 1) 100%);
}

.choice-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    width: 100%;
    margin-top: 18px
}

.choice-option {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.choice-option .choice {
    width: 100%;
}

.choice-caption {
    margin-top: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.choice, .screen-content > .selected_mock {
    cursor: pointer;
    color: #000000;
    min-height: 220px;
    border: none !important;
    background-color: transparent;
    background-image: url("../images/mock-bg.svg");
    background-position: center center;
    background-size: 100% 100%;
    background-origin: border-box;
    background-clip: border-box;
    background-repeat: no-repeat;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: visible;
}

.screen-content > .selected_mock{
    filter: drop-shadow(0 0 4px rgba(139, 234, 16, .85));
    max-width: calc(50% - 22px);
    min-width: 200px;
}

.choice.selected {
    background-image: url("../images/mock-bg-selected.svg");
    filter: drop-shadow(0 0 10px rgba(164, 239, 56, .95));
}

.choice.wrong {
    border-color: #ff5c58;
    background: #4c211e
}

.choice.correct {
    border-color: #9bef3c;
    background: #1c4b1e
}

.choice-title {
    font-weight: 900;
    margin-top: 8px
}

.mock {
    width: 150px;
    height: 150px;
    margin: auto;
    display: flex;
    position: relative;
    padding: 0;
    overflow: hidden;
}

figure.mock {
    margin: auto
}

.selected_mock {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 130px;
    position: relative
}

/* .choice.selected .selected_mock {
    outline: 2px solid var(--lime);
    outline-offset: 4px
} */

.mock img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mock figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4px 3px;
    background: rgba(0, 0, 0, .78);
    color: #fff;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    font-weight: 900;
    display: none !important;
}

.phone {
    width: 64px;
    height: 110px;
    border: 5px solid #111;
    background: #080b0d;
    border-radius: 11px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px
}

.phone .bar {
    height: 10px;
    background: #7dde31
}

.phone .tile {
    height: 22px;
    background: #3e6570
}

.phone.new .bar {
    background: #b5ff3b
}

.phone.new .tile:nth-child(2) {
    background: #b5ff3b
}

.bottles {
    display: flex;
    gap: 8px;
    align-items: flex-end
}

.bottle {
    width: 24px;
    height: 60px;
    background: #f2f2f0;
    border: 3px solid #222;
    position: relative
}

.bottle:before {
    content: "";
    position: absolute;
    left: 5px;
    top: -14px;
    width: 8px;
    height: 13px;
    background: #222
}

.bottle:nth-child(2) {
    height: 75px;
    background: #cfe9b4
}

.bottle:nth-child(3) {
    height: 52px;
    background: #ecd4b2
}

.poster {
    width: 85px;
    height: 106px;
    background: #fff0a5;
    border: 3px solid #1f1f1f;
    color: #d12618;
    font-weight: 900;
    font-size: 13px;
    padding: 8px
}

.laptop {
    width: 130px;
    height: 84px;
    background: #20333a;
    border: 4px solid #111;
    position: relative
}

.laptop:after {
    content: "";
    position: absolute;
    left: -15px;
    right: -15px;
    bottom: -13px;
    height: 12px;
    background: #aab8bb;
    border: 3px solid #111
}

.laptop .sitebar {
    height: 12px;
    background: #b5ff3b
}

.card {
    border: 3px solid #1d1d1d;
    background: #f4f1e5;
    color: #222;
    width: 170px;
    padding: 12px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, .25)
}

.fieldset {
    display: grid;
    gap: 12px;
    width: 100%;
    max-width: 390px;
    text-align: left;
    margin-top: 18px
}

.fieldset label {
    font-size: 14px;
    color: #ffffff;
    padding: 0 8px;
}

.fieldset input {
    width: calc(100% + 16px);
    margin-inline: -8px;
    padding: 10px 14px;
    background: #ffffff;
    color: #0d3342;
    border: 3px solid #bfbfbf;
    margin-top: 4px;
    outline: none;
    clip-path: polygon(0 9px, 3px 9px, 3px 6px, 6px 6px, 6px 3px, 9px 3px, 9px 0, calc(100% - 9px) 0, calc(100% - 9px) 3px, calc(100% - 6px) 3px, calc(100% - 6px) 6px, calc(100% - 3px) 6px, calc(100% - 3px) 9px, 100% 9px, 100% calc(100% - 9px), calc(100% - 3px) calc(100% - 9px), calc(100% - 3px) calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) calc(100% - 3px), calc(100% - 9px) calc(100% - 3px), calc(100% - 9px) 100%, 9px 100%, 9px calc(100% - 3px), 6px calc(100% - 3px), 6px calc(100% - 6px), 3px calc(100% - 6px), 3px calc(100% - 9px), 0 calc(100% - 9px));
    image-rendering: pixelated
}

.fieldset input:focus {
    filter: drop-shadow(0 0 3px rgba(139, 234, 16, .75))
}

.error {
    color: #ff655e;
    font-size: 12px;
    min-height: 16px
}

/* .rightStat {
    position: absolute;
    right: 18px;
    bottom: 10px;
    font-size: 13px;
    z-index: 2
}

.leftStat {
    position: absolute;
    left: 18px;
    bottom: 10px;
    font-size: 13px;
    z-index: 2
} */

.floorbar {
    min-height: 52px;
    transform: none;
    display: flex;
    align-items: center;
    justify-content:center;
    gap: 18px;
    z-index: 10;
    white-space: nowrap;
    padding:14px 0;
}

.floorbar .floor-label {
    width: auto;
    height: auto;
    background: none;
    color: #fff;
    border: 0;
    box-shadow: none;
    display: block;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 900;
    text-align: left;
    padding: 0 4px;
    margin-right: auto
}

.floorbar .floor-badges{
    display: flex;
    justify-content: space-evenly;
    gap: 10px;
    flex:1;
}

.floorbar .floor-badge {
    width: 55px;
    height: 45px;
    background: url("../images/number-coin-bg.svg") center / 100% 100% no-repeat;
    color: #112b31;
    display: grid;
    place-items: center;
    border: 0;
    box-shadow: none;
    font-weight: 900;
    image-rendering: pixelated
}

.floorbar .floor-badge.active {
    background-image: url("../images/number-coin-highlighted-bg.svg");
    color: #16320d;
    filter: drop-shadow(0 0 4px rgba(139, 234, 16, .85))
}

/* full scene */
.start {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: rgba(1, 15, 20, .78);
    display: grid;
    place-items: center;
    animation: start-overlay-in .45s ease-out both
}

.start-card {
    width: min(650px, 90vw);
    padding: 70px 50px;
    text-align: center;
    background-color: transparent;
    background-image: url("../images/horizon-dialog-bg.png");
    background-position: center center;
    background-size: 100% 100%;
    background-origin: border-box;
    background-clip: border-box;
    background-repeat: no-repeat;
    animation: start-card-in .6s cubic-bezier(.2, .8, .2, 1) .08s both
}

@keyframes start-overlay-in {
    from { opacity: 0 }
    to { opacity: 1 }
}

@keyframes start-card-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.97)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

.start-card h1 {
    margin: 0 0 12px;
    font-size: 30px
}

.start-card p {
    color: #c4d7da;
    line-height: 1.5
}

.start-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 180px;
    color: #fff
}

.start-content .title {
    font-size: 22px
}

.start-content .copy {
    max-width: 500px
}

.end-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 180px;
    color: #fff
}

.ending-screen {
    position: absolute;
    inset: 0;
    z-index: 8;
    pointer-events: none;
    overflow: hidden
}

.ending-screen .content_area {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none
}

.ending-screen .content_area > * {
    pointer-events: auto
}

.ending-overlay {
    position: absolute;
    inset: 0;
    background: rgba(1, 15, 20, .58);
    z-index: 0
}

.ending-achievement-screen .ending-overlay{
    backdrop-filter: blur(8px);
}

.ending-handoff .handoff_img {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    margin: 0;
    z-index: 1
}

.ending-handoff .handoff_img img {
    display: block;
    width: min(520px, 58vw);
    height: auto;
    max-height: 72vh;
    object-fit: contain;
    image-rendering: pixelated
}

.handoff_img .handoff-char-1, .handoff_img .handoff-char-2{
    position: absolute;
    left: 0;
    top: 0;
    width:100%;
    height: 100%;
}

.handoff_img .handoff-char-1 {
    animation: handoff-character-left 2s ease-out both;
}

.handoff_img .handoff-char-2 {
    animation: handoff-character-right 2s ease-out both;
}

@keyframes handoff-character-left {
    from { transform: translateX(-100%) }
    to { transform: translateX(0) }
}

@keyframes handoff-character-right {
    from { transform: translateX(100%) }
    to { transform: translateX(0) }
}

.ending-handoff .go {
    position: absolute;
    right: 24px;
    bottom: 22px;
    z-index: 3;
    margin: 0
}

.ending-bubble.ending-pending {
    visibility: hidden;
    animation: none
}

.ending-achievement-screen {
    pointer-events: none
}

.ending-achievement-screen .achievement {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    margin: 0;
    z-index: 1
}

.ending-achievement-screen .achievement img {
    display: block;
    position: relative;
    width: min(270px, 34vw);
    height: auto;
    object-fit: contain;
    image-rendering: pixelated;
    animation: achievement-jump .8s steps(3, end) infinite;
    transform-origin: bottom center
}

.ending-achievement-copy {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
    z-index: 3;
    pointer-events: auto
}

.ending-achievement-copy .title {
    font-size: 30px;
    text-shadow: 3px 3px 0 #111
}

.ending-achievement-copy .go {
    margin-top: 0;
    pointer-events: auto
}

@keyframes achievement-jump {
    0%, 100% { transform: translateY(0) }
    45% { transform: translateY(-22px) }
}

.topNote {
    position: absolute;
    left: 50%;
    top: 8px;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 11px;
    color: #9fbcc1
}

.hide {
    display: none !important
}

.timeout-popup {
    position: absolute;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center
}

.timeout-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 15, 20, .62);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px)
}

.timeout-card {
    position: relative;
    z-index: 1;
    width: min(520px, 86vw);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px 30px;
    background-color: transparent;
    background-image: url("../images/horizon-dialog-bg.png");
    background-position: center center;
    background-size: 100% 100%;
    background-origin: border-box;
    background-clip: border-box;
    background-repeat: no-repeat;
    overflow: hidden
}

.timeout-card > img {
    width: 145px;
    height: 145px;
    object-fit: contain;
    object-position: bottom;
    image-rendering: pixelated
}

.timeout-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 250px;
    text-align: center
}

.timeout-copy h2 {
    margin: 0;
    color: #fff;
    font-size: 26px
}

.timeout-copy p {
    margin: 0;
    color: #c4d7da;
    line-height: 1.35;
    font-size: 13px
}

.timeout-copy .go {
    margin-top: 4px
}

.asset-loader { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: #031a24 url("../images/main-bg.png") center / cover no-repeat; image-rendering: pixelated }
.asset-loader-card { width: min(360px, 82vw); padding: 28px 30px; text-align: center; color: #fff; background: #062a3d; border: 3px solid var(--lime); box-shadow: 6px 6px 0 #000 }
.asset-loader-arrows { display: flex; justify-content: center; gap: 5px; margin-bottom: 12px }
.asset-loader-arrows span { width: 10px; height: 10px; border-left: 3px solid var(--lime); border-top: 3px solid var(--lime); transform: rotate(45deg); animation: loader-arrow .8s steps(3, end) infinite }
.asset-loader-arrows span:nth-child(2) { animation-delay: .15s }
.asset-loader-arrows span:nth-child(3) { animation-delay: .3s }
@keyframes loader-arrow { 0%, 100% { opacity: .25; transform: translateY(5px) rotate(45deg) } 50% { opacity: 1; transform: translateY(0) rotate(45deg) } }
.asset-loader-title { font-size: 22px; font-weight: 900; margin-bottom: 16px }
.asset-loader-bar { height: 14px; padding: 3px; background: #0d3342; border: 2px solid #71939b }
.asset-loader-bar span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--lime2), var(--lime)); transition: width .12s steps(2, end) }
.asset-loader-status { margin-top: 10px; color: #c4d7da; font-size: 12px }

@media(max-width:950px) {
    .ui {
        width: min(640px, 68vw);
        top: 5%;
        bottom: auto;
        max-height: 90vh;
    }

    .char {
        opacity: .95;
        transform: scale(.9);
        transform-origin: bottom
    }

    .char.left {
        left: -1%
    }

    .char.right {
        right: -1%
    }

    .bubble.left {
        left: 13%;
        top: 12%
    }

    .bubble.right {
        right: 13%;
        top: 12%
    }
    .game .ui{ position: relative; transform: none !important; inset: auto !important; 
    margin:20px auto 20px;
    }
    .game:has(.character-group) .ui{
        margin-bottom: 300px;
    }
    .ending-handoff .handoff_img img{
        width: min(520px, 94vw);
        max-height: 60vh;
    }
    .ending-achievement-screen .achievement img{
        width: min(270px, 55vw);
        max-height: 55vh;
    }
    .ending-handoff .go{
        right: 12px;
        bottom: 12px;
    }
    .ending-achievement-copy .title{
        font-size: 24px;
    }

    .character-group{
        position: fixed !important;
        top: inherit !important;
        bottom: 5px !important;
        left: 0;
        width: 100%;
        height: auto;
        z-index: 999;
        
    }
     .character-group .char_wrapp{
        position: relative;
        padding-top: 30px;
        
    }
    .character-group .char_wrapp.right_char{
        padding-top: 10px;
    }
    .character-group .char_wrapp .bubble {
        position: static;
        width:calc(100% - 100px);
        height: auto;
        background: #fff;
        border-radius: 20px;
        max-width: inherit;
        padding: 10px 10px 10px 65px;
        min-height: 60px;
        overflow: visible;
        justify-content: flex-start;
        text-align: left;
        margin-left: 30px;
        font-size: 14px;
        text-align: left;
    }
    .character-group .char_wrapp .bubble.right{
        margin-left: 60px;
        padding: 10px 50px 10px 10px;
        text-align: right;
        justify-content: flex-end;
    }
    .character-group .char_wrapp .char {
        position: absolute;
        height: clamp(70px, 32vw, 140px) !important;
        width: clamp(70px, 32vw, 140px) !important;
        max-width: clamp(70px, 32vw, 140px) !important;
        right: inherit  !important;
        left: -15px !important;
        transform: none !important;
        top:inherit !important;
        bottom: -1px !important;
        border-bottom: 2px solid #fff;
    }
    .character-group .char_wrapp .char.right{
       left: inherit !important; 
       right: -15px !important;
    }
    .character-group .char_wrapp .char img {
        object-fit: contain;
        object-position: bottom;
    }
    .choice.selected{
        filter: none !important;
    }

}

@media(max-width:720px) {
    .lobby-image{
        transform: scale(1.4);
        transform-origin: top center;
    }
    .ui {
        width: 80vw;
        min-width: 225px;
        top: 2%;
        bottom: auto;
    }

    .char {
        display: block;
        width: 160px;
        height: 260px;
        transform: scale(.62);
        transform-origin: bottom
    }

    .bubble {
        max-width: 145px;
        min-height: 150px;
        padding: 28px 18px 42px;
        font-size:11px;
        line-height: 1.35
    }

    .bubble.ending-bubble {
        width: min(320px, 90vw);
        max-width: none;
        min-height: 210px;
        padding: 36px 30px 62px;
        font-size: 12px;
        overflow: visible
    }

    .choice-row {
        grid-template-columns: 1fr 1fr
    }

    .panel {
        padding: 18px 10px 58px
    }

    .floorbar {
        display: flex;
        gap: 5px;
        bottom: 0;
        height: 46px
    }

    .floorbar .floor-label {
        font-size: 9px
    }

    .floorbar .floor-badge {
        width: 25px;
        height: 23px;
        font-size: 11px;
        border-width: 2px;
        box-shadow: 2px 2px 0 #111
    }

    .rightStat {
        right: 12px
    }

    .leftStat {
        left: 12px
    }

    .rightStat,
    .leftStat {
        font-size: 12px
    }

    .panel {
        padding: 0 10px 0
    }

    .screen {
        padding: 20px 12px 20px;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .screen_header {
        min-height: 38px;
        flex-basis: 38px
    }

    .lift-arrows {
        height: 23px;
        transform: scale(.75);
        transform-origin: top center
    }

    .current-floor {
        font-size: 10px
    }

    .stage {
        font-size: 11px
    }

    .title {
        font-size: 16px
    }

    .sub,
    .copy,
    .go,
    .choice-title, .start-card p {
        font-size: 14px
    }
    .sub br,
    .copy br,
    .go br,
    .choice-title br, .start-card p br,  .title br, .stage br, .mission br{
        display: none !important;
    }

    .mission{
        font-size: 16px;
    }

    .choice-row {
        gap: 16px;
        margin-top: 8px
    }

    .choice {
        padding: 14px;
        min-height: 60px;
        font-size: 12px;
        line-height: 1.2
    }
    .mock {
        width: 90px;
        height: 90px;
    }
    .choice, .screen-content > .selected_mock{
                min-height: 170px;
    }
    .screen-content > .selected_mock{
        min-width: 150px;
    }

}

.lobby-arrival {
    background: #082d3a;
    animation: lobby-arrival-in .9s ease-out both
}

@keyframes lobby-arrival-in {
    from {
        opacity: .15
    }

    to {
        opacity: 1
    }
}