/* Reset i podstawowe style */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #ff0080, #ff0000, #ff8c00, #ffd700, #00ff00, #00ffff, #0000ff, #8b00ff);
    --blur-amount: 10px;
    --transition-speed: 0.3s;
}

body {
    margin: 0;
    overflow: hidden;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Inter', 'Arial', sans-serif;
    perspective: 1000px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Kontener sceny */
.scene {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    transform-style: preserve-3d;
    overflow: hidden;
    will-change: transform;
}

/* Kontener tytułu */
.title-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    width: 90%;
    max-width: 1200px;
    padding: 40px;
    text-align: center;
}

/* Główny tytuł */
.main-title {
    font-size: 8rem;
    font-weight: 900;
    color: transparent;
    background: var(--primary-gradient);
    background-size: 800% 800%;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 0, 128, 0.8), 0 0 80px rgba(255, 0, 0, 0.6);
    filter: drop-shadow(0 0 30px rgba(255, 255, 0, 0.6)) drop-shadow(0 0 20px rgba(0, 255, 255, 0.4));
    transform-style: preserve-3d;
    animation: gradientFlow 10s ease infinite;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 0.6em;
    word-break: break-word;
    text-transform: uppercase;
}

/* Kontener odliczania */
.countdown-container {
    position: relative;
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    justify-content: center;
    padding: 0;
}

/* Pudełka odliczania */
.countdown-box {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(var(--blur-amount));
    -webkit-backdrop-filter: blur(var(--blur-amount));
    padding: 30px 25px;
    border-radius: 20px;
    text-align: center;
    transform-style: preserve-3d;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.15), inset 0 0 40px rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    will-change: transform, box-shadow;
    position: relative;
}

.countdown-box::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    background: linear-gradient(45deg, rgba(255, 0, 128, 0.5), rgba(255, 255, 0, 0.5), rgba(0, 255, 255, 0.5), rgba(255, 0, 128, 0.5));
    background-size: 400% 400%;
    animation: borderGlow 8s ease infinite;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s;
}

.countdown-box:hover::before {
    opacity: 1;
}

.countdown-box:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 60px rgba(255, 0, 128, 0.4), inset 0 0 40px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Liczby odliczania */
.countdown-number {
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.9), 0 0 40px rgba(255, 0, 128, 0.6);
    font-weight: 900;
    transition: all 0.3s ease;
    letter-spacing: -0.02em;
}

/* Etykiety odliczania */
.countdown-label {
    font-size: 1.1rem;
    color: #aaa;
    text-transform: uppercase;
    margin-top: 10px;
    letter-spacing: 0.15em;
    font-weight: 600;
}

/* Animacje */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

/* ===== MEDIA QUERIES - MOBILE FIRST ===== */

/* Mobile - Domyślnie 480px i mniej */
@media (max-width: 480px) {
    .title-container {
        top: 35%;
        width: 100%;
        padding: 10px;
    }

    .main-title {
        font-size: 1.1rem;
        text-shadow: 0 0 8px rgba(255, 0, 128, 0.4);
        filter: none;
        margin-bottom: 0.5rem;
        letter-spacing: -0.02em;
        white-space: nowrap;
    }

    .countdown-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        padding: 0 8px;
        margin-top: 0.6rem;
    }

    .countdown-box {
        background: rgba(255, 255, 255, 0.04);
        padding: 8px 6px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.04);
    }

    .countdown-box::before {
        display: none;
    }

    .countdown-box:hover {
        transform: translateY(-2px);
        box-shadow: 0 3px 10px rgba(255, 0, 128, 0.15);
        border-color: rgba(255, 255, 255, 0.12);
    }

    .countdown-number {
        font-size: 1.3rem;
        text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
    }

    .countdown-label {
        font-size: 0.55rem;
        margin-top: 2px;
        letter-spacing: 0.05em;
    }
}

/* Tablet - 768px i mniej */
@media (max-width: 768px) {
    .title-container {
        top: 35%;
        padding: 12px;
    }

    .main-title {
        font-size: 0.95rem;
        text-shadow: 0 0 6px rgba(255, 0, 128, 0.3);
        filter: none;
        margin-bottom: 0.4rem;
        white-space: nowrap;
    }

    .countdown-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        padding: 0 8px;
        margin-top: 0.6rem;
    }

    .countdown-box {
        padding: 8px 6px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .countdown-number {
        font-size: 1.3rem;
        text-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
    }

    .countdown-label {
        font-size: 0.55rem;
        margin-top: 2px;
    }
}

/* Landscape Mobile - Wysokość do 600px */
@media (max-height: 600px) and (orientation: landscape) {
    .title-container {
        top: 50%;
        padding: 10px;
    }

    .main-title {
        font-size: 1.8rem;
        margin-bottom: 0.5em;
    }

    .countdown-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.6rem;
        margin-top: 0.5rem;
    }

    .countdown-box {
        padding: 8px 6px;
        border-radius: 8px;
    }

    .countdown-number {
        font-size: 1.2rem;
    }

    .countdown-label {
        font-size: 0.6rem;
        margin-top: 2px;
    }
}

/* Optymalizacje wydajności */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    .main-title {
        animation: none;
    }

    .countdown-box {
        transition: none;
    }
}

/* Wsparcie dla starszych przeglądarek */
@supports not (backdrop-filter: blur(10px)) {
    .countdown-box {
        background: rgba(0, 0, 0, 0.85);
    }
}
