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

body {
    font-family: 'Arial', sans-serif;
    background: #000000;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Game View */
.game-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: #000000;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.key-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2001;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #8b0000;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.05em;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
    font-weight: bold;
}

/* Gray borders for backdoor level */
.backdoor-level .key-counter {
    border: 1px solid #505050;
    box-shadow: 0 0 10px rgba(80, 80, 80, 0.5);
}

.escape-message {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2001;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ffffff;
    padding: 0.75rem 1.5rem;
    font-size: 1.2rem;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.1em;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(255, 255, 255, 0.4);
    font-weight: bold;
    animation: escapeMessagePulse 2s ease-in-out infinite;
}

@keyframes escapeMessagePulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(255, 255, 255, 0.8),
            0 0 40px rgba(255, 255, 255, 0.4);
        border-color: #ffffff;
    }
    50% {
        box-shadow: 
            0 0 30px rgba(255, 255, 255, 1),
            0 0 60px rgba(255, 255, 255, 0.6),
            0 0 90px rgba(255, 255, 255, 0.3);
        border-color: #ffffff;
    }
}

.search-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2002;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #8b0000;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.1em;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.7);
    font-weight: bold;
    pointer-events: none;
}

.search-progress-bar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2002;
    width: 300px;
    height: 30px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #8b0000;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.7);
    overflow: hidden;
}

.search-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, 
        rgba(139, 0, 0, 0.9) 0%,
        rgba(255, 0, 0, 0.9) 50%,
        rgba(139, 0, 0, 0.9) 100%);
    box-shadow: 
        0 0 10px rgba(255, 0, 0, 0.6),
        inset 0 0 5px rgba(255, 0, 0, 0.3);
    transition: width 0.1s linear;
}

.game-ui {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2001;
}

.controls-hint {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #8b0000;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: #ffffff;
    text-align: center;
    letter-spacing: 0.05em;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
    margin-bottom: 1rem;
}

/* Gray borders for backdoor level */
.backdoor-level .controls-hint {
    border: 1px solid #505050;
    box-shadow: 0 0 10px rgba(80, 80, 80, 0.5);
}

/* Sprint Meter */
.sprint-meter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.sprint-meter-label {
    font-size: 0.8rem;
    color: #ffffff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(139, 0, 0, 0.5);
}

.sprint-meter {
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #8b0000;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 
        0 0 10px rgba(139, 0, 0, 0.5),
        inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.sprint-meter-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, 
        rgba(139, 0, 0, 0.9) 0%,
        rgba(255, 0, 0, 0.9) 50%,
        rgba(139, 0, 0, 0.9) 100%);
    box-shadow: 
        0 0 10px rgba(255, 0, 0, 0.6),
        inset 0 0 5px rgba(255, 0, 0, 0.3);
    transition: width 0.1s linear;
}

.sprint-meter-fill.sprint-low {
    background: linear-gradient(90deg, 
        rgba(100, 0, 0, 0.9) 0%,
        rgba(200, 0, 0, 0.9) 50%,
        rgba(100, 0, 0, 0.9) 100%);
    animation: sprintLowWarning 0.5s ease-in-out infinite;
    box-shadow: 
        0 0 15px rgba(255, 0, 0, 0.8),
        0 0 25px rgba(255, 0, 0, 0.4),
        inset 0 0 5px rgba(255, 0, 0, 0.3);
}

@keyframes sprintLowWarning {
    0%, 100% {
        opacity: 1;
        box-shadow: 
            0 0 15px rgba(255, 0, 0, 0.8),
            0 0 25px rgba(255, 0, 0, 0.4),
            inset 0 0 5px rgba(255, 0, 0, 0.3);
    }
    50% {
        opacity: 0.7;
        box-shadow: 
            0 0 20px rgba(255, 0, 0, 1),
            0 0 35px rgba(255, 0, 0, 0.6),
            inset 0 0 8px rgba(255, 0, 0, 0.5);
    }
}

/* Jumpscare Overlay */
.jumpscare-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: jumpscareFlash 0.1s ease-out;
}

.jumpscare-overlay.active {
    display: flex;
    animation: jumpscareAppear 0.2s ease-out, jumpscareFlash 2s ease-in-out infinite;
}

.jumpscare-content {
    text-align: center;
    animation: jumpscareShake 0.1s ease-in-out infinite;
}

.jumpscare-face {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    margin-bottom: 2rem;
    animation: jumpscarePulse 0.3s ease-in-out infinite;
}

.jumpscare-eye {
    width: 200px;
    height: 200px;
    background: #000000;
    border-radius: 50%;
    position: relative;
    box-shadow: 
        0 0 30px rgba(255, 0, 0, 0.8),
        0 0 60px rgba(255, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    animation: jumpscareEyePulse 0.4s ease-in-out infinite;
}

.jumpscare-pupil {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.5);
}

