/* ============================================
   BITCOIN PREDICTION GAME - STYLES
   Session 1 - Authentification
   ============================================ */

/* ----------------
   VARIABLES CSS
   ---------------- */
:root {
    /* Couleurs principales - CryptoGhost Theme */
    --primary-color: #00d4ff;
    --primary-dark: #00a8cc;
    --secondary-color: #f7931a;
    
    /* Couleurs d'état */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #00d4ff;
    
    /* Couleurs neutres - Dark Mode */
    --background: #0a0e17;
    --background-card: #111827;
    --background-card-hover: #1f2937;
    --white: #ffffff;
    --gray-light: #374151;
    --gray-medium: #9ca3af;
    --gray-dark: #e5e7eb;
    --text-color: #ffffff;
    --text-secondary: #9ca3af;
    
    /* Couleurs de rareté des badges */
    --rarity-common: #6b7280;
    --rarity-rare: #00d4ff;
    --rarity-epic: #8b5cf6;
    --rarity-legendary: #f7931a;
    
    /* Effets néon/glow */
    --glow-primary: 0 0 20px rgba(0, 212, 255, 0.4);
    --glow-secondary: 0 0 20px rgba(247, 147, 26, 0.4);
    --glow-success: 0 0 20px rgba(16, 185, 129, 0.4);
    --glow-error: 0 0 20px rgba(239, 68, 68, 0.4);
    
    /* Espacements */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    
    /* Transitions */
    --transition: all 0.3s ease;
}

/* ----------------
   LOGO
   ---------------- */
.logo-container {
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.logo {
    max-width: 200px;
    height: auto;
}

/* ----------------
   RESET & BASE
   ---------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    color: var(--text-color);
    line-height: 1.6;
}

/* ----------------
   CONTAINER PRINCIPAL
   ---------------- */
.container {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-light);
}

/* ----------------
   MESSAGES & LOADING
   ---------------- */
.loading {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--info-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 1000;
    min-width: 300px;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: var(--success-color);
    color: white;
}

.message.error {
    background: var(--error-color);
    color: white;
}

.message.warning {
    background: var(--warning-color);
    color: white;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----------------
   TITRES
   ---------------- */
h1 {
    text-align: center;
    color: var(--white);
    margin-bottom: var(--spacing-xs);
    font-size: 28px;
}

h2 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
    font-size: 24px;
}

h3 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
    font-size: 18px;
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 14px;
}

/* ----------------
   AUTHENTICATION BOX
   ---------------- */
.auth-box {
    width: 100%;
}

.google-signin {
    margin-bottom: var(--spacing-md);
}

/* ----------------
   BOUTONS
   ---------------- */
button {
    width: 100%;
    padding: var(--spacing-sm);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

button:active {
    transform: translateY(0);
}

.btn-google {
    background: var(--background-card);
    color: var(--white);
    border: 2px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-google:hover {
    background: var(--background-card-hover);
    border-color: var(--primary-color);
}

.google-icon {
    font-weight: bold;
    font-size: 20px;
    color: var(--primary-color);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--background);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--glow-primary);
}

.btn-logout {
    background: var(--error-color);
    color: white;
    padding: var(--spacing-xs) var(--spacing-md);
    width: auto;
}

.btn-logout:hover {
    background: #d32f2f;
}

.btn-test {
    background: var(--info-color);
    color: white;
    margin-top: var(--spacing-sm);
}

.btn-test:hover {
    background: #1976D2;
}

/* ----------------
   DIVIDER
   ---------------- */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--spacing-md) 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--gray-light);
}

.divider span {
    padding: 0 var(--spacing-sm);
}

/* ----------------
   FORMULAIRES
   ---------------- */
.auth-form {
    margin-top: var(--spacing-md);
}

.input-field {
    width: 100%;
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: var(--transition);
    background: var(--background);
    color: var(--white);
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--glow-primary);
}

.input-field::placeholder {
    color: var(--text-secondary);
}

.switch-auth {
    text-align: center;
    margin-top: var(--spacing-md);
    font-size: 14px;
    color: var(--text-secondary);
}

.switch-auth a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.switch-auth a:hover {
    text-decoration: underline;
}

/* ----------------
   INTERFACE CONNECTÉ
   ---------------- */
