/* =========================
   RESET
========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #050505;
    font-family: Arial, sans-serif;
    color: white;
    overflow: hidden;
}

/* =========================
   GAME LAYOUT
========================= */

.game {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.scene {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.scene.active {
    display: block;
}

.background,
.bg-video {
    width: 100%;
    height: 100%;
    background: #111;
}

/* =========================
   GENERELLE KNAPPER
========================= */

button {
    cursor: pointer;
    border: none;
    color: white;
    background: rgba(0, 0, 0, 0);
    border: 1px solid #ff2b2b;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 18px;
    transition: 0.2s ease;
}

button:hover {
    background: rgba(170, 0, 0, 0.95);
}

.hidden {
    display: none !important;
}

.button,
.door-arrow {
    box-shadow: 0 2px 8px black;
    border: none;
}

.button:hover,
.door-arrow:hover {
    background: rgba(0, 0, 0, 0);
    transform: scale(1.1);
}

/* =========================
   INTRO
========================= */

#scene-intro,
#scene-intro .bg-video,
#scene-intro .text-box {
    cursor: pointer;
}

.sound-button {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 50;

    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #ff2b2b;
    color: white;

    padding: 12px 16px;
    border-radius: 10px;
}

/* =========================
   TEXT BOXES
========================= */

.text-box {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);

    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #8b0000;

    padding: 24px;
    width: min(700px, 90%);

    text-align: center;
    border-radius: 12px;
}

.text-box.small {
    font-size: 18px;
    padding: 16px;
}

/* =========================
   KLIKKBARE OBJEKTER
========================= */

.click-object,
.item,
.demon,
.locked-door,
.arrow {
    position: absolute;
}


/* =========================
   TASKEN + ITEMS
========================= */

.bag,
.flashlight,
.key,
.book {
    display: flex;
    align-items: flex-end;
    justify-content: center;

    color: white;
    font-weight: bold;
    text-shadow: 0 2px 8px black;

    padding-bottom: 10px;

    border: none;
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    transition:
            transform 0.2s ease,
            filter 0.2s ease;
}

/* Hover-effekt */
.bag:hover,
.flashlight:hover,
.key:hover,
.book:hover {
    background-color: transparent;
    transform: scale(1.22);
    filter: drop-shadow(0 0 14px rgba(255,255,255,0.45));
}

.bag:hover {
    background-image: url("assest/billeder/taske.png") !important;
}

.flashlight:hover {
    background-image: url("assest/billeder/lommelygte.png") !important;
}

.key:hover {
    background-image: url("assest/billeder/nøgle.png") !important;
}

.book:hover {
    background-image: url("assest/billeder/biblen.png") !important;
}

.bag:hover,
.flashlight:hover,
.key:hover,
.book:hover {
    background-color: transparent !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;

    transform: scale(1.12);
    filter: drop-shadow(0 0 14px rgba(255,255,255,0.45));
}

/* TASKEN */
.bag {
    left: 15%;
    top: 38%;

    width: 440px;
    height: 440px;

    font-size: 24px;

    background-image: url("assest/billeder/taske.png");
}

/* LOMMELYGTE */
.flashlight {
    left: 15%;
    top: 30%;

    width: 360px;
    height: 360px;

    font-size: 18px;

    background-image: url("assest/billeder/lommelygte.png");
}

/* NØGLE */
.key {
    left: 40%;
    top: 45%;

    width: 360px;
    height: 360px;

    font-size: 18px;

    background-image: url("assest/billeder/nøgle.png");
}

/* BIBEL */
.book {
    right: 15%;
    top: 30%;

    width: 360px;
    height: 360px;

    font-size: 18px;

    background-image: url("assest/billeder/biblen.png");
}

/* =========================
   PIL
========================= */

.door-arrow {
    right: 44%;
    top: 30%;
    rotate: 90deg;
}

.arrow-img {
    height: 100px;
    width: 120px;
}


/* =========================
   KOMMODE
========================= */

.dresser {
    position: absolute;
    left: 45%;
    top: 50%;
    z-index: 5;
}


.kommodebillede{
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.kommode{
    width: 500px;
    display: block;
}

/* =========================
   PIL EFTER GÅDE
========================= */

#next-door-arrow {
    right: 12%;
    top: 48%;
    font-size: 42px;
}

.arrow-img-højre {
    height: 100px;
    width: 120px;
    rotate: 90deg;
}



/* =========================
   GÅDE BOX
========================= */

.riddle-box {
    position: absolute;
    left: 15%;
    top: 50%;
    transform: translate(-50%, -50%);

    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #8b0000;

    padding: 25px;
    width: min(500px, 90%);

    border-radius: 14px;
    text-align: center;

    z-index: 5;
}

.riddle-box button {
    display: block;
    width: 100%;
    margin-top: 12px;
    z-index: 5;
}

.backgroundgådehvid{
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    z-index: 1;
}

.backgroundgåde{
    position: absolute;

    top: 50%;
    left: 50%;

    height: 100%;

    transform: translate(-50%, -50%);

    z-index: 3;
}

.tilbage {
    position: absolute;

    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #8b0000;

    text-align: center;
    border-radius: 12px;

    z-index: 4;
}

/* =========================
   HOTBAR
========================= */

.hotbar {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);

    display: flex;
    gap: 12px;

    background: rgba(0, 0, 0, 0.75);
    border: 1px solid #444;

    padding: 12px;
    border-radius: 14px;
}

