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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
}

#main-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Écrans */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height pour iOS */
    position: absolute;
    top: 0;
    left: 0;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix pour viewport mobile */
@supports (height: 100dvh) {
    .screen {
        min-height: 100dvh;
    }
}

/* Écran de chargement */
#loading-screen {
    background: url('../assets/sprites/homepage/menu_background.png') center center;
    background-size: cover;
}

.loading-content {
    text-align: center;
    color: white;
    background: rgba(0,0,0,0.5);
    padding: 40px 60px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.loading-content h1 {
    font-size: 36px;
    margin-bottom: 30px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    color: #4FC3F7;
}

.loading-spinner {
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Menu principal */
#main-menu {
    background: url('../assets/sprites/homepage/menu_background.png') center center;
    background-size: cover;
    position: relative;
    overflow: hidden;
}

/* Couche de montagnes parallax */
.mountains-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: url('../assets/sprites/homepage/mountains_parallax.png') bottom center repeat-x;
    background-size: auto 100%;
    opacity: 0.6;
    z-index: 1;
}

/* Conteneur de neige avec plusieurs couches */
.snow-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

/* Couche de neige 1 - gros flocons lents */
.snow-bg::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(4px 4px at 100px 50px, white 50%, transparent 50%),
        radial-gradient(3px 3px at 200px 150px, white 50%, transparent 50%),
        radial-gradient(5px 5px at 300px 250px, rgba(255,255,255,0.8) 50%, transparent 50%),
        radial-gradient(4px 4px at 400px 100px, white 50%, transparent 50%),
        radial-gradient(3px 3px at 500px 300px, rgba(255,255,255,0.9) 50%, transparent 50%),
        radial-gradient(6px 6px at 50px 200px, rgba(255,255,255,0.7) 50%, transparent 50%),
        radial-gradient(4px 4px at 150px 350px, white 50%, transparent 50%),
        radial-gradient(3px 3px at 250px 50px, rgba(255,255,255,0.8) 50%, transparent 50%),
        radial-gradient(5px 5px at 350px 180px, white 50%, transparent 50%),
        radial-gradient(4px 4px at 450px 280px, rgba(255,255,255,0.9) 50%, transparent 50%);
    background-size: 500px 400px;
    animation: snowfall1 12s linear infinite;
    opacity: 0.8;
}

/* Couche de neige 2 - petits flocons rapides */
.snow-bg::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(2px 2px at 50px 30px, white 50%, transparent 50%),
        radial-gradient(2px 2px at 120px 80px, rgba(255,255,255,0.7) 50%, transparent 50%),
        radial-gradient(1px 1px at 180px 140px, white 50%, transparent 50%),
        radial-gradient(2px 2px at 250px 60px, rgba(255,255,255,0.8) 50%, transparent 50%),
        radial-gradient(1px 1px at 320px 200px, white 50%, transparent 50%),
        radial-gradient(2px 2px at 80px 170px, rgba(255,255,255,0.6) 50%, transparent 50%),
        radial-gradient(1px 1px at 150px 240px, white 50%, transparent 50%),
        radial-gradient(2px 2px at 220px 110px, rgba(255,255,255,0.9) 50%, transparent 50%),
        radial-gradient(1px 1px at 290px 280px, white 50%, transparent 50%),
        radial-gradient(2px 2px at 30px 90px, rgba(255,255,255,0.7) 50%, transparent 50%);
    background-size: 350px 300px;
    animation: snowfall2 8s linear infinite;
    opacity: 0.6;
}

@keyframes snowfall1 {
    0% {
        transform: translateY(0) translateX(0);
    }
    100% {
        transform: translateY(50%) translateX(-3%);
    }
}

@keyframes snowfall2 {
    0% {
        transform: translateY(0) translateX(0);
    }
    100% {
        transform: translateY(50%) translateX(2%);
    }
}

