:root {
    --bg-dark: #050505;
    --neon-orange: #FF5500; 
    --orange-glow: 0 0 20px rgba(255, 85, 0, 0.5);
    --text-white: #ffffff;

    /* Glass Styling */
    --glass-bg: rgba(20, 20, 20, 0.75);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-blur: blur(20px);

    --gap: 8px; 
    --header-h: 70px;
    --sidebar-w: 50px;
    --bottom-h: 75px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* --- 2. ANIMATED BACKGROUND --- */
body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Rajdhani', 'Orbitron', sans-serif;
    overflow-x: hidden;
    padding-top: calc(var(--header-h) + var(--gap) + 8px);
    padding-bottom: calc(var(--bottom-h) + var(--gap) + 20px);
    position: relative;
    min-height: 100vh;
}

/* Glow Orb 1 */
body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(255, 85, 0, 0.296), transparent 70%);
    filter: blur(30px);
    animation: moveGlow1 5s infinite alternate ease-in-out;
    z-index: -2;
    pointer-events: none;
}

/* Glow Orb 2 */
body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(255, 60, 0, 0.241), transparent 70%);
    filter: blur(30px);
    animation: moveGlow2 6s infinite alternate-reverse ease-in-out;
    z-index: -2;
    pointer-events: none;
}

/* Grid Pattern */
.bg-grid {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

/* Animations */
@keyframes moveGlow1 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.5; }
    100% { transform: translate(20vw, 10vh) scale(1.3); opacity: 0.8; }
}
@keyframes moveGlow2 {
    0% { transform: translate(0, 0) scale(1); opacity: 0.4; }
    100% { transform: translate(-20vw, -15vh) scale(1.4); opacity: 0.7; }
}

@media (max-width: 480px) {
    body::before, body::after { width: 100vw; height: 100vw; filter: blur(20px); }
    body::before { animation-duration: 4s; }
    body::after  { animation-duration: 5s; }
}

/* --- 3. FLOATING TOP BAR --- */
.top-glass-nav {
    position: fixed;
    top: var(--gap); left: var(--gap); right: var(--gap);
    height: var(--header-h);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 2000;
}

.nav-left { display: flex; align-items: center; gap: 10px; width: 30%; }
.profile-img {
    width: 38px; height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--neon-orange);
    box-shadow: var(--orange-glow);
}
.p-name { font-weight: bold; font-size: 0.9rem; color: #fff; text-transform: uppercase; }
.p-role { font-size: 0.65rem; color: var(--neon-orange); letter-spacing: 1px; }

.nav-center { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; }
.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px var(--neon-orange);
}
.logo-text span { color: var(--neon-orange); }

.nav-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; width: 30%; }
.nav-btns { display: flex; align-items: center; gap: 10px; }
.balance-pill {
    background: rgba(255, 85, 0, 0.15);
    border: 1px solid rgba(255, 85, 0, 0.3);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--neon-orange);
    font-family: 'Orbitron', sans-serif;
    white-space: nowrap;
}
.restore-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}
.restore-btn:active { transform: rotate(180deg); color: var(--neon-orange); }
.logout-btn {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,0,0,0.1);
    border: 1px solid rgba(255,0,0,0.2);
    color: #ff4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

/* --- 4. HERO SLIDER --- */
.hero-slider-container {
    width: calc(75% - (var(--gap) * 2));
    height: 300px;
    margin: 0 auto 20px auto;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border: 1px solid rgba(255, 85, 0, 0.2);
    z-index: 10;
    touch-action: pan-y; /* ဘေးတိုက်ဆွဲတာကိုပဲ ဖမ်းပြီး၊ အပေါ်အောက်ဆွဲတာကို ပေးလုပ်မယ် */
    cursor: grab;
}
.hero-slider-container:active {
    cursor: grabbing;
}
.slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    
    /* ★ ဒီနေရာမှာ ပြင်ထားပါတယ် ★ */
    background-size: 100% 100%; /* ပုံကို ဘောင်အပြည့် အတင်းဆွဲဆန့်/ဆွဲရှုံ့ ပြီးထည့်မယ် (ပုံအပြည့်ပေါ်မယ်) */
    background-repeat: no-repeat; /* ပုံမထပ်အောင် */
    background-position: center;
}
.slide.active { opacity: 1; }
.slide::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 60%);
}
.hero-content { position: absolute; bottom: 20px; left: 20px; z-index: 2; }
.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,1);
}
.hero-title span { color: var(--neon-orange); }
.slider-dots { position: absolute; bottom: 15px; right: 20px; display: flex; gap: 8px; z-index: 3; }
.dot { width: 8px; height: 8px; background: rgba(255,255,255,0.3); border-radius: 50%; transition: 0.3s; }
.dot.active { background: var(--neon-orange); box-shadow: 0 0 10px var(--neon-orange); transform: scale(1.2); }

