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

:root {
    --primary-color: #10b981;
    --secondary-color: #3b82f6;
    --dark-bg: #1f2937;
    --darker-bg: #111827;
    --light-text: #f9fafb;
    --gray-text: #9ca3af;
    --board-bg: #047857;
    --cell-border: #065f46;
    --valid-cell: #34d399;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 900px;
    overflow-x: hidden;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header h1 i {
    margin-right: 10px;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Écrans */
.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

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

/* Cartes */
.menu-card,
.waiting-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.menu-card h2,
.waiting-card h2 {
    font-size: 2rem;
    color: var(--darker-bg);
    margin-bottom: 10px;
}

.menu-card p,
.waiting-card p {
    color: var(--gray-text);
    margin-bottom: 30px;
}

/* Champ de pseudo */
.nickname-input-group {
    margin-bottom: 25px;
}

.nickname-input-group input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nickname-input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.nickname-input-group input::placeholder {
    color: var(--gray-text);
}

/* Choix de couleur */
.color-choice {
    margin-bottom: 25px;
}

.color-choice p {
    font-size: 0.95rem;
    color: var(--gray-text);
    margin-bottom: 15px;
}

.color-options {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.color-option {
    flex: 1;
    cursor: pointer;
}

.color-option input[type="radio"] {
    display: none;
}

.color-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.color-label span {
    font-size: 0.9rem;
    color: var(--darker-bg);
    text-align: center;
    font-weight: 500;
}

.color-option input[type="radio"]:checked + .color-label {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.color-label:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Type de partie (Public/Privé) */
.game-type-choice {
    margin: 20px 0;
}

.game-type-choice p {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.game-type-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-type-select:hover {
    border-color: var(--primary-color);
}

.game-type-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Boutons */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #059669;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #2563eb;
}

.btn-info {
    background: #8b5cf6;
    color: white;
}

.btn-info:hover {
    background: #7c3aed;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: #059669;
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}

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

.modal-content h2 {
    color: var(--darker-bg);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.modal-content p {
    color: var(--gray-text);
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 2px;
}

.modal-content input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    gap: 10px;
}

.modal-buttons .btn {
    flex: 1;
}

.modal-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-buttons-row {
    display: flex;
    gap: 10px;
}

.modal-buttons-row .btn {
    flex: 1;
}

.btn-full {
    width: 100%;
}

/* Liste des parties publiques */
.public-games-list {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
    text-align: left;
}

.public-games-list h3 {
    color: var(--darker-bg);
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-align: center;
}

.public-games-container {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
}

.public-game-item {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.public-game-item:hover {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.05);
    transform: translateX(5px);
}

.public-game-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.public-game-code {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.public-game-player {
    font-size: 0.9rem;
    color: var(--gray-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-game-player .disc {
    width: 20px;
    height: 20px;
    display: inline-block;
}

.public-game-join {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.public-games-container::-webkit-scrollbar {
    width: 8px;
}

.public-games-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.public-games-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.public-games-empty {
    text-align: center;
    padding: 30px;
    color: var(--gray-text);
    font-style: italic;
}

/* Règles */
.rules-content {
    max-width: 600px;
    text-align: left;
}

.rules-content h2 {
    text-align: center;
}

.rules-text {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.rules-text h3 {
    color: var(--primary-color);
    margin: 20px 0 10px 0;
    font-size: 1.2rem;
}

.rules-text p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.rules-text ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.rules-text li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #4b5563;
}

/* Écran d'attente */
.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #e5e7eb;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: spin 1s linear infinite;
}

.game-code-display {
    background: var(--darker-bg);
    color: white;
    padding: 20px;
    border-radius: 12px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 5px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.info-text {
    color: var(--gray-text);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Écran de jeu */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.player-info.active {
    transform: scale(1.05);
}

.player-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--darker-bg);
    overflow: hidden;
}

.player-indicator span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.score-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-indicator {
    background-color: #10B981;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.color-indicator .disc {
    width: 32px;
    height: 32px;
}

.score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.game-status {
    text-align: center;
}

.turn-indicator {
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    margin-bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.turn-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.3rem;
    margin: 10px 0;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.turn-timer.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    animation: warning-pulse 1s infinite;
}

.turn-timer.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: danger-pulse 0.5s infinite;
}

@keyframes warning-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-md);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    }
}

@keyframes danger-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-md);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.7);
    }
}

