@import url('https://fonts.googleapis.com/css2?family=Tiny5&display=swap');

html {
    font-size: .8vmax;
}

body{
    display:grid;
    place-items: center;
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #008080;
    color: white;
    user-select: none;
    font-family: "Tiny5", sans-serif;
    overflow: hidden;
}

section{
    width: 100%;
    height: 100vh;
}

.main{
    display: flex;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
    transform-origin: center;
    cursor: none;
    z-index: 1;
}
.main.is-open {
    pointer-events: auto;
    animation: tv-turn-on-main 0.4s steps(10) forwards; /*cubic-bezier(0.25, 1, 0.5, 1)*/
}
.main.is-closed {
    pointer-events: none;
    animation: tv-turn-off-main 0.4s steps(10) forwards; /*cubic-bezier(0.25, 1, 0.5, 1)*/
}
/* ─── ANIMATION ALLUMAGE (TV ON) ─── */
@keyframes tv-turn-on-main {
    0% {
        transform: scaleX(0) scaleY(0.005);
        filter: brightness(5);
        opacity: 0;
    }
    40% {
        transform: scaleX(1) scaleY(0.005);
        filter: brightness(5);
        opacity: 0.99;
    }
    100% {
        transform: scaleX(1) scaleY(1);
        filter: brightness(1);
        opacity: 0.99;
    }
}
@keyframes tv-turn-off-main {
    0% {
        transform: scaleX(1) scaleY(1);
        filter: brightness(1);
        opacity: 0.99;
    }
    40% {
        transform: scaleX(1) scaleY(0.005);
        filter: brightness(4);
        opacity: 0.99;
    }
    80% {
        transform: scaleX(0) scaleY(0.005);
        filter: brightness(10);
        opacity: 0.99;
    }
    100% {
        transform: scaleX(0) scaleY(0);
        filter: brightness(10);
        opacity: 0;
    }
}


.cursor{
    width: 50px; /* Converti en rem pour scaler avec le reste */
    height: 50px;
    position: absolute;
    z-index: 99999;
    pointer-events: none;
    user-select: none;
    transform: translate(-0.625rem, -0.8125rem); /* -10px, -13px */
    overflow: hidden;
    display: block;
}

.droite {
    display: flex;
    position: relative;
    flex-direction: column; /* Aligne le menu et les boutons côte à côte */
    flex: 0 0 25%;       /* Conserve tes 25% de l'écran total */
    height: 100vh;
    border: 0.25rem solid #3A2218;
    overflow: hidden;
    box-sizing: border-box; /* Recommandé pour éviter que les bordures déforment les calculs de % */
}

.menu {
    height: 90%;
    flex: 0 0 90%;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

.boutique {
    height: 100%;
    width: 100%; 
    position: relative;
    margin: 0;
    display: none;
    background-image: url("./assets/UI/menu/boutique/boutique_bg.png");
    background-position: center;
    background-size: 100% 100%;
    filter: brightness(1.7);
}
.boutique.selected{
    display: block;
}

#upgrades {
    width: 87%;
    height:94%;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    flex-grow: 1;
    padding: 0.5rem 0.5rem;
    box-sizing: border-box;
    position: absolute;
    overflow-y: scroll;
    scrollbar-color: #3A2218;
}

.intitule{
    width: 95%;
    height: fit-content;
    padding: 0.625rem; /* 10px */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color:#141414;
}

.desc {
    position: fixed;
    pointer-events: none;
    display: none;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.625rem; /* 10px */
    border-radius: 0.375rem; /* 6px */
    max-width: 16.625rem; /* 250px */
    font-size: 0.9rem;
    box-shadow: 0 0.25rem 0.9375rem rgba(0,0,0,0.5); /* 0 4px 15px */
    transform: translate(0.625rem, 0.625rem); /* 10px, 10px */
}

.UI_buttons {
    flex: 0 0 10%;
    height: 10%;
    display: flex;
    flex-direction: row;
    align-items: center;
    box-sizing: border-box;
    overflow: visible;
    background-color: #3A2218;
}

