@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
    /* Color Palette (Neumorphism - Soft Yellow & Deep Red) */
    --bg-dark: #FFF7D3; /* Main Soft Yellow Background */
    --bg-panel: #FFF7D3; /* Same as background for neumorphism */
    --bg-panel-hover: #FFF7D3;
    --bg-panel-header: #FFF7D3;
    --border-light: var(--neu-dark);
    --border-hover: var(--accent-primary);
    
    --text-primary: #332D15;
    --text-secondary: #7A7256;
    --text-muted: #A39B7A;
    
    --accent-primary: #AB1509; /* Deep Rich Red */
    --accent-primary-hover: #8C1006;
    --accent-secondary: #AB1509;
    --accent-secondary-hover: #8C1006;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --font-main: 'Nunito', sans-serif;
    --font-jp: 'Noto Sans JP', sans-serif;
    
    /* Neumorphic Shadows */
    --neu-light: #fff9e6;
    --neu-dark: #d4cca0;
    --shadow-sm: 4px 4px 10px var(--neu-dark), -2px -2px 5px var(--neu-light);
    --shadow-lg: 8px 8px 18px var(--neu-dark), -4px -4px 10px var(--neu-light);
    --shadow-inset: inset 3px 3px 8px var(--neu-dark), inset -2px -2px 5px var(--neu-light);
    --shadow-glow: 4px 4px 12px rgba(171, 21, 9, 0.3), -2px -2px 8px rgba(255, 249, 230, 0.8);
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-norm: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --bg-gradients: none;
    --bg-card: #FFF7D3;
    --bg-card-hover: #FFF7D3;
}

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

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    background-image: var(--bg-gradients);
    background-attachment: fixed;
    height: 100vh;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.5;
    font-family: var(--font-main);
}

/* Base Utilities */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

.glass-panel {
    background: var(--bg-panel);
    border: none;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-norm);
}

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

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    font-family: var(--font-main);
}

.jp-text {
    font-family: var(--font-jp);
}

/* stat sub */
.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-up {
    color: var(--success) !important;
}

.stat-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 2px 0 2px;
}

/* ── SIDEBAR ── */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9;
    background: rgba(51,45,21,.4);
    backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

.sidebar {
    width: 240px;
    height: 100vh;
    background: var(--bg-panel);
    border-right: 1px solid var(--neu-dark);
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 4px 0 12px var(--neu-dark), -2px 0 6px var(--neu-light);
    transition: transform var(--transition-norm);
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--neu-dark);
}
.sidebar-logo-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-jp); font-size: 17px; font-weight: 900;
    color: var(--accent-primary); flex-shrink: 0;
}
.sidebar-logo-text {
    font-size: 17px; font-weight: 900;
    letter-spacing: -0.5px; color: var(--accent-primary);
    line-height: 1; flex: 1;
}
.sidebar-logo-text span {
    display: block; font-size: 10px; font-weight: 600;
    color: var(--text-muted); margin-top: 2px; letter-spacing: 0;
}
.sidebar-close-btn {
    display: none;
    width: 30px; height: 30px; border-radius: 8px;
    border: none; background: var(--bg-panel); box-shadow: var(--shadow-sm);
    color: var(--text-muted); font-size: 13px; cursor: pointer;
    align-items: center; justify-content: center;
    transition: all var(--transition-fast); flex-shrink: 0;
}
.sidebar-close-btn:hover { color: var(--accent-primary); }
.sidebar-nav {
    flex: 1; overflow-y: auto;
    padding: 10px 10px;
    display: flex; flex-direction: column; gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-nav { -ms-overflow-style: none; scrollbar-width: none; }

.nav-section { margin-bottom: 4px; }

.nav-label {
    font-size: 10px; text-transform: uppercase;
    letter-spacing: .08em; color: var(--text-muted);
    font-weight: 800; padding: 10px 10px 5px;
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700; font-size: 14px;
    transition: all var(--transition-fast);
    background: transparent;
}
.nav-icon {
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
    background: transparent;
    transition: all var(--transition-fast);
}
.nav-text { flex: 1; }

.nav-item:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(171,21,9,.05);
}
.nav-item:hover:not(.active) .nav-icon {
    background: rgba(171,21,9,.08);
    color: var(--accent-primary);
}

