/* =========================================
   VIRTUAL PET COMPANION
   ========================================= */
.pet-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.pet-container.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.pet-speech-bubble {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 14px 14px 14px 4px;
    padding: 8px 14px;
    font-size: 0.75rem;
    color: var(--text-main);
    max-width: 180px;
    text-align: center;
    line-height: 1.4;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(8px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.pet-speech-bubble.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.pet-sprite-wrapper {
    width: 72px;
    height: 72px;
    position: relative;
    cursor: pointer;
    pointer-events: all;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

.pet-sprite-wrapper:hover {
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.4));
}

.pet-emoji {
    font-size: 3.2rem;
    line-height: 1;
    display: block;
    text-align: center;
    animation: petIdle 3s ease-in-out infinite;
    transition: font-size 0.3s ease;
    user-select: none;
}

.pet-emoji.celebrating {
    animation: petCelebrate 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.pet-emoji.sleeping {
    animation: petSleep 4s ease-in-out infinite;
}

.pet-emoji.running {
    animation: petRun 0.3s steps(2) infinite;
}

@keyframes petIdle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%       { transform: translateY(-4px) rotate(-2deg); }
    75%       { transform: translateY(-2px) rotate(2deg); }
}

@keyframes petCelebrate {
    0%   { transform: scale(1) rotate(0deg); }
    20%  { transform: scale(1.4) rotate(-10deg); }
    40%  { transform: scale(1.3) rotate(10deg); }
    60%  { transform: scale(1.35) rotate(-8deg); }
    80%  { transform: scale(1.25) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

@keyframes petSleep {
    0%, 100% { transform: translateY(0) rotate(-5deg); opacity: 0.7; }
    50%       { transform: translateY(4px) rotate(-8deg); opacity: 0.5; }
}

@keyframes petRun {
    0%   { transform: translateX(-2px); }
    100% { transform: translateX(2px); }
}

/* =========================================
   DYNAMIC BACKGROUNDS / THEMES
   ========================================= */
.bg-overlay {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

/* Cyber / Dark default is the current body::before */
body[data-bg="lofi"] {
    background-color: #1a1218;
    background-image: none;
}
body[data-bg="lofi"] .bg-overlay {
    background:
        radial-gradient(ellipse 80% 60% at 20% 80%, hsla(280,60%,25%,0.35) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 20%, hsla(200,70%,20%,0.3) 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect fill='%23120f1a' width='400' height='300'/%3E%3Ccircle cx='60' cy='120' r='30' fill='%23ff9f5e' opacity='0.06'/%3E%3Crect x='320' y='60' width='60' height='80' rx='4' fill='%23fff' opacity='0.03'/%3E%3C/svg%3E") center/cover no-repeat;
}

body[data-bg="cyberpunk"] {
    background-color: #050914;
    background-image: none;
}
body[data-bg="cyberpunk"] .bg-overlay {
    background:
        radial-gradient(ellipse 60% 50% at 15% 85%, hsla(180,100%,35%,0.15) 0%, transparent 55%),
        radial-gradient(ellipse 50% 60% at 85% 15%, hsla(300,100%,50%,0.12) 0%, transparent 55%),
        radial-gradient(ellipse 40% 30% at 50% 50%, hsla(60,100%,50%,0.04) 0%, transparent 50%);
}
body[data-bg="cyberpunk"]::before {
    background:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,255,255,0.01) 2px, rgba(0,255,255,0.01) 4px),
        radial-gradient(ellipse 80% 60% at 50% 50%, hsla(180,100%,20%,0.05) 0%, transparent 70%);
}

body[data-bg="cafe"] {
    background-color: #1a1208;
    background-image: none;
}
body[data-bg="cafe"] .bg-overlay {
    background:
        radial-gradient(ellipse 70% 55% at 25% 75%, hsla(35,80%,35%,0.2) 0%, transparent 60%),
        radial-gradient(ellipse 50% 45% at 75% 25%, hsla(20,70%,30%,0.15) 0%, transparent 60%);
}

body[data-bg="nature"] {
    background-color: #0a1a0e;
    background-image: none;
}
body[data-bg="nature"] .bg-overlay {
    background:
        radial-gradient(ellipse 70% 60% at 20% 80%, hsla(140,70%,25%,0.3) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 30%, hsla(200,80%,25%,0.2) 0%, transparent 60%),
        radial-gradient(ellipse 40% 35% at 50% 5%, hsla(60,70%,50%,0.08) 0%, transparent 50%);
}

body[data-bg="aurora"] {
    background-color: #050f1f;
    background-image: none;
}
body[data-bg="aurora"] .bg-overlay {
    background:
        radial-gradient(ellipse 90% 50% at 50% 0%, hsla(160,100%,40%,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 10% 40%, hsla(280,100%,60%,0.1) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 90% 60%, hsla(200,100%,60%,0.08) 0%, transparent 60%);
    animation: auroraShift 12s ease-in-out infinite alternate;
}

@keyframes auroraShift {
    0%   { opacity: 0.6; filter: hue-rotate(0deg); }
    50%  { opacity: 1; filter: hue-rotate(30deg); }
    100% { opacity: 0.8; filter: hue-rotate(-20deg); }
}

/* =========================================
   GOTHIC / DARKNESS THEME
   ========================================= */
body[data-bg="gothic"] {
    background-color: #070408;
    background-image: none;
}
body[data-bg="gothic"] .bg-overlay {
    background:
        radial-gradient(ellipse 65% 55% at 15% 90%, hsla(280,70%,10%,0.6) 0%, transparent 60%),
        radial-gradient(ellipse 50% 45% at 85% 10%, hsla(260,60%,12%,0.5) 0%, transparent 60%),
        radial-gradient(ellipse 30% 25% at 50% 50%, hsla(280,50%,8%,0.3) 0%, transparent 50%);
    animation: gothicPulse 10s ease-in-out infinite alternate;
}
body[data-bg="gothic"]::before {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(180,100,255,0.012) 3px,
            rgba(180,100,255,0.012) 6px
        );
}

@keyframes gothicPulse {
    0%   { opacity: 0.7; }
    50%  { opacity: 1; filter: hue-rotate(15deg); }
    100% { opacity: 0.85; filter: hue-rotate(-10deg); }
}


/* Background Picker Panel */
.bg-picker-panel {
    position: fixed;
    bottom: 110px;
    right: 24px;
    z-index: 200;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
    animation: slideUpPanel 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bg-picker-panel.open {
    display: flex;
}

@keyframes slideUpPanel {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bg-picker-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.bg-option-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.bg-option-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--border-color);
}

.bg-option-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.bg-option-preview {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
}

/* =========================================
   FOCUS MODE (FULL SCREEN)
   ========================================= */
.focus-mode-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(5, 8, 18, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    animation: focusModeIn 0.5s ease;
}

.focus-mode-overlay.active {
    display: flex;
}

@keyframes focusModeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.focus-mode-timer {
    font-family: var(--font-display);
    font-size: clamp(5rem, 18vw, 10rem);
    font-weight: 800;
    letter-spacing: -4px;
    line-height: 1;
    color: var(--text-main);
    text-shadow: 0 0 60px var(--primary-glow);
    margin-bottom: 16px;
}

.focus-mode-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 40px;
}

.focus-mode-pet {
    font-size: 5rem;
    line-height: 1;
    margin-bottom: 40px;
    animation: petIdle 3s ease-in-out infinite;
}

.focus-mode-actions {
    display: flex;
    gap: 16px;
}

.focus-exit-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-primary);
    transition: all 0.2s ease;
}

