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

body {
    min-height: 100vh;
    background: #0a0a0a;
    font-family: 'Courier New', monospace;
    overflow-x: hidden;
    position: relative;
}

/* Background Image with Breathing Effect */
.bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: url('bomb_bg.png') center/cover no-repeat;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
    animation: breathe 4s ease-in-out infinite;
}

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

/* CRT Scanline Effect - Top Layer */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.12),
        rgba(0, 0, 0, 0.12) 1px,
        transparent 1px,
        transparent 3px
    );
    animation: scanlineMove 10s linear infinite;
}

.crt-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(255, 0, 0, 0.03) 0%,
        transparent 50%,
        rgba(0, 255, 0, 0.03) 100%
    );
    animation: chromaticShift 0.1s infinite;
}

@keyframes scanlineMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(6px); }
}

@keyframes chromaticShift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(1px); }
}

/* CRT Flicker Overlay */
.flicker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.08);
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    animation: flicker 0.12s infinite;
}

@keyframes flicker {
    0% { opacity: 0.02; }
    5% { opacity: 0.05; }
    10% { opacity: 0.02; }
    15% { opacity: 0.04; }
    20% { opacity: 0.01; }
    25% { opacity: 0.04; }
    30% { opacity: 0.02; }
    35% { opacity: 0.05; }
    40% { opacity: 0.02; }
    45% { opacity: 0.04; }
    50% { opacity: 0.02; }
    55% { opacity: 0.05; }
    60% { opacity: 0.02; }
    65% { opacity: 0.04; }
    70% { opacity: 0.02; }
    75% { opacity: 0.04; }
    80% { opacity: 0.02; }
    85% { opacity: 0.05; }
    90% { opacity: 0.02; }
    95% { opacity: 0.04; }
    100% { opacity: 0.02; }
}

/* Contained Explosion Flash (behind bomb) */
.explosion-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 235, 59, 0.9) 0%, rgba(255, 152, 0, 0.6) 30%, rgba(255, 0, 0, 0) 70%);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
}

.explosion-flash.active {
    animation: explosionFlash 0.2s ease-out forwards;
}

@keyframes explosionFlash {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}

/* Mini-Bomb Chaos Layer */
.mini-bomb-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.mini-bomb {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.mini-bomb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Size variants */
.mini-bomb.tiny { filter: blur(0.5px); }
.mini-bomb.small { filter: blur(0.3px); }
.mini-bomb.medium { filter: none; }
.mini-bomb.large { filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.3)); }
.mini-bomb.xlarge { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4)); }

.mini-bomb.spawning {
    animation: miniBombSpawn 0.8s ease-out forwards;
}

.mini-bomb.idling {
    animation: miniBombIdle var(--idle-duration, 4s) ease-in-out;
}

.mini-bomb.detonating {
    animation: miniBombDetonate 0.5s ease-out forwards;
}

/* Tiny bombs - fast, subtle movement */
.mini-bomb.tiny.idling {
    animation: miniBombIdleTiny var(--idle-duration, 3s) ease-in-out;
}

/* Large bombs - slower, more dramatic movement */
.mini-bomb.large.idling,
.mini-bomb.xlarge.idling {
    animation: miniBombIdleLarge var(--idle-duration, 5s) ease-in-out;
}

@keyframes miniBombSpawn {
    0% { opacity: 0; transform: scale(0.3); }
    100% { transform: scale(1); }
}

@keyframes miniBombIdle {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(6px, -10px) rotate(6deg); }
    50% { transform: translate(-4px, 6px) rotate(-4deg); }
    75% { transform: translate(10px, 4px) rotate(10deg); }
}

@keyframes miniBombIdleTiny {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(8px, -12px) rotate(15deg); }
    66% { transform: translate(-6px, 8px) rotate(-10deg); }
}

@keyframes miniBombIdleLarge {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(4px, -6px) rotate(3deg); }
    50% { transform: translate(-3px, 4px) rotate(-2deg); }
    75% { transform: translate(6px, 3px) rotate(4deg); }
}