.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-light);
    margin-bottom: var(--spacing-md);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.user-email {
    color: var(--gray-medium);
    font-size: 14px;
}

.user-level {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}

/* ----------------
   SUCCESS BOX
   ---------------- */
.success-box {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid var(--success-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.success-box h2 {
    color: #155724;
    margin-bottom: var(--spacing-sm);
}

.success-box p {
    color: #155724;
    margin-bottom: var(--spacing-xs);
}

.info-text {
    font-size: 14px;
    color: var(--gray-medium);
}

/* ----------------
   TEST SECTION
   ---------------- */
.test-section {
    background: var(--gray-light);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
}

.test-result {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--white);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.test-result pre {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ----------------
   RESPONSIVE
   ---------------- */
@media (max-width: 600px) {
    .container {
        padding: var(--spacing-md);
    }
    
    h1 {
        font-size: 24px;
    }
    
    .user-header {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .btn-logout {
        width: 100%;
    }
}

/* ----------------
   TABS NAVIGATION
   ---------------- */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-light);
    justify-content: center;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-medium);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

@media (max-width: 480px) {
    .tab-button {
        padding: 8px 10px;
        font-size: 12px;
    }
}

.tab-button:hover {
    color: var(--primary-color);
    transform: none;
    box-shadow: none;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ----------------
   PRICE CARD
   ---------------- */
.price-card {
    background: var(--background);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    color: white;
    margin-bottom: var(--spacing-md);
    border: 2px solid var(--primary-color);
    box-shadow: var(--glow-primary);
}

.price-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: var(--spacing-xs);
}

.price-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: var(--spacing-xs);
}

.price-change {
    font-size: 16px;
    font-weight: 600;
}

.price-change.positive {
    color: #4ade80;
}

.price-change.negative {
    color: #f87171;
}

/* ----------------
   PREDICTION SECTION
   ---------------- */
.prediction-section {
    margin-bottom: var(--spacing-md);
}

.prediction-info {
    text-align: center;
    color: var(--gray-medium);
    margin-bottom: var(--spacing-md);
}

.prediction-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.btn-prediction {
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
}

.btn-prediction .btn-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-xs);
}

.btn-prediction .btn-text {
    font-size: 16px;
}

.btn-up {
    background: var(--success-color);
    color: white;
    border: 3px solid transparent;
}

.btn-up:hover {
    border-color: var(--success-color);
    box-shadow: var(--glow-success);
}

.btn-down {
    background: var(--error-color);
    color: white;
    border: 3px solid transparent;
}

.btn-down:hover {
    border-color: var(--error-color);
    box-shadow: var(--glow-error);
}

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

/* ----------------
   WAITING SECTION
   ---------------- */
.waiting-section {
    margin-bottom: var(--spacing-md);
}

.waiting-card {
    background: var(--background);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--gray-light);
}

.waiting-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--gray-light);
}

.waiting-item:last-child {
    border-bottom: none;
}

.waiting-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.waiting-value {
    font-weight: 600;
    color: var(--white);
}

.countdown {
    color: var(--primary-color);
    font-size: 18px;
}

.waiting-info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ----------------
   QUICK STATS
   ---------------- */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.quick-stat-item {
    background: var(--background);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid var(--gray-light);
}

.quick-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.quick-stat-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

/* ----------------
   STATS TAB
   ---------------- */
.level-progress-card {
    background: var(--background);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--gray-light);
}

.level-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--white);
}

.progress-bar {
    height: 12px;
    background: var(--gray-light);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: var(--spacing-xs);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-sm);
}

.stat-card {
    background: var(--background);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-light);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.stat-card.highlight {
    background: var(--background);
    color: white;
    border: 2px solid var(--primary-color);
    box-shadow: var(--glow-primary);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 4px;
}

.stat-card.highlight .stat-value {
    color: white;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-medium);
}

.stat-card.highlight .stat-label {
    color: rgba(255,255,255,0.9);
}

/* ----------------
   LEADERBOARD
   ---------------- */
.user-rank-card {
    background: var(--background);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    border: 2px solid var(--secondary-color);
    box-shadow: var(--glow-secondary);
}

.rank-number {
    font-size: 24px;
    margin-left: var(--spacing-xs);
    color: var(--secondary-color);
}

