* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #2c3e50;
}

.hidden {
    display: none !important;
}

/* Écran d'accueil */
#welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.menu {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 400px;
}

button {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.join-section {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input[type="text"] {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

/* Écran de jeu */
.info-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-content {
    display: flex;
    gap: 20px;
}

.game-board {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.person-card {
    position: relative;
    perspective: 1000px;
    cursor: pointer;
    width: 100%;
    aspect-ratio: 1;
}

.person-card:hover {
    transform: scale(1.03);
}

.person-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1/1;
}

.person-card .name {
    padding: 8px 0;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 14px;
}

.target-button {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    z-index: 2;
}

.person-card.flipped {
    opacity: 0.5;
}

.target-info {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.target-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
}

.target-card img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.target-card .target-name {
    margin-top: 10px;
    font-weight: bold;
}

.sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-panel {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.chat-box {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.chat-box h3 {
    margin-bottom: 15px;
}

.messages {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    max-height: 300px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 4px;
}

.message.self {
    background-color: #d5f5e3;
    text-align: right;
}

.message.other {
    background-color: #ebf5fb;
}

.message-input {
    display: flex;
    gap: 10px;
}

.message-input input {
    flex-grow: 1;
}

/* Écran de fin de partie */
#game-over {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.result-content {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    text-align: center;
    max-width: 500px;
}

#winner-message {
    margin: 20px 0;
    font-size: 18px;
}

.target-card.large img {
    width: 200px;
    height: 200px;
}

#back-to-menu {
    margin-top: 30px;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background-color: #2ecc71;
    color: white;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 100;
}

.notification.error {
    background-color: #e74c3c;
}

.person-card {
    position: relative;
    perspective: 1000px;
    cursor: pointer;
}

.front,
.back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    transition: transform 0.6s;
    border-radius: 4px;
    overflow: hidden;
}

.back {
    transform: rotateY(180deg);
}

.person-card.flipped .front {
    transform: rotateY(180deg);
}

.person-card.flipped .back {
    transform: rotateY(360deg);
}

.front img,
.back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    font-size: 0.8em;
}

.message.system {
    background-color: #f0f0f0;
    text-align: center;
    font-style: italic;
}

.game-over-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
}

#replay-game {
    background-color: #27ae60;
}

#replay-game:hover {
    background-color: #219a52;
}

/* Responsive */
@media (max-width: 900px) {
    .game-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(6, 1fr);
    }
}