.wheel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    backdrop-filter: blur(8px);
}

.wheel-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.wheel-modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.8) translateY(50px);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    position: relative;
}

.wheel-modal-overlay.visible .wheel-modal {
    transform: scale(1) translateY(0);
}

.wheel-modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.wheel-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.wheel-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.wheel-modal-body {
    padding: var(--spacing-lg);
    max-height: 60vh;
    overflow-y: auto;
}

.wheel-modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    background: var(--bg-secondary);
}

.bet-gifts-selection {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.bet-summary {
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.bet-summary-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.bet-total-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-success);
}

.gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--spacing-md);
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-sm);
}

.gift-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gift-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gift-item.selected {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.gift-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.gift-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.gift-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.2;
}

.gift-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-success);
}

.gift-rarity {
    position: absolute;
    top: var(--spacing-xs);
    right: var(--spacing-xs);
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.gift-rarity.common {
    background: #9ca3af;
}

.gift-rarity.rare {
    background: #3b82f6;
}

.gift-rarity.epic {
    background: #8b5cf6;
}

.gift-rarity.legendary {
    background: #f59e0b;
}

.wheel-notification {
    position: fixed;
    top: 80px;
    right: var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    max-width: 400px;
    box-shadow: var(--shadow-xl);
    z-index: 1100;
    transform: translateX(100%);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.wheel-notification.visible {
    transform: translateX(0);
}

.wheel-notification.success {
    border-left: 4px solid var(--color-success);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(16, 185, 129, 0.05) 100%);
}

.wheel-notification.error {
    border-left: 4px solid var(--color-error);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(239, 68, 68, 0.05) 100%);
}

.wheel-notification.warning {
    border-left: 4px solid var(--color-warning);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-text {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
    margin-left: auto;
    font-size: 1rem;
    transition: color var(--transition-fast);
}

.notification-close:hover {
    color: var(--text-primary);
}

.wheel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.history-modal .wheel-modal {
    max-width: 600px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    transition: all var(--transition-normal);
}

.history-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.history-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.history-result {
    font-size: 0.875rem;
    font-weight: 600;
}

.history-result.win {
    color: var(--color-success);
}

.history-result.lose {
    color: var(--color-error);
}

.history-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.fairness-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.fairness-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.hash-display {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
    margin-bottom: var(--spacing-sm);
}

.verify-button {
    background: var(--gradient-secondary);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.verify-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@media (max-width: 768px) {
    .wheel-modal {
        width: 95%;
        max-height: 90vh;
    }

    .wheel-modal-header,
    .wheel-modal-body,
    .wheel-modal-footer {
        padding: var(--spacing-md);
    }

    .gifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: var(--spacing-sm);
    }

    .gift-item {
        padding: var(--spacing-sm);
    }

    .gift-image {
        width: 50px;
        height: 50px;
    }

    .wheel-notification {
        right: var(--spacing-md);
        left: var(--spacing-md);
        max-width: none;
    }
}

@media (max-width: 480px) {
    .wheel-modal {
        width: 98%;
        border-radius: var(--radius-lg);
    }

    .wheel-modal-header,
    .wheel-modal-body,
    .wheel-modal-footer {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .wheel-modal-footer {
        flex-direction: column;
    }

    .wheel-modal-footer .btn-base {
        width: 100%;
    }

    .gifts-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .gift-name {
        font-size: 0.6875rem;
    }

    .gift-value {
        font-size: 0.75rem;
    }

    .history-modal .wheel-modal {
        max-width: none;
    }
}

.btn-base.wallet-required {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border-color: #ff6b6b;
    color: white;
    animation: pulse-wallet 2s infinite;
}

.btn-base.wallet-required:hover {
    background: linear-gradient(135deg, #ee5a52, #dc4c43);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

@keyframes pulse-wallet {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

.recent-gifts-section {
    margin-bottom: var(--spacing-lg);
    width: 100%;
    padding-bottom: var(--spacing-md);
}

.recent-gifts-container {
    display: flex;
    gap: var(--spacing-md);
    overflow-x: auto;
    padding: var(--spacing-md) var(--spacing-lg);
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    min-height: 84px;
}

.recent-gifts-container::-webkit-scrollbar {
    display: none;
}

.recent-gift-item {
    flex: 1 0 auto;
    max-width: 68px;
    min-width: 52px;
    height: 68px;
    border-radius: 10px;
    overflow: hidden;
    border: none;
    transition: all var(--transition-normal);
    background: transparent;
    scroll-snap-align: start;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.recent-gift-item:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.25), 0 0 20px rgba(255,255,255,0.1);
    z-index: 10;
}

.recent-gift-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all var(--transition-normal);
    filter: brightness(0.95);
    border-radius: var(--radius-lg);
}

.recent-gift-item:hover img {
    filter: brightness(1.1) saturate(1.15) contrast(1.05);
    border-radius: var(--radius-xl);
}

.recent-gift-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.2) 50%,
        transparent 100%);
    transition: left 0.6s ease;
    z-index: 1;
}

.recent-gift-item:hover::before {
    left: 100%;
}

.loading-gifts, .empty-gifts {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 14px;
}

.empty-gifts-icon {
    font-size: 24px;
    margin-bottom: var(--spacing-sm);
}

@media (max-width: 768px) {
    .recent-gifts-container {
        gap: var(--spacing-sm);
        padding: var(--spacing-md);
        justify-content: space-between;
        min-height: 72px;
    }

    .recent-gift-item {
        max-width: 58px;
        min-width: 44px;
        height: 58px;
        transform: none;
    }

    .recent-gift-item:hover {
        transform: scale(1.03) translateY(-1px);
    }

    @media (hover: none) and (pointer: coarse) {
        .recent-gift-item:hover {
            transform: none;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .recent-gift-item:hover img {
            filter: brightness(0.95);
            border-radius: var(--radius-lg);
        }

        .recent-gift-item:hover::before {
            left: -100%;
        }
    }
}

@media (max-width: 480px) {
    .recent-gifts-section {
        margin-bottom: var(--spacing-md);
    }

    .recent-gifts-container {
        gap: 10px;
        padding: var(--spacing-sm) var(--spacing-md);
        min-height: 62px;
    }

    .recent-gift-item {
        max-width: 52px;
        min-width: 38px;
        height: 52px;
        box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    }

    .loading-gifts, .empty-gifts {
        padding: var(--spacing-md);
        font-size: 13px;
    }

    .empty-gifts-icon {
        font-size: 22px;
    }
}

@media (max-width: 360px) {
    .recent-gift-item {
        max-width: 46px;
        min-width: 34px;
        height: 46px;
    }

    .recent-gifts-container {
        gap: 8px;
        min-height: 56px;
    }
}

.recent-gift-item {
    animation: giftAppear 0.5s ease-out backwards;
}

.recent-gift-item:nth-child(1) { animation-delay: 0.1s; }
.recent-gift-item:nth-child(2) { animation-delay: 0.2s; }
.recent-gift-item:nth-child(3) { animation-delay: 0.3s; }
.recent-gift-item:nth-child(4) { animation-delay: 0.4s; }
.recent-gift-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes giftAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}