/* --- 5. CONTENT LAYOUT --- */
.layout-container {
    display: flex;
    align-items: flex-start;
    padding: 0 var(--gap);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.img-wrapper {
    position: relative;
    width: 100%;
    height: 150px;
    overflow: hidden; /* main clip */
    border-radius: 12px;
}
.games-right {
    flex: 1;
    overflow: hidden; /* important: prevent overflow from children */
}

/* --- GAME GRID: Desktop 6 / Tablet 4 / Phone 2 --- */
.game-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* Desktop = 6 */
    gap: 15px;
}

/* Tablet */
@media (max-width: 1024px) {
    .game-grid { grid-template-columns: repeat(4, 1fr); }
    .layout-container { max-width: 95%; }
}

@media (max-width: 800px) {
    .game-grid { grid-template-columns: repeat(3, 1fr); }
    .layout-container { max-width: 95%; }
}

/* Phone */
@media (max-width: 480px) {
    .hero-slider-container {
        width: calc(100% - (var(--gap) * 2));
        height: auto !important;
        aspect-ratio: 2.5 / 1;
    }
    .img-wrapper{
        position: relative;
        width: 100%;
        height: 130px;
        overflow: hidden; /* main clip */
        border-radius: 12px;
    }

    .game-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* Phone = 2 */
        gap: 8px;
        
    }

    .layout-container {
        padding: 0 10px;
        gap: 10px;
    }
}

/* --- SIDEBAR --- */
.sidebar-left {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: sticky;
    top: calc(var(--header-h) + var(--gap) + 20px);
    z-index: 100;
}

.side-bubble {
    width: 100%;
    padding: 5px 0;
    margin-bottom: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent !important;
    border: none !important;
    transition: transform 0.2s;
}

.sidebar-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 1;
    filter: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
}

.icon-label {
    font-size: 11px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    color: #aaaaaa;
    margin-top: 6px;
    text-align: center;
    line-height: 1;
    transition: 0.3s;
    opacity: 0.8;
}

.side-bubble:hover .sidebar-icon,
.side-bubble.active .sidebar-icon {
    transform: scale(1.15) translateZ(0);
    filter: drop-shadow(0 0 8px rgba(255, 85, 0, 0.9));
}

.side-bubble.active .icon-label,
.side-bubble:hover .icon-label {
    color: var(--neon-orange);
    text-shadow: 0 0 5px rgba(255, 85, 0, 0.5);
    opacity: 1;
}

/* --- GAME CARD + IMAGE (NO OVERFLOW) --- */
.game-card {
    border-radius: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden; /* clip everything inside card */
    display: block;
    text-decoration: none;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
}

/* Image wrapper: strict clip */

.g-title { 
    font-size: 0.8rem; font-weight: bold; text-align: center; 
    color: #ffffff !important; padding: 8px 5px; 
    white-space: nowrap; overflow: hidden; 
    text-overflow: ellipsis; text-decoration: none !important;
}
/* Image */
.game-card .g-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transform: scale(1);
    transform-origin: center;
    transition: transform 0.35s ease;
}

/* Hover zoom (still clipped) */
.game-card:hover .g-img {
    transform: scale(1.1);
}

/* Touch devices: prevent weird hover zoom */
@media (hover: none) {
    .game-card:hover .g-img { transform: scale(1); }
}

