/* dashboard styles extracted from dashboard.php inline styles */

/* loading overlay */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #02040f 0%, #090d1c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    padding: 20px;
}

.loading-screen .logo-section { text-align: center; margin-bottom: 24px; }
.loading-screen .app-title { font-size: clamp(1.8rem, 4vw, 2.4rem); color: white; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.5px; }
.loading-screen .app-subtitle { font-size: 0.8rem; color: rgba(255,255,255,0.9); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 20px; }
.loading-screen .logo { font-size: 64px; margin-bottom: 10px; animation: bounce 0.6s ease-in-out infinite; }

@keyframes bounce { 0%,100%{ transform: translateY(0); } 50%{ transform: translateY(-16px); } }

.loading-screen .loading-text { font-size: 1rem; color: white; font-weight: 600; letter-spacing: 2px; margin-bottom: 20px; text-transform: uppercase; }
.loading-screen .progress-bar-container { width: min(280px, 80vw); height: 18px; background: rgba(255,255,255,0.2); border: 2px solid white; border-radius: 999px; overflow: hidden; padding: 2px; position: relative; }
.loading-screen .progress-bar { height: 100%; background: linear-gradient(90deg, #ff6b6b, #ffa500, #ffff00, #00ff00, #00ccff, #0066ff, #6600ff); width: 0%; animation: fillBar 4.2s ease-in forwards; border-radius: 999px; }
@keyframes fillBar { 0%{ width:0%; } 100%{ width:100%; } }
.loading-screen p { font-size: 0.9rem; color: rgba(255,255,255,0.8); font-weight: 500; margin-top: 16px; }

body.dashboard-page {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e2e8f0;
    background: radial-gradient(circle at top left, rgba(56,189,248,0.14), transparent 22%), radial-gradient(circle at bottom right, rgba(124,58,237,0.16), transparent 24%), linear-gradient(180deg, #030712 0%, #081424 100%);
    display: block;
    padding: 0;
    overflow-x: hidden;
}

body.dashboard-page.desktop-device .dashboard-container {
    max-width: 1100px;
}

body.dashboard-page.mobile-device .dashboard-container {
    width: min(100%, calc(100% - 14px));
    padding: 14px;
    border-radius: 18px;
}

body.dashboard-page.mobile-device .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

body.dashboard-page.mobile-device .logout-btn {
    width: 100%;
    padding: 12px;
}

body.dashboard-page.mobile-device .stats-section {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

body.dashboard-page.mobile-device .games-grid {
    grid-template-columns: 1fr;
}

body.dashboard-page.mobile-device .game-card {
    min-height: 150px;
    padding: 12px;
}

body.dashboard-page.mobile-device .game-btn {
    padding: 10px;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent 30%);
    pointer-events: none;
}

.dashboard-container {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(2, 8, 23, 0.45);
    width: min(1100px, calc(100% - 16px));
    padding: clamp(16px, 3vw, 24px);
    margin: 10px auto 18px;
    backdrop-filter: blur(14px);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    padding-bottom: 14px;
    gap: 12px;
}

.welcome-section h1 {
    font-size: clamp(1.25rem, 2.7vw, 1.75rem);
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.2;
}

.welcome-section p {
    color: #94a3b8;
    font-size: 0.92rem;
    margin: 0;
}

.logout-btn {
    background: rgba(148, 163, 184, 0.14);
    color: #e2e8f0;
    padding: 10px 14px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.logout-btn:hover {
    background: rgba(148, 163, 184, 0.22);
    transform: translateY(-2px);
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #fff;
    padding: 12px 10px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(2, 8, 23, 0.16);
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-card h3 {
    font-size: 0.78rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 6px;
    letter-spacing: 0.08em;
}

.stat-card .value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}

.ai-feedback-card {
    background: linear-gradient(135deg, rgba(56,189,248,0.16), rgba(124,58,237,0.16));
    border: 1px solid rgba(125, 211, 252, 0.22);
    padding: 14px 16px;
    border-radius: 18px;
    margin-bottom: 16px;
    box-shadow: 0 10px 24px rgba(2, 8, 23, 0.16);
}

.ai-feedback-card h2 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
}

.ai-feedback-card h2::before { content: "🤖"; margin-right: 8px; font-size: 1rem; }
.ai-feedback-card p { margin: 0; color: #e2e8f0; line-height: 1.55; font-size: 0.94rem; }

.games-section { margin-bottom: 16px; }
.games-section h2 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}
.games-section h2::before { content: "⚙️"; margin-right: 8px; font-size: 1rem; }
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.game-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    padding: 14px;
    text-align: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 18px rgba(2, 8, 23, 0.16);
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.game-card:nth-child(2) {
    background: linear-gradient(135deg, rgba(56,189,248,0.12), rgba(124,58,237,0.14));
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(124,58,237,0.2);
    border-color: rgba(124,58,237,0.3);
    background: rgba(255,255,255,0.06);
}

.game-icon { font-size: 1.7rem; margin-bottom: 8px; }
.game-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: #fff; }
.game-card p { font-size: 0.84rem; color: #cbd5e1; margin-bottom: 10px; flex-grow: 1; line-height: 1.45; }
.game-btn {
    background: linear-gradient(135deg, #7c3aed, #38bdf8);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.game-btn:hover { transform: scale(1.01); box-shadow: 0 10px 22px rgba(124,58,237,0.26); }

.recent-section {
    background: rgba(255,255,255,0.03);
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.recent-section h2 { font-size: 1rem; color: #fff; margin-bottom: 8px; }
.recent-section p { margin: 0; color: #cbd5e1; font-size: 0.92rem; }
.no-attempts { text-align: center; color: #94a3b8; padding: 12px 8px; font-style: italic; }

@media (max-width: 900px) {
    .stats-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .dashboard-container { padding: 14px; margin: 8px auto 16px; border-radius: 18px; }
    .dashboard-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .logout-btn { width: 100%; padding: 12px; }
    .stats-section { grid-template-columns: 1fr 1fr; gap: 10px; }
    .games-grid { grid-template-columns: 1fr; }
    .game-card { min-height: 150px; padding: 12px; }
    .game-btn { padding: 10px; }
}

@media (max-width: 420px) {
    .stats-section { grid-template-columns: 1fr; }
    .stat-card { min-height: 78px; }
    .ai-feedback-card, .recent-section { padding: 12px 13px; }
}
