/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    /* Couleurs principales */
    --primary-color: #6a11cb;
    --primary-dark: #560bad;
    --primary-light: #b5179e;
    --secondary-color: #2575fc;
    --accent-color: #ff4d94;
    
    /* Couleurs de statut */
    --success-color: #06d6a0;
    --success-light: #b7f4e2;
    --warning-color: #ffd166;
    --warning-light: #fff3cd;
    --danger-color: #ef476f;
    --danger-light: #ffccd5;
    --info-color: #118ab2;
    --info-light: #d3ecf5;
    
    /* Couleurs de progression */
    --progress-start: #06d6a0;
    --progress-middle: #ffd166;
    --progress-end: #ef476f;
    
    /* Couleurs de base */
    --light-bg: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.2);
    
    /* Bordures */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ============================================
   RESET ET BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #f5f7fa 0%, #e3e8f0 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    z-index: 3000;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.success {
    background: var(--success-color);
    color: white;
}

.notification.error {
    background: var(--danger-color);
    color: white;
}

.notification.info {
    background: var(--info-color);
    color: white;
}

.notification.hidden {
    display: none;
}

/* ============================================
   CONTAINER PRINCIPAL
   ============================================ */
.tournament-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* ============================================
   EN-TÊTE DU TOURNOI
   ============================================ */
.tournament-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.header-main h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    min-width: 0;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.timer-icon {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    word-break: break-word;
}

.stat-value.timer {
    font-size: 1.2rem;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.tournament-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* ============================================
   MACHINE DE DÉFIS
   ============================================ */
.machine-section {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    overflow: hidden;
}

.machine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.machine-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.machine-status-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-badge.active {
    background: linear-gradient(135deg, var(--success-color), #00b383);
    color: white;
    animation: glow 2s ease-in-out infinite;
}

.status-badge.rest {
    background: var(--danger-color);
    color: white;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(6, 214, 160, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(6, 214, 160, 0.6);
    }
}

.next-round-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: right;
}

/* Roue de la machine */
.machine-wheel-container {
    position: relative;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.machine-wheel {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 8px solid var(--border-color);
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-width: 100%;
}

.wheel-segments {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: rotateWheel 4s linear infinite;
    animation-play-state: paused;
}

.wheel-segments.spinning {
    animation-play-state: running !important;
    animation-duration: 3s;
}

.wheel-segments.fast-spin {
    animation-play-state: running !important;
    animation-duration: 1s !important;
}

@keyframes rotateWheel {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.wheel-segments.spinning {
    animation-timing-function: ease-in-out;
}

.machine-wheel.resting .wheel-segments {
    animation-play-state: paused !important;
    opacity: 0.6;
}

.machine-wheel.active .wheel-segments {
    animation-play-state: running !important;
    opacity: 1;
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
}

.wheel-segment span {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transform: rotate(22.5deg);
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(106, 17, 203, 0.4);
}

.wheel-center-content {
    background: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.wheel-center-content i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.wheel-speed {
    font-size: 0.9rem;
    font-weight: 700;
}

.wheel-marker {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--danger-color);
    z-index: 20;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.wheel-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wheel-glow.active {
    opacity: 1;
    box-shadow: 0 0 40px rgba(6, 214, 160, 0.6);
}

/* Indicateur de progression */
.speed-indicator {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-top: 2rem;
    width: 100%;
    max-width: 500px;
}

.speed-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.speed-bar {
    width: 100%;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    position: relative;
}

.speed-fill {
    height: 100%;
    width: 0%;
    transition: width 0.5s ease, background-color 0.5s ease;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.speed-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.speed-info {
    display: flex;
    justify-content: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

#progressMessage {
    text-align: center;
}

/* ============================================
   SECTION DE PARTICIPATION
   ============================================ */
.participation-section {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-balance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--warning-color), #ffb700);
    color: white;
    border-radius: 20px;
    font-weight: 600;
}

.participation-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.number-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.number-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.number-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.number-btn:active {
    transform: scale(0.95);
}

#targetNumber {
    flex: 1;
    max-width: 150px;
    height: 45px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--primary-color);
}

.post-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.post-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.1);
}