/* Shine effect */
.img-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-45deg);
    z-index: 2;
    pointer-events: none;
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -80%; }
    100% { left: 140%; }
}

/* Locked item */
.locked-item .g-img {
    filter: grayscale(100%) blur(4px) brightness(0.4);
}

.lock-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    background: rgba(0, 0, 0, 0.3);
}

.locked-item:hover .g-img {
    filter: grayscale(100%) blur(5px) brightness(0.3);
    transform: scale(1.15);
}

.locked-item:hover .lock-overlay i {
    transform: scale(1.2) rotate(-10deg);
    color: var(--neon-orange);
    filter: drop-shadow(0 0 15px rgba(255, 85, 0, 0.8));
}

.locked-item { cursor: not-allowed !important; }

/* --- FLOATING BOTTOM BAR --- */
.glass-bottom {
    position: fixed;
    bottom: var(--gap); left: var(--gap); right: var(--gap);
    height: var(--bottom-h);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 25px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
}

.btm-item {
    text-decoration: none;
    color: #cbcbcb;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: 0.3s;
    flex: 1;
}
.btm-item i { font-size: 1.3rem; margin-bottom: 4px; }
.btm-item span { font-size: 0.7rem; font-weight: 600; }
.btm-item.active { color: var(--neon-orange); text-shadow: 0 0 10px var(--neon-orange); }

.btm-center {
    width: 65px;
    height: 65px;
    background: var(--neon-orange);
    border-radius: 50%;
    margin-top: -45px;
    border: 5px solid var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    box-shadow: var(--orange-glow);
    animation: pulse 2s infinite;
    text-decoration: none;
}

/* Center Wrapper to hold button and text */
.center-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    flex: 1; /* Takes equal space */
}

/* Modified btm-center (removed negative margin since wrapper handles it) */
.btm-center {
    width: 60px; /* Slightly smaller to fit better */
    height: 60px;
    background: var(--neon-orange);
    border-radius: 50%;
    border: 5px solid var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: var(--orange-glow);
    animation: pulse 2s infinite;
    text-decoration: none;
    margin-bottom: 2px; /* Space between icon and text */
}

/* Style for the text */
.center-text {
    font-size: 0.7rem;
    font-weight: 600;

    text-shadow: 0 0 5px rgba(255, 85, 0, 0.5);
    margin-top: 2px; /* Fine-tune spacing */
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,85,0,0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255,85,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,85,0,0); }
}