/* Canvas de neige JavaScript */
#snow-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.menu-content {
    text-align: center;
    z-index: 10;
    max-width: 500px;
    width: 90%;
}

.game-title {
    width: 400px;
    max-width: 90%;
    height: auto;
    margin: 0 auto 20px;
}

.game-title img {
    width: 100%;
    height: auto;
    filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.5));
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.marmot-logo {
    width: 180px;
    height: 180px;
    margin: 0 auto 30px;
    position: relative;
}

.marmot-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
    animation: marmotBounce 2s ease-in-out infinite;
}

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

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-btn {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.menu-btn .btn-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.menu-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.menu-btn.primary {
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 50%, #03A9F4 100%);
    color: white;
    font-size: 20px;
    padding: 15px 35px;
    border: 3px solid rgba(255,255,255,0.4);
}

.menu-btn.primary:hover {
    background: linear-gradient(135deg, #03A9F4 0%, #29B6F6 50%, #4FC3F7 100%);
    box-shadow: 0 8px 30px rgba(79, 195, 247, 0.5);
}

.menu-btn.small {
    padding: 10px 20px;
    font-size: 14px;
}

.menu-btn.back-btn {
    margin-top: 20px;
    background: rgba(255,255,255,0.7);
}

/* Bouton son */
.sound-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.3) 0%, rgba(3, 169, 244, 0.3) 100%);
    border: 2px solid #4FC3F7;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-toggle:hover {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.5) 0%, rgba(3, 169, 244, 0.5) 100%);
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
    transform: scale(1.1);
}

/* Info utilisateur */
.user-info {
    margin-top: 30px;
    padding: 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    color: white;
}

.user-info.hidden {
    display: none;
}

/* Écran de connexion */
#login-screen {
    background: url('../assets/sprites/homepage/menu_background.png') center center;
    background-size: cover;
}

.form-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
    border: 3px solid rgba(79, 195, 247, 0.5);
    backdrop-filter: blur(10px);
}

.form-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1565C0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #4FC3F7;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.tab-btn:hover {
    background: rgba(79, 195, 247, 0.1);
}

.tab-btn.active {
    background: linear-gradient(135deg, #4FC3F7 0%, #03A9F4 100%);
    color: white;
    border-color: #03A9F4;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form input {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    min-height: 20px;
    text-align: center;
}

/* Écran du classement */
#leaderboard-screen {
    background: url('../assets/sprites/homepage/menu_background.png') center center;
    background-size: cover;
}

.leaderboard-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid rgba(79, 195, 247, 0.5);
    backdrop-filter: blur(10px);
}

.leaderboard-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1565C0;
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

#leaderboard-table th {
    background: linear-gradient(135deg, #4FC3F7 0%, #03A9F4 100%);
    color: white;
    padding: 12px;
    text-align: left;
}

#leaderboard-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

#leaderboard-table tr:hover {
    background: #f5f5f5;
}

/* Écran des équipes */
#teams-screen {
    background: url('../assets/sprites/homepage/menu_background.png') center center;
    background-size: cover;
}

.teams-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid rgba(79, 195, 247, 0.5);
    backdrop-filter: blur(10px);
}

.teams-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1565C0;
}

.teams-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.teams-actions .menu-btn {
    flex: 1;
}

#teams-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.team-card {
    padding: 20px;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: 12px;
    border: 2px solid #4FC3F7;
    transition: all 0.3s;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(79, 195, 247, 0.3);
    border-color: #03A9F4;
}

.team-card h4 {
    margin-bottom: 10px;
    color: #1565C0;
}

/* Écran des tournois */
#tournaments-screen {
    background: url('../assets/sprites/homepage/menu_background.png') center center;
    background-size: cover;
}

.tournaments-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 3px solid rgba(79, 195, 247, 0.5);
    backdrop-filter: blur(10px);
}

.tournaments-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #1565C0;
}