.form-group small {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.challenge-info {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    flex-wrap: wrap;
}

.info-item.warning {
    color: var(--danger-color);
    font-weight: 600;
}

.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Challenge actif */
.active-challenge {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.challenge-card {
    background: linear-gradient(135deg, var(--info-light), #e3f2fd);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 2px solid var(--info-color);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.challenge-header h4 {
    color: var(--info-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.challenge-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.challenge-status.in-progress {
    background: var(--warning-color);
    color: white;
}

.challenge-status.completed {
    background: var(--success-color);
    color: white;
}

.challenge-status.failed {
    background: var(--danger-color);
    color: white;
}

.challenge-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--info-color);
    word-break: break-word;
}

.detail-value.remaining {
    color: var(--danger-color);
}

.progress-container {
    margin: 1.5rem 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #00b383);
    transition: width 0.5s ease;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

.progress-text {
    font-weight: 700;
    color: var(--info-color);
}

.challenge-post {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(17, 138, 178, 0.2);
}

.post-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.post-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    word-break: break-word;
}

.post-link:hover {
    color: var(--primary-dark);
    gap: 0.75rem;
}

/* ============================================
   STATISTIQUES
   ============================================ */
.stats-section {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.stats-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-box {
    background: var(--light-bg);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-box.success {
    border-left-color: var(--success-color);
}

.stat-box.warning {
    border-left-color: var(--warning-color);
}

.stat-box.danger {
    border-left-color: var(--danger-color);
}

.stat-box.info {
    border-left-color: var(--info-color);
}

.stat-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-box.success .stat-icon-box {
    background: var(--success-light);
    color: var(--success-color);
}

.stat-box.warning .stat-icon-box {
    background: var(--warning-light);
    color: var(--warning-color);
}

.stat-box.danger .stat-icon-box {
    background: var(--danger-light);
    color: var(--danger-color);
}

.stat-box.info .stat-icon-box {
    background: var(--info-light);
    color: var(--info-color);
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ============================================
   TOUS LES PARTICIPANTS
   ============================================ */
.ranking-section {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.prize-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--warning-color), #ffb700);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.all-participants-list {
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.participant-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid transparent;
    transition: var(--transition);
    gap: 1rem;
}

.participant-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

/* Couleurs selon la progression */
.participant-card.very-close {
    background: linear-gradient(135deg, #e8f8f5, #d5f4e6);
    border-left-color: var(--success-color);
}

.participant-card.close {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-left-color: var(--warning-color);
}

.participant-card.far {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-left-color: var(--info-color);
}

.participant-card.clashed {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left-color: var(--danger-color);
}

.participant-card.perfect {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-left-color: #059669;
    box-shadow: 0 0 20px rgba(5, 150, 105, 0.2);
}

.participant-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: var(--light-bg);
    color: var(--text-primary);
}

.participant-card.perfect .participant-rank {
    background: linear-gradient(135deg, var(--success-color), #00b383);
    color: white;
}

.participant-card.clashed .participant-rank {
    background: var(--danger-color);
    color: white;
}

.participant-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.participant-name {
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
    margin-bottom: 0.25rem;
}

.participant-post-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.progress-mini-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.progress-mini {
    width: 120px;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

.progress-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.participant-card.perfect .progress-value {
    color: var(--success-color);
}

.participant-card.clashed .progress-value {
    color: var(--danger-color);
}

.participant-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.participant-card.perfect .participant-status-badge {
    background: var(--success-color);
    color: white;
}

.participant-card.clashed .participant-status-badge {
    background: var(--danger-color);
    color: white;
}

.participant-card.very-close .participant-status-badge {
    background: var(--warning-color);
    color: white;
}

.participant-card.close .participant-status-badge {
    background: var(--info-color);
    color: white;
}

.participant-card.far .participant-status-badge {
    background: var(--light-bg);
    color: var(--text-secondary);
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

/* ============================================
   HISTORIQUE DES GAGNANTS
   ============================================ */
.winners-section {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.winners-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.winners-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.winner-item {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.winner-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.winner-rank {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.winner-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.winner-name {
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.winner-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.winner-prize {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* ============================================
   INSTRUCTIONS
   ============================================ */
.instructions-section {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.instructions-section h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.instruction-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.instruction-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.instruction-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.instruction-content h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.instruction-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.strategy-tips {
    background: linear-gradient(135deg, var(--warning-light), #fff9e6);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 5px solid var(--warning-color);
}

.tip-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--warning-color);
}

.tip-header h4 {
    color: var(--text-primary);
}

.tips-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.tip-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius-sm);
}

.tip-item i {
    color: var(--warning-color);
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.tip-item p {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background-color: var(--text-primary);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   UTILITAIRES
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   RESPONSIVE - TABLETTE
   ============================================ */
@media (max-width: 1200px) {
    .tournament-main {
        grid-template-columns: 1fr;
    }
    
    .right-column {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
    
    .machine-wheel {
        width: 300px;
        height: 300px;
    }
}

/* ============================================
   RESPONSIVE - SMARTPHONE
   ============================================ */
@media (max-width: 768px) {
    /* Header mobile */
    .mobile-toggle {
        display: block;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        transform: translateY(-150%);
        opacity: 0;
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-links a {
        color: var(--text-primary);
        padding: 0.75rem 1rem;
    }
    
    .user-info span {
        display: none;
    }
    
    /* Container */
    .tournament-container {
        padding: 10px;
    }
    
    /* Header tournoi */
    .tournament-header {
        padding: 1.5rem;
    }
    
    .header-main h1 {
        font-size: 1.6rem;
        gap: 0.5rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .header-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* Machine */
    .machine-section {
        padding: 1.5rem;
    }
    
    .machine-header h2 {
        font-size: 1.4rem;
    }
    
    .machine-status-group {
        align-items: flex-start;
        width: 100%;
    }
    
    .status-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .next-round-info {
        font-size: 0.8rem;
        text-align: left;
    }
    
    .machine-wheel {
        width: 260px;
        height: 260px;
    }
    
    .wheel-center {
        width: 80px;
        height: 80px;
    }
    
    .wheel-center-content {
        width: 60px;
        height: 60px;
    }
    
    .wheel-center-content i {
        font-size: 1.2rem;
    }
    
    .wheel-speed {
        font-size: 0.8rem;
    }
    
    .wheel-segment span {
        font-size: 1.2rem;
    }
    
    .speed-indicator {
        padding: 1rem;
    }
    
    /* Participation */
    .participation-section {
        padding: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header h3 {
        font-size: 1.3rem;
    }
    
    .user-balance {
        font-size: 0.9rem;
    }
    
    .number-selector {
        justify-content: center;
    }
    
    .number-btn {
        width: 50px;
        height: 50px;
    }
    
    #targetNumber {
        height: 50px;
        font-size: 1.3rem;
    }
    
    /* Statistiques */
    .stats-section {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-box {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    /* Participants */
    .ranking-section {
        padding: 1.5rem;
    }
    
    .participant-card {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .progress-mini {
        width: 100px;
    }
    
    /* Instructions */
    .instructions-section {
        padding: 1.5rem;
    }
    
    .instructions-grid,
    .tips-content {
        grid-template-columns: 1fr;
    }
    
    /* Right column */
    .right-column {
        grid-template-columns: 1fr;
    }
    
    /* Notifications mobile */
    .notification {
        right: 10px;
        left: 10px;
        bottom: 10px;
        max-width: calc(100% - 20px);
    }
}

/* ============================================
   RESPONSIVE - PETIT SMARTPHONE
   ============================================ */
@media (max-width: 480px) {
    .tournament-container {
        padding: 8px;
    }
    
    header {
        padding: 0.75rem 0;
    }
    
    .logo {
        font-size: 1.1rem;
        gap: 6px;
    }
    
    .avatar {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .tournament-header {
        padding: 1.2rem;
    }
    
    .header-main h1 {
        font-size: 1.4rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .header-stats {
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .machine-section,
    .participation-section,
    .stats-section,
    .ranking-section,
    .winners-section,
    .instructions-section {
        padding: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .machine-header h2,
    .section-header h3 {
        font-size: 1.2rem;
    }
    
    .machine-wheel {
        width: 220px;
        height: 220px;
        border: 6px solid var(--border-color);
    }
    
    .wheel-center {
        width: 70px;
        height: 70px;
    }
    
    .wheel-center-content {
        width: 50px;
        height: 50px;
    }
    
    .wheel-center-content i {
        font-size: 1rem;
    }
    
    .wheel-speed {
        font-size: 0.7rem;
    }
    
    .wheel-marker {
        font-size: 1.5rem;
    }
    
    .wheel-segment span {
        font-size: 1rem;
    }
    
    .number-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    #targetNumber {
        height: 45px;
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 0.75rem 1.2rem;
        font-size: 0.95rem;
    }
    
    .challenge-details {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .detail-value {
        font-size: 1.3rem;
    }
    
    .stat-icon-box {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-text {
        font-size: 0.8rem;
    }
    
    .participant-rank {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .progress-mini {
        width: 80px;
    }
    
    .winner-rank {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .winner-name {
        font-size: 0.95rem;
    }
    
    .winner-details {
        font-size: 0.8rem;
    }
    
    .winner-prize {
        font-size: 1rem;
    }
    
    .instruction-number {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .instruction-content h4 {
        font-size: 1rem;
    }
    
    .instruction-content p {
        font-size: 0.9rem;
    }
    
    footer {
        padding: 1.5rem 0;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
    
    .footer-section {
        min-width: 150px;
    }
}

/* ============================================
   TRÈS PETIT ÉCRAN (< 360px)
   ============================================ */
@media (max-width: 360px) {
    .header-stats {
        grid-template-columns: 1fr;
    }
    
    .machine-wheel {
        width: 200px;
        height: 200px;
    }
    
    .number-selector {
        gap: 0.5rem;
    }
    
    .number-btn {
        width: 40px;
        height: 40px;
    } 
    
    #targetNumber {
        height: 40px;
        max-width: 120px;
    }
}