/* --- MOBILE TOP BAR + SIDEBAR FIX --- */
@media (max-width: 480px) {
    .top-glass-nav { height: 70px !important; padding: 0 8px !important; }
    .nav-left { flex-direction: row !important; align-items: center !important; gap: 6px !important; width: auto !important; }
    .profile-img { width: 32px !important; height: 32px !important; border-width: 1px !important; }
    .profile-info { display: block !important; text-align: left; }
    .p-name { font-size: 0.75rem !important; margin-bottom: 0; line-height: 1.1; max-width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .p-role { font-size: 0.55rem !important; color: var(--neon-orange); display: block !important; }
    .nav-center { top: 50%; transform: translate(-50%, -50%); width: auto; }
    .logo-text { font-size: 1.1rem !important; }
    .nav-right { display: flex !important; flex-direction: column !important; justify-content: center !important; align-items: flex-end !important; width: 100px !important; gap: 3px !important; }
    .balance-pill { width: 100% !important; text-align: center !important; font-size: 0.7rem !important; padding: 3px 0 !important; order: 1; }
    .nav-btns { display: flex !important; width: 100% !important; gap: 5px !important; justify-content: space-between !important; order: 2; }
    .restore-btn, .logout-btn {
        display: flex !important;
        flex: 1 !important;
        width: auto !important;
        height: 24px !important;
        border-radius: 8px !important;
        justify-content: center;
        align-items: center;
        font-size: 0.8rem !important;
    }

    .game-card .g-img{
        width: 100%;
        object-fit: fill;
        object-position: center;
        display: block;
    }
    .sidebar-left {
        display: flex !important;
        flex-direction: column !important;
        width: var(--sidebar-w) !important;
        min-width: var(--sidebar-w) !important;
        gap: 10px;
        position: sticky;
        top: calc(var(--header-h) + 15px);
        margin-top: 10px;
        overflow: visible;
    }

    .side-bubble {
        width: 100%;
        min-width: auto;
        margin-bottom: 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .top-glass-nav.guest-mode { padding: 0 10px !important; height: 70px !important; }
    .logo-text.guest-logo { font-size: 1.2rem !important; }
    .g-btn { padding: 6px 12px; font-size: 0.75rem; }
    .guest-btn-group { gap: 8px; padding-right: 100px;}
}

/* --- GUEST MODE STYLES --- */
.top-glass-nav.guest-mode {
    height: var(--header-h);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo-text.guest-logo { font-size: 1.5rem !important; text-shadow: 0 0 10px var(--neon-orange); margin: 0; }
.guest-btn-group { display: flex; gap: 10px; align-items: center; }
.g-btn {
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 50px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: bold;
    font-size: 0.85rem;
    transition: 0.3s;
    white-space: nowrap;
}
.g-btn.login { border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; background: transparent; }
.g-btn.login:hover { border-color: var(--neon-orange); color: var(--neon-orange); }
.g-btn.register { background: var(--neon-orange); color: #fff; box-shadow: 0 0 10px rgba(255, 85, 0, 0.4); border: 1px solid var(--neon-orange); }
.g-btn.register:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(255, 85, 0, 0.6); }

/* --- SWEETALERT CUSTOM THEME --- */
.neon-popup {
    background: rgba(15, 15, 15, 0.95) !important;
    border: 1px solid var(--neon-orange) !important;
    border-radius: 20px !important;
    box-shadow: 0 0 30px rgba(255, 85, 0, 0.3) !important;
    padding: 20px !important;
}
.swal2-title {
    font-family: 'Orbitron', sans-serif !important;
    color: #fff !important;
    font-size: 1.5rem !important;
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--neon-orange);
}
.swal2-html-container {
    font-family: 'Rajdhani', sans-serif !important;
    color: #aaa !important;
    font-size: 1rem !important;
}
.swal2-icon.swal2-success { border-color: var(--neon-orange) !important; }
.swal2-icon.swal2-success .swal2-success-line { background-color: var(--neon-orange) !important; }
.swal2-icon.swal2-success .swal2-success-ring { border: 4px solid rgba(255, 85, 0, 0.2) !important; }

/* Extra animations */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulseText { 0%, 100% { opacity: 1; text-shadow: 0 0 10px #FF5500; } 50% { opacity: 0.5; text-shadow: none; } }

/* Hide Class */
.loaded { opacity: 0; pointer-events: none; }

/* --- SUPPORT FLOATING BUTTON --- */
.support-floater {
    position: fixed;
    bottom: 160px;
    right: 16px;
    width: 80px;
    height: 80px;
    z-index: 2000;
    cursor: pointer;
    transition: transform 0.3s;
    animation: pulse-glow 2s infinite;
}
.support-floater:active { transform: scale(0.9); }
.support-floater img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
}

/* Popup Menu */
.support-popup {
    display: none;
    position: fixed;
    bottom: 230px;
    right: 25px;
    width: 220px;
    background: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 85, 0, 0.3);
    border-radius: 15px;
    padding: 15px;
    flex-direction: column;
    gap: 10px;
    z-index: 1999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    animation: slideUp 0.3s ease-out;
}

.popup-header {
    text-align: center;
    color: #fff;
    font-family: 'Orbitron';
    font-size: 0.9rem;
    margin-bottom: 5px;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #ccc;
    font-weight: bold;
    transition: 0.3s;
    border: 1px solid transparent;
}
.contact-item:hover {
    background: rgba(255, 85, 0, 0.1);
    border-color: var(--neon-orange);
    color: #fff;
}
.c-icon { width: 30px; height: 30px; object-fit: contain; }

@keyframes pulse-glow {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255,85,0,0)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 10px rgba(255,85,0,0.6)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(255,85,0,0)); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