.tournaments-actions {
    margin-bottom: 20px;
}

#tournaments-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.tournament-card {
    padding: 20px;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border-radius: 12px;
    border: 2px solid #FFD54F;
    transition: all 0.3s;
}

.tournament-card:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.3);
    border-color: #FFC107;
}

.tournament-card h4 {
    margin-bottom: 10px;
    color: #F57F17;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        width: 280px;
    }

    .marmot-logo {
        width: 140px;
        height: 140px;
    }

    .menu-btn {
        font-size: 16px;
        padding: 12px 24px;
    }

    .form-container,
    .leaderboard-container,
    .teams-container,
    .tournaments-container {
        padding: 20px;
    }

    #teams-content {
        grid-template-columns: 1fr;
    }
}

/* Mode portrait smartphone - Menu optimisé pleine hauteur */
@media (orientation: portrait) and (max-width: 480px) {
    #main-menu {
        padding: 15px 10px;
        height: 100vh;
        height: 100dvh;
    }

    .menu-content {
        width: 95%;
        max-width: none;
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        height: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        padding: 10px 0;
    }

    .game-title {
        width: 70%;
        max-width: 250px;
        margin: 0 auto 10px;
    }

    .marmot-logo {
        width: 100px;
        height: 100px;
        margin: 0 auto 15px;
    }

    .menu-buttons {
        gap: 8px;
        width: 100%;
        flex: 1;
        justify-content: center;
        max-height: 60%;
    }

    .menu-btn {
        font-size: 14px;
        padding: 10px 20px;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .menu-btn .btn-icon {
        width: 22px;
        height: 22px;
    }

    .menu-btn.primary {
        font-size: 16px;
        padding: 12px 25px;
    }

    .user-info {
        margin-top: 10px;
        padding: 10px;
    }

    .user-info p {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .sound-toggle {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 10px;
        right: 10px;
    }

    /* Écrans de formulaire en portrait */
    .form-container,
    .leaderboard-container,
    .teams-container,
    .tournaments-container {
        padding: 15px;
        width: 95%;
        max-height: 95vh;
        overflow-y: auto;
    }

    .form-container h2,
    .leaderboard-container h2,
    .teams-container h2,
    .tournaments-container h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .auth-form input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .tabs {
        gap: 5px;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Modales en portrait */
    .modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content h3 {
        font-size: 18px;
    }

    .modal-content input,
    .modal-content textarea {
        padding: 10px;
        font-size: 14px;
    }
}

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

.screen.active {
    animation: fadeIn 0.5s ease;
}

/* Modales */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(145deg, rgba(30, 60, 114, 0.95) 0%, rgba(42, 82, 152, 0.95) 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(79, 195, 247, 0.3);
}

.modal-content h3 {
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-content input[type="text"],
.modal-content input[type="datetime-local"],
.modal-content textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 2px solid rgba(79, 195, 247, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1em;
    transition: all 0.3s ease;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #4FC3F7;
    background: rgba(255, 255, 255, 0.15);
}

.modal-content input::placeholder,
.modal-content textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.modal-content label {
    display: block;
    color: #b0d4f1;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.modal-buttons .menu-btn {
    flex: 1;
    max-width: 150px;
}

#join-team-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

#join-team-list .team-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(79, 195, 247, 0.2);
}

#join-team-list .team-card h4 {
    color: #4FC3F7;
    margin-bottom: 5px;
}

#join-team-list .team-card p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
    margin-bottom: 5px;
}

#join-team-list .team-card .menu-btn {
    margin-top: 10px;
}

/* Notice pour tournois par équipe */
.team-notice {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border: 2px solid #FFA000;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.team-notice p {
    color: #E65100;
    margin: 0;
    font-size: 0.95em;
    font-weight: 500;
}

/* Boutons désactivés */
.menu-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666 0%, #555 100%) !important;
    border-color: #555 !important;
}

