:root {
    --val-red: #ff4655;
    --val-black: #0f1923;
    --val-white: #ece8e1;
    --sphere-color: rgba(255, 255, 255, 0.85);
    /* Less transparent white */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-user-select: none;
    /* Chrome/Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+ */
    user-select: none;
    /* Standard */
}

body {
    background: radial-gradient(circle at center, #2c3e50 0%, #0f1923 80%);
    /* Professional Gradient */
    color: var(--val-white);
    font-family: 'Kanit', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.app-container {
    text-align: center;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

/* Video Background Removed */

/* Typography */
/* Typography & HUD */
h1 {
    font-family: var(--font-primary, 'Oswald', sans-serif);
    font-size: 5rem;
    /* Larger, more impactful */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
    color: var(--val-white);
    text-shadow:
        0 0 5px rgba(255, 70, 85, 0.8),
        0 0 10px rgba(255, 70, 85, 0.5);
    position: relative;
    display: inline-block;
}

/* Glitch Effect Animation (Subtle) */
@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-2deg);
    }

    40% {
        transform: skew(2deg);
    }

    60% {
        transform: skew(-1deg);
    }

    80% {
        transform: skew(1deg);
    }

    100% {
        transform: skew(0deg);
    }
}

h1.glitch-effect {
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    color: var(--val-red);
}

#timer {
    font-family: var(--font-primary, 'Oswald', sans-serif);
    font-size: 8rem;
    /* Massive timer */
    font-weight: 700;
    color: var(--val-red);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-shadow:
        2px 2px 0px #000,
        0 0 20px rgba(255, 70, 85, 0.6);
    letter-spacing: 2px;
    margin-top: -10px;

    /* HUD Background for Timer */
    background: rgba(15, 25, 35, 0.6);
    padding: 0 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

/* Controls */
.controls {
    margin-top: 3rem;
    z-index: 100;
}

button {
    background-color: var(--val-red);
    color: var(--val-white);
    border: none;
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: all 0.2s ease;
    font-family: 'Kanit', sans-serif;
    letter-spacing: 1px;
}

button:hover {
    background-color: #ff2b3c;
    transform: translateY(-2px);
}

button:active {
    transform: translateY(1px);
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* SPIKE VISUALS */
.spike-container {
    position: relative;
    width: 200px;
    height: 300px;
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spike-body {
    width: 60px;
    height: 180px;
    background: #333;
    position: relative;
    clip-path: polygon(20% 0%, 80% 0%, 100% 10%, 100% 90%, 80% 100%, 20% 100%, 0% 90%, 0% 10%);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    transition: transform 0.3s;
}

.spike-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #000;
    border-radius: 50%;
    border: 2px solid var(--val-red);
    box-shadow: 0 0 10px var(--val-red);
}

.spike-light {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background-color: var(--val-red);
    border-radius: 50%;
    opacity: 0.3;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(255, 70, 85, 0.7);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 1;
        box-shadow: 0 0 20px 10px rgba(255, 70, 85, 0);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(255, 70, 85, 0);
    }
}

.beeping .spike-light {
    animation: flash 1s infinite;
}

@keyframes flash {

    0%,
    100% {
        opacity: 0.3;
        background-color: #551111;
    }

    50% {
        opacity: 1;
        background-color: var(--val-red);
        box-shadow: 0 0 15px var(--val-red);
    }
}

/* Spike Ring - The expanding red rings (normal state) */
.spike-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--val-red);
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
}

.planted .spike-ring {
    animation: ripple 1.5s linear infinite;
}

@keyframes ripple {
    0% {
        width: 20px;
        height: 20px;
        opacity: 0.8;
        border-width: 2px;
    }

    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
        border-width: 0px;
    }
}

/* White Sphere - The 7s warning */
.sphere {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background-color: var(--sphere-color);
    border-radius: 50%;
    z-index: 20;
    /* Higher than spike */
    mix-blend-mode: normal;
    /* Make it solid/opaque as requested "daha az şeffaf" */
    opacity: 0;
    pointer-events: none;
}

/* Explosion Overlay */
.explosion {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease-out;
}

/* Animation Classes */
.planting {
    animation: shake 0.5s infinite;
}

.spike-container.planted .spike-body {
    filter: drop-shadow(0 0 15px var(--val-red));
}

/* Defuse Bar */
.defuse-bar-container {
    width: 300px;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0 auto 20px auto;
    position: relative;
    border-radius: 5px;
    overflow: hidden;
}

.defuse-progress-fill {
    height: 100%;
    width: 0%;
    background-color: #00ffff;
    /* Cyan for defuse */
    transition: width 0.1s linear;
    box-shadow: 0 0 10px #00ffff;
}

.defuse-checkpoint {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background-color: white;
    z-index: 2;
}

.defuse-active .spike-light {
    background-color: #00ffff !important;
    box-shadow: 0 0 20px #00ffff !important;
}

#defuse-btn {
    background-color: #0f1923;
    border: 2px solid #00ffff;
    color: #00ffff;
}

#defuse-btn:active,
#defuse-btn.active {
    background-color: rgba(0, 255, 255, 0.1);
}

/* Success State */
.defused {
    color: #00ffff !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 3.5rem;
        /* Adjusted for mobile */
    }

    #timer {
        font-size: 6rem;
        /* Adjusted for mobile */
    }

    .spike-container {
        transform: scale(1.1);
        /* Slightly larger scale */
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.5rem;
        letter-spacing: 1px;
    }

    #timer {
        font-size: 4.5rem;
        padding: 0 10px;
        /* Reduce padding on small screens */
    }

    .spike-container {
        transform: scale(1.1);
        /* Slightly larger scale */
        margin: 1.5rem auto;
    }

    button {
        padding: 16px 40px;
        /* Increased padding */
        font-size: 1.4rem;
        /* Increased font size */
        width: 80%;
        /* Make button wider on mobile */
    }

    .app-container {
        padding: 20px;
        justify-content: space-evenly;
        /* Better vertical spacing */
    }

    .controls {
        margin-top: 1rem;
        /* Reduce top margin on mobile */
        width: 100%;
        /* Full width container for button alignment */
    }
}