/* Wordle Game Styles */
.wordle-hero {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.wordle-game-section {
    position: relative;
    z-index: 1;
    padding: 2rem;
}

.wordle-container {
    max-width: 600px;
    margin: 0 auto;
}

.wordle-info {
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.wordle-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.btn-wordle {
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, var(--purple-light), var(--purple-medium));
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-wordle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

/* Wordle Grid */
.wordle-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    min-height: 350px;
}

.wordle-cell {
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.wordle-cell.filled {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.wordle-cell.correct {
    background: #10b981;
    border-color: #10b981;
    animation: flip 0.5s ease;
}

.wordle-cell.present {
    background: #f59e0b;
    border-color: #f59e0b;
    animation: flip 0.5s ease;
}

.wordle-cell.absent {
    background: rgba(107, 114, 128, 0.5);
    border-color: rgba(107, 114, 128, 0.5);
    animation: flip 0.5s ease;
}

.wordle-cell.revealed {
    background: var(--purple-light) !important;
    border-color: var(--purple-light) !important;
    color: var(--text-primary) !important;
    animation: flip 0.5s ease;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
}

.wordle-cell.revealed.correct,
.wordle-cell.revealed.present,
.wordle-cell.revealed.absent {
    background: var(--purple-light) !important;
    border-color: var(--purple-light) !important;
}

/* Styles pour le mode sélection et multijoueur */
.wordle-mode-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.wordle-mode-card {
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wordle-mode-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(124, 58, 237, 0.4);
}

.mode-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.mode-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

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

.wordle-lobby-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.wordle-lobby-card {
    padding: 2rem;
    text-align: center;
}

.wordle-leaderboard {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 300px;
    max-height: 500px;
    padding: 1.5rem;
    z-index: 200;
    overflow-y: auto;
}

.leaderboard-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

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

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

.leaderboard-item.current-player {
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid var(--purple-light);
}

.leaderboard-rank {
    font-weight: bold;
    color: var(--purple-light);
    min-width: 30px;
}

.leaderboard-name {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

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

/* Styles pour le lobby et la salle d'attente Wordle */
.wordle-lobby-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.wordle-lobby-card {
    padding: 2rem;
    text-align: center;
}

.lobby-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--purple-light), var(--blue-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lobby-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.join-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.input-room-id {
    padding: 1rem;
    font-size: 1.2rem;
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.input-room-id:focus {
    outline: none;
    border-color: var(--purple-light);
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.lobby-error {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    text-align: center;
}

.room-info {
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.room-id-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.room-id-label {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.room-id-value {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 0.5rem;
    color: var(--purple-light);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    background: rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    border: 2px solid var(--purple-light);
}

.btn-copy {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.players-list {
    padding: 2rem;
    margin-bottom: 2rem;
}

.players-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    text-align: center;
}

.players-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.player-card {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.player-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    border-color: rgba(124, 58, 237, 0.3);
}

.player-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.player-name.current {
    color: var(--purple-light);
    position: relative;
}

.player-name.current::after {
    content: ' (Vous)';
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.players-count {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
}

.waiting-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .wordle-leaderboard {
        position: relative;
        top: 0;
        right: 0;
        width: 100%;
        margin: 1rem 0;
    }

    .wordle-mode-container,
    .wordle-lobby-container {
        grid-template-columns: 1fr;
    }

    .room-id-display {
        flex-direction: column;
    }

    .room-id-value {
        font-size: 1.5rem;
        letter-spacing: 0.3rem;
    }

    .players-container {
        grid-template-columns: 1fr;
    }

    .waiting-actions {
        flex-direction: column;
        width: 100%;
    }

    .waiting-actions button {
        width: 100%;
    }
}

@keyframes flip {
    0% {
        transform: rotateX(0);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

.wordle-cell.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

/* Keyboard */
.wordle-keyboard {
    padding: 1.5rem;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.key {
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
    text-transform: uppercase;
}

.key:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

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

.key.correct {
    background: #10b981;
    border-color: #10b981;
}

.key.present {
    background: #f59e0b;
    border-color: #f59e0b;
}

.key.absent {
    background: rgba(107, 114, 128, 0.5);
    border-color: rgba(107, 114, 128, 0.5);
}

.key.enter,
.key.backspace {
    background: rgba(124, 58, 237, 0.3);
    border-color: var(--purple-light);
    min-width: 80px;
    font-size: 0.9rem;
}

/* Message */
.wordle-message {
    padding: 1.5rem;
    text-align: center;
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.wordle-message.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: #10b981;
    border-color: #10b981;
}

.wordle-message.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: #ef4444;
    border-color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
    .wordle-grid {
        gap: 0.3rem;
        padding: 1rem;
    }

    .wordle-cell {
        font-size: 1.5rem;
    }

    .key {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        min-width: 30px;
    }

    .key.enter,
    .key.backspace {
        min-width: 60px;
        font-size: 0.8rem;
    }
}