.menu-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Statuts des tournois - couleurs pour fond clair */
.status-upcoming, .status-pending {
    color: #0288D1;
    font-weight: bold;
}

.status-active {
    color: #388E3C;
    font-weight: bold;
}

.status-finished, .status-completed {
    color: #757575;
    font-weight: bold;
}

.status-cancelled {
    color: #D32F2F;
    font-weight: bold;
}

/* Cartes de tournoi - texte sombre pour fond clair */
.tournament-card p {
    color: #333;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.tournament-card .menu-btn {
    margin-top: 10px;
}

/* Cartes d'équipe - texte sombre pour fond clair */
.team-card p {
    color: #333;
    font-size: 0.9em;
    margin-bottom: 5px;
}

/* Sections d'équipes */
.my-teams-section,
.all-teams-section {
    margin-bottom: 20px;
}

.my-teams-section > h4,
.all-teams-section > h4 {
    color: #1565C0;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #4FC3F7;
}

/* Carte d'équipe membre */
.team-card.member {
    border-color: #66BB6A;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
}

/* Badge membre */
.member-badge {
    display: inline-block;
    background: linear-gradient(135deg, #81C784 0%, #66BB6A 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    margin-right: 10px;
    text-transform: uppercase;
}

/* Bouton danger (quitter) */
.menu-btn.danger {
    background: linear-gradient(135deg, #EF5350 0%, #E53935 100%) !important;
    border-color: #EF5350 !important;
}

.menu-btn.danger:hover {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%) !important;
    box-shadow: 0 5px 20px rgba(239, 83, 80, 0.4);
}

.menu-btn.small {
    padding: 8px 16px;
    font-size: 0.85em;
}

/* === TABS DU CLASSEMENT === */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Message données vides */
.no-data {
    text-align: center;
    color: #666;
    padding: 30px;
    font-style: italic;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    margin: 10px 0;
}

/* Table de classement générique */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.leaderboard-table th {
    background: linear-gradient(135deg, #4FC3F7 0%, #03A9F4 100%);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.leaderboard-table th:first-child {
    border-radius: 8px 0 0 0;
}

.leaderboard-table th:last-child {
    border-radius: 0 8px 0 0;
}

.leaderboard-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
    color: #333;
}

.leaderboard-table tr:hover {
    background: rgba(79, 195, 247, 0.1);
}

.leaderboard-table tr:last-child td:first-child {
    border-radius: 0 0 0 8px;
}

.leaderboard-table tr:last-child td:last-child {
    border-radius: 0 0 8px 0;
}

/* Section classement équipe */
.team-leaderboard-section {
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: 12px;
    border: 2px solid #4FC3F7;
}

.team-leaderboard-section h4 {
    color: #1565C0;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #4FC3F7;
    font-size: 1.1em;
}

/* Section classement tournoi */
.tournament-leaderboard-section {
    margin-bottom: 25px;
    padding: 15px;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border-radius: 12px;
    border: 2px solid #FFD54F;
}

.tournament-leaderboard-section h4 {
    color: #F57F17;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.tournament-leaderboard-section .tournament-status {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

/* Info tournoi à venir */
.tournament-info {
    padding: 15px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: 10px;
    border: 2px solid #66BB6A;
    margin-top: 10px;
}

.tournament-info h5 {
    color: #2E7D32;
    margin-bottom: 10px;
    font-size: 1em;
}

.tournament-info p {
    color: #333;
    margin: 5px 0;
    font-size: 0.9em;
}

/* Onglets du classement - responsive */
.leaderboard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.leaderboard-tabs .tab-btn {
    flex: 1 1 auto;
    min-width: 80px;
    padding: 8px 12px;
    font-size: 0.9em;
}

@media (max-width: 600px) {
    .leaderboard-tabs {
        gap: 5px;
    }

    .leaderboard-tabs .tab-btn {
        padding: 6px 8px;
        font-size: 0.8em;
        min-width: 60px;
    }
}

/* === CLASSEMENT ÉQUIPES - CARTES === */
.ranking-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.ranking-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Podium styles */
.ranking-card.rank-1 {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFE082 100%);
    border-color: #FFD700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.ranking-card.rank-2 {
    background: linear-gradient(135deg, #F5F5F5 0%, #E0E0E0 100%);
    border-color: #C0C0C0;
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.3);
}

.ranking-card.rank-3 {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFCC80 100%);
    border-color: #CD7F32;
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.3);
}

