/* CSS pour la page de jeu */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 20px;
}

@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.game-info h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.game-info p {
    color: #666;
    font-size: 1rem;
}

.win-number {
    color: var(--primary-color);
    font-weight: bold;
}

.share-link {
    background-color: #f5f5f5;
    padding: 10px 15px;
    border-radius: var(--border-radius);
}

.share-link p {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #666;
}

/* Indicateur de statut de connexion */
.connection-status {
    margin-bottom: 15px;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    font-weight: bold;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.connection-status.connecting {
    background-color: #f3f3f3;
    color: #333;
    border: 1px solid #ddd;
}

.connection-status.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.connection-status.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.connection-status.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.share-input-group {
    display: flex;
    gap: 10px;
}

#share-url {
    width: 300px;
    max-width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.game-actions {
    display: flex;
    gap: 10px;
}

.game-actions button, 
.game-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.9rem;
}

#hints-counter {
    margin-left: 5px;
    font-weight: bold;
}

/* Informations des joueurs */
.player-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    background-color: white;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    opacity: 0.7;
    transition: all 0.3s;
}

.player.active {
    opacity: 1;
    border-color: var(--player-color);
}

.player-token {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.player-name {
    font-weight: bold;
}

.player-indicator {
    font-size: 0.8rem;
    color: #555;
    font-style: italic;
    margin-left: 5px;
}

.player-turn-indicator {
    font-size: 0.8rem;
    color: #4CAF50;
    font-style: italic;
    font-weight: bold;
    margin-left: 5px;
    animation: blink 1.5s infinite;
}

.player.current-turn {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    position: relative;
}

.player.current-turn::after {
    content: '▶';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--player-color);
    font-size: 1.2rem;
    animation: blink 1.5s infinite;
}

.player.active .player-name::after {
    content: " (Vous)";
    font-style: italic;
}

@keyframes blink {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Indicateur de statut de connexion */
.connection-status {
    margin: 10px 0;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    text-align: center;
    animation: fadeIn 0.5s;
}

.connection-status.connecting {
    background-color: #FFF8E1;
    color: #FF8F00;
    border-left: 4px solid #FF8F00;
}

.connection-status.success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border-left: 4px solid #2E7D32;
}

.connection-status.error, .connection-status.warning {
    background-color: #FFEBEE;
    color: #C62828;
    border-left: 4px solid #C62828;
}

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

/* Plateau de jeu */
.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    width: 100%;
    max-height: 70vh;
    overflow: auto;
}

.board {
    background-color: var(--primary-color);
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: inline-block;
    min-width: 80%;
    max-width: 90%;
}

.columns-selector {
    display: flex;
    margin-bottom: 10px;
}

.column-selector {
    width: calc(min(50px, 10vw));
    height: 40px;
    margin: 0 5px;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.column-selector:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.column-selector:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(255, 255, 255, 0.8);
}

.board-grid {
    display: flex;
    flex-direction: column;
}

.board-row {
    display: flex;
}

.cell {
    width: calc(min(60px, 10vw));
    height: calc(min(60px, 10vw));
    padding: 5px;
    background-color: var(--primary-color);
}

.cell-inner {
    width: 100%;
    height: 100%;
    background-color: white;
    border-radius: 50%;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s, transform 0.3s;
}

.cell-player-1 .cell-inner {
    background-color: #FF4136;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cell-player-2 .cell-inner {
    background-color: #FFDC00;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cell-player-3 .cell-inner {
    background-color: #0074D9;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cell-player-4 .cell-inner {
    background-color: #2ECC40;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cell-player-5 .cell-inner {
    background-color: #B10DC9;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cell-player-6 .cell-inner {
    background-color: #FF851B;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cell-player-7 .cell-inner {
    background-color: #F012BE;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cell-player-8 .cell-inner {
    background-color: #AAAAAA;
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
}

.cell.winning .cell-inner {
    animation: pulse 1s infinite;
}

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

.cell.hint .cell-inner {
    background-color: rgba(255, 255, 255, 0.8);
    animation: hint-pulse 1.5s infinite;
}

@keyframes hint-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

/* Messages de jeu */
.game-messages {
    text-align: center;
    margin: 20px 0;
    min-height: 24px;
}

.message {
    display: inline-block;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    background-color: #f5f5f5;
    margin-bottom: 10px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Statut du jeu */
.game-status {
    text-align: center;
    font-size: 1.2rem;
    padding: 10px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.current-player {
    font-weight: bold;
    color: var(--primary-color);
}

.your-turn-indicator {
    font-weight: bold;
    color: #4CAF50;
    animation: pulse-text 1.5s infinite;
}

@keyframes pulse-text {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Animation de chute des jetons */
.token-animation {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    z-index: 100;
    transform: translateX(-50%);
    animation: drop-animation 0.5s ease-in;
}

@keyframes drop-animation {
    0% {
        transform: translateX(-50%) translateY(-100px);
    }
    100% {
        transform: translateX(-50%) translateY(0);
    }
}

/* Modal de fin de partie */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal h2 {
    color: var(--dark-color);
    margin-bottom: 20px;
    text-align: center;
}

.modal h2:after {
    left: 50%;
    transform: translateX(-50%);
}

.modal p {
    margin-bottom: 30px;
    font-size: 1.2rem;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Responsive pour petits écrans */
@media (max-width: 768px) {
    .cell {
        width: 40px;
        height: 40px;
    }
    
    .column-selector {
        width: 30px;
    }
}
