/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-page:    #0a0a14;
    --bg-card:    #12121f;
    --bg-card2:   #1a1a2e;
    --border:     rgba(99, 102, 241, 0.2);
    --accent:     #6366f1;
    --accent-h:   #818cf8;
    --accent-dim: rgba(99, 102, 241, 0.15);
    --text-main:  #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim:   #475569;
    --danger:     #ef4444;
    --success:    #22c55e;
    --radius:     12px;
    --radius-sm:  8px;
    --shadow:     0 4px 24px rgba(0, 0, 0, 0.4);
}

html, body {
    height: 100%;
    background: var(--bg-page);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}

a { color: var(--accent-h); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Navbar ===== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: rgba(18, 18, 31, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.nav-logo { font-size: 1.4rem; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--text-main); text-decoration: none; }

.nav-user {
    font-size: 0.85rem;
    color: var(--accent-h);
    background: var(--accent-dim);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.nav-btn-logout {
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.nav-btn-logout:hover {
    color: var(--danger);
    border-color: var(--danger);
    text-decoration: none;
}

/* ===== Main ===== */
.main-content { min-height: calc(100vh - 56px); }

/* ===== Messages ===== */
.messages { padding: 0.75rem 2rem 0; }
.message {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.message-error   { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.message-success { background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.3);  color: #86efac; }
.message-warning { background: rgba(234,179,8,0.12);  border: 1px solid rgba(234,179,8,0.3);  color: #fde047; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-h);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
    text-decoration: none;
    color: #fff;
}

.btn-full { width: 100%; display: block; }

.btn-disabled {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(255,255,255,0.05);
    color: var(--text-dim);
    cursor: not-allowed;
    border: 1px solid var(--border);
}

/* ===== Login ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.08) 0%, transparent 60%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-header { text-align: center; margin-bottom: 2rem; }

.login-logo {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.login-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-form { display: flex; flex-direction: column; gap: 1.2rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    color: var(--text-main);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-group input::placeholder { color: var(--text-dim); }

/* ===== Dashboard ===== */
.dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.dashboard-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #e2e8f0, var(--accent-h));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.dashboard-welcome {
    color: var(--text-muted);
    font-size: 1rem;
}

.dashboard-stats {
    flex-shrink: 0;
}

.stat-badge {
    background: var(--accent-dim);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.5rem;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-h);
    line-height: 1;
}

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

.section-title {
    margin-bottom: 1.25rem;
}

.section-title h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== Games Grid ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.game-card:not(.game-card-coming-soon):hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 32px rgba(99,102,241,0.2);
}

.game-card-coming-soon {
    opacity: 0.5;
}

.game-card-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.game-card-body { flex: 1; }

.game-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.game-card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.game-card-footer { margin-top: auto; }