.ranking-position {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.rank-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #1565C0;
}

.rank-1 .rank-number { color: #F9A825; }
.rank-2 .rank-number { color: #757575; }
.rank-3 .rank-number { color: #8D6E63; }

.rank-medal {
    font-size: 1.2em;
    margin-top: -5px;
}

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

.ranking-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #1565C0;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-details {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.detail-item {
    font-size: 0.85em;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ranking-score {
    text-align: right;
    min-width: 90px;
}

.score-label {
    display: block;
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
}

.score-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #2E7D32;
}

/* === CLASSEMENT TOURNOI === */
.tournament-content {
    min-height: 150px;
}

/* Aucun tournoi */
.no-tournament {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-radius: 15px;
    border: 2px dashed #ccc;
}

.no-tournament-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-tournament h4 {
    color: #666;
    margin: 0 0 10px 0;
}

.no-tournament p {
    color: #888;
    margin: 0;
    font-size: 0.9em;
}

/* Tournoi à venir */
.upcoming-tournament {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border-radius: 15px;
    border: 2px solid #4FC3F7;
    overflow: hidden;
}

.upcoming-header {
    background: linear-gradient(135deg, #4FC3F7 0%, #03A9F4 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.upcoming-badge {
    background: #FFF;
    color: #0288D1;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.upcoming-header h4 {
    color: #FFF;
    margin: 0;
    font-size: 1.2em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.upcoming-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upcoming-date {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-icon {
    font-size: 1.5em;
    width: 40px;
    height: 40px;
    background: #FFF;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.date-label {
    font-size: 0.8em;
    color: #0288D1;
    text-transform: uppercase;
    font-weight: bold;
}

.date-value {
    color: #333;
    font-size: 1em;
}

.upcoming-participants {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 10px;
    margin-top: 5px;
}

.participants-icon {
    font-size: 1.3em;
}

.participants-count {
    font-size: 1.5em;
    font-weight: bold;
    color: #1565C0;
}

.participants-label {
    color: #666;
    font-size: 0.9em;
}

.upcoming-description {
    padding: 0 20px 20px;
    color: #555;
    font-style: italic;
    margin: 0;
}

/* Tournoi actif */
.active-tournament {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border-radius: 15px;
    border: 2px solid #FFD54F;
    overflow: hidden;
    margin-bottom: 20px;
}

.tournament-header {
    background: linear-gradient(135deg, #FFD54F 0%, #FFC107 100%);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.active-badge {
    background: #FFF;
    color: #F57F17;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(255, 193, 7, 0); }
}

.tournament-header h4 {
    color: #5D4037;
    margin: 0;
    font-size: 1.2em;
}

/* Classement dans le tournoi */
.tournament-standings {
    padding: 15px;
}

.standing-row {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255,255,255,0.6);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.standing-row:hover {
    background: rgba(255,255,255,0.9);
    transform: translateX(5px);
}

.standing-row.podium-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 193, 7, 0.3) 100%);
    border: 1px solid #FFD700;
}

.standing-row.podium-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.3) 0%, rgba(158, 158, 158, 0.3) 100%);
    border: 1px solid #C0C0C0;
}

.standing-row.podium-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.3) 0%, rgba(161, 136, 127, 0.3) 100%);
    border: 1px solid #CD7F32;
}

.standing-rank {
    width: 40px;
    text-align: center;
    font-size: 1.2em;
}

