/* ===================================
   L'Atelier des Kanji - Mini-jeux Hub
   Pastel Theme: Beige, Orange, Green
   =================================== */

/* CSS Variables (matching dashboard) */
:root {
    /* Primary Colors */
    --orange-primary: #E67E5A;
    --orange-light: #F5A882;
    --orange-dark: #D15A3A;

    /* Secondary Colors */
    --green-primary: #7DB59A;
    --green-light: #A8D5BA;
    --green-dark: #5A9B7A;

    /* Neutral Colors */
    --beige-light: #FBF8F4;
    --beige-medium: #F5EDE3;
    --beige-dark: #E8DDD0;

    /* Background Colors */
    --bg-white: #FFFFFF;
    --bg-light: #FBF8F4;
    --bg-cream: #F9F5F0;

    /* Text Colors */
    --text-primary: #3D3A36;
    --text-secondary: #6B6560;
    --text-muted: #9A938A;
    --text-inverse: #FFFFFF;

    /* Accent Colors */
    --accent-gold: #D4A84B;
    --accent-pink: #E8A8B8;
    --accent-blue: #7BA3C9;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(61, 58, 54, 0.06);
    --shadow-md: 0 4px 12px rgba(61, 58, 54, 0.08);
    --shadow-lg: 0 8px 24px rgba(61, 58, 54, 0.12);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Typography */
    --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* Layout */
    --sidebar-width: 260px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ===================================
   SIDEBAR (Same as Dashboard)
   =================================== */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    background: var(--bg-white);
    border-right: 1px solid var(--beige-medium);
    display: flex;
    flex-direction: column;
    padding: var(--space-5);
}

.sidebar-top {
    flex: 1;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    margin-bottom: var(--space-6);
}

.logo-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--orange-light), var(--orange-primary));
    color: white;
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    border-radius: var(--radius-md);
}

.logo-text {
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--beige-light);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--orange-primary);
    color: var(--text-inverse);
}

.nav-item.active svg {
    stroke: var(--text-inverse);
}

.nav-item svg {
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--beige-light);
    border-radius: var(--radius-lg);
}

.user-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--green-light), var(--green-primary));
    color: white;
    font-weight: var(--font-weight-bold);
    border-radius: var(--radius-full);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
}

.user-link {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-link:hover {
    color: var(--orange-primary);
}

/* ===================================
   MAIN CONTENT
   =================================== */
.main-content {
    padding: var(--space-6);
    max-width: 1200px;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-6);
    gap: var(--space-5);
}

.header-content h1 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: 2rem;
    font-weight: var(--font-weight-extrabold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.header-icon {
    font-size: 2.5rem;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.header-stats {
    display: flex;
    gap: var(--space-4);
}

.stat-card {
    background: var(--bg-white);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-width: 120px;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: var(--font-weight-bold);
    color: var(--orange-primary);
}

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

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    background: var(--bg-white);
    padding: var(--space-2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-tab {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.filter-tab:hover {
    background: var(--beige-light);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--orange-primary);
    color: var(--text-inverse);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

/* Game Card */
.game-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: var(--space-5);
    background: linear-gradient(135deg, var(--beige-light) 0%, var(--beige-medium) 100%);
}

.game-icon {
    font-size: 3rem;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.game-badges {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-end;
}

.badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
}

.badge-level {
    background: var(--green-light);
    color: var(--green-dark);
}

.badge-duration {
    background: var(--beige-dark);
    color: var(--text-secondary);
}

.game-body {
    flex: 1;
    padding: var(--space-5);
}

.game-title {
    font-size: 1.4rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.game-subtitle {
    font-size: 0.95rem;
    color: var(--orange-primary);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-3);
}

.game-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-4);
}

.game-description strong {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

.game-skills {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.skill-tag {
    padding: var(--space-1) var(--space-2);
    background: var(--beige-light);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
}

.game-footer {
    padding: var(--space-4) var(--space-5);
    background: var(--beige-light);
    border-top: 1px solid var(--beige-medium);
}

.game-lessons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.lessons-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
}

.lesson-link-small {
    padding: var(--space-1) var(--space-2);
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

a.lesson-link-small:hover {
    background: var(--orange-light);
    color: var(--text-inverse);
}

.game-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--orange-light), var(--orange-primary));
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(230, 126, 90, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 90, 0.4);
}

.btn-outline {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 2px solid var(--beige-medium);
}

.btn-outline:hover {
    border-color: var(--orange-primary);
    color: var(--orange-primary);
}

.btn-small {
    padding: var(--space-2) var(--space-3);
    font-size: 0.85rem;
}

/* Tip Card */
.tip-card {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-5);
    background: linear-gradient(135deg, var(--green-light) 0%, var(--green-primary) 100%);
    border-radius: var(--radius-xl);
    color: var(--text-inverse);
}

.tip-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.tip-content h3 {
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-2);
}

.tip-content p {
    font-size: 0.95rem;
    opacity: 0.95;
    line-height: 1.6;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 900px) {
    body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        padding: var(--space-4);
    }

    .page-header {
        flex-direction: column;
    }

    .header-stats {
        width: 100%;
    }

    .stat-card {
        flex: 1;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header-content h1 {
        font-size: 1.5rem;
    }

    .header-icon {
        font-size: 2rem;
    }

    .filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .game-actions {
        flex-direction: column;
    }

    .game-actions .btn {
        width: 100%;
    }

    .tip-card {
        flex-direction: column;
        text-align: center;
    }
}