@keyframes miniBombDetonate {
    0% { 
        transform: scale(1);
        filter: brightness(1);
    }
    30% {
        filter: brightness(1.5) sepia(0.5) hue-rotate(-20deg) saturate(2);
    }
    50% { 
        transform: scale(1.5);
        filter: brightness(2) sepia(0.8) hue-rotate(-40deg) saturate(3) drop-shadow(0 0 20px rgba(255, 0, 0, 0.8));
    }
    100% { 
        opacity: 0; 
        transform: scale(1.8);
        filter: brightness(3);
    }
}

/* Tiny bomb detonation - faster */
.mini-bomb.tiny.detonating {
    animation: miniBombDetonateTiny 0.3s ease-out forwards;
}

@keyframes miniBombDetonateTiny {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(2); filter: brightness(2) sepia(0.6) saturate(2); }
    100% { opacity: 0; transform: scale(2.5); filter: brightness(3); }
}

/* Large bomb detonation - more dramatic */
.mini-bomb.large.detonating,
.mini-bomb.xlarge.detonating {
    animation: miniBombDetonateLarge 0.7s ease-out forwards;
}

@keyframes miniBombDetonateLarge {
    0% { 
        transform: scale(1);
        filter: brightness(1) drop-shadow(0 0 10px rgba(255, 100, 0, 0.5));
    }
    30% {
        transform: scale(1.2);
        filter: brightness(1.8) sepia(0.6) hue-rotate(-30deg) saturate(2.5) drop-shadow(0 0 30px rgba(255, 50, 0, 0.8));
    }
    60% { 
        transform: scale(1.4);
        filter: brightness(2.5) sepia(0.9) hue-rotate(-50deg) saturate(4) drop-shadow(0 0 50px rgba(255, 0, 0, 1));
    }
    100% { 
        opacity: 0; 
        transform: scale(1.6);
        filter: brightness(4);
    }
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Bomb Image Container */
.bomb-container {
    position: relative;
    margin-bottom: 40px;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bomb-image {
    width: 280px;
    height: 280px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    transition: all 0.1s;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    will-change: transform, filter;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Bomb Animation States */
.bomb-image.tension {
    animation: tensionPhase 3s ease-in-out;
}

.bomb-image.detonating {
    animation: detonatePhase 0.3s ease-out forwards;
}

.bomb-image.void {
    opacity: 0;
    transform: scale(2);
    filter: brightness(2);
}

.bomb-image.respawning {
    animation: respawnPhase 0.5s ease-out forwards;
}

.bomb-image.chromatic {
    animation: chromaticAberration 0.3s ease-out;
}

@keyframes tensionPhase {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    }
    25% { 
        transform: translateY(-10px) rotate(-1deg) scale(1.02);
        filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.7));
    }
    50% { 
        transform: translateY(-5px) rotate(1deg) scale(1);
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 0.6));
    }
    75% { 
        transform: translateY(-15px) rotate(-2deg) scale(1.03);
        filter: drop-shadow(0 0 35px rgba(255, 215, 0, 0.8));
    }
}

@keyframes detonatePhase {
    0% { 
        transform: scale(1);
        filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.8)) brightness(1);
    }
    30% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 60px rgba(255, 100, 0, 1)) brightness(1.5) sepia(0.5) hue-rotate(-30deg);
    }
    60% {
        transform: scale(1.3);
        filter: drop-shadow(0 0 100px rgba(255, 0, 0, 1)) brightness(2) sepia(0.8) hue-rotate(-50deg) saturate(2);
    }
    100% { 
        transform: scale(2);
        opacity: 0;
        filter: brightness(3) sepia(1) hue-rotate(-60deg);
    }
}

@keyframes respawnPhase {
    0% {
        opacity: 0;
        transform: scale(0.1);
        filter: brightness(2) contrast(2);
    }
    30% {
        opacity: 0.3;
        transform: scale(0.5);
        filter: brightness(1.5) contrast(1.5);
    }
    60% {
        opacity: 0.7;
        transform: scale(1.1);
        filter: brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
    }
}