.jumpscare-text {
    font-size: 4rem;
    font-weight: bold;
    color: #ff0000;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    text-shadow: 
        0 0 10px #ff0000,
        0 0 20px #ff0000,
        0 0 30px #ff0000,
        0 0 40px #ff0000;
    animation: jumpscareTextPulse 0.5s ease-in-out infinite;
}

@keyframes jumpscareAppear {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes jumpscareFlash {
    0%, 100% {
        background: #000000;
    }
    50% {
        background: #1a0000;
    }
}

@keyframes jumpscareShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

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

@keyframes jumpscareEyePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 30px rgba(255, 0, 0, 0.8),
            0 0 60px rgba(255, 0, 0, 0.5),
            inset 0 0 20px rgba(0, 0, 0, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 
            0 0 50px rgba(255, 0, 0, 1),
            0 0 100px rgba(255, 0, 0, 0.7),
            inset 0 0 30px rgba(0, 0, 0, 0.7);
    }
}

@keyframes jumpscareTextPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

.title-screen {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.title-container {
    text-align: center;
    z-index: 2;
    animation: fadeIn 2s ease-in;
}

.device-warning {
    font-size: 0.75rem;
    color: #8b0000;
    opacity: 0.7;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(139, 0, 0, 0.5);
}

.title {
    font-size: 4.5rem;
    font-weight: bold;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 4rem;
    color: #8b0000;
    text-shadow: 
        0 0 10px #8b0000,
        0 0 20px #8b0000,
        0 0 30px #8b0000,
        0 0 40px #ff0000,
        0 0 70px #ff0000;
    animation: pulse 3s ease-in-out infinite;
    position: relative;
}

.title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, transparent 0%, rgba(139, 0, 0, 0.3) 100%);
    animation: flicker 4s infinite;
}

.menu-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.menu-btn {
    background: rgba(20, 20, 20, 0.8);
    border: 2px solid #8b0000;
    color: #ffffff;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 10px rgba(139, 0, 0, 0.5),
        inset 0 0 10px rgba(139, 0, 0, 0.2);
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.menu-btn:hover {
    border-color: #ff0000;
    color: #ff0000;
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.8),
        0 0 40px rgba(255, 0, 0, 0.4),
        inset 0 0 20px rgba(255, 0, 0, 0.2);
    transform: scale(1.05);
}

.menu-btn:hover::before {
    width: 300px;
    height: 300px;
}

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

.background-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(139, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(139, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(139, 0, 0, 0.05) 0%, transparent 50%);
    animation: breathe 8s ease-in-out infinite;
    z-index: 0;
}

.background-effects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(139, 0, 0, 0.03) 2px,
        rgba(139, 0, 0, 0.03) 4px
    );
    animation: scan 10s linear infinite;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 
            0 0 10px #8b0000,
            0 0 20px #8b0000,
            0 0 30px #8b0000,
            0 0 40px #ff0000,
            0 0 70px #ff0000;
    }
    50% {
        opacity: 0.85;
        text-shadow: 
            0 0 5px #8b0000,
            0 0 10px #8b0000,
            0 0 15px #8b0000,
            0 0 20px #ff0000,
            0 0 35px #ff0000;
    }
}

@keyframes flicker {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

@keyframes scan {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Instructions Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeInOverlay 0.4s ease-in;
}

.modal-box {
    background: rgba(10, 10, 10, 0.95);
    border: 3px solid #8b0000;
    border-radius: 8px;
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 0 30px rgba(139, 0, 0, 0.6),
        0 0 60px rgba(139, 0, 0, 0.4),
        inset 0 0 30px rgba(139, 0, 0, 0.2);
    animation: modalAppear 0.5s ease-out;
}

.modal-box::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 1px solid #ff0000;
    border-radius: 8px;
    opacity: 0.5;
    animation: borderPulse 2s ease-in-out infinite;
    pointer-events: none;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: 2px solid #8b0000;
    color: #ffffff;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
}

.close-btn:hover {
    border-color: #ff0000;
    color: #ff0000;
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.8),
        0 0 40px rgba(255, 0, 0, 0.4);
    transform: rotate(90deg) scale(1.1);
}

.close-btn:active {
    transform: rotate(90deg) scale(0.95);
}

.instructions-content {
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1.8;
    letter-spacing: 0.05em;
    text-align: justify;
    padding-top: 1rem;
    position: relative;
    max-height: calc(80vh - 4rem);
    overflow-y: auto;
}

.instructions-content p {
    margin: 0;
    text-shadow: 0 0 5px rgba(139, 0, 0, 0.3);
}

/* Mode Selection Modal */
.mode-selection-box {
    max-width: 500px;
    text-align: center;
}

