@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;700;900&display=swap');

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

:root {
    --steel-grey: #2a2a2a;
    --desaturated-blue: #3a3f4a;
    --rain-grey: #4a4a4a;
    --lightning: #c0c0c0;
    --blood-red: #8b0000;
    --film-grain: rgba(0, 0, 0, 0.03);
}

body {
    min-height: 100vh;
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    font-family: 'Noto Serif JP', serif;
    overflow: hidden;
    position: relative;
}

/* Film Grain Overlay */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.15;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    animation: grain 0.5s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-1%, -1%); }
    20% { transform: translate(1%, 1%); }
    30% { transform: translate(-1%, 1%); }
    40% { transform: translate(1%, -1%); }
    50% { transform: translate(-1%, 0%); }
    60% { transform: translate(1%, 0%); }
    70% { transform: translate(0%, 1%); }
    80% { transform: translate(0%, -1%); }
    90% { transform: translate(1%, 1%); }
}

/* Rain Effect */
.rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.rain-drop {
    position: absolute;
    width: 1px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(200, 200, 200, 0.4), transparent);
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

/* Lightning Flash */
.lightning-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 90;
    transition: opacity 0.05s ease-out;
}

.lightning-flash.active {
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0% { opacity: 0; }
    10% { opacity: 0.3; }
    20% { opacity: 0; }
    30% { opacity: 0.2; }
    40% { opacity: 0; }
    100% { opacity: 0; }
}

/* Main Container */
.cinema-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Scene Frame */
.scene-frame {
    position: relative;
    width: 80vmin;
    height: 80vmin;
    max-width: 600px;
    max-height: 600px;
    border: 3px solid rgba(100, 100, 100, 0.3);
    box-shadow: 
        0 0 100px rgba(0, 0, 0, 0.8),
        inset 0 0 100px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

/* Subject Container */
.subject-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.subject-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: 
        grayscale(60%) 
        contrast(1.2) 
        brightness(0.8)
        sepia(20%)
        saturate(0.6);
    transform: scale(1.1);
    transition: all 0.3s ease;
}

.subject-image.clash {
    filter: 
        grayscale(40%) 
        contrast(1.5) 
        brightness(0.9)
        sepia(10%)
        saturate(0.8);
    transform: scale(1.15);
    transition: all 0.1s ease;
}

/* Samurai Overlay */
.samurai-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(139, 0, 0, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(0, 0, 0, 0.4) 0%, transparent 50%);
    pointer-events: none;
    mix-blend-mode: multiply;
}

/* Shadow Overlay */
.shadow-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
    pointer-events: none;
}

/* Atmosphere Layers */
.atmosphere {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.mist-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 50% 100%, rgba(200, 200, 200, 0.05) 0%, transparent 60%);
    animation: mist 8s ease-in-out infinite;
}

@keyframes mist {
    0%, 100% { opacity: 0.3; transform: translateX(0); }
    50% { opacity: 0.6; transform: translateX(20px); }
}

.rain-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 3px
    );
    animation: rain-sheen 0.5s linear infinite;
}

@keyframes rain-sheen {
    to { transform: translateX(3px); }
}

/* Lightning Bolts */
.lightning-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
}

.lightning-container.active {
    opacity: 1;
}

.lightning-bolt {
    position: absolute;
    background: linear-gradient(to bottom, transparent, rgba(200, 200, 220, 0.8), transparent);
    filter: blur(2px);
    opacity: 0;
}

.lightning-1 {
    width: 3px;
    height: 60%;
    top: 10%;
    left: 30%;
    transform: rotate(5deg);
    animation: lightning-strike 0.3s ease-out;
}

.lightning-2 {
    width: 2px;
    height: 40%;
    top: 20%;
    right: 25%;
    transform: rotate(-3deg);
    animation: lightning-strike 0.3s ease-out 0.1s;
}

@keyframes lightning-strike {
    0% { opacity: 0; height: 0; }
    20% { opacity: 1; height: 100%; }
    40% { opacity: 0.5; }
    60% { opacity: 1; }
    100% { opacity: 0; }
}

/* Cinematic Text */
.cinematic-text {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 50;
    opacity: 0;
    animation: fade-in 3s ease-out 1s forwards;
}

@keyframes fade-in {
    to { opacity: 1; }
}

.title {
    font-size: 8rem;
    font-weight: 900;
    color: rgba(200, 200, 200, 0.9);
    text-shadow: 
        0 0 20px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(139, 0, 0, 0.3);
    letter-spacing: 0.5em;
    margin-bottom: 0.2em;
    filter: blur(0.5px);
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(180, 180, 180, 0.7);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-weight: 400;
}

/* Controls */
.controls {
    position: absolute;
    bottom: 5%;
    z-index: 200;
}

.clash-btn {
    padding: 15px 40px;
    font-family: 'Noto Serif JP', serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    background: transparent;
    color: rgba(200, 200, 200, 0.9);
    border: 2px solid rgba(139, 0, 0, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.clash-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 0, 0, 0.3), transparent);
    transition: left 0.5s ease;
}

.clash-btn:hover::before {
    left: 100%;
}

.clash-btn:hover {
    border-color: rgba(139, 0, 0, 0.9);
    box-shadow: 0 0 30px rgba(139, 0, 0, 0.4);
    text-shadow: 0 0 10px rgba(139, 0, 0, 0.5);
}

.clash-btn:active {
    transform: scale(0.95);
}

/* Blade Slash Effect */
.blade-slash {
    position: fixed;
    top: 50%;
    left: -100%;
    width: 200%;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 20%,
        rgba(255, 255, 255, 0.9) 45%,
        rgba(255, 255, 255, 1) 50%,
        rgba(255, 255, 255, 0.9) 55%,
        rgba(255, 255, 255, 0.1) 80%,
        transparent 100%
    );
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(200, 200, 255, 0.6),
        0 0 60px rgba(139, 0, 0, 0.4);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transform: rotate(-15deg);
}

.blade-slash.active {
    animation: slash 0.15s ease-out forwards;
}

@keyframes slash {
    0% {
        left: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    50% {
        left: 0%;
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Speed Lines */
.speed-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 400;
    opacity: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 12px
    );
}

.speed-lines.active {
    animation: speed-burst 0.2s ease-out forwards;
}

@keyframes speed-burst {
    0% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 0;
        transform: scale(1.05);
    }
}

/* Screen Shake */
.shake {
    animation: screen-shake 0.3s ease-out;
}

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

/* Responsive */
@media (max-width: 768px) {
    .title {
        font-size: 5rem;
    }
    .subtitle {
        font-size: 0.9rem;
    }
    .scene-frame {
        width: 90vmin;
        height: 90vmin;
    }
}