/* Telegram Game Hub - Main Styles */
:root {
    /* Telegram Theme Colors */
    --tg-theme-bg-color: #17212b;
    --tg-theme-text-color: #ffffff;
    --tg-theme-button-color: #5288c1;
    --tg-theme-secondary-bg-color: #232e3c;
    
    /* Neon Theme Colors */
    --neon-blue: #00f3ff;
    --neon-purple: #b967ff;
    --neon-pink: #ff00ff;
    --neon-green: #00ff9d;
    --neon-yellow: #ffde00;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body .telegram-game-hub {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Loading Screen */
.tgh-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.tgh-loader {
    text-align: center;
}

.tgh-loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--neon-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Game Container */
.tgh-game-container {
    max-width: 100%;
    min-height: 600px;
    padding: 20px;
}

/* Game Hub Layout */
.tgh-hub {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.tgh-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
}

.tgh-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
}

.tgh-user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.tgh-user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--neon-blue);
    object-fit: cover;
}

.tgh-coin-display {
    background: linear-gradient(135deg, #2a2a4e 0%, #1a1a3e 100%);
    padding: 10px 20px;
    border-radius: 15px;
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tgh-coin-icon {
    color: var(--neon-yellow);
    font-size: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Game Grid */
.tgh-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tgh-game-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.tgh-game-card:hover {
    transform: translateY(-5px);
    border-color: var(--neon-blue);
    box-shadow: 0 10px 30px rgba(0, 243, 255, 0.2);
}

.tgh-game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink));
}

.tgh-game-icon {
    font-size: 48px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px currentColor);
}

.tgh-game-1 .tgh-game-icon { color: var(--neon-yellow); }
.tgh-game-2 .tgh-game-icon { color: var(--neon-blue); }
.tgh-game-3 .tgh-game-icon { color: var(--neon-green); }
.tgh-game-4 .tgh-game-icon { color: var(--neon-pink); }
.tgh-game-5 .tgh-game-icon { color: var(--neon-purple); }

.tgh-game-cooldown {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--neon-yellow);
    opacity: 0.8;
}

/* Buttons */
.tgh-btn {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.tgh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 243, 255, 0.3);
}

.tgh-btn:active {
    transform: translateY(0);
}

.tgh-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.tgh-btn:hover::before {
    left: 100%;
}

/* Ads Container */
.tgh-ads-container {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.tgh-ad-reward {
    background: linear-gradient(135deg, #2a4e23 0%, #1a3e1a 100%);
    border: 1px solid var(--neon-green);
    padding: 15px;
    border-radius: 15px;
    margin: 15px 0;
    box-shadow: 0 0 20px rgba(0, 255, 157, 0.2);
}

/* Modal */
.tgh-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.tgh-modal.active {
    display: flex;
}

.tgh-modal-content {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.2);
}

.tgh-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.tgh-modal-close:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff0000;
}

/* Leaderboard */
.tgh-leaderboard {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    margin-top: 30px;
}

.tgh-leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.tgh-leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.tgh-rank {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.tgh-rank-1 { background: linear-gradient(135deg, #ffd700, #ffed4e); color: #000; }
.tgh-rank-2 { background: linear-gradient(135deg, #c0c0c0, #e0e0e0); color: #000; }
.tgh-rank-3 { background: linear-gradient(135deg, #cd7f32, #e39e53); color: #000; }

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.tgh-floating {
    animation: float 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 10px currentColor; }
    50% { box-shadow: 0 0 20px currentColor; }
}

.tgh-glow {
    animation: glow 2s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .tgh-game-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .tgh-header {
        padding: 15px;
    }
    
    .tgh-user-info {
        flex-direction: column;
        text-align: center;
    }
    
    .tgh-game-card {
        min-height: 180px;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .tgh-game-grid {
        grid-template-columns: 1fr;
    }
    
    .tgh-game-container {
        padding: 10px;
    }
}