@keyframes chromaticAberration {
    0% {
        filter: drop-shadow(-3px 0 0 rgba(255, 0, 0, 0.5)) 
                drop-shadow(3px 0 0 rgba(0, 255, 255, 0.5));
    }
    25% {
        filter: drop-shadow(3px 0 0 rgba(255, 0, 0, 0.5)) 
                drop-shadow(-3px 0 0 rgba(0, 255, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 -3px 0 rgba(255, 0, 0, 0.5)) 
                drop-shadow(0 3px 0 rgba(0, 255, 255, 0.5));
    }
    75% {
        filter: drop-shadow(-2px 2px 0 rgba(255, 0, 0, 0.5)) 
                drop-shadow(2px -2px 0 rgba(0, 255, 255, 0.5));
    }
    100% {
        filter: drop-shadow(0 0 0 transparent);
    }
}

/* Fuse Spark Effect */
.fuse-spark {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffff00;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffff00, 0 0 20px #ff6600;
    pointer-events: none;
    opacity: 0;
}

.fuse-spark.active {
    animation: sparkBurst 0.1s ease-out;
}

@keyframes sparkBurst {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 1; transform: scale(2); box-shadow: 0 0 20px #ffff00, 0 0 40px #ff6600; }
    100% { opacity: 0; transform: scale(0.5); }
}

/* Smoke Effect */
.smoke {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(100,100,100,0.6) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

.smoke.active {
    animation: smokeRise 1s ease-out forwards;
}

@keyframes smokeRise {
    0% { 
        opacity: 0.6;
        transform: translateY(0) scale(0.5);
    }
    100% { 
        opacity: 0;
        transform: translateY(-100px) scale(2);
    }
}

/* Hazard Tape Strip at top */
.hazard-tape {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: repeating-linear-gradient(
        45deg,
        #ffd700 0px,
        #ffd700 20px,
        #000 20px,
        #000 40px
    );
    z-index: 100;
}

.hazard-tape-bottom {
    top: auto;
    bottom: 0;
}

/* Buttons Grid */
.buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 600px;
}

/* Hazard Button Base */
.hazard-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 30px;
    background: #1a1a1a;
    border: 4px solid #000;
    color: #ffd700;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    text-decoration: none;
    transform: skewX(-5deg);
    transition: all 0.1s ease;
    animation: btnWiggle 4s ease-in-out infinite;
    overflow: hidden;
    min-height: 70px;
}

.hazard-btn:nth-child(1) { animation-delay: 0s; }
.hazard-btn:nth-child(2) { animation-delay: 0.5s; }
.hazard-btn:nth-child(3) { animation-delay: 1s; }
.hazard-btn:nth-child(4) { animation-delay: 1.5s; }

@keyframes btnWiggle {
    0%, 90%, 100% { transform: skewX(-5deg) translateY(0); }
    92% { transform: skewX(-5deg) translateY(-3px); }
    94% { transform: skewX(-5deg) translateY(2px); }
    96% { transform: skewX(-5deg) translateY(-2px); }
    98% { transform: skewX(-5deg) translateY(1px); }
}

/* Button Content (unskew text) */
.btn-content {
    display: flex;
    align-items: center;
    gap: 12px;
    transform: skewX(5deg);
}

/* Hover Effects */
.hazard-btn:hover {
    animation: btnShake 0.3s ease-in-out infinite;
    background: linear-gradient(90deg, #ffd700 0%, #ff0000 50%, #ffd700 100%);
    background-size: 200% 100%;
    animation: btnShake 0.3s ease-in-out infinite, flashRed 0.2s ease-in-out infinite;
    border-color: #ff0000;
    color: #000;
}

/* Active/Press Down Effect */
.hazard-btn:active {
    transform: skewX(-5deg) translateY(4px) scale(0.98);
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.5);
}

.hazard-btn:active .btn-content {
    transform: skewX(5deg) translateY(2px);
}

