/* ==========================================================================
   GAMIFICATION SYSTEM - PAGE STYLES (achievements.html, leaderboard.html)
   Uses global variables/reset/navbar/footer from styles.css
   ========================================================================== */

body.gamification-body {
    background: var(--bg-dark-deep);
}

.gam-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: calc(var(--navbar-height) + 32px) 24px 80px;
}

.gam-hero {
    text-align: center;
    padding: 40px 0 32px;
}

.gam-hero .hero-kicker {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--primary-gold);
    background: rgba(255, 176, 31, 0.12);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.gam-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-light);
    margin: 0 0 12px;
}

.gam-hero h1 span {
    background: var(--gradient-saffron-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gam-hero p {
    max-width: 620px;
    margin: 0 auto;
    color: var(--text-muted);
    line-height: 1.6;
}

.gam-section {
    margin-top: 40px;
}

.gam-section-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--text-light);
    margin: 0 0 18px;
}

.gam-loading,
.gam-empty {
    color: var(--text-muted);
    font-style: italic;
}

/* ---- progress bars (shared) ---- */

.gam-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin: 10px 0 4px;
}

.gam-progress-track-sm {
    height: 6px;
    margin: 8px 0 4px;
}

.gam-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--gradient-saffron-gold);
    transition: width 0.4s ease;
}

/* ---- summary card ---- */

.gam-summary-card {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--bg-dark-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-soft);
}

.gam-level-badge {
    flex-shrink: 0;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: #1a1a2e;
    background: var(--gradient-gold-green);
    box-shadow: var(--shadow-glow);
}

.gam-summary-main {
    flex: 1;
    min-width: 220px;
}

.gam-level-title {
    font-family: var(--font-heading);
    color: var(--text-light);
    margin: 0 0 6px;
    font-size: 1.4rem;
}

.gam-xp-line {
    color: var(--text-muted);
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.gam-streak-chip {
    flex-shrink: 0;
    text-align: center;
    background: rgba(255, 153, 51, 0.12);
    border: 1px solid rgba(255, 153, 51, 0.25);
    border-radius: var(--border-radius-sm);
    padding: 10px 18px;
    color: var(--text-light);
    font-weight: 600;
}

.gam-streak-chip span {
    font-size: 1.2rem;
    color: var(--primary-saffron);
}

.gam-streak-chip small {
    display: block;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

/* ---- challenges ---- */

.gam-challenges-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.gam-challenge-card {
    background: var(--bg-dark-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 18px;
    transition: var(--transition-snappy);
}

.gam-challenge-card:hover {
    border-color: rgba(255, 176, 31, 0.4);
}

.gam-challenge-card.gam-completed {
    border-color: var(--primary-green);
    background: rgba(18, 136, 7, 0.1);
}

.gam-challenge-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.gam-challenge-xp {
    color: var(--primary-gold);
    font-weight: 600;
}

.gam-challenge-card h3 {
    font-family: var(--font-heading);
    color: var(--text-light);
    font-size: 1.05rem;
    margin: 0 0 6px;
}

.gam-challenge-card p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0 0 4px;
    line-height: 1.4;
}

.gam-challenge-status {
    display: block;
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ---- badges ---- */

.gam-badge-category {
    margin-bottom: 32px;
}

.gam-category-title {
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: capitalize;
    color: var(--primary-gold);
    font-size: 1rem;
    letter-spacing: 0.02em;
    margin: 0 0 14px;
}

.gam-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.gam-badge {
    background: var(--bg-dark-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: 18px;
    text-align: center;
    transition: var(--transition-snappy);
}

.gam-badge-unlocked {
    border-color: rgba(255, 176, 31, 0.5);
    box-shadow: var(--shadow-glow);
}

.gam-badge-locked {
    opacity: 0.55;
    filter: grayscale(0.6);
}

.gam-badge-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.gam-badge-title {
    font-family: var(--font-heading);
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.gam-badge-desc {
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.4;
    margin-bottom: 6px;
}

.gam-badge-date {
    font-size: 0.72rem;
    color: var(--primary-gold);
}

.gam-badge-progress-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.gam-tier-gold .gam-badge-icon,
.gam-tier-platinum .gam-badge-icon {
    filter: drop-shadow(0 0 6px rgba(255, 176, 31, 0.5));
}

/* ---- leaderboard ---- */

.gam-tabs {
    display: inline-flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.gam-tab {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition-snappy);
}

.gam-tab.active {
    background: var(--gradient-saffron-gold);
    color: #1a1a2e;
}

.gam-leaderboard-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 20px;
}

.gam-leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gam-leader-row {
    display: grid;
    grid-template-columns: 48px 1fr auto auto;
    align-items: center;
    gap: 14px;
    background: var(--bg-dark-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    padding: 12px 18px;
}

.gam-leader-me {
    border-color: var(--primary-saffron);
    box-shadow: var(--shadow-glow);
}

.gam-leader-rank {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-gold);
}

.gam-leader-name {
    color: var(--text-light);
    font-weight: 500;
}

.gam-demo-tag,
.gam-you-tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 400;
}

.gam-demo-tag {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.gam-you-tag {
    background: var(--primary-saffron);
    color: #1a1a2e;
}

.gam-leader-level {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.gam-leader-xp {
    color: var(--primary-gold);
    font-weight: 600;
}

/* ---- light theme ---- */

body.gamification-[data-theme="light"] {
    background: #f7f7f5;
}

[data-theme="light"] .gam-summary-card,
[data-theme="light"] .gam-challenge-card,
[data-theme="light"] .gam-badge,
[data-theme="light"] .gam-leader-row {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .gam-level-title,
[data-theme="light"] .gam-challenge-card h3,
[data-theme="light"] .gam-badge-title,
[data-theme="light"] .gam-leader-name,
[data-theme="light"] .gam-hero h1 {
    color: #1a1a2e;
}

/* ---- responsive ---- */

@media (max-width: 640px) {
    .gam-summary-card {
        flex-direction: column;
        text-align: center;
    }

    .gam-leader-row {
        grid-template-columns: 36px 1fr auto;
    }

    .gam-leader-level {
        display: none;
    }
}
