/**
 * Keybet - Game Launch Experience Stylesheet
 * Ultra-premium, responsive casino arena styling
 */

:root {
    --gml-bg: #070d11;
    --gml-panel: #0d171e;
    --gml-panel-elevated: #111e27;
    --gml-gold: #f5bd32;
    --gml-gold-bright: #ffd45a;
    --gml-gold-glow: rgba(245, 189, 50, 0.25);
    --gml-cyan: #38bdf8;
    --gml-green: #10b981;
    --gml-red: #ef4444;
    --gml-text: #f4f5f6;
    --gml-muted: #94a1aa;
    --gml-border: rgba(255, 255, 255, 0.08);
}

/* ── Theater Mode Layout Overrides ─────────────────────────────────────── */
body.theater-mode .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theater-mode .site {
    margin-left: 0 !important;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theater-mode .game-page-container {
    max-width: 100% !important;
    padding: 12px 18px !important;
}

body.theater-mode .game-arena-wrapper {
    height: calc(100vh - 130px) !important;
    max-height: none !important;
}

/* ── Main Page Layout ─────────────────────────────────────────────────── */
.game-launch-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-page-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Top Game Control Bar ─────────────────────────────────────────────── */
.game-launch-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(13, 23, 30, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--gml-border);
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    flex-wrap: wrap;
}

.game-bar-left,
.game-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-bar-left {
    flex: 1;
    min-width: 260px;
}

/* Back button */
.btn-game-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gml-border);
    color: var(--gml-text);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-game-back:hover {
    background: rgba(245, 189, 50, 0.15);
    border-color: var(--gml-gold);
    color: var(--gml-gold);
    transform: translateX(-2px);
}

.btn-game-back i {
    font-size: 13px;
    transition: transform 0.2s ease;
}

.btn-game-back:hover i {
    transform: translateX(-2px);
}

/* Title & Meta */
.game-info-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-provider-pill {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gml-muted);
}

/* Mode Badges */
.mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.mode-badge.real {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.mode-badge.real .pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulseGlow 1.8s infinite;
}

.mode-badge.demo {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
}

.mode-badge.demo i {
    font-size: 10px;
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Right tools */
.game-bar-right {
    flex-shrink: 0;
}

/* Switch to Real CTA button */
.btn-switch-real {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #f5bd32 0%, #e09b18 100%);
    color: #070d11;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 7px;
    border: none;
    box-shadow: 0 2px 10px rgba(245, 189, 50, 0.3);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-switch-real:hover {
    background: linear-gradient(135deg, #ffd45a 0%, #f5bd32 100%);
    box-shadow: 0 4px 15px rgba(245, 189, 50, 0.5);
    transform: translateY(-1px);
    color: #070d11;
}

/* User Balance Pill */
.game-balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--gml-border);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 12px;
}

.game-balance-pill .label {
    color: var(--gml-muted);
    font-size: 11px;
}

.game-balance-pill .val {
    font-weight: 700;
    color: var(--gml-gold);
}

.btn-quick-deposit {
    background: rgba(245, 189, 50, 0.15);
    border: 1px solid rgba(245, 189, 50, 0.4);
    color: var(--gml-gold);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-quick-deposit:hover {
    background: var(--gml-gold);
    color: #070d11;
}

/* Control buttons group */
.game-control-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.game-ctrl-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--gml-border);
    color: #d1d5db;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    outline: none;
}

.game-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.game-ctrl-btn:active {
    transform: translateY(0);
}

.game-ctrl-btn.btn-close-game {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.game-ctrl-btn.btn-close-game:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

/* ── Game Stage & Viewport Arena ───────────────────────────────────────── */
.game-stage {
    position: relative;
    width: 100%;
}

.game-ambient-halo {
    position: absolute;
    inset: -15px;
    border-radius: 20px;
    background: radial-gradient(circle at 50% 35%, rgba(245, 189, 50, 0.1) 0%, rgba(56, 189, 248, 0.05) 50%, transparent 75%);
    filter: blur(25px);
    pointer-events: none;
    z-index: 0;
}

.game-arena-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    height: calc(100vh - 215px);
    min-height: 580px;
    max-height: 900px;
    background: #03070a;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.65),
        0 0 30px rgba(245, 189, 50, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fullscreen Mode on Arena */
.game-arena-wrapper:fullscreen,
.game-arena-wrapper:-webkit-full-screen,
.game-arena-wrapper:-moz-full-screen,
.game-arena-wrapper:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000000 !important;
}

/* Floating overlay bar inside fullscreen */
.fullscreen-floating-bar {
    display: none;
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 9999;
    align-items: center;
    gap: 8px;
    background: rgba(13, 23, 30, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 10px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    opacity: 0.35;
    transition: opacity 0.25s ease;
}

.game-arena-wrapper:fullscreen .fullscreen-floating-bar,
.game-arena-wrapper:-webkit-full-screen .fullscreen-floating-bar,
.game-arena-wrapper:-moz-full-screen .fullscreen-floating-bar,
.game-arena-wrapper:-ms-fullscreen .fullscreen-floating-bar {
    display: flex;
}

.fullscreen-floating-bar:hover {
    opacity: 1;
}

/* Iframe */
.game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
    display: block;
    background: #000;
}

/* Loading Overlay */
.game-loader-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: radial-gradient(circle at center, #0d171e 0%, #04080b 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.game-loader-overlay.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-spinner-ring {
    position: relative;
    width: 60px;
    height: 60px;
}

.loader-spinner-ring::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(245, 189, 50, 0.15);
}

.loader-spinner-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--gml-gold);
    border-right-color: var(--gml-gold);
    animation: gmlSpin 1s cubic-bezier(0.6, 0.2, 0.4, 0.9) infinite;
}

.loader-chip-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gml-gold);
    font-size: 20px;
}

.loader-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--gml-muted);
    letter-spacing: 0.3px;
    margin: 0;
    animation: loaderPulse 1.6s ease-in-out infinite;
}

@keyframes gmlSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes loaderPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; color: #fff; }
}

/* ── Under-Game Quick Information Bar ──────────────────────────────────── */
.game-sub-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(13, 23, 30, 0.45);
    border: 1px solid var(--gml-border);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--gml-muted);
    flex-wrap: wrap;
}

.game-sub-left,
.game-sub-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.sub-info-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sub-info-item i {
    color: var(--gml-gold);
    font-size: 13px;
}

.sub-info-item.secure i {
    color: var(--gml-green);
}

/* ── Mobile Immersive Mode (Phone Screens) ─────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }

    .site {
        margin-left: 0 !important;
    }

    .topbar {
        display: none !important;
    }

    .game-launch-page {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        background: #000;
        z-index: 999999;
    }

    .game-page-container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        height: 100vh !important;
        gap: 0 !important;
    }

    /* Sleek floating mobile controls */
    .game-launch-bar {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        z-index: 1000;
        padding: 6px 10px;
        border-radius: 10px;
        background: rgba(7, 13, 17, 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .game-title {
        font-size: 13px;
        max-width: 130px;
    }

    .game-arena-wrapper {
        border-radius: 0;
        border: none;
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        box-shadow: none;
    }

    .game-sub-bar,
    .game-ambient-halo {
        display: none !important;
    }

    .btn-game-back span {
        display: none;
    }

    .btn-switch-real span {
        display: none;
    }
}
