/* Page Headers */
.header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(to right, #fff, #b2bec3);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

/* Section Divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    margin: 32px auto;
    width: 85%;
    border-radius: 1px;
}

/* Card Lists (Earn/History) */
/* Card Lists (Earn/History) */
.task-card {
    background: rgba(30, 30, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.15s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    /* Performance: GPU layer */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    contain: layout style paint;
}

.task-card:hover {
    background: rgba(40, 40, 45, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.task-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

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

.task-info h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.3;
    /* Allow text to wrap naturally instead of truncating */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

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

/* Empty Tasks State */
.empty-tasks {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-tasks .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-tasks p {
    font-size: 15px;
    margin-bottom: 4px;
}

.empty-tasks span {
    font-size: 12px;
    opacity: 0.7;
}

.btn-small {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.btn-small:active {
    transform: scale(0.95);
}

/* Go Button */
.btn-small.btn-go {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

/* Loading State */
.btn-small.btn-loading {
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Claim Button */
.btn-small.btn-claim {
    background: linear-gradient(135deg, #00b894, #00cec9);
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
    animation: claimPulse 1s ease-in-out infinite alternate;
}

@keyframes claimPulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
    }

    100% {
        box-shadow: 0 4px 25px rgba(0, 184, 148, 0.7);
    }
}

/* Completed State */
.btn-small.btn-completed {
    background: rgba(0, 184, 148, 0.2);
    color: #00b894;
    cursor: not-allowed;
    pointer-events: none;
}

/* Completed Task Card */
.task-card.completed {
    opacity: 0.7;
    background: rgba(0, 184, 148, 0.05);
    border-color: rgba(0, 184, 148, 0.2);
}

/* Referral Section */
.refer-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-box {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-box .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.stat-box .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.refer-link-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
}

.refer-link-box {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.refer-link-box input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    padding: 12px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 12px;
}

.refer-link-box button {
    background: var(--primary);
    color: white;
    padding: 0 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
}

/* Account Section */
.profile-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--hero-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.profile-info h2 {
    font-size: 18px;
    margin-bottom: 4px;
}

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

.settings-list {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 8px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 14px;
}

/* Spin Wheel */
/* Premium Spin Wheel Container */
.spin-container {
    background: linear-gradient(165deg,
            rgba(30, 25, 45, 0.95) 0%,
            rgba(15, 12, 25, 0.98) 50%,
            rgba(25, 20, 40, 0.95) 100%);
    border: 2px solid transparent;
    border-image: linear-gradient(135deg,
            rgba(255, 215, 0, 0.5),
            rgba(255, 107, 107, 0.3),
            rgba(78, 205, 196, 0.3),
            rgba(255, 215, 0, 0.5)) 1;
    border-radius: 32px;
    padding: 35px 20px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 60px rgba(255, 107, 107, 0.15),
        0 0 100px rgba(78, 205, 196, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(255, 215, 0, 0.05);
}

/* Animated rainbow glow behind wheel */
.spin-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            rgba(255, 107, 107, 0.2),
            rgba(255, 230, 109, 0.2),
            rgba(78, 205, 196, 0.2),
            rgba(170, 150, 218, 0.2),
            rgba(252, 186, 211, 0.2),
            rgba(255, 107, 107, 0.2));
    animation: rainbowGlow 8s linear infinite;
    pointer-events: none;
    z-index: 0;
    filter: blur(40px);
}

@keyframes rainbowGlow {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.6;
    }

    50% {
        opacity: 0.9;
    }

    100% {
        transform: rotate(360deg) scale(1);
        opacity: 0.6;
    }
}

/* Spotlight effect on pointer area */
.spin-container::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle,
            rgba(255, 107, 107, 0.5) 0%,
            rgba(255, 215, 0, 0.2) 40%,
            transparent 70%);
    filter: blur(25px);
    z-index: 0;
    animation: spotlightPulse 2s ease-in-out infinite alternate;
}

@keyframes spotlightPulse {
    0% {
        opacity: 0.7;
        transform: translateX(-50%) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
}

.wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1/1;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
}

.spin-btn {
    width: 100%;
    padding: 18px;
    background: var(--hero-gradient);
    border: none;
    border-radius: 16px;
    color: white;
    font-weight: 800;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 10px 40px rgba(108, 92, 231, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.spin-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.spin-btn:active {
    transform: scale(0.96);
    box-shadow: 0 5px 20px rgba(108, 92, 231, 0.4);
}

.spin-btn:disabled {
    background: #333;
    color: #666;
    box-shadow: none;
}

.spin-cost {
    font-size: 12px;
    display: block;
    margin-top: 5px;
    opacity: 0.8;
}

/* Task Popup Overlay */
.task-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: popupFadeIn 0.25s ease-out forwards;
    /* Performance: GPU layer to prevent flicker */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popupScaleIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateZ(0);
    }

    to {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

.task-popup {
    background: linear-gradient(145deg, rgba(30, 25, 45, 0.98), rgba(20, 18, 35, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 32px;
    width: 90%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: popupScaleIn 0.25s ease-out forwards;
    /* Performance: GPU layer */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform, opacity;
}

.task-popup-header {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.task-popup-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 28px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.task-popup-actions {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 12px;
}

/* Homescreen Popup Icon */
.homescreen-popup-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 12px;
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-btn {
    padding: 14px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, opacity 0.2s;
}

.popup-btn:active {
    transform: scale(0.96);
}

.popup-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.popup-btn.primary {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}

.popup-btn.primary:active {
    transform: scale(0.96);
}

.popup-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.popup-btn.secondary:active {
    background: rgba(255, 255, 255, 0.15);
}

/* Verification Popups */
.verify-popup {
    text-align: center;
}

.verify-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #6c5ce7;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: verifySpinAnim 1s linear infinite;
}

@keyframes verifySpinAnim {
    to {
        transform: rotate(360deg);
    }
}

.verify-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.verify-icon svg {
    filter: drop-shadow(0 0 15px rgba(255, 71, 87, 0.4));
}

.popup-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 20px;
    color: #ff6b81;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
}

.notice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.verify-success .verify-icon {
    animation: successPop 0.4s ease-out;
}

.verify-failed .verify-icon {
    animation: failShake 0.4s ease-out;
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes failShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

/* Single action popup (centered full-width button) */
.task-popup-actions.single-action {
    display: flex;
    justify-content: center;
}

.popup-btn.full-width {
    width: 100%;
}

/* Verify icon - make emojis large */
.verify-icon {
    font-size: 56px;
    margin-bottom: 16px;
    text-align: center;
}

/* Dismiss/Cancel link button */
.popup-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-top: 16px;
    cursor: pointer;
    padding: 8px 16px;
    transition: color 0.2s;
}

.popup-dismiss:hover {
    color: rgba(255, 255, 255, 0.8);
}