:root {
    --bg-main: #0a0b10;
    --bg-secondary: rgba(18, 20, 28, 0.7);
    --bg-tertiary: rgba(28, 31, 43, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --text-accent: #6ee7b7; /* success/highlight */
    
    --primary: #6366f1; /* indigo */
    --primary-hover: #4f46e5;
    --secondary: #ec4899; /* pink */
    --danger: #ef4444; /* red */
    --warning: #fbbf24; /* yellow */
    --success: #10b981; /* emerald */

    --font-ui: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Animated Shapes */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.6;
    animation: drift 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}
.bg-shape-1 { left: -10vw; top: -10vh; width: 40vw; height: 40vw; background: rgba(99, 102, 241, 0.3); }
.bg-shape-2 { right: -5vw; bottom: -5vh; width: 35vw; height: 35vw; background: rgba(236, 72, 153, 0.25); animation-delay: -10s; }

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10vw, 15vh) scale(1.1); }
}

/* Base App Layout */
.app-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.glass-panel {
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
}

/* Typography elements */
h1, h2, h3, h4 { color: #fff; font-weight: 600; }
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}
.mono { font-family: var(--font-mono); }

/* Buttons */
.btn {
    appearance: none; border: none; outline: none; background: none;
    cursor: pointer; font-family: var(--font-ui); font-size: 0.9rem; font-weight: 500;
    padding: 10px 18px; border-radius: var(--radius-sm);
    transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(to right, var(--primary), var(--primary-hover)); color: #fff; box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-main); border: 1px solid var(--glass-border); }
.btn-secondary:hover { background: rgba(255,255,255,0.05); }
.btn-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn-success { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.btn-success:hover { background: rgba(16, 185, 129, 0.2); }
.btn-warning { background: rgba(251, 191, 36, 0.1); color: var(--warning); border: 1px solid rgba(251, 191, 36, 0.3); }
.btn-warning:hover { background: rgba(251, 191, 36, 0.2); }

/* Inputs */
.input-group { margin-bottom: 16px; display: flex; flex-direction: column; }
.input-group label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.input-control {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 16px; color: var(--text-main); font-family: inherit; font-size: 0.95rem;
    transition: border-color 0.2s; outline: none; width: 100%;
}
.input-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }

/* Public Home & Store Layout */
.home-wrapper { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(145deg, var(--bg-main) 0%, rgba(20,22,35,1) 100%); position: relative; overflow: hidden; }
.flare { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; }
.flare-1 { top: -20%; left: -10%; width: 50vw; height: 50vw; background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%); }
.flare-2 { bottom: -10%; right: -10%; width: 40vw; height: 40vw; background: radial-gradient(circle, rgba(236,72,153,0.1) 0%, transparent 70%); }
.flare-3 { top: 10%; right: -10%; width: 40vw; height: 40vw; background: radial-gradient(circle, rgba(99,102,241,0.1) 0%, transparent 70%); }

