/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
}

.nav-brand i {
    margin-right: 0.5rem;
    font-size: 2rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.balance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: bold;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lootbox-showcase {
    position: relative;
}

.lootbox-card.featured {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.lootbox-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: conic-gradient(from 0deg, #667eea, #764ba2, #667eea);
    animation: rotate 3s linear infinite;
    z-index: -1;
}

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

.lootbox-card.featured i {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.lootbox-card.featured h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.lootbox-card.featured .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

/* Sections */
section {
    padding: 80px 0;
}

.lootboxes-section,
.marketplace-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.lootboxes-section h2,
.marketplace-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

/* Loot Boxes Grid */
.lootboxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.lootbox-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.lootbox-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.lootbox-image {
    position: relative;
    margin-bottom: 1rem;
}

.lootbox-image i {
    font-size: 3rem;
    color: #667eea;
}

.rarity-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.rarity-badge.common {
    background: #95a5a6;
}

.rarity-badge.rare {
    background: #3498db;
}

.rarity-badge.epic {
    background: #9b59b6;
}

.rarity-badge.legendary {
    background: linear-gradient(45deg, #f39c12, #e74c3c);
}

.rarity-badge.ultra-rare {
    background: linear-gradient(45deg, #e91e63, #9c27b0);
}

.lootbox-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.lootbox-card p {
    color: #666;
    margin-bottom: 1rem;
}

.lootbox-card .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 1rem;
}

/* Marketplace */
.marketplace-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.filter-btn.active,
.filter-btn:hover {
    background: #667eea;
    color: white;
}

.marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.marketplace-item {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.marketplace-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.marketplace-item .item-image {
    position: relative;
    text-align: center;
    margin-bottom: 1rem;
}

.marketplace-item .item-image i {
    font-size: 2.5rem;
    color: #667eea;
}

.marketplace-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.item-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #666;
}

.item-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.market-trend {
    font-size: 0.9rem;
    font-weight: bold;
}

.market-trend.up {
    color: #27ae60;
}

.market-trend.down {
    color: #e74c3c;
}

.market-trend.neutral {
    color: #95a5a6;
}

/* Stats Section */
.stats-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-card {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #666;
    font-weight: 500;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #667eea;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #667eea;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    color: #bdc3c7;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
    font-size: 0.9rem;
}

/* Styles pour les modals et notifications */
.reward-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.reward-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.reward-modal.show .modal-content {
    transform: scale(1);
}

.reward-animation {
    margin-bottom: 2rem;
}

.reward-animation i {
    font-size: 4rem;
    color: #667eea;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.modal-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.modal-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
}

.reward-item {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid transparent;
}

.reward-item.common {
    border-color: #95a5a6;
    background: linear-gradient(135deg, #f8f9fa, #ecf0f1);
}

.reward-item.rare {
    border-color: #3498db;
    background: linear-gradient(135deg, #ebf3fd, #d6eaf8);
}

.reward-item.epic {
    border-color: #9b59b6;
    background: linear-gradient(135deg, #f4ecf7, #e8daef);
}

.reward-item.legendary {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fef9e7, #fcf3cf);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.3);
}

.reward-item h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.reward-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #667eea;
}

/* Notifications d'achat */
.purchase-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.purchase-notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-content i {
    color: #27ae60;
    font-size: 1.2rem;
}

.notification-content span {
    color: #333;
    font-weight: 500;
}

/* Animation d'ouverture de loot box */
.lootbox-card.opening {
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from {
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    }
    to {
        box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
    }
}

/* Animation de chargement */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation de freinage pour le spin - Maintenant géré par JavaScript */

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .marketplace-filters {
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lootbox-card,
.marketplace-item,
.stat-card {
    animation: fadeInUp 0.6s ease forwards;
}

/* Scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Système de spin comme CS:GO */
.spin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.9);
}

.spin-modal.show {
    opacity: 1;
    visibility: visible;
}

.spin-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 2rem;
    max-width: 900px;
    width: 90%;
    text-align: center;
}

.spin-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
}

.spin-wheel-container {
    position: relative;
    height: 200px;
    margin: 2rem 0;
    overflow: hidden;
    border: 3px solid #667eea;
    border-radius: 10px;
    background: #f8f9fa;
    /* Optimisations pour les performances */
    contain: layout style paint;
    /* Forcer l'accélération matérielle */
    transform: translateZ(0);
}

.spin-wheel {
    display: flex;
    height: 100%;
    /* Retirer la transition CSS pour utiliser requestAnimationFrame */
    will-change: transform;
    /* Assurer que la wheel peut défiler sur une longue distance */
    width: max-content;
    /* Forcer l'accélération matérielle */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.spin-item {
    min-width: 150px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 2px solid #ddd;
    padding: 1rem;
    position: relative;
    gap: 0.5rem;
    /* Optimisations pour la performance */
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Empêcher la compression des éléments */
    flex-shrink: 0;
    /* Assurer la visibilité des contenus */
    overflow: visible;
}

.spin-item.common {
    background: linear-gradient(135deg, #95a5a6, #bdc3c7);
}

.spin-item.rare {
    background: linear-gradient(135deg, #3498db, #5dade2);
}

.spin-item.ultra-rare {
    background: linear-gradient(135deg, #e91e63, #f48fb1);
}

.spin-item.epic {
    background: linear-gradient(135deg, #9b59b6, #bb6bd9);
}

.spin-item.legendary {
    background: linear-gradient(135deg, #f39c12, #f7dc6f);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
}

.spin-item i {
    font-size: 2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    /* Assurer la visibilité */
    display: block;
    line-height: 1;
    /* Empêcher le flicker */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.spin-item-name {
    font-size: 0.85rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    text-align: center;
    line-height: 1.1;
    /* Assurer la lisibilité */
    max-width: 120px;
    word-wrap: break-word;
    hyphens: auto;
    /* Empêcher le flicker */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.spin-item-grade {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: 600;
    /* Empêcher le flicker */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.spin-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid #667eea;
    z-index: 10;
}

.spin-result {
    margin-top: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 15px;
    display: none;
}

.spin-result.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.result-item i {
    font-size: 3rem;
    color: #667eea;
}

.result-details h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.result-details p {
    color: #666;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

/* Modal de confirmation avant spin */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirmation-modal.show {
    opacity: 1;
    visibility: visible;
}

.confirmation-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.confirmation-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.confirmation-content p {
    margin-bottom: 2rem;
    color: #666;
}

.confirmation-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}