.focus-exit-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-main);
}

/* =========================================
   CONFETTI CANVAS
   ========================================= */
#confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* =========================================
   FLOATING ACTION BUTTONS (FABs)
   ========================================= */
.fab-group {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.fab-btn {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-solid);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: var(--shadow-md);
}

.fab-btn:hover {
    color: var(--text-main);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.fab-btn.active-fab {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

/* =========================================
   ONBOARDING TOUR
   ========================================= */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(5, 8, 18, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.5s ease;
}

.onboarding-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    max-width: 520px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg), 0 0 80px var(--primary-glow);
    animation: onboardingIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes onboardingIn {
    from { opacity: 0; transform: scale(0.85) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.onboarding-emoji {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: block;
    animation: petIdle 2s ease-in-out infinite;
}

.onboarding-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary), hsl(262,83%,70%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.onboarding-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 24px;
}

.onboarding-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
    text-align: left;
}

.onboarding-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.onboarding-feature-item span:first-child {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.onboarding-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* =========================================
   STREAK COUNTER (Gamification)
   ========================================= */
.streak-widget {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 5px 10px;
    cursor: default;
    transition: all 0.3s ease;
}

.streak-widget.active-streak {
    color: hsl(38, 92%, 55%);
    background: hsla(38, 92%, 50%, 0.1);
    border-color: hsla(38, 92%, 50%, 0.3);
    box-shadow: 0 0 12px hsla(38, 92%, 50%, 0.15);
}

.streak-fire {
    font-size: 1rem;
}

/* =========================================
   PET SELECTOR IN SETTINGS
   ========================================= */
.pet-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pet-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-primary);
}

.pet-option-btn span:first-child {
    font-size: 1.8rem;
}

.pet-option-btn span:last-child {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pet-option-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.pet-option-btn.active {
    border-color: var(--primary);
    background: var(--primary-glow);
    box-shadow: 0 0 12px var(--primary-glow);
}

/* =========================================
   MOBILE HAMBURGER MENU
   ========================================= */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 10px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.06);
}

.sidebar.mobile-open {
    transform: translateX(0) !important;
}

