/* Styles spécifiques pour l'interface multiplayer */

/* Menu principal amélioré */
.menu-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.large-btn {
    width: 100%;
    padding: 20px 30px;
    font-size: 1.3rem;
    font-weight: 800;
    border-radius: 25px;
    border: 4px solid white;
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.btn-primary.large-btn {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.btn-secondary.large-btn {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
}

.btn-outline {
  background: transparent;
  color: white;
  border: 4px solid white;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 20px;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 160px;
  height: 60px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.btn-outline:hover {
    background: white;
    color: #30A9FF;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(255,255,255,0.3);
}

/* Étapes de création de partie */
.create-room-steps {
    max-width: 600px;
    margin: 0 auto;
}

.step {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    border: 4px solid #87CEEB;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.step h3 {
    color: #30A9FF;
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* Formulaires améliorés */
.config-form, .join-form {
    max-width: 400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    border: 4px solid #87CEEB;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #30A9FF;
    font-weight: 700;
    font-size: 1.1rem;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 3px solid #87CEEB;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    background: #F8FAFC;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: #30A9FF;
    background: white;
    box-shadow: 0 0 0 3px rgba(48, 169, 255, 0.2);
    transform: scale(1.02);
}

/* Salle d'attente améliorée */
.waiting-room {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 30px;
    border: 4px solid #87CEEB;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.waiting-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #E6F3FF;
}

.waiting-header h2 {
    color: #ffffff;
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
    margin-bottom: 15px;
}

.room-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: linear-gradient(135deg, #E6F3FF 0%, #B0E0E6 100%);
    padding: 15px 25px;
    border-radius: 15px;
    border: 3px solid #30A9FF;
    font-size: 1.2rem;
    font-weight: 800;
    color: #30A9FF;
}

.room-code-display span {
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    background: white;
    padding: 5px 15px;
    border-radius: 10px;
    border: 2px solid #30A9FF;
    letter-spacing: 2px;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
    border-radius: 12px;
    border: 2px solid white;
}

/* Contenu de la salle d'attente */
.waiting-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.players-list {
    background: #F8FAFC;
    padding: 25px;
    border-radius: 20px;
    border: 3px solid #E6F3FF;
}

.players-list h3 {
    color: #30A9FF;
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
}

.players-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-card {
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    border: 3px solid #87CEEB;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.player-card:hover {
    border-color: #30A9FF;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(48, 169, 255, 0.2);
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #30A9FF 0%, #1E90FF 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
}

.player-name {
    flex: 1;
    font-weight: 700;
    color: #30A9FF;
    font-size: 1.1rem;
}

.player-status {
    font-size: 0.9rem;
    color: #10B981;
    font-weight: 600;
}

.host-badge {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Paramètres de partie */
.game-settings {
    background: #F8FAFC;
    padding: 25px;
    border-radius: 20px;
    border: 3px solid #E6F3FF;
    text-align: center;
}

.game-settings h3 {
    color: #30A9FF;
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.game-settings p {
    color: #6B7280;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1rem;
}

.waiting-message {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    padding: 25px;
    border-radius: 20px;
    border: 3px solid #F59E0B;
    text-align: center;
    grid-column: 1 / -1;
}

.waiting-message p {
    color: #92400E;
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
}

/* Interface de jeu multijoueur */
.multiplayer-game {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 30px;
    border: 4px solid #87CEEB;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.game-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.game-info span {
    background: rgba(255, 255, 255, 0);
    padding: 8px 15px;
    border-radius: 12px;
    border: 2px solid #30A9FF;
    font-weight: 700;
    color: #30A9FF;
}

.timer {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
    color: rgba(255, 255, 255, 0) !important;
    border-color: #EF4444 !important;
    animation: pulse 1s infinite;
}

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

/* Scores en temps réel */
.players-scores {
    margin-top: 30px;
    background: #F8FAFC;
    padding: 20px;
    border-radius: 20px;
    border: 3px solid #E6F3FF;
}

.players-scores h4 {
    color: #30A9FF;
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 15px;
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.score-card {
    background: white;
    padding: 15px;
    border-radius: 15px;
    border: 3px solid #87CEEB;
    text-align: center;
    transition: all 0.3s ease;
}

.score-card:hover {
    border-color: #30A9FF;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(48, 169, 255, 0.2);
}

.score-player-name {
    font-weight: 700;
    color: #30A9FF;
    margin-bottom: 8px;
    font-size: 1rem;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10B981;
}

/* Résultats finaux */
.final-results {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 40px;
    border: 4px solid #87CEEB;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.final-results .section-header h2 {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: none;
}

.game-summary {
    background: linear-gradient(135deg, #E6F3FF 0%, #B0E0E6 100%);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    border: 3px solid #30A9FF;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.summary-stat {
    text-align: center;
}

.summary-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #30A9FF;
    display: block;
}

.summary-stat-label {
    font-size: 0.9rem;
    color: #6B7280;
    font-weight: 600;
    margin-top: 5px;
}

.ranking {
    max-width: 500px;
    margin: 0 auto 30px;
}

.ranking-header {
    background: linear-gradient(135deg, #30A9FF 0%, #1E90FF 100%);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.rank-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 20px;
    border: 4px solid #87CEEB;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.rank-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #30A9FF 0%, #1E90FF 100%);
}

.rank-item:hover {
    border-color: #30A9FF;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(48, 169, 255, 0.2);
}

.rank-item.first {
    border-color: #F59E0B;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.rank-item.first::before {
    background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%);
}

.rank-item.second {
    border-color: #6B7280;
    background: linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
    box-shadow: 0 0 15px rgba(107, 114, 128, 0.2);
}

.rank-item.second::before {
    background: linear-gradient(90deg, #6B7280 0%, #4B5563 100%);
}

.rank-item.third {
    border-color: #D97706;
    background: linear-gradient(135deg, #FED7AA 0%, #FDBA74 100%);
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.2);
}

.rank-item.third::before {
    background: linear-gradient(90deg, #D97706 0%, #B45309 100%);
}

.rank-position {
    font-size: 2rem;
    font-weight: 800;
    width: 60px;
    text-align: center;
    margin-right: 20px;
    position: relative;
}

.rank-position.first { 
    color: #F59E0B;
    text-shadow: 2px 2px 4px rgba(245, 158, 11, 0.3);
}

.rank-position.second { 
    color: #6B7280;
    text-shadow: 2px 2px 4px rgba(107, 114, 128, 0.3);
}

.rank-position.third { 
    color: #D97706;
    text-shadow: 2px 2px 4px rgba(217, 119, 6, 0.3);
}

.rank-player {
    flex: 1;
    text-align: left;
}

.rank-player-name {
    font-size: 1.3rem;
    font-weight: 800;
    color: #30A9FF;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-player-badge {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.rank-player-stats {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.rank-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rank-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #30A9FF;
}

.rank-stat-label {
    font-size: 0.8rem;
    color: #6B7280;
    font-weight: 600;
}

.rank-player-score {
    font-size: 1rem;
    color: #6B7280;
    font-weight: 600;
}

.performance-indicator {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
}

.performance-excellent {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
}

.performance-good {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
}

.performance-average {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    color: white;
}

.final-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.final-actions .btn {
    position: relative;
    overflow: hidden;
}

.final-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.final-actions .btn:hover::before {
    left: 100%;
}

.celebration-message {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border: 3px solid #10B981;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    color: #065F46;
    font-weight: 700;
    font-size: 1.1rem;
}

.celebration-message.winner {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-color: #F59E0B;
    color: #92400E;
}

/* Responsive pour multiplayer */
@media (max-width: 768px) {
    .waiting-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .room-code-display {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px 20px;
        font-size: 1.1rem;
    }
    
    .room-code-display span {
        font-size: 1.2rem;
        padding: 4px 12px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .game-info span {
        padding: 6px 12px;
        font-size: 0.95rem;
    }
    
    .scores-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .score-card {
        padding: 12px 8px;
    }
    
    .score-player-name {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .score-value {
        font-size: 1.3rem;
    }
    
    .rank-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 15px;
    }
    
    .rank-position {
        margin-right: 0;
        margin-bottom: 8px;
        font-size: 1.5rem;
    }
    
    .rank-player-name {
        font-size: 1.1rem;
    }
    
    .rank-player-score {
        font-size: 0.9rem;
    }
    
    .final-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .final-actions .btn {
        width: 100%;
        max-width: 280px;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .players-list, .game-settings {
        padding: 20px 15px;
    }
    
    .player-card {
        padding: 12px 15px;
        gap: 10px;
    }
    
    .player-avatar {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }
    
    .player-name {
        font-size: 1rem;
    }
    
    .waiting-message {
        padding: 20px 15px;
    }
    
    .waiting-message p {
        font-size: 1.1rem;
    }
}

/* Media query ultra-mobile pour multiplayer */
@media (max-width: 480px) {
    .menu-options {
        max-width: 100%;
        gap: 15px;
    }
    
    .large-btn {
        padding: 15px 25px;
        font-size: 1.1rem;
        border-radius: 20px;
        border-width: 3px;
    }
    
    .step {
        padding: 20px 15px;
        margin-bottom: 15px;
        border-radius: 15px;
        border-width: 3px;
    }
    
    .step h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .config-form, .join-form {
        max-width: 100%;
        padding: 20px 15px;
        border-radius: 15px;
        border-width: 3px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 12px;
        border-width: 2px;
        border-radius: 12px;
        font-size: 0.95rem;
    }
    
    .waiting-room {
        padding: 20px 15px;
        border-radius: 20px;
        border-width: 3px;
    }
    
    .waiting-header h2 {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }
    
    .room-code-display {
        padding: 10px 15px;
        font-size: 1rem;
        border-radius: 12px;
        border-width: 2px;
    }
    
    .room-code-display span {
        font-size: 1.1rem;
        padding: 3px 10px;
        border-width: 2px;
    }
    
    .btn-small {
        padding: 15px 30px;
        font-size: 1.1rem;
        border-radius: 20px;
        width: 220px;
        height: 60px;
    }
    
    .waiting-content {
        gap: 12px;
    }
    
    .players-list, .game-settings {
        padding: 15px 12px;
        border-radius: 15px;
        border-width: 2px;
    }
    
    .players-list h3, .game-settings h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .player-card {
        padding: 10px 12px;
        gap: 8px;
        border-radius: 12px;
        border-width: 2px;
    }
    
    .player-avatar {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    
    .player-name {
        font-size: 0.95rem;
    }
    
    .player-status {
        font-size: 0.8rem;
    }
    
    .game-settings p {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .waiting-message {
        padding: 15px 12px;
        border-radius: 15px;
        border-width: 2px;
    }
    
    .waiting-message p {
        font-size: 1rem;
    }
    
    .multiplayer-game {
        padding: 20px 15px;
        border-radius: 20px;
        border-width: 3px;
    }
    
    .game-info span {
        padding: 5px 10px;
        font-size: 0.9rem;
        border-radius: 10px;
        border-width: 2px;
    }
    
    .timer {
        border-width: 2px !important;
    }
    
    .players-scores {
        margin-top: 20px;
        padding: 15px 12px;
        border-radius: 15px;
        border-width: 2px;
    }
    
    .players-scores h4 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .scores-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 6px;
    }
    
    .score-card {
        padding: 10px 6px;
        border-radius: 12px;
        border-width: 2px;
    }
    
    .score-player-name {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }
    
    .score-value {
        font-size: 1.2rem;
    }
    
    .final-results {
        padding: 25px 15px;
        border-radius: 20px;
        border-width: 3px;
    }
    
    .ranking {
        max-width: 100%;
        margin-bottom: 20px;
    }
    
    .rank-item {
        padding: 12px 15px;
        margin-bottom: 10px;
        border-radius: 15px;
        border-width: 3px;
        gap: 6px;
    }
    
    .rank-position {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    
    .rank-player-name {
        font-size: 1rem;
        margin-bottom: 4px;
    }
    
    .rank-player-score {
        font-size: 0.85rem;
    }
    
    .final-actions {
        gap: 10px;
    }
    
    .final-actions .btn {
        max-width: 100%;
        padding: 10px 18px;
        font-size: 0.95rem;
        border-radius: 15px;
        border-width: 3px;
    }
}

/* Animations spéciales pour multiplayer */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.player-card {
    animation: slideInFromLeft 0.5s ease-out;
}

.score-card {
    animation: slideInFromRight 0.5s ease-out;
}

.rank-item {
    animation: slideInFromLeft 0.6s ease-out;
}

/* États de connexion */
.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 1000;
    transition: all 0.3s ease;
}

.connection-status.connected {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #065F46;
    border: 2px solid #10B981;
}

.connection-status.disconnected {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #991B1B;
    border: 2px solid #EF4444;
}

.connection-status.connecting {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    color: #92400E;
    border: 2px solid #F59E0B;
}
