.xp-widget {
    position: fixed;
    top: 76px;
    right: 24px;
    width: 240px;
    background: rgba(30, 32, 36, 0.95);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 900;
    backdrop-filter: blur(10px);
}

.xp-widget:hover {
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.15);
}

.xp-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.xp-level-badge {
    position: relative;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.15));
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.xp-icon {
    width: 24px;
    height: 24px;
}

.xp-level-number {
    display: none;
}

.xp-info {
    flex: 1;
    min-width: 0;
}

.xp-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.xp-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.xp-progress-container {
    position: relative;
    margin-bottom: 10px;
}

.xp-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 6px;
    position: relative;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.xp-progress-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% {
        left: -100%;
    }
    100% {
        left: 200%;
    }
}

.xp-progress-text {
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 10px;
    font-weight: 600;
    color: #fbbf24;
}

.xp-stats {
    display: flex;
    gap: 6px;
}

.xp-stat {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.xp-stat:hover {
    background: rgba(251, 191, 36, 0.05);
    border-color: rgba(251, 191, 36, 0.2);
}

.xp-stat svg {
    width: 12px;
    height: 12px;
    color: #fbbf24;
    flex-shrink: 0;
}

.xp-stat span {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xp-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 0;
    width: 280px;
    background: rgba(30, 32, 36, 0.98);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 16px;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.xp-widget:hover .xp-tooltip,
.xp-tooltip:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
}

.xp-tooltip::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: rgba(30, 32, 36, 0.98);
    border-right: 1px solid rgba(251, 191, 36, 0.2);
    border-top: 1px solid rgba(251, 191, 36, 0.2);
    transform: rotate(45deg);
}

.xp-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.xp-tooltip-header svg {
    width: 18px;
    height: 18px;
    color: #fbbf24;
}

.xp-tooltip-header span {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.xp-quests {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.xp-quest {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.xp-quest:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(251, 191, 36, 0.2);
}

.xp-quest.completed {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.2);
}

.xp-quest.active {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.2);
}

.xp-quest-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.xp-quest svg {
    width: 16px;
    height: 16px;
    color: rgba(255, 255, 255, 0.3);
}

.xp-quest.completed svg {
    color: #22c55e;
    animation: checkBounce 0.5s ease;
}

@keyframes checkBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.xp-quest.active svg {
    color: #fbbf24;
    animation: questPulse 2s ease-in-out infinite;
}

@keyframes questPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.xp-quest-info {
    flex: 1;
    min-width: 0;
}

.xp-quest-name {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2px;
}

.xp-quest-progress {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.xp-quest.completed .xp-quest-progress {
    color: rgba(34, 197, 94, 0.8);
}

.xp-quest.active .xp-quest-progress {
    color: rgba(251, 191, 36, 0.8);
}

.xp-quest-reward {
    font-size: 12px;
    font-weight: 600;
    color: #fbbf24;
    flex-shrink: 0;
}

.xp-tooltip-footer {
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.xp-daily-limit span {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    display: block;
    margin-bottom: 8px;
}

.xp-limits {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.xp-limit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
}

.xp-limit-item span:first-child {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.xp-limit-item span:last-child {
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
}

.xp-leaderboard-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.xp-leaderboard-link:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.15));
    border-color: rgba(251, 191, 36, 0.4);
    transform: translateY(-1px);
}

.xp-leaderboard-link svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 1400px) {
    .xp-widget {
        width: 220px;
        right: 16px;
    }
    
    .xp-tooltip {
        width: 260px;
    }
}

@media (max-width: 1200px) {
    .xp-widget {
        width: 200px;
        padding: 10px;
        top: 72px;
        right: 12px;
    }
    
    .xp-level-badge {
        width: 36px;
        height: 36px;
    }
    
    .xp-icon {
        width: 20px;
        height: 20px;
    }
    
    .xp-level-number {
        font-size: 16px;
    }
    
    .xp-title {
        font-size: 12px;
    }
    
    .xp-subtitle {
        font-size: 10px;
    }
    
    .xp-stat span {
        font-size: 9px;
    }
    
    .xp-tooltip {
        width: 240px;
    }
}

.xp-mobile-button {
    display: none;
}

.xp-tooltip-mobile {
    display: none;
}

@media (max-width: 768px) {
    .xp-widget {
        display: none;
    }
    
    .xp-tooltip-mobile {
        display: block;
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        width: calc(100vw - 40px);
        max-width: 340px;
        opacity: 0;
        visibility: hidden;
        z-index: 10001;
        max-height: 80vh;
        overflow-y: auto;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .xp-mobile-header {
        padding-bottom: 12px;
        margin-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .xp-mobile-header .xp-header {
        margin-bottom: 10px;
    }
    
    .xp-mobile-header .xp-progress-container {
        margin-bottom: 10px;
    }
    
    body.xp-modal-open .xp-tooltip-mobile {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
        pointer-events: auto;
    }
    
    .xp-mobile-button {
        display: flex;
        position: fixed;
        bottom: 20px;
        left: 20px;
        width: 56px;
        height: 56px;
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
        border: 3px solid rgba(251, 191, 36, 0.3);
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 900;
        box-shadow: 0 4px 16px rgba(251, 191, 36, 0.4);
        transition: all 0.3s ease;
    }
    
    .xp-mobile-button:active {
        transform: scale(0.95);
    }
    
    .xp-mobile-button img {
        width: 32px;
        height: 32px;
    }
    
    .xp-mobile-button .xp-level-badge-mobile {
        position: absolute;
        top: -4px;
        right: -4px;
        width: 24px;
        height: 24px;
        background: rgba(30, 32, 36, 0.95);
        border: 2px solid #fbbf24;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: 700;
        color: #fbbf24;
    }
    
    .xp-tooltip {
        position: fixed;
        right: auto;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) scale(0.9);
        width: calc(100vw - 40px);
        max-width: 340px;
        opacity: 0;
        visibility: hidden;
        z-index: 10001;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .xp-tooltip::before {
        display: none;
    }
    
    .xp-mobile-button.tooltip-open ~ .xp-widget .xp-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }
    
    body.xp-modal-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 10000;
        animation: fadeIn 0.3s ease;
        pointer-events: none;
    }
    
    body.xp-modal-open .xp-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
        pointer-events: auto;
    }
}

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

@media (max-width: 480px) {
    .xp-mobile-button {
        width: 52px;
        height: 52px;
        bottom: 16px;
        left: 16px;
    }
    
    .xp-mobile-button img {
        width: 28px;
        height: 28px;
    }
    
    .xp-mobile-button .xp-level-badge-mobile {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
}

.xp-gain-animation {
    position: fixed;
    font-size: 16px;
    font-weight: 700;
    color: #fbbf24;
    pointer-events: none;
    z-index: 10000;
    animation: xpFloat 1.5s ease-out forwards;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

@keyframes xpFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1.2);
    }
}