.turn-timer i {
    font-size: 1.1rem;
}

#timer-text {
    min-width: 40px;
    text-align: center;
}

.game-code-small {
    font-size: 0.9rem;
    color: var(--gray-text);
    font-weight: 600;
}

/* Plateau de jeu */
.board {
    background: var(--board-bg);
    border-radius: 15px;
    padding: 15px;
    box-shadow: var(--shadow-xl);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-bottom: 20px;
    transition: background 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.board.board-urgent {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.7);
    animation: urgentPulse 1.5s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% {
        box-shadow: 0 0 30px rgba(220, 38, 38, 0.7);
    }
    50% {
        box-shadow: 0 0 50px rgba(220, 38, 38, 0.9);
    }
}

.cell {
    aspect-ratio: 1;
    background: #059669;
    border-radius: 8px;
    border: 2px solid var(--cell-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.cell:hover {
    background: #10b981;
}

.cell.valid {
    background: var(--valid-cell);
    cursor: pointer;
    animation: validPulse 1.5s infinite;
}

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

.cell.valid::after {
    content: '';
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.cell.pending {
    background: #10b981;
    cursor: wait;
    animation: pendingPulse 1s infinite;
}

@keyframes pendingPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }
}

.cell.pending::after {
    content: '';
    width: 60%;
    height: 60%;
    border: 4px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.disc {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    animation: placeDisc 0.3s ease-out;
}

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

.disc.black {
    background: radial-gradient(circle at 30% 30%, #4b5563, #1f2937);
}

.disc.white {
    background: radial-gradient(circle at 30% 30%, #ffffff, #e5e7eb);
}

.disc.flipping {
    animation: flip 0.6s ease-in-out;
}

@keyframes flip {
    0%, 100% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg);
    }
}

/* Contrôles de jeu */
.game-controls {
    text-align: center;
}

/* Modal de fin de partie */
.game-over-content {
    max-width: 400px;
}

.trophy-icon {
    font-size: 4rem;
    color: #fbbf24;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.defeat-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: defeatPulse 1.5s ease-in-out infinite;
}

.defeat-icon i {
    animation: defeatRotate 2s linear infinite;
}

@keyframes defeatPulse {
    0%, 100% {
        color: #dc2626;
        text-shadow: 0 0 20px rgba(220, 38, 38, 0.8);
        transform: scale(1);
    }
    50% {
        color: #ef4444;
        text-shadow: 0 0 40px rgba(239, 68, 68, 1);
        transform: scale(1.1);
    }
}

@keyframes defeatRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

.final-scores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.final-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.final-score .disc {
    width: 50px;
    height: 50px;
}

.final-score span {
    font-size: 2rem;
    font-weight: 700;
    color: var(--darker-bg);
}

.vs {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-text);
}

/* Modal adversaire déconnecté */
.opponent-left-content {
    text-align: center;
}

.disconnect-icon {
    font-size: 4rem;
    color: #ef4444;
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-in;
}

.opponent-left-content h2 {
    color: var(--darker-bg);
    margin-bottom: 15px;
}

.opponent-left-content p {
    color: var(--gray-text);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.victory-message {
    margin: 25px 0;
    padding: 15px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 15px;
}

.blinking-victory {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 700;
    animation: colorBlink 2s ease-in-out infinite;
}

@keyframes colorBlink {
    0% {
        color: #ef4444;
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }
    50% {
        color: #10b981;
        text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    }
    100% {
        color: #ef4444;
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }
}

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast i {
    font-size: 1.3rem;
}

.toast.black-color {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.toast.white-color {
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
    color: #1f2937;
}

/* Responsive */

/* Très grands écrans */
@media (min-width: 1400px) {
    .container {
        max-width: 1000px;
    }

    .board {
        max-width: 650px;
    }
}

/* Tablettes en mode paysage et grands écrans */
@media (min-width: 769px) and (max-width: 1024px) {
    .board {
        max-width: 550px;
    }

    .game-info {
        padding: 18px;
    }
}

/* Tablettes et petits ordinateurs portables */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .menu-card,
    .waiting-card,
    .modal-content {
        padding: 25px 15px;
    }

    .game-info {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .game-status {
        order: -1;
    }

    .player-info {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }

    .player-indicator {
        font-size: 0.9rem;
    }

    .color-indicator {
        width: 38px;
        height: 38px;
    }

    .color-indicator .disc {
        width: 26px;
        height: 26px;
    }

    .score {
        font-size: 1.6rem;
    }

    .turn-indicator {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    .turn-timer {
        padding: 8px 16px;
        font-size: 1.1rem;
    }

    .board {
        padding: 10px;
        gap: 3px;
        max-width: 100%;
    }

    .cell {
        border-radius: 4px;
    }

    .disc {
        width: 75%;
        height: 75%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    header {
        margin-bottom: 15px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .menu-card,
    .waiting-card,
    .modal-content {
        padding: 20px 12px;
    }

    .game-code-display {
        font-size: 1.3rem;
        padding: 12px;
        letter-spacing: 3px;
    }

    .game-info {
        padding: 12px;
        gap: 12px;
    }

    .player-indicator {
        font-size: 0.85rem;
        gap: 6px;
    }

    .player-indicator span {
        max-width: 100px;
    }

    .player-indicator .disc {
        width: 18px;
        height: 18px;
    }

    .color-indicator {
        width: 30px;
        height: 30px;
    }

    .color-indicator .disc {
        width: 20px;
        height: 20px;
    }

    .score {
        font-size: 1.4rem;
    }

    .turn-indicator {
        padding: 8px 16px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .turn-timer {
        padding: 6px 12px;
        font-size: 1rem;
    }

    .game-code-small {
        font-size: 0.8rem;
    }

    .board {
        padding: 6px;
        gap: 2px;
        border-radius: 10px;
        max-width: 100%;
    }

    .cell {
        border-radius: 3px;
        border-width: 1px;
    }

    .disc {
        width: 70%;
        height: 70%;
    }

    .modal-content {
        width: 95%;
        padding: 25px 15px;
    }

    .final-scores {
        gap: 20px;
    }

    .final-score .disc {
        width: 40px;
        height: 40px;
    }

    .final-score span {
        font-size: 1.6rem;
    }

    .button-group {
        gap: 12px;
    }

    .color-options {
        flex-direction: column;
    }

    .color-option {
        width: 100%;
    }

    .toast {
        font-size: 0.95rem;
        padding: 12px 18px;
    }
}

/* Ajout d'une media query pour les très petits écrans */
@media (max-width: 360px) {
    body {
        padding: 5px;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .game-info {
        padding: 10px;
    }

    .player-indicator {
        font-size: 0.75rem;
    }

    .player-indicator span {
        max-width: 80px;
    }

    .score {
        font-size: 1.2rem;
    }

    .turn-indicator {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .turn-timer {
        padding: 5px 10px;
        font-size: 0.9rem;
    }

    .board {
        padding: 5px;
        gap: 1px;
    }

    .cell {
        border-width: 1px;
    }

    .disc {
        width: 65%;
        height: 65%;
    }
}

/* Bouton Revanche */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 2px solid #059669;
    position: relative;
    overflow: hidden;
}

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

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

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-color: #047857;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

.btn-success i {
    margin-right: 8px;
}

/* Icône de revanche dans les modals */
.rematch-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: exchange 1s ease-in-out infinite;
}

@keyframes exchange {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.1);
    }
}

/* Modal demande de revanche */
#rematch-request-modal .modal-content {
    text-align: center;
    max-width: 500px;
}

#rematch-request-modal .modal-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

#rematch-request-modal .modal-buttons-group button {
    width: 100%;
}

/* Modal attente de revanche */
#rematch-waiting-modal .modal-content {
    text-align: center;
    max-width: 450px;
}

#rematch-waiting-modal .spinner {
    margin: 30px auto;
}

/* Disposition des boutons dans la modal de fin de partie */
.game-over-content .btn {
    margin: 10px 0;
    width: 100%;
}

.game-over-content #rematch-btn {
    margin-top: 20px;
}

.game-over-content #new-game-btn {
    margin-top: 10px;
}

/* Dark Mode - Pions blancs deviennent rouges */
@media (prefers-color-scheme: dark) {
    .disc.white {
        background: radial-gradient(circle at 30% 30%, #ef4444, #dc2626);
    }
}