.button{
    flex: 1;
    position: relative;
    height: 10rem;
    z-index: 100;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    border-top: none;
    transform: translateY(-20%);
    transition: transform 0.2s steps(3);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: 0% 100%;
}
.button.selected{
    filter: brightness(0.8);
}
.button.selected:hover{
    filter: brightness(0.8);
}
.button:hover{    
    filter:brightness(1.2);
    transform: translate(0,-12%);
}
.button.selected:hover{
    transform: translate(0,-20%);
}
.button:active{    
    transform: scale(1.04) translate(0,-15%);
}
.button_text{
    font-size: 1.7rem;
    position: absolute;
    width:100%;
    bottom:0;
    text-align:center;
}
#boutique{
    background-image: url("./assets/UI/menu/boutique/shop_button.png");
}
#trophies{
    background-image: url("./assets/UI/menu/trophy_button.png");
}
#options{
    background-image: url("./assets/UI/menu/setting_button.png");
}
#options.selected{
    filter: brightness(0.8);
    background-image: url("./assets/UI/menu/setting_button.png");
}

.trophies{
    display: none;
    position:absolute;
    top:0%;
    left: 0%;
    z-index: 99;
    background-color: black;
    width: 100%;
    height: 100%;
    transition: transform 5s ease-in-out;
}
.trophies.selected{
    display: block;
}

.gauche {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* border: 1.2rem solid #3A2218;  */
    box-sizing: border-box;
}

.frame{
    background: url("./assets/UI/main_frame1.png");
    background-position: center;
    background-size:100% 102%;
    background-repeat: no-repeat;
    position: absolute;
    width: 101%;
    height: 100%;
    top: 0rem;
    left: 0rem;
    filter: brightness(1.7);
}

.background{
    background: url("./assets/background/bedroom1.png");
    background-size: cover;
    background-position: center;
    position: absolute;
    height: 100%;
    width: 100%;
    z-index: -1;
    top: 0;
    left: 0;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

.background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, 
        #abe3ff, #ffffff,   /* Jour (0% à 33%) */
        #f9d423,   /* Sunset (33% à 66%) */
        #102e5c, #0a3d66    /* Nuit (66% à 100%) */
    );
    background-size: 100% 350%;
    background-position: 0% 100%;
    mix-blend-mode: multiply; 
    transition: background-position var(--transition-vitesse) steps(10);
    pointer-events: none;
    filter: url(#pixelate);
}

.background.night::before {
    background-position: 0% 100%;
}
.background.day::before {
    background-position: 0% 0%;
}

.stop_button{
    overflow: visible;
    position: absolute;
    right:0;
    bottom:0;
    width: 23vmin;
    height: auto;
    box-shadow: 0rem 0.2rem 0 0.1rem black;
}
.stop_button img{
    border-radius: 0.2rem;
    width: 100%;
    height: 100%;
    filter: brightness(0.95);
}
.stop_button.broken{
    pointer-events: none;
}
.stop_button.broken .safety_glass{
    pointer-events: none;
    width: 83%;
    transform: translate(-60%,-150%) scale(1, -1);
}
.stop_button.broken img{
    border-radius: 0.2rem;
    width: 120.5%;
    height: 120.5%;
    filter: brightness(0.95);
}
.stop_hitbox{
    position: absolute;
    width:19vmin;
    height:19vmin;
    top:50%;
    left:50%;
    transform: translate(-50%,-51%);
    z-index: 1;
}


.safety_glass{
    top:50%;
    left:50%;
    transform: translate(-50%,-50%);
    position: absolute;
    opacity: 0.8;
    width: 95%;
    z-index: 2;
}
.safety_glass.open{
    -webkit-transform: scale(-1, -1);
    -moz-transform: scale(-1, -1);
    -o-transform: scale(-1, -1);
    transform: translate(-50%,-150%) scale(1, -1);
}

.explosion{
    background-position: center;
    background-size: 100%;
    background-repeat: no-repeat;
    width: 200%;
    height: 200%;
    z-index: 3;
    position: absolute;
    animation: timeout 0.8s;
}
@keyframes timeout{
    0%{ opacity: 1; }
    99%{ opacity: 1;}
    100%{ opacity: 0; }
}


.gauche p {
    font-size: clamp(1.2rem, 3vw, 2rem);
    align-self: center;
    text-align: center;
    margin: 2vh 0;
}

.div-img-clickable {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

.loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: auto;
    z-index: 2;
    width: 100%;
    height: 100%;
    background-color: black;
    border-radius: 10%;
}