.nav-item.active {
    background: var(--accent-primary);
    color: #FFF7D3;
    box-shadow: 3px 3px 8px rgba(171,21,9,.25), -2px -2px 5px var(--neu-light);
}
.nav-item.active .nav-icon {
    background: rgba(255,247,211,.15);
    color: #FFF7D3;
}
.nav-item-admin { color: var(--warning); }
.nav-item-admin:hover:not(.active) { background: rgba(245,158,11,.08); }
.nav-item-admin:hover:not(.active) .nav-icon { background: rgba(245,158,11,.12); color: var(--warning); }

/* Legacy compat */
.logo-container { display: none; }
.logo-icon { display: none; }
.logo-text { display: none; }

/* Mobile sidebar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: 0; top: 0;
        transform: translateX(-100%);
        z-index: 10;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close-btn { display: flex; }

    /* Header mobile */
    .top-header { padding: 0 12px; gap: 8px; }
    .header-left { gap: 8px; }
    .search-bar { display: none; }
    .streak-btn span { display: none; }
    .streak-btn { padding: 8px 10px; min-width: 38px; justify-content: center; }
    .header-user-info { display: none; }
    .header-profile { min-width: 0; padding: 6px 8px; }
    .header-profile-caret { display: none; }
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
.top-header {
    height: 68px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-panel-header);
    border-bottom: none;
    box-shadow: 0 3px 8px var(--neu-dark), 0 -1px 3px var(--neu-light);
    z-index: 5;
    gap: 12px;
}
.header-left {
    display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
}
.hamburger-btn {
    display: none;
    width: 38px; height: 38px; border-radius: 10px;
    border: none; background: var(--bg-panel); box-shadow: var(--shadow-sm);
    color: var(--text-secondary); font-size: 15px; cursor: pointer;
    align-items: center; justify-content: center; flex-shrink: 0;
    transition: all var(--transition-fast);
}
.hamburger-btn:hover { box-shadow: var(--shadow-inset); color: var(--accent-primary); }

@media (max-width: 768px) {
    .hamburger-btn { display: flex; }
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-panel);
    border: none;
    border-radius: 99px;
    padding: 0 16px;
    flex: 1;
    min-width: 0;
    max-width: 360px;
    height: 40px;
    box-shadow: var(--shadow-inset);
    transition: all var(--transition-fast);
}

.search-bar:focus-within {
    box-shadow: var(--shadow-inset), 0 0 0 2px rgba(171, 21, 9, 0.2);
}

.search-bar i {
    color: var(--text-muted);
    font-size: 14px;
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0 12px;
    width: 100%;
    outline: none;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
}

.search-bar input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-profile-wrap {
    position: relative;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    max-width: 240px;
    height: 50px;
    padding: 6px 16px 6px 8px;
    border-radius: 99px;
    color: var(--text-primary);
    background: var(--bg-panel);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.header-profile:hover,
.header-profile-wrap.open .header-profile {
    box-shadow: var(--shadow-inset);
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    color: #FFF7D3;
    font-size: 0.9rem;
    font-weight: 800;
    background: var(--accent-primary);
    box-shadow: 2px 2px 6px rgba(171, 21, 9, 0.3);
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-user-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1;
}

.header-user-info strong {
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 800;
    white-space: nowrap;
}

.header-user-info small {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.header-profile-caret {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.72rem;
}

.profile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    padding: 8px;
    border-radius: 20px;
    border: none;
    background: var(--bg-panel);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: all var(--transition-fast);
    z-index: 30;
}

.header-profile-wrap.open .profile-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.profile-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--neu-dark);
}

.profile-menu-head p {
    margin: 0 0 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 800;
}

.profile-menu-head span {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.profile-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 99px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.profile-menu a:hover {
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.profile-menu a.danger {
    color: var(--danger);
}

.profile-menu a.danger:hover {
    background: rgba(239, 68, 68, 0.08);
    box-shadow: none;
}

.streak-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-panel);
    border: none;
    padding: 10px 18px;
    border-radius: 99px;
    color: var(--warning);
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    font-size: 13px;
}