.mode-selection-title {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8b0000;
    text-shadow: 
        0 0 10px #8b0000,
        0 0 20px #8b0000,
        0 0 30px #ff0000;
    margin-bottom: 2.5rem;
    animation: pulse 3s ease-in-out infinite;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.mode-btn {
    background: rgba(20, 20, 20, 0.8);
    border: 2px solid #8b0000;
    color: #ffffff;
    padding: 1.2rem 2rem;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 10px rgba(139, 0, 0, 0.5),
        inset 0 0 10px rgba(139, 0, 0, 0.2);
    width: 100%;
}

.mode-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.mode-btn:hover {
    border-color: #ff0000;
    color: #ff0000;
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.8),
        0 0 40px rgba(255, 0, 0, 0.4),
        inset 0 0 20px rgba(255, 0, 0, 0.2);
    transform: scale(1.05);
}

.mode-btn:hover::before {
    width: 300px;
    height: 300px;
}

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

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

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes borderPulse {
    0%, 100% {
        opacity: 0.3;
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
    }
}

/* Victory Overlay */
.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: victoryFadeIn 0.5s ease-in;
}

.victory-overlay.active {
    display: flex;
}

.victory-content {
    text-align: center;
    animation: victoryAppear 0.8s ease-out;
}

.victory-title {
    font-size: 5rem;
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin-bottom: 2rem;
    text-shadow: 
        0 0 10px #ffffff,
        0 0 20px #ffffff,
        0 0 30px #ffffff,
        0 0 40px #ffffff,
        0 0 70px #ffffff;
    animation: victoryTitlePulse 2s ease-in-out infinite;
}

.victory-text {
    font-size: 2rem;
    color: #ffffff;
    letter-spacing: 0.2em;
    margin-bottom: 3rem;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.5);
}

.victory-btn {
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid #ffffff;
    color: #ffffff;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.5),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.victory-btn:hover {
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.8),
        0 0 60px rgba(255, 255, 255, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

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

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

@keyframes victoryAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.1) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes victoryTitlePulse {
    0%, 100% {
        text-shadow: 
            0 0 10px #ffffff,
            0 0 20px #ffffff,
            0 0 30px #ffffff,
            0 0 40px #ffffff,
            0 0 70px #ffffff;
    }
    50% {
        text-shadow: 
            0 0 20px #ffffff,
            0 0 40px #ffffff,
            0 0 60px #ffffff,
            0 0 80px #ffffff,
            0 0 120px #ffffff;
    }
}

/* Story Overlay */
.story-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    pointer-events: none;
}

.story-overlay.active {
    display: flex;
    animation: storyFadeIn 1s ease-in forwards;
    pointer-events: all;
}

.story-content {
    max-width: 800px;
    width: 90%;
    padding: 3rem;
    text-align: center;
    color: #ffffff;
}

.story-text {
    font-size: 1.3rem;
    line-height: 1.8;
    letter-spacing: 0.05em;
    margin-bottom: 3rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    opacity: 0;
    animation: storyTextFadeIn 0.7s ease-in 0.4s forwards;
}

.story-continue {
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8b0000;
    text-shadow: 
        0 0 10px #8b0000,
        0 0 20px #8b0000;
    cursor: pointer;
    opacity: 0;
    animation: storyContinueFadeIn 0.6s ease-in 1.0s forwards, storyContinuePulse 2s ease-in-out 2s infinite;
    transition: all 0.3s ease;
}

.story-continue:hover {
    color: #ff0000;
    text-shadow: 
        0 0 15px #ff0000,
        0 0 30px #ff0000;
    transform: scale(1.05);
}

@keyframes storyFadeIn {
    from {
        background: rgba(0, 0, 0, 0);
    }
    to {
        background: rgba(0, 0, 0, 1);
    }
}

@keyframes storyTextFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes storyContinuePulse {
    0%, 100% {
        text-shadow: 
            0 0 10px #8b0000,
            0 0 20px #8b0000;
    }
    50% {
        text-shadow: 
            0 0 20px #8b0000,
            0 0 40px #8b0000;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
        letter-spacing: 0.2em;
        margin-bottom: 3rem;
    }
    
    .menu-buttons {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .menu-btn {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }

    .modal-box {
        padding: 2rem 1.5rem;
        max-width: 90%;
    }

    .instructions-content {
        font-size: 1rem;
        line-height: 1.6;
    }

    .close-btn {
        top: 0.5rem;
        right: 0.5rem;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }

    .mode-selection-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .mode-btn {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    .escape-message {
        font-size: 1rem;
        padding: 0.5rem 1rem;
        top: 70px;
    }

    .victory-title {
        font-size: 3rem;
        letter-spacing: 0.2em;
    }

    .victory-text {
        font-size: 1.5rem;
    }
}