.rank-num {
    font-weight: bold;
    color: #666;
}

.standing-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    padding: 0 15px;
}

.standing-score {
    font-weight: bold;
    font-size: 1.1em;
    color: #2E7D32;
    min-width: 80px;
    text-align: right;
}

.no-participants {
    text-align: center;
    padding: 30px;
    color: #888;
    font-style: italic;
}

/* Responsive */
@media (max-width: 500px) {
    .ranking-card {
        flex-wrap: wrap;
        padding: 12px;
    }

    .ranking-position {
        min-width: 40px;
    }

    .ranking-score {
        width: 100%;
        text-align: center;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(0,0,0,0.1);
    }

    .upcoming-details {
        padding: 15px;
    }

    .standing-row {
        padding: 10px;
    }
}

/* === ÉCRAN ÉQUIPES - NOUVEAU DESIGN === */
.teams-section {
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #4FC3F7;
}

.section-icon {
    font-size: 1.5em;
}

.section-header h4 {
    flex: 1;
    margin: 0;
    color: #1565C0;
    font-size: 1.1em;
}

.section-count {
    background: #4FC3F7;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Carte d'équipe nouvelle */
.team-card-new {
    background: linear-gradient(145deg, #ffffff 0%, #f5f7fa 100%);
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.team-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #4FC3F7;
}

.team-card-new.member {
    border-color: #66BB6A;
    background: linear-gradient(145deg, #E8F5E9 0%, #C8E6C9 100%);
}

.team-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.1) 0%, rgba(3, 169, 244, 0.1) 100%);
}

.team-card-new.member .team-card-header {
    background: linear-gradient(135deg, rgba(102, 187, 106, 0.15) 0%, rgba(76, 175, 80, 0.15) 100%);
}

.team-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #4FC3F7 0%, #03A9F4 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    box-shadow: 0 3px 10px rgba(3, 169, 244, 0.3);
}

.team-card-new.member .team-avatar {
    background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%);
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.team-title {
    flex: 1;
    min-width: 0;
}

