/* ===== SLOT ARAMA ALANI ===== */

#bb-slots .bb-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-sizing: border-box;
}

#bb-slots .bb-tools label {
    position: relative;
    display: block;
    min-width: 0;
    width: 100%;
    margin: 0;
}

/* Etiketler ekran okuyucular için korunur. */
#bb-slots .bb-tools label > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

#bb-slots .bb-tools input,
#bb-slots .bb-tools select {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid #3b423c;
    border-radius: 11px;
    background-color: #222423;
    color: #eef2ec;
    font: inherit;
    font-size: 16px;
    color-scheme: dark;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
    transition: border-color .18s, box-shadow .18s;
}

#bb-slots .bb-tools input::placeholder {
    color: #aeb8ad;
    opacity: 1;
}

#bb-slots .bb-tools select {
    appearance: none;
    padding-right: 34px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd8b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}

#bb-slots .bb-tools select option {
    background: #222423;
    color: #eef2ec;
}

#bb-slots .bb-tools input:focus-visible,
#bb-slots .bb-tools select:focus-visible {
    outline: 2px solid #bddc8c;
    outline-offset: 2px;
    border-color: #a9c67d;
    box-shadow: 0 0 18px rgba(174,215,113,.10);
}

/* JavaScript bağlantısı korunur; düğme gösterilmez. */
#bb-slots #bb-reload {
    display: none !important;
}

/* ===== OYUNUN AÇILDIĞI PENCERE ===== */

#bb-modal {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(1440px, 96vw);
    height: min(900px, 94dvh);
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(199,226,145,.42);
    border-radius: 20px;
    background: #171b17;
    color: #fff;
    box-shadow:
        0 35px 100px rgba(0,0,0,.75),
        0 0 45px rgba(164,210,106,.13),
        0 0 85px rgba(226,187,107,.08),
        inset 0 1px 0 rgba(255,255,255,.12);
}

#bb-modal::backdrop {
    background: rgba(6,10,7,.84);
    backdrop-filter: blur(9px);
}

#bb-modal .bb-player {
    display: grid;
    grid-template-rows: 64px minmax(0,1fr) 44px;
    height: 100%;
    min-height: 0;
    background: #171b17;
}

/* Logo, oyun adı ve kontrol düğmeleri */
#bb-modal .bb-player-bar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    border: 0;
    background:
        radial-gradient(
            ellipse at 0% 0%,
            rgba(168,219,109,.17),
            transparent 65%
        ),
        linear-gradient(110deg, #2a3029, #222423 65%, #303025);
}

#bb-modal .bb-player-bar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        transparent,
        #9bc96e,
        #e8dfa0,
        #9bc96e,
        transparent
    );
    background-size: 200% 100%;
    box-shadow: 0 0 12px rgba(191,221,130,.35);
    animation: bb-frame-light 7s linear infinite;
}

#bb-modal .bb-player-heading {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 18px;
}

#bb-modal .bb-player-logo {
    flex: 0 0 auto;
    padding-right: 18px;
    border-right: 1px solid rgba(255,255,255,.13);
}

#bb-modal .bb-player-logo a {
    display: flex;
    align-items: center;
}

#bb-modal .bb-player-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 120px;
    max-height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 2px 9px rgba(190,224,141,.18));
}

#bb-modal h2 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #f2f5ed;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#bb-modal .bb-player-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

#bb-modal .bb-player-actions button,
#bb-modal #bb-retry,
#bb-modal #bb-newtab {
    box-sizing: border-box;
    border: 1px solid rgba(194,217,154,.25);
    border-radius: 10px;
    background: linear-gradient(145deg, #424b39, #2b3128);
    color: #eef5df;
    font: inherit;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
    transition: background .18s, box-shadow .18s;
}

#bb-modal .bb-player-actions button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 20px;
}

#bb-modal .bb-player-actions button:hover,
#bb-modal #bb-retry:hover,
#bb-modal #bb-newtab:hover {
    background: #46543a;
    box-shadow: 0 0 16px rgba(173,216,113,.16);
}

#bb-modal #bb-close:hover {
    background: #583b35;
    border-color: #b47d68;
}

/* Oyun alanı */
#bb-modal .bb-player-body {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #000;
}

#bb-modal iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

#bb-modal [hidden] {
    display: none !important;
}

/* Alt çubuk */
#bb-modal .bb-player-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 6px 16px;
    border-top: 1px solid rgba(196,218,156,.16);
    background: linear-gradient(110deg, #222423, #292d25);
    color: #aeb8a5;
    font-size: 11px;
}

#bb-modal .bb-player-foot > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#bb-modal #bb-newtab {
    flex-shrink: 0;
    margin-left: auto;
    padding: 5px 10px;
    font-size: 11px;
    text-decoration: none;
}

/* Yükleme ve hata ekranı */
#bb-modal .bb-loading,
#bb-modal .bb-player-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    background:
        radial-gradient(
            ellipse at center,
            rgba(163,207,108,.10),
            transparent 65%
        ),
        #171b17;
    color: #e5edda;
    text-align: center;
}

#bb-modal .bb-loading::before {
    border-color: rgba(196,222,146,.15);
    border-top-color: #c9e59a;
    box-shadow: 0 0 22px rgba(181,220,120,.14);
}

#bb-modal #bb-retry {
    padding: 12px 22px;
}

#bb-modal :focus-visible {
    outline: 2px solid #d6eda6;
    outline-offset: 3px;
}

@keyframes bb-frame-light {
    from { background-position: 0% 50%; }
    to   { background-position: 200% 50%; }
}

/* ===== MOBİL ===== */

@media (max-width: 767px) {
    #bb-slots .bb-tools {
        grid-template-columns: repeat(2, minmax(0,1fr));
        gap: 8px;
    }

    #bb-slots .bb-tools input,
    #bb-slots .bb-tools select {
        height: 44px;
        padding-left: 10px;
        border-radius: 9px;
    }

    #bb-modal {
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    #bb-modal .bb-player {
        grid-template-rows:
            calc(58px + env(safe-area-inset-top))
            minmax(0,1fr)
            calc(40px + env(safe-area-inset-bottom));
    }

    #bb-modal .bb-player-bar {
        gap: 8px;
        padding: 8px 10px;
        padding-top: calc(8px + env(safe-area-inset-top));
    }

    #bb-modal .bb-player-heading {
        gap: 10px;
    }

    #bb-modal .bb-player-logo {
        padding-right: 10px;
    }

    #bb-modal .bb-player-logo img {
        max-width: 78px;
        max-height: 28px;
    }

    #bb-modal h2 {
        font-size: 12px;
    }

    #bb-modal .bb-player-actions {
        gap: 6px;
    }

    #bb-modal .bb-player-actions button {
        width: 36px;
        height: 36px;
    }

    #bb-modal .bb-player-foot {
        padding: 4px 10px;
        padding-bottom: calc(4px + env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    #bb-modal *,
    #bb-modal *::after {
        animation: none !important;
        transition: none !important;
    }

    #bb-slots .bb-tools input,
    #bb-slots .bb-tools select {
        transition: none;
    }
}