.scene {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-size: cover;
    background-position: center;
}

.scene-prologue {
    background: linear-gradient(180deg, #2a1a1a 0%, #1a1a1a 100%);
}

.scene-apartment {
    background: linear-gradient(180deg, #1a1a0a 0%, #0a0a0a 100%);
}

.scene-door {
    background: radial-gradient(circle, #2a2a2a 0%, #0a0a0a 100%);
}

.scene-murder {
    background: radial-gradient(circle, #3a0a0a 0%, #0a0000 100%);
    animation: murder-pulse 2s ease-in-out infinite;
}

@keyframes murder-pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(0.8); }
}

.scene-content {
    width: 100%;
    padding: 0;
    padding-top: calc(38px + var(--safe-area-inset-top, 0px));
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

@media (min-width: 768px) {
    .scene-content {
       
    }
}

.scene-image {
    width: 100%;
    max-width: 600px;
    height: 400px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 10px;
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    font-size: 1.2rem;
}

.scene-image-fullscreen {
    max-width: 100%;
    height: 100%;
    margin: 0;
    margin-top: calc(-38px - var(--safe-area-inset-top, 0px));
    border: none;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6rem;
}

@media (min-width: 768px) {
    .scene-image-fullscreen {
     }
}

.scene-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.scene-text-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 60%;
    max-height: 70%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #d4d4d4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.75);
    padding: 2rem;
    border-radius: 10px;
    overflow-y: auto;
    cursor: pointer;
}

.scene-text-overlay.prologue-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.scene-text-overlay::-webkit-scrollbar {
    width: 6px;
}

.scene-text-overlay::-webkit-scrollbar-track {
    background: transparent;
}

.scene-text-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

@media (max-width: 768px) {
    .scene-text-overlay {
        width: 90%;
        max-height: 80%;
        font-size: 1rem;
        padding: 1.5rem;
    }
}

.prologue-line {
    margin-bottom: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease-in;
    min-height: 1.8em;
}

.prologue-line.typing {
    border-right: 2px solid rgba(255, 255, 255, 0.7);
    animation: cursor-blink 0.8s infinite;
}

@keyframes cursor-blink {
    0%, 50% { border-right-color: rgba(255, 255, 255, 0.7); }
    51%, 100% { border-right-color: transparent; }
}

.prologue-skip-hint {
    position: sticky;
    bottom: 0;
    text-align: right;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    transition: opacity 0.5s ease;
    pointer-events: none;
    padding-top: 1rem;
    margin-top: auto;
}

.prologue-skip-hint.hidden {
    opacity: 0;
}

.prologue-red {
    color: #ff4444;
    font-weight: bold;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.prologue-ominous {
    color: #cc8888;
    font-style: italic;
    text-shadow: 0 0 8px rgba(139, 0, 0, 0.6), 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.prologue-ironic {
    color: #aaaaaa;
    font-style: italic;
}

.prologue-soft {
    color: #bbbbbb;
    font-size: 1.1rem;
    font-style: italic;
}

.prologue-whisper {
    color: #999999;
    font-size: 1rem;
    font-style: italic;
    opacity: 0.8;
}

.day0-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 1s ease-in;
}

.day0-modal-content {
    width: 80%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #8b0000;
    border-radius: 10px;
    padding: 3rem;
    padding-top: calc(3rem + var(--safe-area-inset-top, 0px));
    padding-bottom: calc(3rem + var(--safe-area-inset-bottom, 0px));
    text-align: center;
    transition: all 0.6s ease-in-out;
}

.day0-modal-content * {
    transition: all 0.6s ease-in-out;
}

.day0-text-container {
    min-height: 300px;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .day0-modal-content {
        width: 95%;
        padding: 1.5rem;
        padding-top: calc(1.5rem + var(--safe-area-inset-top, 0px));
        padding-bottom: calc(1.5rem + var(--safe-area-inset-bottom, 0px));
    }
    
    .day0-text-container {
        min-height: 200px;
        margin-bottom: 1rem;
        font-size: 0.9rem;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.scene-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #d4d4d4;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.scene-text.large {
    font-size: 2rem;
    color: #ff0000;
    font-weight: bold;
}

.door-container {
    width: 100%;
    height: calc(var(--vh, 1vh) * 100);
    background: linear-gradient(180deg, #3d2a1f 0%, #2a1f1a 50%, #3d2a1f 100%);
    border: 30px solid #1a1410;
    box-shadow: 
        inset 0 0 80px rgba(0, 0, 0, 0.6),
        inset 0 0 120px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 250px;
}

.door-container::before {
    content: '';
    position: absolute;
    top: 8%;
    left: 10%;
    right: 10%;
    height: 25%;
    border: 4px solid rgba(90, 60, 40, 0.4);
    border-radius: 8px;
    box-shadow: inset 0 3px 15px rgba(0, 0, 0, 0.4);
}

.door-container::after {
    content: '';
    position: absolute;
    bottom: 8%;
    left: 10%;
    right: 10%;
    height: 25%;
    border: 4px solid rgba(90, 60, 40, 0.4);
    border-radius: 8px;
    box-shadow: inset 0 3px 15px rgba(0, 0, 0, 0.4);
}

.peephole-view {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 15, 15, 0.9) 0%, rgba(0, 0, 0, 1) 80%);
    border: 10px solid #0a0a0a;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.9), 0 0 25px rgba(139, 0, 0, 0.3);
    z-index: 2;
}

@media (max-width: 768px) {
    .peephole-view {
        width: 95px;
        height: 95px;
        border: 5px solid #0a0a0a;
    }
    
    .door-container {
        padding-bottom: 280px;
    }
    
    .peephole-character .spinner {
        width: 60px;
        height: 60px;
        border-width: 4px;
    }
    
    .peephole-character p {
        font-size: 0.7rem;
        bottom: 15px;
    }
    
    .action-btn {
        padding: 1rem 0.8rem;
        min-height: 44px;
        font-size: 0.9rem;
    }
}

.peephole-character {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #d4d4d4;
    overflow: hidden;
    position: relative;
    animation: peephole-sway 3s ease-in-out infinite;
}

.peephole-character::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(80, 80, 60, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 80% 70%, rgba(60, 60, 50, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(40, 40, 30, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 30% 80%, rgba(70, 70, 55, 0.12) 0%, transparent 20%),
        radial-gradient(circle at 70% 20%, rgba(50, 50, 40, 0.18) 0%, transparent 35%);
    backdrop-filter: blur(0.5px) brightness(0.9) contrast(1.1);
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: multiply;
}

@keyframes peephole-sway {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(1px, -1px);
    }
    50% {
        transform: translate(-1px, 1px);
    }
    75% {
        transform: translate(1px, 1px);
    }
}

.peephole-character .spinner {
    width: 140px;
    height: 140px;
    border: 6px solid rgba(139, 0, 0, 0.15);
    border-top-color: #8b0000;
    border-right-color: rgba(139, 0, 0, 0.6);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    box-shadow: 0 0 25px rgba(139, 0, 0, 0.5), inset 0 0 15px rgba(139, 0, 0, 0.2);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.peephole-character p {
    position: absolute;
    bottom: 40px;
    text-align: center;
    color: #e0e0e0;
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: 0 0 15px rgba(139, 0, 0, 0.7), 0 2px 4px rgba(0, 0, 0, 0.8);
    max-width: 80%;
    letter-spacing: 0.5px;
}

.guest-avatar-door {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    animation: fadeInAvatar 1.5s ease-in forwards;
    border-radius: 50%;
}

@keyframes fadeInAvatar {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.apartment-view {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 1rem;
    padding: 1rem;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .apartment-view {
        grid-template-columns: repeat(2, 1fr);
    }
}

.room {
    position: relative;
    border: 2px solid #555;
    background: rgba(40, 40, 30, 0.8);
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    box-sizing: border-box;
}

.room:hover {
    border-color: #8b0000;
}

.room-bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0.5;
    z-index: 0;
}

.room-name {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    font-size: 0.9rem;
    z-index: 1;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}


.guest-list {
    
    width: 100%;
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(var(--vh, 1vh) * 80);
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    min-height: 0;
}

.scrollable-content::-webkit-scrollbar {
    width: 8px;
}

.scrollable-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.scrollable-content::-webkit-scrollbar-thumb {
    background: #8b0000;
    border-radius: 4px;
}

.action-buttons {
    display: flex;
    gap: 0.3rem;
    justify-content: center;
    margin-top: 0.5rem;
    padding: 0.5rem;
}

.action-btn {
    min-width: 70px;
    padding: 0.6rem 0.7rem;
    font-size: 0.85rem;
}

.room-search-single {
    width: 100%;
    margin: 1rem auto;
    display: flex;
    justify-content: center;
}

.room-search-single .room {
    height: calc(var(--vh, 1vh) * 85);
    aspect-ratio: 1 / 1;
    width: auto;
}

.room-search-results {
    max-width: 865px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(30, 30, 20, 0.9);
    border: 2px solid #555;
    border-radius: 10px;
    text-align: left;
}

.found-item {
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(60, 60, 40, 0.6);
    border-left: 3px solid #8b0000;
    color: #d4d4d4;
    font-size: 1.1rem;
}

.room-guest-card {
    padding: 0.8rem;
    margin: 0.5rem 0;
    background: rgba(80, 60, 40, 0.6);
    border: 1px solid #666;
    color: #ffcc88;
    border-radius: 5px;
}

.found-clue {
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 5px;
    font-size: 1rem;
    line-height: 1.5;
}

.clue-suspicious {
    background: rgba(139, 0, 0, 0.3);
    border-left: 3px solid #ff4444;
    color: #ffcccc;
}

.clue-normal {
    background: rgba(60, 60, 40, 0.4);
    border-left: 3px solid #888;
    color: #d4d4d4;
}

.murder-notice {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(20, 10, 10, 0.9);
    border: 3px solid #8b0000;
    border-radius: 10px;
    text-align: left;
}

.murder-icon {
    font-size: 5rem;
    text-align: center;
    margin-bottom: 1rem;
    animation: skull-shake 1s ease-in-out infinite;
}

@keyframes skull-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.murder-survivor-avatar {
    text-align: center;
    margin: 1.5rem 0;
}

.murder-survivor-avatar img {
    width: 150px;
    object-fit: cover;
}

.murder-text {
    color: #d4d4d4;
}

.madness-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 90%;
    max-width: 800px;
    text-align: center;
}

.news-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: newsModalFadeIn 0.3s ease-out;
}

@keyframes newsModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.news-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid rgba(100, 180, 255, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    height: auto;
    max-height: 85vh;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(100, 180, 255, 0.1);
    animation: newsContentSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes newsContentSlideUp {
    from {
        transform: translateY(50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.news-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.news-bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    max-height: 80%;
    overflow-y: auto;
    text-align: center;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.6;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.8);
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    animation: newsTextFadeIn 0.6s ease-out 0.3s backwards;
}

@keyframes newsTextFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.news-close-btn {
    display: block;
    width: calc(100% - 2rem);
    margin: 1rem;
    padding: 0.8rem 1.5rem;
    background: #8b0000;
    border: none;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
}

.news-close-btn:hover {
    background: #a00000;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.5);
}

.news-close-btn:active {
    transform: scale(0.98);
}

.news-modal.closing {
    animation: newsModalFadeOut 0.4s ease-in forwards;
}

@keyframes newsModalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.news-modal.closing .news-modal-content {
    animation: newsContentSlideOut 0.4s ease-in forwards;
}

@keyframes newsContentSlideOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(30px) scale(0.9);
        opacity: 0;
    }
}

@media (max-width: 600px) {
    .news-modal {
        padding: 0;
    }
    
    .news-modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        display: flex;
        flex-direction: column;
    }
    
    .news-video-container {
        border-radius: 0;
        flex: 1;
        aspect-ratio: unset;
    }
    
    .news-text-overlay {
        font-size: 0.9rem;
        width: 90%;
        max-height: 80%;
        line-height: 1.5;
        padding: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .news-close-btn {
        flex-shrink: 0;
        margin: 1rem;
        padding: 1rem;
        font-size: 1.1rem;
    }
}
.jumpscare-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    opacity: 0;
    animation: jumpscare-effect 3s ease-out forwards;
}

@keyframes jumpscare-effect {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(3);
    }
}

