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

body {
    background-color: #000;
    color: #fff;
    font-family: 'Arial', sans-serif;
    height: 100vh;
    overflow: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    position: relative;
    z-index: 10; /* Daha yüksek z-index */
}

.main-title {
    font-size: clamp(4rem, 15vw, 25rem);
    font-weight: bold;
    color: #ff0000;
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
    line-height: 0.9;
    opacity: 0.85; /* Transparanlık azaltıldı */
    position: relative;
    z-index: 15; /* En üstte olsun */
}

.counter-text {
    font-size: clamp(1rem, 3.5vw, 3rem);
    color: #ccc;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
    padding: 0 1rem;
    line-height: 1.2;
    position: relative;
    z-index: 15;
}

#day-counter {
    color: #ff6b6b;
    font-weight: bold;
}

.brain-root-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.image-container {
    position: absolute;
    opacity: 0.3;
    z-index: 2; /* Container'dan düşük */
    transition: opacity 0.3s ease; /* Yumuşak geçiş */
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.brain-root-img {
    width: clamp(80px, 15vw, 150px);
    height: clamp(80px, 15vw, 150px);
    object-fit: cover;
    border-radius: 50%;
    /* Daha da parlak ve daha az gri */
    filter: grayscale(25%) brightness(1.5);
    transition: all 0.3s ease;
    will-change: transform;
    /* Hızlı yükleme için */
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.brain-root-img:hover {
    /* Hover'da maksimum parlaklık ve minimum gri */
    filter: grayscale(0%) brightness(2);
    opacity: 0.95;
}

.floating-1 {
    /* Sabit konumları kaldır, JavaScript tarafından ayarlanacak */
    animation: float1 6s ease-in-out infinite;
}

.floating-2 {
    /* Sabit konumları kaldır, JavaScript tarafından ayarlanacak */
    animation: float2 8s ease-in-out infinite;
}

.floating-3 {
    /* Sabit konumları kaldır, JavaScript tarafından ayarlanacak */
    animation: float3 7s ease-in-out infinite;
}

.floating-4 {
    animation: float4 5s ease-in-out infinite;
}

.floating-5 {
    animation: float5 9s ease-in-out infinite;
}

.floating-6 {
    animation: float6 6s ease-in-out infinite;
}

.falling-image {
    /* Düşme animasyonu için */
    animation-name: fallDown;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    /* Konumlar JS ile ayarlanıyor */
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 0 50px rgba(255, 0, 0, 0.8);
    }
}

@keyframes float1 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) rotate(-3deg);
    }
    75% {
        transform: translateY(-30px) rotate(7deg);
    }
}

@keyframes float2 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-25px) rotate(-8deg);
    }
    66% {
        transform: translateY(-15px) rotate(4deg);
    }
}

@keyframes float3 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    20% {
        transform: translateY(-15px) rotate(3deg);
    }
    40% {
        transform: translateY(-35px) rotate(-6deg);
    }
    60% {
        transform: translateY(-20px) rotate(8deg);
    }
    80% {
        transform: translateY(-10px) rotate(-2deg);
    }
}

@keyframes float4 {
    0%, 100% {
        transform: translateX(0px) translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateX(-15px) translateY(-20px) rotate(-4deg);
    }
    50% {
        transform: translateX(10px) translateY(-30px) rotate(6deg);
    }
    75% {
        transform: translateX(-5px) translateY(-15px) rotate(-3deg);
    }
}

@keyframes float5 {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    30% {
        transform: translateY(-40px) rotate(10deg);
    }
    60% {
        transform: translateY(-20px) rotate(-5deg);
    }
    80% {
        transform: translateY(-35px) rotate(8deg);
    }
}

@keyframes float6 {
    0%, 100% {
        transform: translateX(0px) translateY(0px) rotate(0deg);
    }
    20% {
        transform: translateX(20px) translateY(-25px) rotate(5deg);
    }
    40% {
        transform: translateX(-10px) translateY(-15px) rotate(-7deg);
    }
    60% {
        transform: translateX(15px) translateY(-35px) rotate(4deg);
    }
    80% {
        transform: translateX(-5px) translateY(-20px) rotate(-2deg);
    }
}