.leaderboard-list {
    max-height: 500px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    background: var(--background);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: 1px solid var(--gray-light);
}

.leaderboard-item:hover {
    background: var(--background-card-hover);
    border-color: var(--primary-color);
}

.leaderboard-item.current-user {
    background: var(--background);
    border: 2px solid var(--primary-color);
    box-shadow: var(--glow-primary);
}

.rank {
    font-size: 20px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    color: var(--primary-color);
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.you-badge {
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: var(--spacing-xs);
}

.player-stats {
    font-size: 12px;
    color: var(--gray-medium);
}

.player-points {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

/* ----------------
   HISTORY
   ---------------- */
.history-list {
    max-height: 500px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    background: var(--background);
    border-radius: var(--radius-sm);
    border-left: 4px solid transparent;
    border: 1px solid var(--gray-light);
    border-left: 4px solid transparent;
}

.history-item.won {
    border-left-color: var(--success-color);
}

.history-item.lost {
    border-left-color: var(--error-color);
}

.history-icon {
    font-size: 24px;
}

.history-details {
    flex: 1;
}

.history-prediction {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--white);
}

.history-prices {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.history-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.history-points {
    font-size: 16px;
    font-weight: bold;
    color: var(--success-color);
}

.positive {
    color: var(--success-color);
}

.negative {
    color: var(--error-color);
}

/* ----------------
   MODAL (Résultat)
   ---------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--background-card);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--gray-light);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--white);
}

.result-title {
    text-align: center;
    margin-bottom: var(--spacing-md);
    font-size: 28px;
}

.result-title.won {
    color: var(--success-color);
}

.result-title.lost {
    color: var(--error-color);
}

.result-details {
    margin-bottom: var(--spacing-md);
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--gray-light);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--text-secondary);
}

.result-value {
    font-weight: 600;
    color: var(--white);
}

.result-item.points-earned {
    background: var(--background);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
    border: 1px solid var(--success-color);
}

.result-item.points-earned .result-value {
    color: var(--success-color);
    font-size: 20px;
}

/* ----------------
   LOADING & NO DATA
   ---------------- */
.loading-text {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-md);
}

.no-data {
    text-align: center;
    color: var(--gray-medium);
    padding: var(--spacing-xl);
    font-style: italic;
}

/* ----------------
   ANIMATIONS
   ---------------- */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 1s ease;
}

.level-up-animation {
    animation: pulse 1s ease 3;
    color: var(--success-color);
}

.button-pressed {
    transform: scale(0.95);
}

/* ----------------
   UTILITIES
   ---------------- */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

/* =====================================
   BADGES - SYSTÈME DE BADGES
   ===================================== */

/* En-tête des badges */
.badges-header {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.badges-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.badges-counter {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Filtres de badges */
.badges-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    justify-content: center;
}

.badge-filter {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.badge-filter:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.badge-filter.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Grille de badges - Format cartes */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
}

@media (min-width: 768px) {
    .badges-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Item de badge - Format Trading Card */
.badge-item {
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.9), rgba(10, 14, 23, 0.95));
    border-radius: 16px;
    padding: var(--spacing-md);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
    cursor: pointer;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Effet holographique de fond */
.badge-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.badge-item:hover::before {
    opacity: 1;
    animation: holographic 1.5s ease infinite;
}

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

/* Badge débloqué */
.badge-item.unlocked {
    cursor: pointer;
}

.badge-item.unlocked[data-rarity="common"] {
    border-color: var(--rarity-common);
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.2);
}

.badge-item.unlocked[data-rarity="rare"] {
    border-color: var(--rarity-rare);
    box-shadow: 0 4px 25px rgba(0, 212, 255, 0.3),
                inset 0 0 30px rgba(0, 212, 255, 0.05);
}

.badge-item.unlocked[data-rarity="epic"] {
    border-color: var(--rarity-epic);
    box-shadow: 0 4px 25px rgba(139, 92, 246, 0.3),
                inset 0 0 30px rgba(139, 92, 246, 0.05);
}

.badge-item.unlocked[data-rarity="legendary"] {
    border-color: var(--rarity-legendary);
    box-shadow: 0 4px 30px rgba(247, 147, 26, 0.4),
                inset 0 0 40px rgba(247, 147, 26, 0.08);
    animation: legendaryPulse 3s ease-in-out infinite;
}