.hotbar-item {
    padding: 10px 14px;
    background: #1b1b1b;
    border: 1px solid #777;
    border-radius: 8px;
}

.hotbar-item.selected {
    border-color: red;
    background: #400;
}

/* =========================
   TIMER
========================= */

.timer {
    position: absolute;
    top: 20px;
    right: 20px;

    background: rgba(0, 0, 0, 0.8);

    padding: 14px 20px;
    border: 1px solid red;

    border-radius: 10px;
    font-size: 24px;
}

/* =========================
   DÆMONER
========================= */

.demon {
    position: absolute;
    background: transparent !important;
    border: none;
    cursor: pointer;

    width: 120px;
    height: 120px;

    padding: 0;
    overflow: visible;

    animation-timing-function: linear;
    animation-iteration-count: infinite;

    z-index: 20;
}

.the-stalker {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.demon1 {
    left: 20%;
    top: 35%;
    animation: demonMoveOne 2s infinite alternate;
}

.demon2 {
    left: 50%;
    top: 25%;
    animation: demonMoveTwo 1.9s infinite alternate;
}

.demon3 {
    left: 72%;
    top: 55%;
    animation: demonMoveThree 1.1s infinite alternate;
}

@keyframes demonMoveOne {
    0% {
        transform: translate(0,0);
    }

    25% {
        transform: translate(100px,-80px);
    }

    50% {
        transform: translate(-120px,30px);
    }

    75% {
        transform: translate(120px,70px);
    }

    100% {
        transform: translate(-100px,-40px);
    }
}

@keyframes demonMoveTwo {
    0% {
        transform: translate(0,0);
    }

    25% {
        transform: translate(-140px,120px);
    }

    50% {
        transform: translate(130px,-90px);
    }

    75% {
        transform: translate(-70px,-70px);
    }

    100% {
        transform: translate(130px,40px);
    }
}

@keyframes demonMoveThree {
    0% {
        transform: translate(0,0);
        opacity: 1;
    }

    25% {
        transform: translate(140px,100px);
        opacity: 0.6;
    }

    50% {
        transform: translate(-120px,-40px);
        opacity: 1;
    }

    75% {
        transform: translate(140px,-90px);
        opacity: 0.7;
    }

    100% {
        transform: translate(-110px,90px);
        opacity: 1;
    }
}

/* =========================
   DÆMON TEKST
========================= */

.demon-instruction {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);

    background: rgba(0, 0, 0, 0.85);
    border: 1px solid red;

    color: white;

    padding: 14px 22px;
    border-radius: 10px;

    font-size: 22px;
    z-index: 10;
}

/* =========================
   LÅST DØR
========================= */

.locked-door {
    right: 8%;
    top: 45%;
}

/* =========================
   SKAB
========================= */

.closet {
    left: 81%;
    top: 42%;
}

/* =========================
   DIALOG BOX
========================= */

.dialog-box {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);

    width: min(750px, 90%);

    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #8b0000;

    padding: 24px;
    border-radius: 14px;

    text-align: center;
}

.dialog-box h2 {
    color: #ff2b2b;
    margin-top: 0;
}

.dialog-box button {
    margin: 10px;
}

/* =========================
   JUMPSCARE
========================= */

.jumpscare-scene {
    background: black;
    animation: jumpscareShake 0.12s infinite;
}

.jumpscare-scene h1 {
    position: absolute;
    inset: 0;

    display: grid;
    place-items: center;

    font-size: 160px;
    color: red;

    text-shadow: 0 0 30px red;
}

@keyframes jumpscareShake {
    0% {
        transform: translate(0,0);
    }

    25% {
        transform: translate(12px,-8px);
    }

    50% {
        transform: translate(-10px,8px);
    }

    75% {
        transform: translate(8px,10px);
    }

    100% {
        transform: translate(0,0);
    }
}

/* =========================
   FINALE DØRE
========================= */

.final-door {
    position: absolute;
    top: 45%;

    padding: 20px 30px;
    font-size: 22px;
}

.final-door-left {
    left: 25%;
}

.final-door-right {
    right: 25%;
}

/* =========================
   SATAN SCENE
========================= */

.satan-scene .background {
    animation: satanShake 0.15s infinite;
    z-index: 1;
    position: absolute;
}

.satan-scene.stop-shake .background {
    animation: none;
}

.satan-scene .dialog-box {
    position: absolute;
    z-index: 100;
}

.satan {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);

    width: 950px;
    height: auto;

    z-index: 3;
    pointer-events: none;
}




@keyframes satanShake {
    0% {
        transform: translate(0,0);
    }

    25% {
        transform: translate(10px,-6px);
    }

    50% {
        transform: translate(-8px,8px);
    }

    75% {
        transform: translate(6px,10px);
    }

    100% {
        transform: translate(0,0);
    }
}

/* =========================
   SATAN SVAR KNAPPER
========================= */

.satan-reply-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.satan-reply-buttons button {
    margin-top: 12px;
}

/* =========================
   WIN / DEATH
========================= */

.death-scene,
.win-scene {
    display: none;
    place-items: center;
    text-align: center;
    background: #050505;
}

.death-scene.active,
.win-scene.active {
    display: grid;
}

.death-scene h1 {
    font-size: 70px;
    color: red;
}

.win-scene h1 {
    font-size: 70px;
    color: #8cff8c;
}

.good-ending-vid {
    width: 100%;
    height: auto;
}