/* Casino / game pages — game sits inside normal site layout (sidebar + topbar) */
.page-game-play .main-content.game-play-page {
    padding: 16px 20px 20px !important;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

.game-play-page {
    padding: 16px 20px 20px !important;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

.game-player {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 14px;
}

/* Prevent global svg { width:100%; height:100% } from blowing up toolbar icons */
.game-player svg {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    flex-shrink: 0;
}

/* — Toolbar — */
.game-player__toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.game-player__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e4e4e7;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.game-player__back svg {
    width: 16px !important;
    height: 16px !important;
    opacity: 0.85;
}

.game-player__back:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.game-player__id {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.game-player__id-label {
    font-size: 13px;
    font-weight: 600;
    color: #71717a;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-player__id-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    font-weight: 500;
    color: #d4d4d8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.game-player__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #a1a1aa;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}

.game-player__icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.game-player__icon-btn.is-copied {
    color: #4ade80;
}

.game-player__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.game-player__round-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: #d4d4d8;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.game-player__round-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.game-player__icon-btn svg {
    width: 16px !important;
    height: 16px !important;
}

.game-player__round-btn svg {
    width: 18px !important;
    height: 18px !important;
}

/* — Game stage — */
.game-player__stage {
    flex: 1;
    min-height: 0;
    max-height: calc(100vh - var(--topbar-height) - 120px);
    max-height: calc(100dvh - var(--topbar-height) - 120px);
    display: flex;
    background: #050608;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}

.game-frame-wrap {
    flex: 1;
    min-height: 0;
    background: #000;
    position: relative;
    overflow: hidden;
}

.game-frame-loader {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #050608;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.game-frame-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.game-frame-loader__spinner {
    width: 40px !important;
    height: 40px !important;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    animation: game-frame-spin 0.75s linear infinite;
}

.game-frame-loader__text {
    font-size: 14px;
    font-weight: 500;
    color: #71717a;
    margin: 0;
}

@keyframes game-frame-spin {
    to { transform: rotate(360deg); }
}

.game-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    position: relative;
    z-index: 1;
    background: #000;
}

.game-player__stage.is-fullscreen {
    max-height: none;
    border-radius: 0;
    border: none;
}

.page-game-play .main-content {
    padding-bottom: 20px !important;
}

.page-game-play .chat-fab {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.45);
}

.page-game-play .chat-fab svg {
    width: 22px !important;
    height: 22px !important;
}

@media (max-width: 768px) {
    .game-play-page {
        padding: 12px !important;
    }

    .game-player__toolbar {
        flex-wrap: wrap;
    }

    .game-player__id {
        order: 3;
        flex: 1 1 100%;
    }

    .game-player__actions {
        margin-left: 0;
    }
}

.game-error {
    text-align: center;
    padding: 80px 24px;
}

.game-error h1 {
    margin-bottom: 12px;
}

.game-error p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Login gate (guests opening a game) */
.game-login-gate-page {
    min-height: calc(100vh - var(--topbar-height, 64px));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 48px;
}

.game-login-gate {
    width: min(520px, 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-login-gate__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}

.game-login-gate__back:hover {
    color: #fff;
}

.game-login-gate__back svg {
    width: 18px;
    height: 18px;
}

.game-login-gate__card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 18px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(163, 38, 255, 0.28);
    background: linear-gradient(165deg, rgba(28, 21, 48, 0.98) 0%, rgba(16, 12, 28, 0.98) 100%);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.game-login-gate__thumb {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: rgba(0, 0, 0, 0.35);
}

.game-login-gate__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-login-gate__eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #c4b5fd;
}

.game-login-gate__title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}

.game-login-gate__provider {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.game-login-gate__text {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.game-login-gate__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.game-login-gate__btn {
    flex: 1 1 120px;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.game-login-gate__btn--primary {
    background: linear-gradient(135deg, #a326ff 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.game-login-gate__btn--ghost {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(163, 38, 255, 0.28);
    color: #fff;
}

@media (max-width: 560px) {
    .game-login-gate__card {
        grid-template-columns: 1fr;
    }

    .game-login-gate__thumb {
        max-height: 180px;
        aspect-ratio: 16 / 10;
    }
}

/* Games library */
.games-library {
    padding-top: 8px;
    padding-bottom: 32px;
}

.games-library__header {
    margin-bottom: 28px;
}

.games-library__title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 8px;
}

.games-library__header h1 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin: 0;
}

.games-library__count {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(168, 85, 247, 0.12);
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: #c084fc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.games-library__sub {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
    max-width: 720px;
    margin: 0;
}

.provider-tabs-wrap {
    margin-bottom: 28px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: linear-gradient(to right, #000 95%, transparent);
}

.provider-tabs-wrap::-webkit-scrollbar {
    display: none;
}

.provider-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding-bottom: 4px;
    min-width: min-content;
}

.provider-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.provider-tab:hover {
    color: #fff;
    border-color: rgba(163, 38, 255, 0.4);
    background: var(--bg-card-hover);
}

.provider-tab.active {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.22), rgba(124, 58, 237, 0.1));
    border-color: rgba(168, 85, 247, 0.55);
    color: #fff;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.22);
}

.provider-tab__count {
    font-size: 11px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
}

.provider-tab.active .provider-tab__count {
    background: rgba(255, 255, 255, 0.16);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 168px));
    gap: 18px;
    justify-content: start;
}

