* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #000;
    color: #fff;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    touch-action: manipulation;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.active {
    display: flex;
}

#entrance-screen,
#game-screen {
    position: relative;
    background-color: #000;
}

.screen-title {
    position: absolute;
    top: 20px;
    color: #fff;
    font-size: 2rem;
    text-align: center;
    width: 100%;
    margin-bottom: 20px;
}

#entrance {
    width: 80%;
    max-width: 300px;
    height: 60vh;
    background-position: center;
    background-size: cover;
    transition: all 0.5s ease;
}

#entrance.closed {
    background-image: url('/IMG_5807.webp');
    filter: brightness(0.7);
}

#entrance.open {
    background-image: url('/IMG_5808.webp');
    filter: brightness(1);
    cursor: pointer;
}

#ookamuro-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 400px;
    opacity: 0;
    transition: opacity 2s ease;
}

#ookamuro-container.visible {
    opacity: 1;
}

#ookamuro {
    width: 100%;
    height: auto;
}

.mirror, .dot {
    cursor: pointer;
    margin: 15px;
    transition: all 0.3s ease;
}

.mirror img {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.mirror:hover, .dot:hover {
    transform: scale(1.1);
}

#mirror-container, #dots-container {
    position: absolute;
    bottom: 30px;
    left: 20px;
    display: flex;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 5;
}

#mirror-container.visible, #dots-container.visible {
    opacity: 1;
}

.dot {
    width: 40px;
    height: 40px;
    background-image: url('/IMG_5809.webp');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
    display: block;
    margin: 0 10px;
    border: 2px solid white;
}

#jumpscare-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
}

#jumpscare-container.active {
    opacity: 1;
    animation: jumpscare 3s forwards;
}

#yukie {
    width: 100%;
    max-width: 100vw;
    height: auto;
    transform: scale(0.1);
}

#toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 5;
    opacity: 0;
    transition: opacity 1s ease;
}

#toggle-container.visible {
    opacity: 1;
}

#toggle-button {
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#toggle-button:hover {
    background-color: rgba(50, 50, 50, 0.7);
    transform: scale(1.05);
}

#changelog-button-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 5;
}

#changelog-button, #feedback-button {
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 1px solid #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#changelog-button:hover, #feedback-button:hover {
    background-color: rgba(50, 50, 50, 0.7);
    transform: scale(1.05);
}

#changelog-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    z-index: 20;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: auto;
    box-sizing: border-box;
}

#changelog-display.visible {
    display: flex;
}

#changelog-content {
    background-color: rgba(20, 20, 20, 0.95);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    max-width: 800px;
    text-align: left;
    position: relative;
}

#changelog-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 2em;
    border-bottom: 1px solid #fff;
    padding-bottom: 10px;
}

#changelog-content p {
    line-height: 1.6;
    font-size: 1.1em;
}

#changelog-content button#close-changelog-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    color: white;
    border: none;
    font-size: 1em;
    cursor: pointer;
}

#changelog-content button#close-changelog-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

#changelog-content button#close-changelog-button svg {
    width: 24px;
    height: 24px;
}

#changelog-content button#close-changelog-button svg path {
    fill: red;
}

#changelog-content button#close-changelog-button svg path.blood {
    fill: darkred;
}

#changelog-content button#close-changelog-button:hover svg path {
    fill: darkred;
}

#changelog-content button#close-changelog-button:hover svg path.blood {
    fill: red;
}

#warning-screen {
    background-color: #000;
    color: #fff;
    text-align: center;
    padding: 20px;
}

#warning-content {
    max-width: 800px;
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border: 1px solid #333;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-height: 80vh;
}

#warning-title {
    font-size: 2rem;
    margin-bottom: 20px;
}

.warning-red {
    color: #ff0000;
}

#warning-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 0 10px;
    text-align: left;
}

#continue-button {
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#continue-button:hover {
    background-color: #555;
    transform: scale(1.05);
}

#elizabeth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 15;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#multi-elizabeth {
    width: 100%;
    height: 100%;
    position: relative;
}

#single-elizabeth {
    cursor: pointer;
    z-index: 16;
}

.hidden {
    display: none !important;
}

.shake {
    animation: shake 0.1s infinite;
}

.pulse-effect {
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes jumpscare {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}

.tiny-head {
    position: absolute;
    top: 70px;
    left: 50%;
    width: 30px;
    height: 30px;
    background-image: url('/IMG_5294.gif');
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    z-index: 16;
    display: none;
}

.size-1 { 
    width: 50px;
    --width: 50px;
    top: 10%;
    left: 10%;
    --duration: 8s;
}

.size-2 {
    width: 100px;
    --width: 100px;
    top: 25%;
    --duration: 12s;
}

.size-3 {
    width: 150px;
    --width: 150px;
    top: 40%;
    --duration: 16s;
}

.size-4 {
    width: 120px;
    --width: 120px;
    top: 55%;
    --duration: 10s;
}

.size-5 {
    width: 80px;
    --width: 80px;
    top: 70%;
    --duration: 14s;
}

.size-6 {
    width: 200px;
    --width: 200px;
    top: 85%;
    --duration: 18s;
}

.size-7 {
    width: 30px;
    --width: 30px;
    top: 15%; 
    --duration: 10s; 
}

.elizabeth {
    position: absolute;
    animation: bounce-horizontal var(--duration) linear infinite;
}

@keyframes bounce-horizontal {
    0% {
        left: 0;
        transform: scaleX(1);
    }
    45% {
        left: calc(100% - var(--width));
        transform: scaleX(1);
    }
    50% {
        left: calc(100% - var(--width));
        transform: scaleX(-1);
    }
    95% {
        left: 0;
        transform: scaleX(-1);
    }
    100% {
        left: 0;
        transform: scale(1);
    }
}

#elizabeth-title {
    position: relative;
    z-index: 20;
    display: block;
}

#window4 {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#window5 {
    right: 200px;
    bottom: 100px;
    animation: swing2 9s infinite;
}

@media screen and (max-width: 768px) {
    #elizabeth-screen {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #multi-elizabeth {
        min-height: 150vh; 
        padding-bottom: 50px; 
    }
    
    .elizabeth {
        position: absolute;
        animation: bounce-horizontal var(--duration) linear infinite;
        max-width: 80%;
    }
}

/* Multiplayer cursors (rendered by script.js) */
/* @tweakable size of remote cursors in px */
:root { --remote-cursor-size: 18px; --remote-cursor-label-size: 12px; }

.remote-cursors-layer {
    position: fixed;
    inset: 0;
    pointer-events: none; /* don't block page interaction */
    z-index: 9999;
    mix-blend-mode: normal;
}

.remote-cursor {
    position: absolute;
    width: var(--remote-cursor-size);
    height: var(--remote-cursor-size);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform, left, top;
    transition: transform 80ms linear;
    border: 2px solid rgba(255,255,255,0.08);
}

.remote-cursor-label {
    position: absolute;
    top: calc(var(--remote-cursor-size) + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: var(--remote-cursor-label-size);
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

/* small-screen friendly label scaling */
@media (max-width:420px){
    :root { --remote-cursor-size: 14px; --remote-cursor-label-size: 11px; }
}