.streak-btn:hover {
    box-shadow: var(--shadow-inset);
    transform: translateY(1px);
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    font-size: 16px;
}

.icon-btn:hover {
    box-shadow: var(--shadow-inset);
    color: var(--text-primary);
}

/* Dashboard Content Scroll Area */
.dashboard-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 36px 40px;
    background: var(--bg-dark);
}

.dashboard-scroll::-webkit-scrollbar {
    width: 6px;
}

.dashboard-scroll::-webkit-scrollbar-thumb {
    background: var(--neu-dark);
    border-radius: 6px;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.page-shell-balanced {
    max-width: 1080px;
    margin: 0 auto;
    width: 100%;
}

.page-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.page-topbar h2 {
    font-size: 24px;
    margin-bottom: 4px;
}

.page-topbar p {
    color: var(--text-secondary);
    font-size: 13px;
}

.ui-chip,
.vocab-chip,
.toolbar-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 16px;
    border-radius: 999px;
    text-decoration: none;
    background: var(--bg-panel);
    border: none;
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.ui-chip:hover,
.vocab-chip:hover,
.toolbar-chip:hover {
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.ui-chip.active,
.vocab-chip.active,
.toolbar-chip.active {
    background: var(--accent-primary);
    color: #FFF7D3;
    box-shadow: 3px 3px 8px rgba(171,21,9,0.3), -2px -2px 6px var(--neu-light);
}

.ui-status,
.status-pill,
.word-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ui-status.known,
.ui-status.mastered,
.status-pill.mastered,
.word-status.known {
    background: rgba(16,185,129,.14);
    color: #10b981;
}

.ui-status.learning,
.status-pill.learning,
.word-status.learning {
    background: rgba(245,158,11,.14);
    color: #f59e0b;
}

.ui-status.review,
.status-pill.review {
    background: rgba(239,68,68,.14);
    color: #ef4444;
}

.ui-status.new,
.status-pill.new {
    background: rgba(255,255,255,.06);
    color: var(--text-muted);
}

.icon-btn-lite {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn-lite:hover {
    box-shadow: var(--shadow-inset);
    color: var(--accent-primary);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--accent-primary);
    color: #FFF7D3;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
    z-index: 10001;
    opacity: 0;
    transition: all .3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-error {
    background: #ef4444;
}

/* Buttons */
/* Buttons */
.btn {
    font-family: var(--font-main);
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 99px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    background: var(--bg-panel);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    box-shadow: var(--shadow-inset);
    transform: translateY(1px);
}

.btn-primary {
    background: var(--accent-primary);
    color: #FFF7D3;
    box-shadow: 4px 4px 10px rgba(171, 21, 9, 0.3), -3px -3px 8px var(--neu-light);
}

.btn-primary:hover {
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.2), inset -2px -2px 5px rgba(255, 254, 240, 0.15);
    background: var(--accent-primary-hover);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: none;
}

.btn-outline:hover {
    background: rgba(171, 21, 9, 0.05);
    box-shadow: none;
}

.btn-join {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-join:hover {
    background: var(--success);
    color: white;
}

/* Hero Banner */
.hero-banner {
    position: relative;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    padding: 40px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    margin-bottom: 32px;
    background: var(--accent-primary);
    border-radius: 28px;
    box-shadow: 8px 8px 20px rgba(171, 21, 9, 0.4), -3px -3px 10px rgba(255, 254, 240, 0.5);
}

.hero-label {
    color: rgba(255, 247, 211, 0.75);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.hero-name {
    font-size: 38px;
    font-weight: 900;
    color: #FFF7D3;
    margin-bottom: 6px;
    font-family: var(--font-main);
}

.hero-sub {
    color: rgba(255, 247, 211, 0.7);
    font-size: 14px;
    margin-bottom: 28px;
    font-family: var(--font-jp);
}

.btn-hero {
    background: #FFF7D3;
    color: var(--accent-primary);
    font-weight: 800;
    padding: 12px 28px;
    border-radius: 99px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 3px 3px 8px rgba(171,21,9,0.25), -2px -2px 6px var(--neu-light);
    transition: all var(--transition-fast);
}

.btn-hero:hover {
    box-shadow: inset 2px 2px 5px rgba(171,21,9,0.2), inset -2px -2px 5px var(--neu-light);
    transform: translateY(1px);
}

.hero-art {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    user-select: none;
    pointer-events: none;
}

.hero-kanji-bg {
    font-family: var(--font-jp);
    font-size: 180px;
    font-weight: 900;
    color: rgba(255, 247, 211, 0.07);
    line-height: 1;
}

/* ─── Stats Grid ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow-inset);
}

.vocab-icon  { color: #AB1509; }
.kanji-icon  { color: var(--warning); }
.grammar-icon { color: var(--success); }
.score-icon  { color: #6366f1; }

.stat-details { flex: 1; }

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}




.stat-value .total {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.text-success { color: var(--success); }

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--neu-dark);
    border-radius: 99px;
    overflow: hidden;
    box-shadow: var(--shadow-inset);
}

.progress {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
}

/* ─── Grids ─── */
.content-grid-2 {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.view-all-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: opacity var(--transition-fast);
}
.view-all-link:hover { opacity: 0.7; }

/* ─── Continue Section ─── */
.continue-section, .info-section {
    padding: 28px;
}

.course-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.course-card-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 18px;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.course-card-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.course-thumb {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-inset);
}

.thumb-grammar { color: var(--warning); }
.thumb-kanji   { color: var(--accent-primary); }
.thumb-vocabulary { color: var(--success); }

.course-info { flex: 1; }

.course-info h4 {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.course-info p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.mini-progress-bar {
    width: 100%;
    height: 5px;
    background: var(--neu-dark);
    border-radius: 99px;
    box-shadow: var(--shadow-inset);
    overflow: hidden;
}

.mini-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 99px;
    transition: width 0.5s ease;
}

.play-chip {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-panel);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

/* ─── Account Info Section ─── */
.info-card-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.info-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: var(--shadow-inset);
}

.xp-icon { color: #6366f1; }
.streak-icon { color: var(--warning); }

.info-card h4 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.info-card p {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Daily Missions (legacy compatibility) */
.daily-missions {
    padding: 24px;
}

.badge {
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
}

.badge-primary {
    background: rgba(171, 21, 9, 0.1);
    color: var(--accent-primary);
    box-shadow: none;
}

.mission-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mission-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    gap: 16px;
    transition: all var(--transition-fast);
}

.mission-item:hover {
    background: var(--bg-card-hover);
}

.mission-item.completed {
    opacity: 0.7;
}

.mission-item.completed h4 {
    text-decoration: line-through;
    color: var(--text-muted);
}

.mission-check {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.mission-item.completed .mission-check {
    background: var(--success);
    color: white;
}

.mission-check.pending {
    border: 2px solid var(--border-light);
}

.mission-item.active .mission-check.pending {
    border-color: var(--accent-secondary);
}

.mission-info {
    flex: 1;
}

.mission-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.exp-reward {
    font-size: 12px;
    color: var(--warning);
    font-weight: 600;
}

/* Schedule & Leaderboard */
.schedule-section, .leaderboard-section {
    padding: 24px;
}

.schedule-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    gap: 16px;
}

.date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.date-box .month {
    font-size: 10px;
    color: var(--accent-primary);
    font-weight: 700;
    text-transform: uppercase;
}

.date-box .day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.schedule-info {
    flex: 1;
}

.schedule-info h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.schedule-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    border-radius: 12px;
    gap: 12px;
}

.leaderboard-item.rank-1 {
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--warning);
}

.leaderboard-item.rank-2 {
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--text-muted);
}

