/* ===== HORROR DEUTSCH MODE STYLES ===== */

.horror-theme {
    --horror-bg: #09060d;
    --horror-card-bg: rgba(22, 13, 31, 0.85);
    --horror-red: #ef4444;
    --horror-dark-red: #991b1b;
    --horror-accent: #a855f7;
    --horror-border: rgba(239, 68, 68, 0.3);
    --horror-text: #f3f4f6;
    background-color: var(--horror-bg) !important;
    color: var(--horror-text) !important;
}

.horror-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Horror Hero Card */
.horror-hero-card {
    background: radial-gradient(circle at top, rgba(153, 27, 27, 0.25), rgba(9, 6, 13, 0.95)), var(--horror-card-bg);
    border: 1px solid var(--horror-border);
    border-radius: 20px;
    padding: 36px 24px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 68, 68, 0.15);
    position: relative;
    overflow: hidden;
}

.horror-hero-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--horror-red), transparent);
    animation: horror-glow 3s infinite alternate;
}

@keyframes horror-glow {
    0% { opacity: 0.3; }
    100% { opacity: 1; filter: drop-shadow(0 0 8px var(--horror-red)); }
}

.horror-title {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: #fff;
    text-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    margin-bottom: 8px;
}

.horror-subtitle {
    color: #d1d5db;
    font-size: 14px;
    margin-bottom: 24px;
}

/* Level Grid */
.horror-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.horror-level-card {
    background: var(--horror-card-bg);
    border: 1px solid var(--horror-border);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.horror-level-card:hover {
    transform: translateY(-4px);
    border-color: var(--horror-red);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.horror-level-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(239, 68, 68, 0.2);
    color: var(--horror-red);
    margin-bottom: 8px;
}

.horror-level-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.horror-level-desc {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.4;
}

/* Gameplay Effects */
.screen-shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(3px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
    40%, 60% { transform: translate3d(5px, 0, 0); }
}

.screen-flicker {
    animation: flicker 0.3s linear;
}

@keyframes flicker {
    0% { opacity: 1; }
    25% { opacity: 0.1; }
    50% { opacity: 0.8; }
    75% { opacity: 0.2; }
    100% { opacity: 1; }
}

.horror-timer-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 16px;
}

.horror-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #eab308, #ef4444);
    width: 100%;
    transition: width 0.1s linear;
}

.horror-hp-hearts {
    display: flex;
    gap: 6px;
    font-size: 20px;
}

/* Audio toggle floating btn */
.horror-sound-toggle {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--horror-border);
    color: #fff;
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Animated Game Canvas & Hero Avatar */
.horror-game-canvas-wrap {
    position: relative;
    width: 100%;
    height: 150px;
    background: #050308;
    border-radius: 16px;
    border: 1px solid var(--horror-border);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.9);
}

.horror-canvas-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0; left: 0;
    background: radial-gradient(circle at 70% 30%, rgba(153, 27, 27, 0.25), rgba(5, 3, 8, 0.95));
}

.horror-corridor-walls {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
                      linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}

.horror-character-sprite {
    position: absolute;
    bottom: 20px;
    font-size: 38px;
    transition: left 0.4s ease-out;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.8));
    user-select: none;
}

.horror-hero-avatar {
    left: 55%;
    animation: hero-walk 0.6s infinite alternate ease-in-out;
}

.horror-monster-avatar {
    left: 15%;
    animation: monster-stalk 0.8s infinite alternate ease-in-out;
    filter: drop-shadow(0 0 12px #ef4444);
}

.horror-door-avatar {
    right: 20px;
    bottom: 20px;
    position: absolute;
    font-size: 44px;
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.5));
}

@keyframes hero-walk {
    0% { transform: translateY(0) rotate(-3deg); }
    100% { transform: translateY(-6px) rotate(3deg); }
}

@keyframes monster-stalk {
    0% { transform: scale(1) translateY(0); filter: drop-shadow(0 0 8px #ef4444); }
    100% { transform: scale(1.1) translateY(-4px); filter: drop-shadow(0 0 18px #ef4444); }
}

.character-picker {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 20px 0;
}

.character-card {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 24px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    flex: 1;
    max-width: 200px;
}

.character-card:hover, .character-card.selected {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.15);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    transform: translateY(-3px);
}

/* ===== SCARY SCREEN BORDER OVERLAY (WRONG ANSWER ANIMATION) ===== */
.horror-scary-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    overflow: hidden;
}

.horror-scary-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Deep Blood-red Vignette Border pulse around screen edges */
.horror-scary-overlay .scary-vignette-border {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 130px 45px rgba(239, 68, 68, 0.85),
                inset 0 0 60px 25px rgba(153, 27, 27, 0.95),
                inset 0 0 220px 90px rgba(9, 6, 13, 0.9);
    animation: scary-vignette-pulse 0.35s ease-in-out infinite alternate;
}

@keyframes scary-vignette-pulse {
    0% {
        box-shadow: inset 0 0 100px 35px rgba(239, 68, 68, 0.75),
                    inset 0 0 50px 15px rgba(153, 27, 27, 0.85),
                    inset 0 0 180px 70px rgba(9, 6, 13, 0.85);
        filter: hue-rotate(0deg);
    }
    100% {
        box-shadow: inset 0 0 170px 70px rgba(220, 38, 38, 0.95),
                    inset 0 0 90px 35px rgba(185, 28, 28, 1),
                    inset 0 0 260px 110px rgba(0, 0, 0, 0.95);
        filter: hue-rotate(-15deg);
    }
}

/* Spooky floating corner spirits along the border */
.horror-scary-overlay .scary-corner {
    position: absolute;
    font-size: clamp(34px, 7vw, 60px);
    filter: drop-shadow(0 0 15px #ef4444) drop-shadow(0 0 30px #991b1b);
    user-select: none;
    animation: scary-spirit-creep 0.6s ease-in-out infinite alternate;
}

.horror-scary-overlay .scary-top-left {
    top: 15px;
    left: 20px;
    transform: rotate(-12deg);
}

.horror-scary-overlay .scary-top-right {
    top: 15px;
    right: 20px;
    transform: rotate(12deg);
}

.horror-scary-overlay .scary-bottom-left {
    bottom: 20px;
    left: 20px;
    transform: rotate(10deg);
}

.horror-scary-overlay .scary-bottom-right {
    bottom: 20px;
    right: 20px;
    transform: rotate(-10deg);
}

.horror-scary-overlay .scary-left-edge {
    top: 45%;
    left: 12px;
    animation-delay: 0.15s;
}

.horror-scary-overlay .scary-right-edge {
    top: 45%;
    right: 12px;
    animation-delay: 0.3s;
}

@keyframes scary-spirit-creep {
    0% {
        transform: scale(0.92) translate(0, 0);
        filter: drop-shadow(0 0 10px #ef4444);
    }
    100% {
        transform: scale(1.18) translate(5px, -5px);
        filter: drop-shadow(0 0 25px #ef4444) drop-shadow(0 0 45px #7f1d1d);
    }
}