@keyframes legendaryPulse {
    0%, 100% {
        box-shadow: 0 4px 30px rgba(247, 147, 26, 0.4),
                    inset 0 0 40px rgba(247, 147, 26, 0.08);
    }
    50% {
        box-shadow: 0 4px 40px rgba(247, 147, 26, 0.6),
                    inset 0 0 50px rgba(247, 147, 26, 0.12);
    }
}

.badge-item.unlocked:hover {
    transform: translateY(-8px) rotateX(5deg);
}

.badge-item.unlocked[data-rarity="rare"]:hover {
    box-shadow: 0 8px 35px rgba(0, 212, 255, 0.5),
                inset 0 0 40px rgba(0, 212, 255, 0.1);
}

.badge-item.unlocked[data-rarity="epic"]:hover {
    box-shadow: 0 8px 35px rgba(139, 92, 246, 0.5),
                inset 0 0 40px rgba(139, 92, 246, 0.1);
}

.badge-item.unlocked[data-rarity="legendary"]:hover {
    box-shadow: 0 8px 45px rgba(247, 147, 26, 0.7),
                inset 0 0 50px rgba(247, 147, 26, 0.15);
    animation: none;
}

/* Badge verrouillé */
.badge-item.locked {
    opacity: 0.6;
    border-color: rgba(107, 114, 128, 0.3);
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.5), rgba(10, 14, 23, 0.6));
}

.badge-item.locked:hover {
    opacity: 0.8;
    transform: translateY(-3px);
}

.badge-item.locked .badge-image {
    /* Pas de filtre - l'image locked.svg est déjà grise */
    opacity: 1;
}

/* Icône du badge - Grande image centrée */
.badge-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
}

.badge-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    transition: all 0.4s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Effet brillant pour badges débloqués */
.badge-item.unlocked .badge-image {
    animation: cardShine 4s ease-in-out infinite;
}

@keyframes cardShine {
    0%, 100% {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)) brightness(1);
    }
    50% {
        filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4)) brightness(1.15);
    }
}

.badge-item.unlocked:hover .badge-image {
    transform: scale(1.15);
}

/* Contenu texte du badge */
.badge-content {
    text-align: center;
}

/* Nom du badge */
.badge-name {
    font-weight: 700;
    color: var(--white);
    margin-bottom: 6px;
    font-size: 0.9rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Description du badge */
.badge-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
    min-height: 36px;
}

/* Rareté du badge */
.badge-rarity {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 10px;
    display: inline-block;
    letter-spacing: 0.5px;
}

/* Couleurs par rareté */
.badge-item[data-rarity="common"] .badge-rarity {
    background: rgba(107, 114, 128, 0.3);
    color: var(--rarity-common);
    border: 1px solid rgba(107, 114, 128, 0.5);
}

.badge-item[data-rarity="rare"] .badge-rarity {
    background: rgba(0, 212, 255, 0.2);
    color: var(--rarity-rare);
    border: 1px solid rgba(0, 212, 255, 0.5);
}

.badge-item[data-rarity="epic"] .badge-rarity {
    background: rgba(139, 92, 246, 0.2);
    color: var(--rarity-epic);
    border: 1px solid rgba(139, 92, 246, 0.5);
}

.badge-item[data-rarity="legendary"] .badge-rarity {
    background: rgba(247, 147, 26, 0.2);
    color: var(--rarity-legendary);
    border: 1px solid rgba(247, 147, 26, 0.5);
}

