/* 
   GAME LIVE - MODERN HUB THEME
   Minimalist • Glassmorphism • Premium
*/

:root {
    --primary-glow: rgba(145, 70, 255, 0.6);
    --card-radius: 24px;
}

body {
    background: #050505;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    overflow-x: hidden;
}

/* --- DYNAMIC BACKGROUND --- */
.app-background {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15), transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.15), transparent 40%);
    background-color: #08080c;
}

.scanlines {
    display: none; /* Cleaner look without scanlines */
}

/* --- HUB LAYOUT --- */
.hub-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 1rem 1rem;
    gap: 1.5rem;
    position: relative;
    z-index: 10;
}

/* --- MAIN LOGO REMOVED --- */

/* --- GAMES GRID --- */
.games-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    max-width: 75rem; /* Increased container width */
    perspective: 1000px;
}

/* --- GAME CARD --- */
.game-card {
    flex: 1 1 18rem; /* Reduced flex basis */
    max-width: 22rem; /* Reduced max width */
    background: rgba(30, 30, 35, 0.7);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: var(--glass-border);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: auto;
    min-height: 32rem; /* Reduced height */
    padding: 1.5rem;
    gap: 1.2rem;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s;
}

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(145, 70, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.game-card:hover::before {
    opacity: 1;
}

/* Card Image Area */
.game-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* Perfect Square */
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.game-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.game-card:hover .game-card-image img {
    transform: scale(1.1);
}

/* Typography */
.game-card h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0.5rem 0 0;
    color: white; /* Solid white for better readability */
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.game-card p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8); /* Lighter text */
    text-align: center;
    line-height: 1.6;
    margin: 0;
    flex-grow: 1;
}

/* Button */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: white;
    color: black;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    display:flex; justify-content:center; align-items:center;
}

.btn-primary:hover {
    background: var(--primary-glow);
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
}

/* DISABLED CARD */
.game-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-style: solid;
    filter: blur(4px) grayscale(0.8);
    transition: filter 0.3s;
}

.game-card.disabled:hover {
    filter: blur(2px) grayscale(0.6);
    transform: none;
    box-shadow: none;
}

.game-card.disabled .btn-primary {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.2);
}

/* --- TOP BAR (Redesigned - Compact Floating) --- */
/* (Moved to common.css but restored here to override style.css conflicts) */
.user-profile-bar {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 62rem;
    height: 3.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: rgba(20, 20, 25, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, background 0.3s;
    right: auto; /* Reset style.css override */
}

.user-profile-bar:hover {
    transform: translateX(-50%) !important;
}

.highlight-urgent {
    animation: pulse-red 0.8s ease-in-out infinite;
    background: #FF4444 !important;
    color: white !important;
    box-shadow: 0 0 20px var(--accent);
    transform: scale(1.1);
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7); transform: scale(1); }
    50% { box-shadow: 0 0 20px 10px rgba(255, 68, 68, 0); transform: scale(1.1); }
    100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); transform: scale(1); }
}

/* Audio Popover */
.audio-popover {
    position: absolute;
    top: 4.375rem;
    right: 0;
    width: 15rem;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
    transform-origin: top right;
    animation: popIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.audio-popover.hidden {
    display: none;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.9) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Sliders */
.slider-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; 
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s;
}

.slider-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}



.btn-logout-icon {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px;
}

.btn-logout-icon:hover {
    color: #ff4444;
}

.btn-login-bar {
    background: white;
    color: black;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-login-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,255,255,0.2);
}

.btn-login-bar svg {
    fill: black; /* Invert icon color for white button */
}

/* FOOTER CREDITS */
.hub-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.hub-footer .credits,
.hub-footer .separator,
.hub-footer .version {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

.hub-footer .separator {
    opacity: 0.3;
}

.hub-footer .credits a {
    color: rgba(145, 70, 255, 0.8);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.hub-footer .credits a:hover {
    color: #9146FF;
    text-shadow: 0 0 8px rgba(145, 70, 255, 0.4);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hub-main-logo {
        width: 280px;
    }
    
    .user-profile-bar {
        padding: 0 20px;
    }
    
    .games-grid {
        gap: 1rem;
    }
}

/* STATS DASHBOARD */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 3rem auto 1rem; /* Increased top margin for separation */
    padding: 0 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    border-radius: var(--radius-lg);
    padding: 1.2rem; /* Reduced padding */
    display: flex;
    align-items: center;
    gap: 1rem; /* Reduced gap */
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.08);
}

.stat-icon {
    font-size: 2rem; /* Reduced size */
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-value {
    font-size: 1.8rem; /* Reduced size */
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}



/* BADGES STYLES */
.full-width {
    width: 100%;
}

.badge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    width: 100%;
}

.badge-count {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 700;
}

.badges-grid {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badge-item {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
}

.badge-item img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.3);
    transition: all 0.5s;
}

.badge-item.unlocked {
    background: radial-gradient(circle at center, rgba(145, 70, 255, 0.2), rgba(0,0,0,0.3));
    border-color: rgba(145, 70, 255, 0.5);
    box-shadow: 0 0 15px rgba(145, 70, 255, 0.2);
}

.badge-item.unlocked img {
    filter: grayscale(0%) opacity(1) drop-shadow(0 0 5px rgba(255,255,255,0.2));
    transform: scale(1.1);
}

.badge-item:hover .badge-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.badge-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid var(--accent);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    z-index: 10;
    margin-bottom: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    text-align: center;
}

.badge-tooltip strong {
    display: block;
    color: #fff;
    margin-bottom: 2px;
}

.badge-tooltip span {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* HISTORY PANEL */
.history-panel {
    max-width: 45rem;
    margin: 2rem auto 4rem;
    padding: 0 2rem;
}

.history-panel h3 {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.history-list {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.history-title {
    font-weight: 600;
    color: var(--text-main);
}

.history-details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.no-history {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}
