:root {
    --bg-main: #0a0a0e;
    --bg-surface: rgba(25, 25, 35, 0.6);
    --bg-surface-hover: rgba(45, 45, 60, 0.8);
    --accent: #6c5ce7;
    --accent-hover: #8073ea;
    --accent-glow: rgba(108, 92, 231, 0.5);
    
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-blur: blur(16px);
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    
    /* Subtle background gradient */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(0, 210, 211, 0.1) 0%, transparent 50%);
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #00d2d3);
    border-radius: 12px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #fff, #a0a0b0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Game List Navigation */
.game-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    /* Custom Scrollbar for sidebar */
    scrollbar-width: thin;
    scrollbar-color: var(--bg-surface-hover) transparent;
}

.game-list::-webkit-scrollbar {
    width: 6px;
}
.game-list::-webkit-scrollbar-thumb {
    background-color: var(--bg-surface-hover);
    border-radius: 10px;
}

/* Individual Game Card in Sidebar */
.game-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    background: transparent;
}

.game-card:hover {
    background: var(--bg-surface-hover);
    transform: translateX(4px);
}

.game-card.active {
    background: var(--bg-surface-hover);
    border-color: var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.game-card.active::before {
    content: '';
    position: absolute;
    left: -1rem;
    width: 4px;
    height: 30px;
    background: var(--accent);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--accent-glow);
}

.game-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: #2a2a35;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.game-title {
    font-weight: 600;
    font-size: 1rem;
}

.game-genre {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Top Bar */
.top-bar {
    height: 80px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(10, 10, 14, 0.9), transparent);
    z-index: 5;
}

.top-bar h2 {
    font-size: 1.8rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}
.avatar:hover {
    border-color: var(--accent);
}

/* Game Container Wrapper */
.game-container {
    flex: 1;
    padding: 0 2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-wrapper {
    width: 100%;
    height: 100%;
    max-width: 1400px; /* Constrain max width for ultra-wide */
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Iframe Styling */
#game-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 24px;
    background: #000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#game-frame.loaded {
    opacity: 1;
}

/* Empty State Styling */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.5;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* Trophy Button */
.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}
.hs-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}
.hs-btn:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}
.modal.show {
    display: flex;
}
.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover {
    color: #fff;
}
.modal-title {
    text-align: center;
    color: #fbc531;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(251, 197, 49, 0.3);
}

/* Tabs */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    justify-content: center;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}
.tab-btn:hover {
    color: #fff;
}
.tab-btn.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.tab-content {
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 8px;
    min-height: 200px;
}