/* Animation de déblocage */
@keyframes badgeUnlock {
    0% {
        transform: scale(0.5) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.badge-item.just-unlocked {
    animation: badgeUnlock 0.6s ease;
}

/* =====================================
   MODAL BADGE - Affichage détaillé
   ===================================== */

.badge-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.badge-modal.active {
    display: flex;
}

.badge-modal-content {
    background: linear-gradient(145deg, #1a2332, #0d1117);
    border-radius: 24px;
    padding: var(--spacing-xl);
    max-width: 360px;
    width: 90%;
    text-align: center;
    position: relative;
    border: 3px solid transparent;
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* Bordure couleur selon rareté */
.badge-modal-content[data-rarity="common"] {
    border-color: var(--rarity-common);
}

.badge-modal-content[data-rarity="rare"] {
    border-color: var(--rarity-rare);
    box-shadow: 0 0 60px rgba(0, 212, 255, 0.3);
}

.badge-modal-content[data-rarity="epic"] {
    border-color: var(--rarity-epic);
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.3);
}

.badge-modal-content[data-rarity="legendary"] {
    border-color: var(--rarity-legendary);
    box-shadow: 0 0 80px rgba(247, 147, 26, 0.4);
}

.badge-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
}

.badge-modal-close:hover {
    color: var(--white);
    transform: rotate(90deg);
}

.badge-modal-image {
    width: 280px;
    height: 280px;
    object-fit: contain;
    margin-bottom: var(--spacing-md);
    border-radius: 16px;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
    transition: all 0.3s ease;
}

.badge-modal-content:hover .badge-modal-image {
    transform: translateY(-5px);
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.5));
}

/* Glow selon rareté au hover */
.badge-modal-content[data-rarity="rare"]:hover .badge-modal-image {
    filter: drop-shadow(0 12px 30px rgba(0, 212, 255, 0.4));
}

.badge-modal-content[data-rarity="epic"]:hover .badge-modal-image {
    filter: drop-shadow(0 12px 30px rgba(139, 92, 246, 0.4));
}

.badge-modal-content[data-rarity="legendary"]:hover .badge-modal-image {
    filter: drop-shadow(0 12px 35px rgba(247, 147, 26, 0.5));
}

.badge-modal-content.locked .badge-modal-image {
    /* Pas de filtre - l'image locked.svg est déjà grise */
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.badge-modal-content.locked:hover .badge-modal-image {
    transform: none;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
}

.badge-modal-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--spacing-xs);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.badge-modal-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.badge-modal-rarity {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: var(--spacing-md);
    letter-spacing: 1px;
}

.badge-modal-content[data-rarity="common"] .badge-modal-rarity {
    background: rgba(107, 114, 128, 0.3);
    color: var(--rarity-common);
}

.badge-modal-content[data-rarity="rare"] .badge-modal-rarity {
    background: rgba(0, 212, 255, 0.2);
    color: var(--rarity-rare);
}

.badge-modal-content[data-rarity="epic"] .badge-modal-rarity {
    background: rgba(139, 92, 246, 0.2);
    color: var(--rarity-epic);
}

.badge-modal-content[data-rarity="legendary"] .badge-modal-rarity {
    background: rgba(247, 147, 26, 0.2);
    color: var(--rarity-legendary);
}

.badge-modal-date {
    font-size: 0.85rem;
    color: var(--success-color);
    margin-top: var(--spacing-sm);
}

.badge-modal-locked-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: var(--spacing-sm);
}