.leaderboard-item.rank-3 {
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--accent-primary);
}

.rank {
    font-weight: 700;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.rank-1 .rank { color: var(--warning); }
.rank-2 .rank { color: var(--text-muted); }
.rank-3 .rank { color: var(--accent-primary); }

.lb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.lb-info {
    flex: 1;
}

.lb-info h4 {
    font-size: 14px;
    font-weight: 500;
}

.you-badge {
    font-size: 11px;
    color: var(--accent-primary);
    background: rgba(171, 21, 9, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.lb-info p {
    font-size: 11px;
    color: var(--text-muted);
}

.lb-score {
    font-weight: 600;
    font-size: 13px;
    color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .content-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left var(--transition-norm);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .top-header {
        padding: 0 20px;
    }

    .search-bar {
        width: min(260px, 44vw);
    }

    .header-profile {
        min-width: 0;
        padding: 6px;
    }

    .header-profile-caret,
    .header-user-info {
        display: none;
    }
    
    .dashboard-scroll {
        padding: 20px;
    }
    
    .hero-banner {
        flex-direction: column;
        padding: 30px 20px;
    }
    
    .hero-content {
        max-width: 100%;
        text-align: center;
    }
    
    .hero-illustration {
        position: relative;
        right: 0;
        top: 0;
        transform: none;
        margin-top: 30px;
        height: 120px;
    }
}

/* Universal app header: keep status/profile identical on every tab. */
.app-container > .main-content > .top-header {
    flex: 0 0 76px;
    width: 100%;
    box-sizing: border-box;
}

.app-container > .main-content > .top-header .header-actions {
    margin-left: auto;
}

.app-container > .main-content > .top-header .header-profile-wrap {
    position: relative;
    flex: 0 0 auto;
}

.app-container > .main-content > .top-header .profile-menu {
    display: block;
}

.app-container > .main-content > .top-header .profile-menu a {
    text-decoration: none;
}

.course-horizontal-scroll::-webkit-scrollbar { display: none; }
.course-horizontal-scroll { -ms-overflow-style: none; scrollbar-width: none; display: flex; gap: 24px; overflow-x: auto; padding-bottom: 24px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.course-card-wrapper { min-width: 320px; max-width: 380px; flex: 0 0 auto; scroll-snap-align: start; text-decoration: none; color: inherit; display: block; transition: transform 0.2s; }

/* ── Internal Modal (Confirm/Alert) ── */
.nui-modal-overlay {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(51, 45, 21, .35);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s ease;
    padding: 20px;
}
.nui-modal-overlay.visible { opacity: 1; }
.nui-modal {
    background: var(--bg-panel);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 32px 28px 24px;
    max-width: 380px; width: 100%;
    text-align: center;
    transform: scale(.95) translateY(8px);
    transition: transform .2s ease;
}
.nui-modal-overlay.visible .nui-modal {
    transform: scale(1) translateY(0);
}
.nui-modal-icon {
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(171, 21, 9, .1);
    color: var(--accent-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin: 0 auto 16px;
}
.nui-modal-icon.success { background: rgba(16,185,129,.1); color: var(--success); }
.nui-modal-icon.warning { background: rgba(245,158,11,.1); color: var(--warning); }
.nui-modal-msg {
    font-size: 15px; font-weight: 700;
    color: var(--text-primary);
    line-height: 1.5; margin-bottom: 24px;
}
.nui-modal-actions {
    display: flex; gap: 10px; justify-content: center;
}
.nui-modal-btn {
    padding: 10px 24px; border-radius: 99px;
    font-family: var(--font-main); font-weight: 800; font-size: 14px;
    cursor: pointer; border: none; transition: all .2s;
}
.nui-modal-cancel {
    background: var(--bg-panel);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
}
.nui-modal-cancel:hover { box-shadow: var(--shadow-inset); }
.nui-modal-ok {
    background: var(--accent-primary);
    color: #FFF7D3;
    box-shadow: 4px 4px 10px rgba(171,21,9,.3), -3px -3px 8px var(--neu-light);
}
.nui-modal-ok:hover { background: var(--accent-primary-hover); box-shadow: inset 2px 2px 5px rgba(0,0,0,.2); }
.nui-modal-ok.danger {
    background: #dc2626;
    box-shadow: 4px 4px 10px rgba(220,38,38,.3), -3px -3px 8px var(--neu-light);
}
.nui-modal-ok.danger:hover { background: #b91c1c; }
