body {
    margin: 0;
    background: black;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* ESCENA */
.game {
    position: relative;
    width: 90vw;
    max-width: 1600px;
    aspect-ratio: 16 / 9;
    background: black;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

/* FONDO */
.background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    z-index: 0;
}

/* OVERLAY */
.overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 50, 0.25);
    z-index: 1;
}

/* PERSONAJE */
.character {
    position: absolute;
    bottom: 90px;
    left: 30%;
    transform: translateX(-50%) scale(4);
    image-rendering: pixelated;
    z-index: 3;
    pointer-events: none;
}

/* HITBOXES */
.object {
    position: absolute;
    cursor: pointer;
    z-index: 2;
    background: transparent;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

/* HOVER */
.object:hover {
    box-shadow:
        0 0 10px rgba(255, 255, 200, 0.6),
        0 0 25px rgba(255, 255, 200, 0.4);
}

/* CLICK */
.object:active {
    box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

/* POSICIONES */
#pc { top: 47%; left: 52%; width: 20%; height: 11%; }
#coffee { top: 55%; left: 45%; width: 4%; height: 8%; }
#poster { top: 15%; left: 13%; width: 14%; height: 31%; }
#snes { top: 58%; left: 37%; width: 7%; height: 6%; }
#window { top: 14%; left: 32%; width: 17%; height: 39%; }
#bed { top: 65%; left: 0%; width: 22%; height: 25%; }

/* DIÁLOGO */
.dialogue-box {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    border-top: 3px solid white;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    line-height: 1.6;
    z-index: 4;
}

.dialogue-box p {
    white-space: pre-wrap;
}

/* TOOLTIP */
.object::after {
    content: attr(data-name);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 4px 6px;
    border: 1px solid white;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.object:hover::after {
    opacity: 1;
}

/* ANIMACIÓN HABLAR */
.talking {
    animation: talkBounce 0.3s ease;
}

@keyframes talkBounce {
    0% { transform: translateX(-50%) scale(4); }
    50% { transform: translateX(-50%) scale(4.1); }
    100% { transform: translateX(-50%) scale(4); }
}

#muteBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    background: rgba(0,0,0,0.7);
    color: white;
    border: 2px solid white;
    padding: 6px 10px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    cursor: pointer;
}

#muteBtn:hover {
    background: white;
    color: black;
}

/*  MOBILE FIX */
@media (max-width: 768px) and (orientation: portrait) {

    body {
        align-items: flex-start;
    }

    .game {
        width: 100vw;
        height: 100vh;
        aspect-ratio: 9 / 16;
        max-width: none;
        box-shadow: none;
    }

    .background {
        object-fit: cover;
    }

    /* 👤 personaje centrado mejor */
    .character {
        left: 50%;
        bottom: 140px;
        transform: translateX(-50%) scale(3);
    }

    /* 💬 texto más grande */
    .dialogue-box {
        font-size: 11px;
        padding: 18px;
    }

    /* 🔘 botón más cómodo */
    #muteBtn {
        font-size: 12px;
        padding: 10px 14px;
    }
}