/* Responsive pour badges */
@media (max-width: 768px) {
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .badge-image {
        width: 60px;
        height: 60px;
    }
    
    .badge-name {
        font-size: 0.8rem;
    }
    
    .badge-description {
        font-size: 0.7rem;
        min-height: 32px;
    }
    
    .badge-rarity {
        font-size: 0.6rem;
        padding: 3px 8px;
    }
    
    .badges-filters {
        gap: 6px;
    }
    
    .badge-filter {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .badge-modal-content {
        padding: var(--spacing-md);
    }
    
    .badge-modal-image {
        width: 200px;
        height: 200px;
    }
    
    .badge-modal-name {
        font-size: 1.1rem;
    }
    
    .badge-modal-description {
        font-size: 0.85rem;
    }
}

/* Empty state */
.badges-grid .loading-text {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

/* =====================================
   MISSIONS - SYSTÈME DE MISSIONS
   ===================================== */

/* Section missions */
.missions-section {
    margin-bottom: var(--spacing-lg);
}

.missions-section h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

/* Catégorie de missions */
.missions-category {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

/* En-tête de catégorie */
.missions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.missions-title {
    font-weight: 600;
    color: var(--text-primary);
}

.missions-counter {
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Liste des missions */
.missions-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Item de mission */
.mission-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mission-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mission-item.completed {
    border-left: 3px solid var(--success-color);
}

.mission-item.claimed {
    opacity: 0.6;
}

/* Icône de mission */
.mission-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

/* Info de mission */
.mission-info {
    flex: 1;
    min-width: 0;
}

.mission-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.mission-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

/* Barre de progression */
.mission-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.mission-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.mission-item.completed .mission-progress-fill {
    background: var(--success-color);
}

.mission-progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Récompense */
.mission-reward {
    flex-shrink: 0;
    text-align: right;
}

.reward-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.btn-claim {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 1.5s infinite;
}

.btn-claim:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-success);
}

.claimed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    font-size: 0.9rem;
}

/* Animation pour le bouton claim */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

/* Responsive missions */
@media (max-width: 768px) {
    .mission-item {
        flex-wrap: wrap;
    }
    
    .mission-info {
        flex: 1 1 calc(100% - 60px);
    }
    
    .mission-reward {
        flex: 1 1 100%;
        text-align: left;
        margin-top: var(--spacing-xs);
        padding-left: 48px;
    }
    
    .mission-icon {
        font-size: 1.3rem;
        width: 35px;
    }
    
    .mission-name {
        font-size: 0.9rem;
    }
}

/* ============================================
   ÉVÉNEMENTS SAISONNIERS - CALENDRIER
   ============================================ */

/* ----------------
   BANNER D'ÉVÉNEMENT
   ---------------- */
.event-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--background-card) 0%, #1a2332 100%);
    border-bottom: 2px solid var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.event-banner.banner-hiding {
    animation: slideUp 0.3s ease forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.event-banner-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.event-banner-icon {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.event-banner-text {
    color: var(--text-color);
    font-size: 0.9rem;
}

.event-banner-text strong {
    color: var(--primary-color);
}

.event-banner-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    transition: var(--transition);
}

.event-banner-close:hover {
    color: var(--text-color);
    transform: scale(1.1);
}

/* Ajuster le body quand le banner est visible */
body.has-event-banner {
    padding-top: 70px;
}

/* ----------------
   ONGLET EVENT
   ---------------- */
#event-tab {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(247, 147, 26, 0.2) 100%);
    border: 1px solid var(--primary-color);
    animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
    }
}

/* ----------------
   CONTENU ÉVÉNEMENT
   ---------------- */