.loading img{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    width: 30%;
    pointer-events: none;
    user-select: none;
}

.scroll-area {
    display: inline-block;
    position: relative; 
    line-height: 0;
}

.clicker {
    pointer-events: none;
    user-select: none;
    height: 60vh;
    width: auto;
    display: block;
    position: relative;
    z-index: 2;
}

.glow {
    position: absolute;
    top: 49%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22vh;
    height: 49vh;
    background: transparent;
    /* Traduction des ombres en rem (15px, 25px, 35px, 45px) */
    box-shadow: 
        0 0 0 0.9375rem rgba(255, 255, 255, 0.2), 
        0 0 0 1.5625rem rgba(255, 255, 255, 0.15),
        0 0 0 2.1875rem rgba(255, 255, 255, 0.1),
        0 0 0 2.8125rem rgba(255, 255, 255, 0.05);
    image-rendering: pixelated;
    pointer-events: none;
    z-index: 3;
    animation: glow_pulse 1s steps(4) infinite;
}

@keyframes glow_pulse {
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.05, 1.03); }
}

.highlight-text{
    font-size: 2rem; /* 32px */
    color: rgb(234, 59, 59);
    text-shadow: 0.125rem 0.125rem 0.1875rem rgb(0, 0, 0); /* 2px 2px 3px */
}

.prixstr{
    font-size: 1.25rem; /* 20px */
}

.scroll-area:hover{
    transform:scale(1.01) ;
}

.clickfeedback{
    color: white;
    position: absolute;
    font-size: 3vmin;
    width: 12vmin;
    pointer-events: none;
    z-index: 3;
    white-space: nowrap;
}

.onclickicon{
    position: absolute;
    top: 0.2vmin; 
    width: 3vmin;
    height: 3vmin;
}

.upgrade {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: left;
    width: 100%;
    box-sizing: border-box;
    height: auto;
    min-height: 6vh;
    border-radius: 0.3125rem;
    padding: 1vh 1vw;
    padding-left: 3rem;
    margin: 0 auto 0.625rem auto;
    z-index: 1;
    transition: transform 0.1s ease-out;
    will-change: transform;
    filter: brightness(0.6);
}

.upgrade.upgrade.achetable{
    filter: brightness(0.8);
}

.upgrade.achetable .info-prix{
    color:#00ff00;
}

.upgrade::after {
    content: '';
    position: absolute;
    z-index: -1; 
    top: 0.1875rem; /* 3px */
    left: 0.1875rem; 
    right: 0.1875rem; 
    bottom: 0.1875rem;
    background: url("./assets/UI/menu/boutique/upgrade_frames/upg_frame1.png");
    background-position: center;
    background-size: 100% 100%;
    filter:brightness(0.8);
}

.upgrade::before {
    content: '';
    position: absolute;
    z-index: -2; 
    top: 0;
    left: 0;
    width: 101%;
    height: 100%;
    background: #3A2218;
    background-size: 500%;
    animation: multicolor 5s steps(40) infinite;
    border-radius: 0.5rem;
    box-shadow: 0rem 0.2rem 0 0.1rem black;
}

.upgrade.upgrade.has-powerup .sectionG::before{
    background: url('./assets/upgrades/pu_bg.png');
    animation: tourbillon 10s steps(40) infinite;
    background-size: 100%;
}

.upgrade.has-powerup::before {
    background: linear-gradient(90deg, 
        #ff0000, #00ff00, #0000ff, #ff0000, #00ff00, #0000ff, #ff0000
    );
    background-size: 200% 100%;
    filter: url(#pixelate); 
    image-rendering: pixelated;
    animation: multicolor 4s steps(20) infinite;
}

@keyframes multicolor {
    0% {background-position: 0% 0%;}
    100% { background-position: 300% 0%;}
}

.sectionG {
    max-width: 20%;
    max-height: 20%;
    border-radius: 0.3125rem; /* 5px */
    padding: 0.125rem; /* 2px */
    position: relative;
    overflow: hidden; 
    filter: brightness(0.5);
}

.sectionG::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: url('./assets/upgrades/bg.png');
    background-size: 110%;
    background-repeat: no-repeat;
    background-position: center;
    transform: scale(1.4);
}