/* Düşme animasyonu */
@keyframes fallDown {
    0% {
        top: -20%;
        opacity: 0.2;
        transform: scale(0.9) rotate(-10deg);
    }
    10% {
        opacity: 0.5;
    }
    80% {
        opacity: 0.4;
    }
    100% {
        top: 110%;
        opacity: 0.1;
        transform: scale(1.05) rotate(10deg);
    }
}

/* Loading optimizations */
.brain-root-img {
    width: clamp(80px, 15vw, 150px);
    height: clamp(80px, 15vw, 150px);
    object-fit: cover;
    border-radius: 50%;
    /* Daha da parlak ve daha az gri */
    filter: grayscale(25%) brightness(1.5);
    transition: all 0.3s ease;
    will-change: transform;
    /* Hızlı yükleme için */
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

/* Preload state */
.brain-root-img[src*="data:"] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.brain-root-img:not([src*="data:"]) {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 480px) {
    .main-title {
        font-size: clamp(3rem, 12vw, 6rem);
        margin-bottom: 1rem;
    }

    .counter-text {
        font-size: clamp(0.8rem, 4vw, 1.5rem);
        padding: 0 0.5rem;
    }

    .brain-root-img {
        width: clamp(60px, 12vw, 100px);
        height: clamp(60px, 12vw, 100px);
    }

    .floating-1, .floating-2, .floating-3,
    .floating-4, .floating-5, .floating-6 {
        animation-duration: 4s;
    }

    .image-container {
        opacity: 0.2; /* Küçük ekranlarda daha da şeffaf */
    }
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .container {
        padding: 1rem;
    }

    .main-title {
        z-index: 20; /* Mobilde daha da yüksek */
        font-size: clamp(3.5rem, 14vw, 8rem);
    }

    .counter-text {
        z-index: 15;
        position: relative;
        font-size: clamp(0.9rem, 3.8vw, 2rem);
    }

    .brain-root-img {
        width: clamp(70px, 13vw, 120px);
        height: clamp(70px, 13vw, 120px);
    }

    /* Mobilde sabit konumları kaldır */
    .floating-1,
    .floating-2,
    .floating-3,
    .floating-4,
    .floating-5,
    .floating-6 {
        /* JavaScript tarafından dinamik olarak ayarlanacak */
        position: absolute;
    }

    .image-container {
        opacity: 0.25; /* Mobilde daha şeffaf */
        z-index: 1;
    }
}

@media (max-width: 1024px) and (orientation: landscape) {
    .main-title {
        font-size: clamp(4rem, 10vw, 12rem);
        margin-bottom: 1rem;
    }

    .counter-text {
        font-size: clamp(1rem, 3vw, 2rem);
    }

    .brain-root-img {
        width: clamp(80px, 10vw, 120px);
        height: clamp(80px, 10vw, 120px);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .brain-root-img:hover {
        /* Touch cihazlarda hover efekti olmasın, yine de parlak kalsın */
        filter: grayscale(25%) brightness(1.5);
        opacity: 0.5;
    }

    .image-container {
        opacity: 0.35; /* Touch cihazlarda daha görünür */
    }

    /* Reduce animation intensity for better performance */
    .floating-1, .floating-2, .floating-3,
    .floating-4, .floating-5, .floating-6 {
        animation-duration: 6s;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .main-title {
        text-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    }

    .counter-text {
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    }
}

/* Performance optimizations */
.image-container {
    position: absolute;
    opacity: 0.3;
    z-index: 2;
    transition: opacity 0.3s ease;
    /* GPU acceleration */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.music-hint {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 100;
    opacity: 0.8;
    animation: pulse 2s infinite;
    display: block; /* Her zaman görünür yap */
}

.music-hint.show {
    display: block;
}

@media (max-width: 768px) {
    .music-hint {
        bottom: 15px;
        font-size: 12px;
        padding: 6px 12px;
    }
}