.public-header { padding: 24px 40px; display: flex; justify-content: space-between; align-items: center; z-index: 1; border-bottom: 1px solid rgba(255,255,255,0.03); }
.header-brand-group { display: flex; align-items: center; gap: 24px; }
.header-logo { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.header-logo i { font-size: 2rem; }
.header-logo .brand { font-size: 1.8rem; margin: 0; font-weight: 800; letter-spacing: -0.5px; color: #fff; text-align: left;}
.header-store-link { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 1rem; transition: color 0.2s; }
.header-store-link:hover { color: #fff; }
.header-actions { display: flex; gap: 16px; }
.btn-signin { padding: 10px 24px; border-radius: 24px; }
.btn-getstarted { padding: 10px 24px; border-radius: 24px; box-shadow: 0 8px 24px rgba(99,102,241,0.4); }

.home-hero { flex: 1; padding: 80px 24px; max-width: 1400px; margin: 0 auto; width: 100%; z-index: 1; display: flex; flex-direction: column; justify-content: center; }
.home-hero.p-store { padding: 40px 24px; justify-content: flex-start; }
.hero-content { text-align: center; position: relative; }
.hero-subtitle { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 3px; color: var(--primary); font-weight: 700; margin-bottom: 16px; display: block; }
.hero-title { font-size: 5rem; margin-bottom: 24px; line-height: 1.1; font-weight: 800; }
.hero-description { font-size: 1.2rem; max-width: 650px; margin: 0 auto; line-height: 1.6; }
.hero-actions { margin-top: 40px; display: flex; gap: 16px; justify-content: center; }
.btn-lg { font-size: 1.1rem; padding: 16px 36px; border-radius: 32px; font-weight: 600; }

/* Login Page */
.login-view { display: flex; align-items: center; justify-content: center; flex: 1; }
.login-card { width: 100%; max-width: 420px; padding: 40px; position: relative; overflow: hidden; }
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 2rem; margin-bottom: 8px; }
.login-header p { color: var(--text-muted); font-size: 0.95rem; }

/* Dashboard Layout */
.dashboard-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; min-height: calc(100vh - 48px); position: relative; }
.mobile-header { display: none; }
.sidebar-backdrop { display: none; }
.mobile-close-btn { display: none; }

/* Sidebar */
.sidebar { padding: 24px; display: flex; flex-direction: column; position: sticky; top: 24px; height: calc(100vh - 48px); }
.brand { font-size: 1.4rem; font-weight: 700; margin-bottom: 40px; text-align: center; }
.nav-menu { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0; padding-right: 4px; margin-bottom: 12px; }
.nav-menu::-webkit-scrollbar { width: 4px; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.nav-link {
    padding: 12px 16px; border-radius: var(--radius-sm); color: var(--text-muted);
    text-decoration: none; display: flex; align-items: center; gap: 12px; font-weight: 500;
    transition: var(--transition); cursor: pointer; border: 1px solid transparent; flex-shrink: 0;
}
.nav-link:hover { background: rgba(255,255,255,0.03); color: var(--text-main); }
.nav-link.active { background: rgba(99, 102, 241, 0.1); color: var(--primary); border-color: rgba(99, 102, 241, 0.2); }
.user-profile-sm { margin-top: auto; padding-top: 24px; border-top: 1px solid var(--glass-border); display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.profile-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.profile-name { font-size: 0.9rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.user-profile-sm .btn { flex-shrink: 0; }

/* Profile Layoyt */
.profile-layout { display: flex; gap: 32px; align-items: flex-start; }
.profile-details-grid { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.profile-avatar-block { display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* Main Content Area */
.main-content { display: flex; flex-direction: column; gap: 24px; overflow: hidden; padding-bottom: 40px;}

/* Topbar / Header in content */
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--glass-border); }
.view-title { font-size: 1.6rem; }
.view-actions { display: flex; gap: 12px; }

/* Dashboard Cards (Stats) */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px;}
.stat-card { padding: 20px; border-top: 2px solid var(--primary); position: relative; overflow: hidden; transition: transform 0.2s;}
.stat-card:hover { transform: translateY(-3px); }
.stat-card::before { content: ''; position: absolute; top:0; left:0; right:0; height: 50px; background: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, transparent 100%); pointer-events: none;}
.stat-label { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.5px;}
.stat-value { font-size: 2rem; font-weight: 700; font-family: var(--font-mono); }

/* Announcement Ribbon */
.announcement-ribbon { padding: 12px 16px; background: rgba(99, 102, 241, 0.15); border-left: 4px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-main); font-size: 0.95rem; }

/* Markdown Styling */
.markdown-body { color: var(--text-main); line-height: 1.6; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { color: #fff; margin-top: 1.5em; margin-bottom: 0.5em; font-weight: 600; line-height: 1.25; }
.markdown-body h1 { font-size: 2em; padding-bottom: 0.3em; border-bottom: 1px solid var(--glass-border); }
.markdown-body h2 { font-size: 1.5em; padding-bottom: 0.3em; border-bottom: 1px solid var(--glass-border); }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body p, .markdown-body ul, .markdown-body ol { margin-top: 0; margin-bottom: 16px; }
.markdown-body ul, .markdown-body ol { padding-left: 2em; list-style-type: disc; }
.markdown-body ul ul, .markdown-body ul ol, .markdown-body ol ul, .markdown-body ol ol { margin-bottom: 0; }
.markdown-body li { word-wrap: break-all; margin-bottom: 0.25em; }
.markdown-body a { color: var(--primary); text-decoration: none; font-weight: 500; }
.markdown-body a:hover { text-decoration: underline; }
.markdown-body strong { font-weight: 700; color: #fff; }
.markdown-body hr { height: 1px; border: none; background: var(--glass-border); margin: 24px 0; }
.markdown-body code { font-family: var(--font-mono); font-size: 0.9em; padding: 0.2em 0.4em; background: rgba(0,0,0,0.3); border-radius: 4px; color: var(--secondary); }

/* Tables */
.table-container { width: 100%; overflow-x: auto; background: var(--bg-tertiary); border-radius: var(--radius-md); border: 1px solid var(--glass-border); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 16px; background: rgba(0,0,0,0.2); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--glass-border); }
td { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 0.9rem; }
tr:hover td { background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-flex; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.badge-warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge-primary { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.badge-neutral { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

/* Games List (User) */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.game-card { padding: 20px; display: flex; flex-direction: column; gap: 16px; position: relative; overflow: hidden; }
.game-card.locked { opacity: 0.5; filter: grayscale(80%); pointer-events: none; }
.game-icon { font-size: 2rem; color: var(--primary); margin-bottom: 8px;}
.game-title { font-size: 1.25rem; font-weight: 600; }
.game-files { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--glass-border); padding-top: 16px; }
.file-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); }
.file-version { font-family: var(--font-mono); font-size: 0.85rem; color: var(--secondary); }

/* Ticket Chat System - Modernized */
.tickets-layout { display: flex; border: 1px solid var(--glass-border); border-radius: var(--radius-lg); height: 650px; overflow: hidden; background: var(--bg-tertiary); box-shadow: var(--glass-shadow); }
.ticket-list { width: 320px; border-right: 1px solid var(--glass-border); display: flex; flex-direction: column; background: rgba(0,0,0,0.2); z-index: 10; }
.ticket-list-header { padding: 20px; font-weight: 600; font-size: 1.1rem; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; }
.ticket-scroll { flex: 1; overflow-y: auto; }
.ticket-scroll::-webkit-scrollbar { width: 6px; }
.ticket-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.ticket-item { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer; transition: all 0.2s ease; position: relative; }
.ticket-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; transition: all 0.2s ease; }
.ticket-item:hover { background: rgba(255,255,255,0.04); }
.ticket-item.active { background: rgba(99, 102, 241, 0.08); }
.ticket-item.active::before { background: var(--primary); }
.ticket-subject { font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; color: var(--text-muted); }
.ticket-status { padding: 2px 8px; border-radius: 12px; font-weight: 600; font-size: 0.7rem; text-transform: uppercase; }
.status-open { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-closed { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

.ticket-chat { flex: 1; display: flex; flex-direction: column; background: var(--bg-secondary); position: relative; }
.chat-header { padding: 20px 24px; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.02); backdrop-filter: blur(10px); z-index: 10; }
.chat-header-info h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.chat-header-info span { font-size: 0.8rem; color: var(--text-muted); }
.chat-messages { flex: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; background: linear-gradient(180deg, var(--bg-secondary) 0%, rgba(10, 11, 16, 0.95) 100%); scroll-behavior: smooth; }
.msg-row { display: flex; width: 100%; flex-direction: column; margin-bottom: 4px; }
.msg-row.sent { align-items: flex-end; }
.msg-row.received { align-items: flex-start; }
.msg-bubble { max-width: 75%; padding: 14px 18px; font-size: 0.95rem; line-height: 1.5; box-shadow: 0 4px 15px rgba(0,0,0,0.1); word-break: break-word; }
.msg-row.sent .msg-bubble { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: #fff; border-radius: 18px 18px 4px 18px; }
.msg-row.received .msg-bubble { background: var(--bg-tertiary); color: var(--text-main); border: 1px solid var(--glass-border); border-radius: 18px 18px 18px 4px; }
.msg-meta { font-size: 0.7rem; margin-top: 6px; color: var(--text-muted); opacity: 0.8; display: flex; gap: 8px; }
.chat-input-wrapper { padding: 20px 24px; border-top: 1px solid var(--glass-border); background: rgba(255,255,255,0.02); }
.chat-input { display: flex; gap: 12px; background: rgba(0,0,0,0.4); border: 1px solid var(--glass-border); border-radius: 24px; padding: 6px 6px 6px 20px; align-items: center; transition: all 0.2s; }
.chat-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15); }
.chat-input input { flex: 1; background: transparent; border: none; outline: none; color: #fff; font-size: 0.95rem; }
.chat-input .btn-send { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; transition: all 0.2s; }
.chat-input .btn-send:hover { background: var(--primary-hover); transform: scale(1.05); }
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); opacity: 0.7; }
.chat-empty i { font-size: 4rem; margin-bottom: 20px; color: var(--text-muted); opacity: 0.3; }

/* Modals */
.hidden { display: none !important; }
#modal-backdrop { position: fixed; top:0; left:0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; opacity: 1; transition: opacity 0.3s; }
.modal { width: 100%; max-width: 500px; padding: 32px; position: relative; animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; transition: color 0.2s; }
.modal-close:hover { color: #fff; }
@keyframes slideUp { from { transform: translateY(20px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }

/* Toast */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; pointer-events: none;}
.toast { background: var(--bg-tertiary); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); padding: 12px 20px; border-radius: var(--radius-sm); color: #fff; box-shadow: 0 4px 15px rgba(0,0,0,0.3); font-size: 0.9rem; display: flex; align-items: center; gap: 10px; pointer-events: auto; animation: slideInRight 0.3s forwards; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Submenu Context Menu */
.ctx-menu { position: fixed; background: var(--bg-secondary); backdrop-filter: blur(14px); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 4px; box-shadow: var(--glass-shadow); z-index: 1050; display: none; min-width: 160px; animation: fadeIn 0.15s ease-out;}
.ctx-menu.active { display: block; }
.ctx-item { padding: 8px 12px; font-size: 0.85rem; color: var(--text-main); cursor: pointer; border-radius: 4px; transition: background 0.2s; display: flex; align-items: center; gap: 8px; }
.ctx-item:hover { background: rgba(255,255,255,0.05); }
.ctx-item i { width: 16px; text-align: center; color: var(--text-muted); }
.ctx-sep { height: 1px; background: var(--glass-border); margin: 4px 0; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Inner View Tabs */
.view-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--glass-border); padding-bottom: 8px; }
.view-tab { padding: 8px 16px; font-size: 0.9rem; font-weight: 500; cursor: pointer; color: var(--text-muted); transition: var(--transition); border-bottom: 2px solid transparent; border-radius:4px 4px 0 0; }
.view-tab:hover { color: var(--text-main); background: rgba(255,255,255,0.02); }
.view-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(99, 102, 241, 0.05); }

/* Data loading skeleton or specific utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; }
.text-danger { color: var(--danger); } .text-success { color: var(--success); } .text-muted { color: var(--text-muted); }

/* =========================================
   MOBILE RESPONSIVENESS (Max-width: 900px)
   ========================================= */
@media(max-width: 900px) {
    .app-container { padding: 12px; }
    
    .dashboard-layout { 
        display: flex; flex-direction: column; gap: 16px; 
    }
    
    /* Show Mobile Header */
    .mobile-header {
        display: flex; justify-content: space-between; align-items: center;
        background: var(--bg-secondary); backdrop-filter: blur(16px);
        padding: 16px 20px; border-radius: var(--radius-md); 
        border: 1px solid var(--glass-border);
        position: sticky; top: 12px; z-index: 100;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    }
    
    .mobile-menu-btn {
        background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; display: flex;
    }
    
    .mobile-close-btn { 
        display: block; position: absolute; top: 16px; right: 16px; 
        background: none; border: none; color: #fff; font-size: 1.4rem; 
        cursor: pointer; padding: 10px; z-index: 201;
    }

    /* Convert Sidebar to Slide-out Menu */
    .sidebar {
        position: fixed; top: 0; bottom: 0; left: 0; width: 280px; height: auto;
        z-index: 200; border-radius: 0; background: var(--bg-main);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
        padding: 24px; padding-top: 64px; padding-bottom: calc(24px + env(safe-area-inset-bottom));
        overflow-y: auto;
        display: flex; flex-direction: column;
    }
    .sidebar.open { transform: translateX(0); }
    
    /* Backdrop */
    .sidebar-backdrop {
        display: block; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.6); backdrop-filter: blur(2px);
        z-index: 199; opacity: 0; pointer-events: none; transition: opacity 0.3s;
    }
    .sidebar.open ~ .sidebar-backdrop, .dashboard-layout:has(.sidebar.open) > .sidebar-backdrop {
        opacity: 1; pointer-events: auto;
    }

    /* Adjust main content */
    .main-content { padding-bottom: 40px; }
    #main-content { padding: 20px; }
    
    /* Table to Card styling */
    .table-container { border: none; border-radius: 0; background: transparent; overflow: visible; padding: 0; }
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { display: none; }
    tr {
        background: var(--bg-secondary);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-md);
        margin-bottom: 16px;
        padding: 8px 16px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        padding: 12px 0;
        font-size: 0.95rem;
        word-break: break-word;
        text-align: right;
    }
    td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.75rem;
        text-align: left;
    }
    td:last-child { border-bottom: none; }
    
    /* Simulate labels by forcing items to the right and allowing them to expand */
    td > * { max-width: 100%; }

    /* Login Mobile Adjustments */
    .login-card { padding: 24px; max-width: 100%; border-radius: var(--radius-lg); }

    /* Fix stats grid */
    .stats-grid { grid-template-columns: 1fr; gap: 12px; }

    /* Profile Layout Mobile */
    .profile-layout { flex-direction: column; align-items: center; text-align: center; }
    .profile-details-grid { grid-template-columns: 1fr; width: 100%; text-align: left; }

    /* General fixes for store and tickets */
    .games-grid { grid-template-columns: 1fr; gap: 16px; }
    
    .tickets-layout { flex-direction: column; height: calc(100vh - 120px); min-height: 600px; }
    .ticket-list { width: 100%; height: 35vh; min-height: 180px; max-height: 300px; border-right: none; border-bottom: 1px solid var(--glass-border); flex-shrink: 0; }
    .ticket-chat { flex: 1; min-height: 0; }
    .chat-header { padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .chat-header-info h4 { font-size: 1rem; }
    .chat-messages { padding: 16px; gap: 12px; }
    .msg-bubble { max-width: 95%; font-size: 0.9rem; padding: 12px 14px; }
    .chat-input-wrapper { padding: 12px; }
    .chat-input { padding: 4px 4px 4px 16px; }

    /* Public Home Layout Mobile Overrides */
    .public-header { padding: 16px 20px; flex-direction: column; gap: 16px; }
    .header-logo i { font-size: 1.5rem; }
    .header-logo .brand { font-size: 1.4rem; }
    .header-actions { width: 100%; justify-content: space-between; gap: 8px; }
    .btn-signin, .btn-getstarted { flex: 1; text-align: center; padding: 10px 16px; font-size: 0.9rem; }
    
    .home-hero { padding: 40px 16px; }
    .hero-title { font-size: 2.5rem; }
    .hero-description { font-size: 1rem; }
    .hero-actions { flex-direction: column; }
    .btn-lg { width: 100%; }
}