.sectionG .upgrade-img {
    position: relative;
    z-index: 2; 
}

.upgrade.ishovered{
    filter: brightness(0.8);
    transform: scale(1.01);
}

.upgrade.achetable.ishovered{
    transform: scale(1.01);
}

.upgrade.achetable .sectionG{
    filter:brightness(0.6);
}
.upgrade.achetable.ishovered .sectionG{
    filter:brightness(0.7);
}

.upgrade.ishovered .upgrade-img{
    animation: pulse 2s steps(10) infinite;
}

@keyframes pulse {
    0%, 100%{ transform: scale(1); }
    50%{ transform: scale(1.1); }
}

.upgrade.ishovered .sectionG::before {
    animation: tourbillon 10s steps(40) infinite;
}

@keyframes tourbillon {
    0% { transform: scale(1.4) rotate(0deg); }
    100% { transform: scale(1.4) rotate(360deg); }
}

.sectionM{
    padding-left: 5%;
}

.sectionM h4{
    margin: 0;
    margin-bottom: 0.625rem; /* 10px */
    font-size: 110%;
}

.sectionM p{
    margin:0;
}

.sectionD{
    margin-left: auto;
}

.sectionD span{
    font-size: 1.875rem; /* 30px */
}

.upgrade-img {
    image-rendering:pixelated;
    width: 100%;
    pointer-events: none;
    user-select: none;
}

.upgrade-txt{
    font-weight: 400;
}

.currency-img{
    width: 1.875rem; /* 30px */
    height: 1.875rem;
    pointer-events: none;
    user-select: none;
}

.info-prix{
    display: flex;
    align-items: center;
    gap : 0.3125rem; /* 5px */
}

.info{
    align-self: center;
    width: 30%;
    height: 13%;
    background: url('./assets/UI/score_frame.png');
    background-position: center;
    background-size: 100% 100%;
    box-shadow: 0rem 0.3rem 0 0.1rem black;
    border-radius: 0.2rem;
    filter: brightness(0.9);
}

.statistiques {
    width: 100%;
    height: fit-content;
    padding: 2.5vh;
    box-sizing: border-box;
    border-top: 0.375rem white solid; /* 6px */
    background: #523020;
    margin-left: 2rem;
    margin-bottom: 2rem;
}

.texte {
    display: flex;
    flex-wrap: wrap;
    padding-left: 2%;
    gap: 2vw;
    width: 75%;
    justify-content: flex-start;
}
.texte p {
    font-size: clamp(0.9rem, 2vw, 1.375rem);
    margin: 0;
}

.fade-up{
    animation: fade-up 1s;
}

@keyframes fade-up{
    0%{ transform: translateY(0); opacity: 1; }
    20%{ transform: translateY(-0.3125rem); opacity: 0.9; }
    40%{ transform: translateY(-0.8125rem); opacity: 0.75; }
    60%{ transform: translateY(-1.5625rem); opacity: 0.55; }
    80%{ transform: translateY(-2.625rem); opacity: 0.3; }
    100%{ transform: translateY(-4.0625rem); opacity: 0; }
}

::-webkit-scrollbar{
    width: 0.625rem; /* 10px */
}

::-webkit-scrollbar-track{
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb{
    background: #888;
}

::-webkit-scrollbar-thumb-hover{
    background: #555;
}

.area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    height: 95%;
    background: transparent !important;
    overflow: hidden;
    z-index: 0;
}
 
/* ─── Contenu scrollable ─── */
.scroll-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    will-change: transform;
}
 
.item { 
    width: 100%;
    aspect-ratio: 372 / 770; 
    background-color: black;
    transition: border-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.fade-top,
.fade-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 2;
}
 