.event-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.event-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.event-ended-message {
    background: rgba(247, 147, 26, 0.1);
    border: 1px solid var(--secondary-color);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.event-progress-summary {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.event-progress-summary span {
    background: var(--background-card);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
}

/* ----------------
   GRILLE CALENDRIER
   ---------------- */
.event-calendar-grid {
    display: grid;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

/* ----------------
   CASES DU CALENDRIER
   ---------------- */
.calendar-cell {
    aspect-ratio: 1;
    background: var(--background-card);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid var(--gray-light);
    transition: var(--transition);
    overflow: hidden;
}

.calendar-day-number {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--text-secondary);
}

.calendar-badge {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

.calendar-mystery {
    font-size: 2rem;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

/* Case disponible (cliquable) */
.calendar-cell.available {
    cursor: pointer;
    border-color: var(--primary-color);
    box-shadow: var(--glow-primary);
}

.calendar-cell.available:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

/* Case réclamée */
.calendar-cell.claimed {
    border-color: var(--success-color);
    background: linear-gradient(135deg, var(--background-card) 0%, rgba(16, 185, 129, 0.1) 100%);
    cursor: pointer;
}

.calendar-cell.claimed:hover {
    transform: scale(1.03);
}

/* Case manquée */
.calendar-cell.missed {
    border-color: var(--error-color);
    opacity: 0.6;
}

.calendar-cell.missed .calendar-badge {
    filter: grayscale(100%);
}

.calendar-cell.missed::after {
    content: '✕';
    position: absolute;
    font-size: 1.5rem;
    color: var(--error-color);
    opacity: 0.8;
}

/* Case verrouillée */
.calendar-cell.locked {
    opacity: 0.5;
    border-color: var(--gray-light);
}

/* Animation d'ouverture */
.calendar-cell.opening {
    animation: cellOpen 0.5s ease forwards;
}

@keyframes cellOpen {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1); }
}

/* Bordures par rareté */
.calendar-cell.rarity-common.claimed {
    border-color: var(--rarity-common);
}

.calendar-cell.rarity-rare.claimed {
    border-color: var(--rarity-rare);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.calendar-cell.rarity-epic.claimed {
    border-color: var(--rarity-epic);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.calendar-cell.rarity-legendary.claimed {
    border-color: var(--rarity-legendary);
    box-shadow: 0 0 15px rgba(247, 147, 26, 0.4);
    animation: legendaryGlow 2s infinite;
}

@keyframes legendaryGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(247, 147, 26, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(247, 147, 26, 0.6);
    }
}

/* ----------------
   BONUS DE COMPLÉTION
   ---------------- */
.event-completion-bonus {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--background-card);
    border: 2px solid var(--gray-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.event-completion-bonus.claimed {
    border-color: var(--rarity-legendary);
    background: linear-gradient(135deg, var(--background-card) 0%, rgba(247, 147, 26, 0.1) 100%);
    box-shadow: 0 0 20px rgba(247, 147, 26, 0.3);
}

.completion-badge {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.completion-badge.locked {
    filter: grayscale(100%);
    opacity: 0.5;
}

.completion-info {
    display: flex;
    flex-direction: column;
}

.completion-info strong {
    color: var(--secondary-color);
}

.completion-info span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ----------------
   ANIMATION D'ÉTOILES
   ---------------- */
.stars-container {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

.star-particle {
    position: absolute;
    font-size: 1.2rem;
    animation: starExplode 0.8s ease-out forwards;
    animation-delay: var(--delay);
}

@keyframes starExplode {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * 80px),
            calc(sin(var(--angle)) * 80px)
        ) scale(1);
        opacity: 0;
    }
}

/* Fallback pour navigateurs sans support de cos/sin */
.star-particle:nth-child(1) { transform: translate(80px, 0); }
.star-particle:nth-child(2) { transform: translate(69px, 40px); }
.star-particle:nth-child(3) { transform: translate(40px, 69px); }
.star-particle:nth-child(4) { transform: translate(0, 80px); }
.star-particle:nth-child(5) { transform: translate(-40px, 69px); }
.star-particle:nth-child(6) { transform: translate(-69px, 40px); }
.star-particle:nth-child(7) { transform: translate(-80px, 0); }
.star-particle:nth-child(8) { transform: translate(-69px, -40px); }
.star-particle:nth-child(9) { transform: translate(-40px, -69px); }
.star-particle:nth-child(10) { transform: translate(0, -80px); }
.star-particle:nth-child(11) { transform: translate(40px, -69px); }
.star-particle:nth-child(12) { transform: translate(69px, -40px); }

/* Animation simplifiée pour tous les navigateurs */
@keyframes starExplodeSimple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(-50px);
        opacity: 0;
    }
}

.star-particle {
    animation: starExplodeSimple 0.8s ease-out forwards;
}

/* ----------------
   MODAL DE RÉCOMPENSE
   ---------------- */
.reward-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.reward-modal-content {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    max-width: 320px;
    width: 90%;
    border: 2px solid var(--primary-color);
    box-shadow: var(--glow-primary);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

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

.reward-modal-content h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-size: 1.3rem;
}

.reward-badge-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: var(--spacing-sm);
    animation: badgeReveal 0.5s ease;
}

@keyframes badgeReveal {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.reward-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
}

.reward-points {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--success-color);
}

.reward-rarity {
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.reward-rarity.rarity-common {
    background: rgba(107, 114, 128, 0.2);
    color: var(--rarity-common);
}

.reward-rarity.rarity-rare {
    background: rgba(0, 212, 255, 0.2);
    color: var(--rarity-rare);
}

.reward-rarity.rarity-epic {
    background: rgba(139, 92, 246, 0.2);
    color: var(--rarity-epic);
}

.reward-rarity.rarity-legendary {
    background: rgba(247, 147, 26, 0.2);
    color: var(--rarity-legendary);
}

.completion-reward {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-light);
}

.completion-reward h4 {
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
}

.master-badge-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: var(--spacing-xs);
}

.bonus-points {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.modal-close-btn {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--primary-color);
    color: var(--background);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ----------------
   SOUS-ONGLETS BADGES
   ---------------- */
.badges-sub-tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: var(--spacing-xs);
}

