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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100vh;
    background-color: #000;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

.container {
    display: flex;
    gap: 15px;
    height: 90vh;
    width: 90vw;
    max-width: none;
    contain: layout style;
    will-change: contents;
    overflow: hidden;
}

.panel {
    flex: 1;
    border-radius: 115px;
    transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    will-change: transform, opacity, flex;
    backface-visibility: hidden;
    transform: translateZ(0);
    contain: layout style paint;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: brightness(0.7);
}

.panel img {
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: 60%;
    max-height: 60%;
    transform: scale(1);
}

.panel-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.panel.playing .panel-video {
    opacity: 1;
}

.panel.playing .panel-logo {
    opacity: 0;
}

.skip-button {
    position: absolute;
    bottom: 24px;
    right: 0px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    padding: 20px 50px 20px 40px;
    border-radius: 8px;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background-color 0.2s ease;
    z-index: 10;
    font-family: Arial, sans-serif;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    min-width: 180px;
}

.panel.playing .skip-button {
    opacity: 1;
    pointer-events: auto;
}

.skip-button:hover {
    background-color: rgba(0, 0, 0, 0.85);
}

.skip-button:active {
    background-color: rgba(0, 0, 0, 0.95);
}

/* Büyük ekranlar (1920px ve üzeri) */
@media (min-width: 1920px) {
    .container {
        gap: 20px;
        width: 95vw;
        height: 95vh;
    }

    .panel {
        border-radius: 140px;
    }
}

/* Orta ekranlar (1200px - 1919px) */
@media (min-width: 1200px) and (max-width: 1919px) {
    .container {
        gap: 15px;
        width: 92vw;
        height: 92vh;
    }

    .panel {
        border-radius: 115px;
    }
}

/* Küçük ekranlar / Tablet (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .container {
        gap: 12px;
        width: 95vw;
        height: 95vh;
    }

    .panel {
        border-radius: 90px;
    }

    .container .panel:hover {
        flex: 4.5;
    }
}

/* Mobil cihazlar için - dikey düzen */
@media (max-width: 767px) {
    :root {
        --vh: 1vh;
    }
    
    html, body {
        min-height: 100vh;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
        height: 100dvh;
        height: -webkit-fill-available;
        overflow: hidden;
        position: relative;
        width: 100%;
    }

    body {
        padding: 0;
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    .container {
        flex-direction: column;
        height: 100%;
        height: calc(var(--vh, 1vh) * 100);
        height: 100vh;
        height: 100dvh;
        height: -webkit-fill-available;
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        max-height: 100vh;
        max-height: calc(var(--vh, 1vh) * 100);
        max-height: 100dvh;
        max-height: -webkit-fill-available;
        width: 100vw;
        gap: 10px;
        padding: 10px;
        box-sizing: border-box;
        display: flex;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .panel {
        width: 100%;
        min-height: 0;
        border-radius: 70px;
        flex: 1 1 0%;
        flex-shrink: 1;
        flex-basis: 0;
        transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                    box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                    min-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: flex, opacity, transform;
    }

    /* Mobilde hover'ı devre dışı bırak, sadece tıklama ile çalışsın */
    .container:hover .panel {
        flex: 1;
        opacity: 1;
    }

    .container .panel:hover {
        flex: 1;
        opacity: 1;
        transform: none;
        box-shadow: none;
    }

    /* Mobil aktif panel - daha fazla büyüme */
    .panel.active {
        flex: 4 !important;
        opacity: 1 !important;
        z-index: 10;
        transform: translateZ(0);
        box-shadow: 0 10px 40px rgba(138, 43, 226, 0.5);
        will-change: transform, opacity, flex;
        min-height: 0;
    }

    .panel.active img {
        transform: scale(1);
        max-width: 60%;
        max-height: 60%;
    }

    .panel.active .panel-video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Aktif panel olduğunda diğerleri küçülsün */
    .container.has-active .panel:not(.active) {
        flex: 0.6 !important;
        opacity: 0.7;
        min-height: 0;
    }

    /* Mobilde skip butonu - web ile aynı tasarım, responsive boyutlar */
    .skip-button {
        bottom: 16px;
        right: 0px;
        padding: 14px 35px 14px 28px;
        border-radius: 6px;
        font-size: 16px;
        font-weight: 600;
        min-width: 140px;
    }
}

/* Safari özel düzeltmeleri */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 767px) {
        html, body {
            height: -webkit-fill-available;
            height: calc(var(--vh, 1vh) * 100);
        }
        
        body {
            min-height: -webkit-fill-available;
            min-height: calc(var(--vh, 1vh) * 100);
        }
        
        .container {
            height: -webkit-fill-available;
            height: calc(var(--vh, 1vh) * 100);
            min-height: -webkit-fill-available;
            min-height: calc(var(--vh, 1vh) * 100);
            max-height: -webkit-fill-available;
            max-height: calc(var(--vh, 1vh) * 100);
            overflow: hidden;
        }
        
        .panel {
            flex: 1 1 auto;
            flex-basis: auto;
            min-height: 0;
        }
        
        .panel.active {
            flex: 4 1 auto !important;
        }
        
        .panel.active .panel-video {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .container.has-active .panel:not(.active) {
            flex: 0.6 1 auto !important;
            min-height: 0;
        }
    }
}

/* Panel renkleri */
.panel:nth-child(1) {
    background: #00044a;
}

.panel:nth-child(2) {
    background: #ffffff;
}

.panel:nth-child(3) {
    background: #9ff37c;
}

.panel:nth-child(4) {
    background: #ffffff;
}

.panel:nth-child(5) {
    background: #d93a8b;
}

/* Hover efekti */
.container .panel:hover {
    flex: 5;
    opacity: 1;
    z-index: 10;
    transform: translateZ(0);
    box-shadow: 0 10px 40px rgba(138, 43, 226, 0.5);
    filter: brightness(1);
}

.container .panel:hover img {
    transform: scale(1);
    max-width: 60%;
    max-height: 60%;
}

/* Hover olan panel için will-change (performans için) */
.container .panel:hover {
    will-change: transform, opacity, flex;
}