.team-title h4 {
    margin: 0;
    color: #1565C0;
    font-size: 1.1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-tag {
    display: inline-block;
    background: #66BB6A;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
    margin-top: 3px;
}

.creator-tag {
    color: #888;
    font-size: 0.8em;
    margin-top: 3px;
    display: block;
}

.team-card-body {
    padding: 15px;
}

.team-desc {
    color: #666;
    font-size: 0.9em;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.team-stats {
    display: flex;
    gap: 20px;
}

.stat {
    text-align: center;
    flex: 1;
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
}

.stat-value {
    display: block;
    font-size: 1.4em;
    font-weight: bold;
    color: #1565C0;
}

.stat-label {
    display: block;
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
    margin-top: 2px;
}

.team-card-footer {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.02);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-team {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-team.primary {
    background: linear-gradient(135deg, #4FC3F7 0%, #03A9F4 100%);
    color: white;
}

.btn-team.primary:hover {
    background: linear-gradient(135deg, #03A9F4 0%, #0288D1 100%);
    box-shadow: 0 4px 15px rgba(3, 169, 244, 0.4);
}

.btn-team.danger {
    background: linear-gradient(135deg, #EF5350 0%, #E53935 100%);
    color: white;
}

.btn-team.danger:hover {
    background: linear-gradient(135deg, #E53935 0%, #D32F2F 100%);
    box-shadow: 0 4px 15px rgba(239, 83, 80, 0.4);
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
}

.empty-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 15px;
    opacity: 0.6;
}

.empty-state p {
    margin: 0;
    color: #666;
    font-size: 1em;
}

.empty-hint {
    color: #888 !important;
    font-size: 0.9em !important;
    margin-top: 5px !important;
}

/* === ÉCRAN TOURNOIS - NOUVEAU DESIGN === */
.tournaments-section {
    margin-bottom: 25px;
}

.tournaments-section.active .section-header {
    border-bottom-color: #FF9800;
}

.tournaments-section.upcoming .section-header {
    border-bottom-color: #4FC3F7;
}

.tournaments-section.finished .section-header {
    border-bottom-color: #9E9E9E;
}

.tournaments-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Notice tournoi */
.tournament-notice {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    border: 2px solid #FFA000;
    border-radius: 12px;
    margin-bottom: 20px;
}

.notice-icon {
    font-size: 2em;
}

.notice-content {
    flex: 1;
}

.notice-content strong {
    display: block;
    color: #E65100;
    margin-bottom: 3px;
}

.notice-content p {
    margin: 0;
    color: #F57C00;
    font-size: 0.9em;
}

/* Carte tournoi nouvelle */
.tournament-card-new {
    background: linear-gradient(145deg, #ffffff 0%, #f5f7fa 100%);
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.tournament-card-new:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tournament-card-new.active {
    border-color: #FF9800;
    background: linear-gradient(145deg, #FFF8E1 0%, #FFECB3 100%);
}

.tournament-card-new.upcoming {
    border-color: #4FC3F7;
    background: linear-gradient(145deg, #E3F2FD 0%, #BBDEFB 100%);
}

.tournament-card-new.finished {
    border-color: #BDBDBD;
    background: linear-gradient(145deg, #FAFAFA 0%, #EEEEEE 100%);
    opacity: 0.8;
}

.tournament-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
}

.tournament-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #FFD54F 0%, #FFC107 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.3);
    flex-shrink: 0;
}

.tournament-card-new.upcoming .tournament-icon {
    background: linear-gradient(135deg, #4FC3F7 0%, #03A9F4 100%);
    box-shadow: 0 3px 10px rgba(3, 169, 244, 0.3);
}

.tournament-card-new.finished .tournament-icon {
    background: linear-gradient(135deg, #BDBDBD 0%, #9E9E9E 100%);
    box-shadow: 0 3px 10px rgba(158, 158, 158, 0.3);
}

.tournament-title {
    flex: 1;
    min-width: 0;
}

.tournament-title h4 {
    margin: 0;
    color: #E65100;
    font-size: 1.15em;
}

.tournament-card-new.upcoming .tournament-title h4 {
    color: #1565C0;
}

.tournament-card-new.finished .tournament-title h4 {
    color: #616161;
}

.tournament-desc {
    color: #666;
    font-size: 0.85em;
    margin: 5px 0 0 0;
    line-height: 1.3;
}

.tournament-card-body {
    padding: 0 15px 15px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.tournament-dates {
    flex: 1;
}

.date-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.date-row .date-label {
    font-size: 0.85em;
    color: #888;
    min-width: 70px;
}

.date-row .date-value {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
}

.tournament-participants {
    text-align: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

.tournament-participants .participants-count {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #E65100;
}

.tournament-card-new.upcoming .tournament-participants .participants-count {
    color: #1565C0;
}

.tournament-card-new.finished .tournament-participants .participants-count {
    color: #616161;
}

.tournament-participants .participants-label {
    font-size: 0.75em;
    color: #888;
    text-transform: uppercase;
}

.tournament-card-footer {
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-tournament {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-tournament.primary {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
}

.btn-tournament.primary:hover {
    background: linear-gradient(135deg, #F57C00 0%, #EF6C00 100%);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.btn-tournament.disabled {
    background: #E0E0E0;
    color: #9E9E9E;
    cursor: not-allowed;
}

/* Responsive équipes et tournois */
@media (max-width: 600px) {
    .teams-grid {
        grid-template-columns: 1fr;
    }

    .tournament-card-body {
        flex-direction: column;
        align-items: stretch;
    }

    .tournament-participants {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 10px;
    }

    .tournament-participants .participants-count {
        font-size: 1.4em;
    }
}