@keyframes btnShake {
    0% { transform: skewX(-5deg) translate(0, 0) rotate(0deg); }
    20% { transform: skewX(-5deg) translate(-3px, 2px) rotate(-2deg); }
    40% { transform: skewX(-5deg) translate(3px, -2px) rotate(2deg); }
    60% { transform: skewX(-5deg) translate(-2px, -3px) rotate(-1deg); }
    80% { transform: skewX(-5deg) translate(2px, 3px) rotate(1deg); }
    100% { transform: skewX(-5deg) translate(0, 0) rotate(0deg); }
}

@keyframes flashRed {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Caution Strip Border on Hover */
.hazard-btn::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: repeating-linear-gradient(
        45deg,
        #ffd700 0px,
        #ffd700 10px,
        #000 10px,
        #000 20px
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.1s;
}

.hazard-btn:hover::before {
    opacity: 1;
}

/* Icon Styling */
.btn-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* Particle Explosion Container */
.explosion-container {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
}

/* Warning Text */
.warning-text {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff0000;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 4px;
    animation: warningBlink 1s ease-in-out infinite;
    z-index: 101;
}

@keyframes warningBlink {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px #ff0000; }
    50% { opacity: 0.3; text-shadow: 0 0 20px #ff0000; }
}

/* System Status Text */
.system-status {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #00ff00;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-top: -20px;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    z-index: 2;
    animation: glitchText 3s infinite;
}

.system-status::before,
.system-status::after {
    content: 'SYSTEM STATUS: UNSTABLE // V.2.0.26';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0.8;
}

.system-status::before {
    color: #ff0000;
    animation: glitchLeft 2s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.system-status::after {
    color: #00ffff;
    animation: glitchRight 2s infinite linear alternate-reverse;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitchText {
    0%, 90%, 100% { opacity: 1; }
    92% { opacity: 0.8; text-shadow: 2px 0 #ff0000, -2px 0 #00ffff; }
    94% { opacity: 1; text-shadow: none; }
    96% { opacity: 0.9; text-shadow: -2px 0 #ff0000, 2px 0 #00ffff; }
    98% { opacity: 1; text-shadow: none; }
}

@keyframes glitchLeft {
    0% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(0); }
    60% { transform: translateX(2px); }
    80% { transform: translateX(0); }
    100% { transform: translateX(-1px); }
}

@keyframes glitchRight {
    0% { transform: translateX(0); }
    20% { transform: translateX(2px); }
    40% { transform: translateX(0); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(0); }
    100% { transform: translateX(1px); }
}

/* Preloader / Splash Screen */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.8s ease-out, visibility 0.8s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-bomb {
    width: 100px;
    height: 100px;
    object-fit: contain;
    animation: preloaderPulse 1s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

.preloader-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #ffd700;
    margin-top: 20px;
    letter-spacing: 4px;
    animation: preloaderBlink 1s ease-in-out infinite;
}

@keyframes preloaderPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 40px rgba(255, 215, 0, 1)); }
}

@keyframes preloaderBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Mobile Responsive - Updated for < 768px */
@media (max-width: 768px) {
    .bomb-container {
        width: 240px;
        height: 240px;
        margin-bottom: 30px;
    }
    
    .bomb-image {
        width: 224px; /* 20% smaller than 280px */
        height: 224px;
    }

    .buttons-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 15px;
        max-width: 100%;
    }

    .hazard-btn {
        padding: 16px 20px;
        font-size: 14px;
        min-height: 60px;
        width: 100%;
    }

    .btn-icon {
        width: 24px;
        height: 24px;
    }

    .warning-text {
        font-size: 10px;
        letter-spacing: 2px;
        top: 35px;
    }
    
    .system-status {
        font-size: 10px;
        letter-spacing: 2px;
        margin-top: -15px;
        margin-bottom: 20px;
    }
    
    .container {
        padding: 15px;
    }
}

/* Desktop wide bars */
@media (min-width: 769px) {
    .hazard-btn {
        min-width: 280px;
    }
}

/* Particle Explosion Animation */
@keyframes particleExplode {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Flash Fade Animation */
@keyframes flashFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* Screen Shake Animation */
@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}