.fade-top {
    background: linear-gradient(to bottom, #141414, transparent);
}
 
.fade-bottom {
    background: linear-gradient(to top, #141414, transparent);
}

.item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    backface-visibility: hidden; 
}


.home{
    position: fixed;
    width: 100%;
    height: 100%;
}
.bottom_bar{
    background-image: url("./assets/UI/start/bottom_bar.png");
    background-position: center;
    background-size: 100% 100%;
    position: absolute;
    width: 100%;
    height: 4%;
    bottom: 0;
}

.title-card{
    align-content: center;
    position: absolute;
    top:40%;
    left:50%;
    transform: translate(-50%,-50%) scale(0);
    background-color: #C0C0C0;
    border: 2px solid;
    border-color: #FFF #000 #000 #FFF;
    padding: 15px;
    font-family: "Courier New", Courier, monospace;

    opacity: 0;
    overflow: hidden;
    transform-origin: center;
}
.title-card p{
    text-align: center;
    color: #000;
    font-size: 1.5rem;
    animation: blink 2s steps(10) infinite;
}
@keyframes blink {
    0%{
        opacity: 1;
    }
    50%{
        opacity: 0;
    }
}
#title-card-img{
    width: 90rem;
    background-color: #000000;
    border: 2px solid;
    border-color: #000 #FFF #FFF #000;
}
#title-card-img img{
    width: 100%;
    animation: pulse_title 2s steps(5) infinite;
}
@keyframes pulse_title {
    0%{
        transform: scale(1);
    }
    50%{
        transform: scale(1.02);
    }
}
.title-card.is-open {
    pointer-events: auto;
    animation: tv-turn-on 0.4s steps(10) forwards; /*cubic-bezier(0.25, 1, 0.5, 1)*/
}
.title-card.is-closed {
    pointer-events: none;
    animation: tv-turn-off 0.4s steps(10) forwards;
}

.start{
    top:50%;
    left: 50%;
    position: absolute;
    width: 75rem;
    height: 50rem;
    background-image: url("./assets/UI/start/bg.png");
    background-position: center;
    background-size: 100% 100%;
    z-index:997;
    opacity: 0;
    pointer-events: none;
    transform: scale(0) translate(-50%, -50%);
    overflow: hidden;

    transform-origin: center;
}
.start.is-open {
    pointer-events: auto;
    animation: tv-turn-on 0.4s steps(10) forwards; /*cubic-bezier(0.25, 1, 0.5, 1)*/
}
.start.is-closed {
    pointer-events: none;
    animation: tv-turn-off 0.4s steps(10) forwards;
}
#window-title{
    font-family: "Courier New", Courier, monospace;
    position: absolute;
    top:1rem;
    left:1.5rem;
    width: fit-content;
    height: auto;
    font-size: 2rem;
}
/* ─── ANIMATION ALLUMAGE (TV ON) ─── */
@keyframes tv-turn-on {
    0% {
        transform: scaleX(0) scaleY(0.005) translate(-50%,-50%);
        filter: brightness(5);
        opacity: 0;
    }
    40% {
        transform: scaleX(1) scaleY(0.005);
        filter: brightness(5);
        opacity: 0.99;
    }
    100% {
        transform: scaleX(1) scaleY(1) translate(-50%,-50%);
        filter: brightness(1);
        opacity: 0.99;
    }
}
/* ─── ANIMATION EXTINCTION (TV OFF) ─── */
@keyframes tv-turn-off {
    0% {
        transform: scaleX(1) scaleY(1) translate(-50%,-50%);
        filter: brightness(1);
        opacity: 0.99;
    }
    40% {
        transform: scaleX(1) scaleY(0.005);
        filter: brightness(4);
        opacity: 0.99;
    }
    80% {
        transform: scaleX(0) scaleY(0.005) translate(-50%,-50%);
        filter: brightness(10);
        opacity: 0.99;
    }
    100% {
        transform: scaleX(0) scaleY(0);
        filter: brightness(10);
        opacity: 0;
    }
}

#endbox{
    display: none;
}
#endbox.is-open{
    display: inline;
}

#end-text-box{
    color: #000;
    transform: translate(-50%, 10%);
    left: 50%;
    top: 50%;
    position: absolute;
    background-color: white;
    width: 90%;
    height: fit-content;
}
.summary{
    font-size: 1.5rem;
    background-color: #C0C0C0;
    width: 66.14rem;
    height: fit-content;
    border: 2px solid;
    border-color: #FFF #000 #000 #FFF;
    padding: 0.5rem;
}
#room-state{
    position: absolute;
    border: 2px solid;
    border-color: #000 #FFF #FFF #000;
    transform: translate(-50%, -100%);
    left: 50%;
    top: 50%;
    width: 90%;
    height: 35%;
    background-size: cover;
    background-position: 0% 70%;
}