.games-grid__card {
    display: block;
    width: 100%;
    max-width: 168px;
}

.games-grid .game-tile {
    width: 100%;
    max-width: 168px;
}

.games-grid .game-tile--slot,
.games-grid .game-tile--original,
.games-grid .game-tile--live,
.games-grid .game-tile--mini {
    width: 100%;
    max-width: 168px;
}

.games-grid .game-tile__cover {
    width: 100%;
    max-width: 168px;
    height: auto;
    aspect-ratio: 3 / 4;
}

.games-grid .game-tile:hover .game-tile__cover {
    border-color: rgba(168, 85, 247, 0.45);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.25);
}

.games-library__empty {
    text-align: center;
    padding: 64px 24px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

.games-library__empty p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 15px;
}

.game-tile__provider-tag {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.provider-logo--pragmatic { color: #fbbf24; }
.provider-logo--hacksaw { color: #f87171; }
.provider-logo--originals { color: #a855f7; }

/* Phones — 3 game tiles per row (all providers: BGaming, slots, originals, etc.) */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
    }

    .games-grid > .games-grid__card,
    .games-grid > .game-tile {
        min-width: 0;
    }

    .games-grid__card,
    .games-grid .game-tile,
    .games-grid .game-tile--slot,
    .games-grid .game-tile--original,
    .games-grid .game-tile--live,
    .games-grid .game-tile--mini {
        width: 100%;
        max-width: none;
    }

    .games-grid .game-tile__cover {
        width: 100%;
        max-width: none;
        min-width: 0;
        height: auto;
        aspect-ratio: 3 / 4;
    }

    .games-grid .game-tile__img {
        width: 100%;
        height: 100%;
        min-width: 0;
        max-width: 100%;
        object-fit: cover;
    }

    .games-grid .game-tile__caption {
        padding: 8px 6px 10px;
    }

    .games-grid .game-tile__title {
        font-size: 9px;
        line-height: 1.2;
    }

    .games-grid .game-tile__provider-name {
        font-size: 7px;
        margin-top: 2px;
    }

    .games-grid .game-tile__play-icon {
        width: 36px;
        height: 36px;
    }

    .games-grid .game-tile__play-icon svg {
        width: 14px;
        height: 14px;
    }
}

/* ============================================================
   SIDEBAR DROPDOWN — "More Providers"
   Matches existing sidebar navigation-link styling exactly
   ============================================================ */

.navigation-item--dropdown {
    position: relative;
}

/* The "More" button looks exactly like other sidebar links */
.navigation-link--dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #a1a1aa;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    text-decoration: none;
}

.navigation-link--dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.navigation-link--dropdown-toggle.active {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.18), rgba(124, 58, 237, 0.08));
    color: #fff;
}

/* Arrow/chevron rotates when open */
.navigation-link__arrow {
    margin-left: auto;
    transition: transform 0.2s ease;
    opacity: 0.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navigation-link__arrow svg {
    width: 14px !important;
    height: 14px !important;
}

.navigation-item--dropdown.open .navigation-link__arrow {
    transform: rotate(180deg);
    opacity: 0.8;
}

/* Dropdown list — hidden by default */
.navigation-dropdown {
    display: none;
    list-style: none;
    padding: 4px 0;
    margin: 2px 0 4px 20px;
    border-left: 2px solid rgba(168, 85, 247, 0.25);
}

/* Show dropdown when parent has .open class */
.navigation-item--dropdown.open .navigation-dropdown {
    display: block;
    animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dropdown items match sidebar link style */
.navigation-dropdown__item {
    padding: 0;
}

.navigation-dropdown__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.navigation-dropdown__link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.navigation-dropdown__link.active {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.12), rgba(124, 58, 237, 0.06));
    color: #c084fc;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .navigation-dropdown {
        margin-left: 16px;
        padding-left: 0;
    }
    
    .navigation-dropdown__link {
        padding: 10px 12px;
        font-size: 14px;
    }
}