.badges-sub-tab {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.badges-sub-tab:hover {
    color: var(--text-color);
}

.badges-sub-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.badges-subtab-content {
    display: none;
}

.badges-subtab-content.active {
    display: block;
}

/* ----------------
   COLLECTIONS
   ---------------- */
.collections-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.collections-header h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.collections-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.collections-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

.collections-empty p {
    margin-bottom: var(--spacing-sm);
}

.collection-group {
    margin-bottom: var(--spacing-md);
}

.collection-group h3 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--gray-light);
}

.collection-event {
    background: var(--background-card);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.collection-event:hover {
    background: var(--background-card-hover);
}

.collection-event-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
}

.collection-event-icon {
    font-size: 1.5rem;
}

.collection-event-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-color);
}

.collection-event-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.collection-event-badges {
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--gray-light);
}

.collection-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: var(--spacing-xs);
}

.collection-badge {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-card);
    border: 2px solid var(--gray-light);
}

.collection-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.collection-badge.claimed {
    border-color: var(--success-color);
}

.collection-badge.missed {
    opacity: 0.4;
}

.collection-badge.missed img {
    filter: grayscale(100%);
}

.collection-badge.rarity-common.claimed {
    border-color: var(--rarity-common);
}

.collection-badge.rarity-rare.claimed {
    border-color: var(--rarity-rare);
}

.collection-badge.rarity-epic.claimed {
    border-color: var(--rarity-epic);
}

.collection-badge.rarity-legendary.claimed,
.collection-badge.master {
    border-color: var(--rarity-legendary);
    box-shadow: 0 0 10px rgba(247, 147, 26, 0.3);
}

/* ----------------
   RESPONSIVE ÉVÉNEMENTS
   ---------------- */
@media (max-width: 768px) {
    .event-banner {
        flex-direction: column;
        gap: var(--spacing-xs);
        text-align: center;
    }
    
    .event-banner-close {
        position: absolute;
        top: var(--spacing-xs);
        right: var(--spacing-xs);
    }
    
    .event-calendar-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .calendar-cell {
        min-height: 60px;
    }
    
    .calendar-day-number {
        font-size: 0.6rem;
    }
    
    .calendar-mystery {
        font-size: 1.5rem;
    }
    
    .event-completion-bonus {
        flex-direction: column;
        text-align: center;
    }
    
    .badges-sub-tabs {
        justify-content: center;
    }
    
    .collection-event-header {
        flex-wrap: wrap;
    }
    
    .collection-event-stats {
        flex: 1 1 100%;
        text-align: left;
        padding-left: 40px;
        margin-top: var(--spacing-xs);
    }
    
    .collection-badges-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ============================================
   RÈGLEMENT - ICÔNE ET MODAL
   ============================================ */

/* ----------------
   HEADER ACTIONS
   ---------------- */
.header-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.btn-rules {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-rules:hover {
    background: var(--primary-color);
    color: var(--background-dark);
    transform: scale(1.1);
    box-shadow: var(--glow-primary);
}

/* ----------------
   MODAL RÈGLEMENT
   ---------------- */
.rules-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.rules-modal-content {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--spacing-lg);
    position: relative;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.3);
}

.rules-modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rules-modal-close:hover {
    color: var(--text-color);
    transform: rotate(90deg);
}

.rules-title {
    color: var(--primary-color);
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--gray-light);
}

.rules-section {
    margin-bottom: var(--spacing-lg);
}

.rules-section h2 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.rules-section h3 {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.rules-section p {
    color: var(--text-color);
    line-height: 1.8;
    margin-bottom: var(--spacing-xs);
}

.rules-section strong {
    color: var(--primary-color);
}

.rules-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: var(--spacing-xs);
}

.rules-levels {
    background: rgba(0, 212, 255, 0.05);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.rules-levels p {
    margin: 0;
}

.rules-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-light);
    margin-top: var(--spacing-md);
}

.rules-footer p {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* ----------------
   RESPONSIVE RÈGLEMENT
   ---------------- */
@media (max-width: 768px) {
    .rules-modal {
        padding: var(--spacing-sm);
    }
    
    .rules-modal-content {
        padding: var(--spacing-md);
        max-height: 85vh;
    }
    
    .rules-title {
        font-size: 1.4rem;
    }
    
    .rules-section h2 {
        font-size: 1.1rem;
    }
    
    .rules-section h3 {
        font-size: 1rem;
    }
    
    .btn-rules {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .header-actions {
        gap: var(--spacing-xs);
    }
}