.narrator{
    position:absolute;
    /* top: 28%;
    left: 15%; */
    display: flex;
    flex-direction: row;
    z-index: 10000;

    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}
.narrator.is-open {
    pointer-events: auto;
    animation: narrator-turn-on 0.2s steps(10) forwards; /*cubic-bezier(0.25, 1, 0.5, 1)*/
}
.narrator.is-closed {
    pointer-events: none;
    animation: narrator-turn-off 0.2s steps(10) forwards;
}
@keyframes narrator-turn-on {
    0% {
        transform: scaleX(0) scaleY(0.005);
        filter: brightness(5);
        opacity: 0;
    }
    40% {
        transform: scaleX(1) scaleY(0.005);
        filter: brightness(5);
        opacity: 0.99;
    }
    100% {
        transform: scaleX(1) scaleY(1);
        filter: brightness(1);
        opacity: 0.99;
    }
}
@keyframes narrator-turn-off {
    0% {
        transform: scaleX(1) scaleY(1);
        filter: brightness(1);
        opacity: 0.99;
    }
    40% {
        transform: scaleX(1) scaleY(0.005);
        filter: brightness(4);
        opacity: 0.99;
    }
    80% {
        transform: scaleX(0) scaleY(0.005);
        filter: brightness(10);
        opacity: 0.99;
    }
    100% {
        transform: scaleX(0) scaleY(0);
        filter: brightness(10);
        opacity: 0;
    }
}
.sprite{
    background-position: center;
    background-size: 220% 105%;
    background-image: url("./assets/UI/start/idle.gif");
}
.narrator.is-talking .sprite{
    background-image: url("./assets/UI/start/talk.gif");
}
.sprite.shocked{
    background-position: center;
    background-size: 220% 105%;
    background-image: url("./assets/UI/start/shock.png");
}

.dialog{
    color: #141414;
    /* top:-3rem; */
    /* left: 25rem; */
    position: relative;
    background-image: url("./assets/UI/start/text_bubble.png");
    background-position: center;
    background-size: 100% 100%;
    width: 45rem;
    height: 18rem;
    display: none;
}
.dialog.visible{
    display: block;
}

.dialog p{
    font-size:2rem;
    position: absolute;
    top:7%;
    left:6%;
    width: 88%;
    height: 50%;
}


#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.1s ease;
}
.loader-hidden {
    opacity: 0;
    pointer-events: none;
}
#progress-bar{
    background-color: #C0C0C0;
    border: 2px solid;
    border-color: #FFF #000 #000 #FFF;
    padding: 15px;
    width: 300px;
    font-family: "Courier New", Courier, monospace;
}
.loading-title {
    margin-bottom: 10px;
    font-weight: bold;
}
.progress-bar-border {
    background-color: #808080;
    border: 2px solid;
    border-color: #000 #FFF #FFF #000;
    height: 25px;
    padding: 2px;
}
.progress-bar-fill {
    background-color: #000080;
    height: 100%;
    width: 0%;
}



