* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
}

/* Styles de la navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand h1 {
    color: #ffffff;
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-link {
    color: #b0b0b0;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.2);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #667eea;
    border-radius: 50%;
}

/* Dropdown utilisateur */
.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 8px 16px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.user-avatar {
    font-size: 18px;
}

.user-name {
    font-weight: 600;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(30, 30, 45, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.user-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 12px 16px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.dropdown-label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.dropdown-value {
    font-weight: 600;
    color: #667eea;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.logout-btn {
    color: #ff6b6b !important;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.1) !important;
}

/* Menu mobile */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -8px);
}

/* Leaderboard flottant */
.floating-leaderboard {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 999;
}

.leaderboard-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.leaderboard-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.leaderboard-panel {
    position: absolute;
    top: 60px;
    right: 0;
    width: 280px;
    background: rgba(30, 30, 45, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.leaderboard-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.leaderboard-panel .leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-panel .leaderboard-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.leaderboard-panel .leaderboard-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
}

.leaderboard-panel .leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.leaderboard-panel .leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.leaderboard-panel .leaderboard-item.top-player {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

.leaderboard-panel .rank {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    font-weight: bold;
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 6px;
    min-width: 25px;
    text-align: center;
}

.leaderboard-panel .player-info {
    flex: 1;
}

.leaderboard-panel .player-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.leaderboard-panel .player-wins {
    color: #888;
    font-size: 12px;
}

.leaderboard-panel .trophy {
    font-size: 16px;
    animation: pulse 2s infinite;
}

/* Ajustement du container pour la navbar fixe */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 20px 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    padding: 0 20px;
}

.header-left {
    flex: 1;
    text-align: center;
}

.header-right {
    flex: 0 0 280px;
}

header h1 {
    color: white;
    font-size: 2.8rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.main-nav, .user-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.user-info {
    color: white;
    font-weight: 600;
    margin-right: 15px;
}

.nav-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 6px;
}

/* Styles du leaderboard */
.leaderboard {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 220px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.leaderboard-header h3 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 18px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.leaderboard-loading {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-size: 12px;
    margin-bottom: 10px;
}

.leaderboard-content {
    min-height: 80px;
}

.top-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.rank {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    font-weight: bold;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 6px;
    min-width: 30px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(255, 215, 0, 0.3);
}

.player-info {
    flex: 1;
}

.player-name {
    color: white;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 3px;
}

.player-wins {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.trophy {
    font-size: 24px;
    animation: pulse 2s infinite;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.5));
}

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

.no-data, .error {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-size: 12px;
    padding: 10px;
}

.error {
    color: #ff6b6b;
}

/* Animations et transitions supplémentaires */

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); }
    50% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.8); }
}

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

/* Animations pour les éléments principaux */
main {
    animation: fadeIn 0.6s ease-out;
}

.game-container {
    animation: fadeIn 0.8s ease-out;
}

.auth-form {
    animation: slideIn 0.6s ease-out;
}

/* Transitions améliorées */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.form-group input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Animations pour le leaderboard */
.top-player {
    transition: all 0.3s ease;
}

.top-player:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.15);
}

/* Animations pour les éléments de jeu */
.stat-value {
    animation: glow 3s infinite;
}

.history-item {
    animation: slideIn 0.3s ease-out;
}

/* Effet de flottement pour le trophée */
.trophy {
    animation: float 3s ease-in-out infinite;
}

/* Transitions pour les tabs */
.tab-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-content {
    animation: fadeIn 0.4s ease-out;
}

/* Animations pour les messages */
.error-message, .success-message {
    animation: slideIn 0.4s ease-out;
}

.feedback {
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: center;
    }
    
    .header-right {
        flex: 1;
        width: 100%;
        max-width: 300px;
    }
    
    .leaderboard {
        margin-top: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

main {
    background: rgba(30, 30, 45, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(102, 126, 234, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-options {
    text-align: center;
}

.auth-options h2 {
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.welcome-message {
    text-align: center;
}

.welcome-message h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.auth-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #b0b0b0;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 5px;
    position: relative;
    overflow: hidden;
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.actions {
    text-align: center;
    margin-top: 30px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

.auth-link p {
    color: #b0b0b0;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

.back-link {
    text-align: center;
    margin-top: 20px;
}

.error-message {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid rgba(220, 53, 69, 0.3);
    backdrop-filter: blur(10px);
}

.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-section h2 {
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dashboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card h3 {
    color: #ffffff;
    margin-bottom: 15px;
}

.card p {
    color: #b0b0b0;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .dashboard-content {
        grid-template-columns: 1fr;
    }
}