/* =========================================
   RESPONSIVE IMPROVEMENTS
   ========================================= */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 300;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: 260px !important;
        border-right: 1px solid var(--border-color);
        border-bottom: none !important;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 40px rgba(0,0,0,0.5);
    }

    .workspace {
        width: 100vw;
    }

    .workspace-header {
        padding: 0 16px;
    }

    .header-quick-stats {
        display: none;
    }

    .content-panel {
        padding: 16px !important;
    }

    .timer-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .timer-main-card {
        padding: 24px 16px;
    }

    .timer-visual-container {
        width: 220px;
        height: 220px;
        margin-bottom: 24px;
    }

    .progress-ring-svg {
        width: 220px;
        height: 220px;
    }

    .timer-countdown {
        font-size: 2.8rem;
    }

    .kanban-columns {
        grid-template-columns: 1fr !important;
    }

    .pet-container {
        bottom: 16px;
        right: 16px;
    }

    .pet-emoji {
        font-size: 2.5rem;
    }

    .fab-group {
        bottom: 16px;
        left: 16px;
    }

    .sidebar-nav {
        flex-direction: column !important;
        overflow-x: visible !important;
    }

    .nav-btn span {
        display: inline !important;
    }

    .mobile-overlay {
        display: block;
    }

    .analytics-overview {
        grid-template-columns: 1fr !important;
    }
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 299;
    backdrop-filter: blur(2px);
}

/* =========================================
   FOCUS TIMER PROGRESS RING GLOW FIX
   ========================================= */
.progress-ring-fill {
    filter: drop-shadow(0 0 8px var(--primary));
}

/* =========================================
   XP BAR & PET LEVEL (v3.0)
   ========================================= */
.pet-xp-bar-wrapper {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 49;
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: none;
}
.pet-level-badge {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    opacity: 0.75;
}
.pet-xp-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.pet-xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), hsl(262,83%,70%));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: 0 0 6px var(--primary);
}
.pet-accessory-overlay {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.4rem;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* =========================================
   TIMER PRESET BUTTONS (v3.0)
   ========================================= */
.timer-preset-btns {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 8px;
}
.preset-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.preset-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb, 99,102,241),0.08);
}

/* Alarm tone selector */
.alarm-tone-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.alarm-tone-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}
.alarm-tone-btn.active,
.alarm-tone-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb, 99,102,241),0.08);
}

/* =========================================
   BINAURAL PANEL (v3.0)
   ========================================= */
.binaural-panel {
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
    padding-top: 12px;
}
.binaural-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.binaural-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}
.binaural-toggle {
    width: 36px;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    border: none;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    flex-shrink: 0;
}
.binaural-toggle::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 14px; height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}
.binaural-toggle.active {
    background: var(--primary);
}
.binaural-toggle.active::after {
    transform: translateX(16px);
}
.binaural-presets {
    display: flex;
    gap: 6px;
}
.binaural-preset-btn {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-dim);
    text-align: center;
    transition: all 0.2s ease;
}
.binaural-preset-btn:hover,
.binaural-preset-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(var(--primary-rgb, 99,102,241),0.08);
}
.binaural-preset-btn .preset-freq {
    display: block;
    font-size: 0.6rem;
    opacity: 0.7;
    margin-top: 1px;
}

/* =========================================
   ACHIEVEMENTS PANEL (v3.0)
   ========================================= */
.achievements-section {
    margin-top: 24px;
}
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.achievement-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.2s ease;
}
.achievement-badge.unlocked {
    border-color: rgba(var(--primary-rgb, 99,102,241), 0.4);
    background: rgba(var(--primary-rgb, 99,102,241), 0.05);
}
.achievement-badge.unlocked:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(var(--primary-rgb, 99,102,241), 0.2);
}
.achievement-badge.locked {
    opacity: 0.4;
    filter: grayscale(1);
}
.achievement-icon {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 4px;
}
.achievement-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.3;
}
.achievement-desc {
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-top: 2px;
    line-height: 1.3;
}

/* Share card button */
.share-card-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

/* =========================================
   SHOP MODAL (v3.0)
   ========================================= */
.shop-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.shop-modal-overlay.visible { opacity: 1; }
.shop-modal-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.shop-modal-overlay.visible .shop-modal-card { transform: scale(1); }
.shop-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.shop-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}
.shop-coins-display {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    background: rgba(var(--primary-rgb, 99,102,241), 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}
.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 8px;
}
.shop-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.shop-item:hover { border-color: var(--primary); }
.shop-item.owned { border-color: rgba(var(--primary-rgb), 0.6); }
.shop-item.equipped {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb, 99,102,241), 0.1);
    box-shadow: 0 0 12px rgba(var(--primary-rgb, 99,102,241), 0.2);
}
.shop-item-icon { font-size: 1.8rem; display: block; margin-bottom: 4px; }
.shop-item-name { font-size: 0.62rem; font-weight: 600; color: var(--text-main); }
.shop-item-cost { font-size: 0.6rem; color: var(--primary); margin-top: 2px; }
.shop-item.owned .shop-item-cost { color: var(--text-dim); }
.shop-item-equipped-badge {
    position: absolute;
    top: 4px; right: 4px;
    width: 8px; height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

/* Level-up notification toast */
.levelup-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, var(--primary), hsl(262,83%,65%));
    color: white;
    border-radius: 40px;
    padding: 12px 28px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none;
    white-space: nowrap;
}
.levelup-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