.glitch-target.glitch-active {
    filter: none !important;
    animation: none !important;
}
.glitch-target.glitch-active .main > *:not(.glitch-immune):not(:has(.glitch-immune)),
.glitch-target.glitch-active .main :has(.glitch-immune) > *:not(.glitch-immune):not(:has(.glitch-immune)) {
    filter: url(#global-rgb-glitch) !important;
    animation: screen-shake 0.15s infinite steps(2);
    will-change: filter, transform;
}
.glitch-immune {
    z-index: 10000 !important; 
    filter: none !important;    
    animation: none !important; 
}
.cursor.glitch-immune {
    position: absolute !important; 
    flex-shrink: 0;                
    z-index: 20000 !important;  
}
.glitch-negative-square {
    position: absolute;
    background-color: #ffffff;
    mix-blend-mode: difference; 
    z-index: 9999;
    pointer-events: none;
}



.visual{
    z-index: 999;
    pointer-events: none;
    user-select: none;
}
.visual.robot-visual{
    position: absolute;
    top:0;
    left:0;
    width: 20%;
    height: 10%;
    transform-origin: center;
    /* transform: translate(-90%, 50%); */
}
.visual.robot-visual img{
    /* width: 150%; */
    width: 600%;
}

.visual.dragger-visual{
    position: absolute;
    animation: dragger-animation 90s steps(60) infinite;
    top:0;
    left:0;
    width: 20%;
    height: 10%;
    transform-origin: center;
    transform: translate(-120%, -90%);
}
.visual.dragger-visual img{
    width: 150%;
}
@keyframes dragger-animation {
    0%{
        transform: translate(-120%, -150%);
    }
    25%{
        transform: translate(470%, -150%);
    }
    50%{
        transform: translate(470%, 960%);
    }
    75%{
        transform: translate(-120%, 960%);
    }
}

.shutter{
    top:-110%;
    left:0;
    position: absolute;
    z-index: 99999999;
    width:100vw;
    height: 110vh;
    background-image: url("./assets/UI/main_shutter.png");
    background-position: center;
    background-size: cover;
    transition: top 0.1s;
}
.shutter.closed{
    top:-10%;
}
.shake {
    animation: slam-shake 0.2s ease-out;
}
@keyframes slam-shake {
    0%   { transform: translateY(0); }
    25%  { transform: translateY(3rem); }
    50%  { transform: translateY(-2rem); }
    75%  { transform: translateY(1rem); }
    100% { transform: translateY(0); }
}
.shutter img{
    width: 100%;
    top:50%;
    transform: translateY(70%);
    mix-blend-mode:hard-light;
}

.space-sequence{
    position: fixed;
    top: 0;
    left: 0;
    background-image: url("./assets/end/space.png");
    background-size: cover;
    z-index: 1000000;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.1s ease;
}
.space-sequence.active {
    visibility: visible;
    opacity: 1;
}
#blackhole, #earth, #nokia {
    position: absolute;
    width: 40rem;
    height: 40rem;
    background-size: contain;
    background-repeat: no-repeat;
}
#blackhole {
    background-image: url("./assets/end/blackhole.gif");
    transform-origin: center;
    z-index: 2;
    transform: scale(0);
    top:40%
}
#blackhole.freeze{
    background-image: url("./assets/upgrades/icon/singularity.png");
}
#earth {
    background-image: url("./assets/end/earth.gif");
    z-index: 1;
    transform-origin: center;
    top:40%;
}
#nokia {
    background-image: url("./assets/end/nokia.png");
    transform: scale(0.01);
    filter: brightness(0.7);
}
@keyframes nokia-attack {
    0% { opacity: 0;transform: scale(3) translate(0, 0); }
    100% { opacity: 0.8;transform: scale(3) translate(0, -8%); }
}
.animate-nokia {
    animation: nokia-attack 3s steps(10) forwards;
}
@keyframes blackhole {
    0%   { transform: scale(0); }
    25%  { transform: scale(0.2); }
    50%  { transform: scale(1); }
    75%  { transform: scale(0.6); }
    100% { transform: scale(0.8); }
}
.animate-blackhole {
    animation: blackhole 2s steps(2) forwards;
}
@keyframes earth {
    0% {transform: scale(1);}
    100% {transform: scale(0);}
}
.animate-earth {
    animation: earth 1s steps(8) forwards;
}
.win95{
    display: none;
    border: 2px solid;
    border-color: #FFF #000 #000 #FFF;
    width: fit-content;
}
.win95-body{
    background-color: white;
    border: 2px solid;
    border-color:#000 #FFF #FFF #000;
    padding: .2rem;
    width: fit-content;
}
.win95-header{
    background-color: #0000ff;
    width: 100%;
    height: 2rem;
}
.win95-content{
    background-color: #C0C0C0;
    width:fit-content;
    height: fit-content;
}
.win95-border{
    background-color: #dedcdc;
    padding: .5rem;
    display: flex;
    flex-direction: row;
    width: fit-content;
    height: fit-content;
    border: 2px solid;
    border-color:#000 #FFF #FFF #000;
}
#window-error{
    z-index: 3;
}
#relief img{
    width: 4rem;
    height: 4rem;
}
#relief p{
    padding-left: 1rem;
    font-size: 1.3rem;
    color: #000;
}

#brain0{
    position: absolute;
    top:10%;
    right: 5%;
    z-index: 1000;
}
#brain0 img{
    width: 20rem;
}
#brain1{
    position: absolute;
    top:11%;
    right: 5.5%;
    z-index: 1001;
}
#brain1 img{
    width: 20rem;
}