/* ===========================================
   STYLES POUR LES MINI-JEUX
   ========================================== */

/* Modal de jeu */
.game-modal-content {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: #1a1a2e;
    padding: 30px;
    border-radius: 15px;
}

.game-container {
    color: #fff;
    text-align: center;
}

.game-container h2 {
    margin-bottom: 20px;
    color: #4ecdc4;
    font-size: 2em;
}

/* Boutons génériques */
.game-container button {
    background: #4ecdc4;
    color: #1a1a2e;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    margin: 5px;
}

.game-container button:hover {
    background: #45b7d1;
    transform: scale(1.05);
}

.game-container button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: scale(1);
}

/* Écrans d'introduction pour les jeux */
.rps-intro, .ttt-intro, .memory-intro, .breakout-intro, .catch-intro, .hangman-intro {
    padding: 40px 20px;
    text-align: center;
}

.rps-intro p, .ttt-intro p, .memory-intro p, .breakout-intro p, .catch-intro p, .hangman-intro p {
    font-size: 1.1em;
    margin: 15px 0;
    color: #95e1d3;
}

.game-start-btn {
    font-size: 1.3em !important;
    padding: 15px 40px !important;
    margin-top: 20px !important;
    background: linear-gradient(135deg, #4ecdc4, #45b7d1) !important;
    font-weight: bold;
}

.game-start-btn:hover {
    background: linear-gradient(135deg, #45b7d1, #4ecdc4) !important;
    transform: scale(1.1) !important;
}

/* ===========================================
   1. PIERRE-FEUILLE-CISEAUX
   ========================================== */

.rps-game {
    padding: 20px;
}

.rps-score {
    display: flex;
    justify-content: space-around;
    font-size: 1.3em;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 10px;
}

.rps-choices {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.rps-btn {
    font-size: 1.2em;
    padding: 15px 25px;
    min-width: 120px;
}

.rps-result {
    margin-top: 30px;
}

#rps-message {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #ffd93d;
}

#rps-choices-display {
    font-size: 2em;
    margin-top: 10px;
}

/* ===========================================
   2. MORPION
   ========================================== */

.ttt-game {
    padding: 20px;
}

#ttt-message {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #ffd93d;
}

.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 5px;
    justify-content: center;
    margin: 20px 0;
}

.ttt-cell {
    background: rgba(78, 205, 196, 0.2);
    border: 2px solid #4ecdc4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    cursor: pointer;
    transition: all 0.3s;
}

.ttt-cell:hover {
    background: rgba(78, 205, 196, 0.4);
    transform: scale(1.05);
}

.ttt-reset {
    margin-top: 20px;
}

/* ===========================================
   3. SNAKE
   ========================================== */

.snake-game {
    padding: 20px;
}

.snake-score {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #ffd93d;
}

#snake-canvas {
    border: 3px solid #4ecdc4;
    border-radius: 10px;
    margin: 15px 0;
    background: #1a1a2e;
}

.snake-controls {
    margin: 15px 0;
    color: #95e1d3;
}

/* ===========================================
   4. MEMORY
   ========================================== */

.memory-game {
    padding: 20px;
}

.memory-score {
    display: flex;
    justify-content: space-around;
    font-size: 1.2em;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 10px;
}

.memory-board {
    display: grid;
    grid-template-columns: repeat(4, 80px);
    grid-template-rows: repeat(4, 80px);
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.memory-card {
    cursor: pointer;
    perspective: 1000px;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner,
.memory-card.matched .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front,
.memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 2.5em;
}

.memory-card-front {
    background: linear-gradient(135deg, #4ecdc4, #45b7d1);
    color: #1a1a2e;
    font-weight: bold;
}

.memory-card-back {
    background: linear-gradient(135deg, #ffd93d, #ff6b6b);
    transform: rotateY(180deg);
}

.memory-card.matched .memory-card-inner {
    opacity: 1;
}

.memory-card.matched .memory-card-back {
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
    filter: brightness(0.7);
}

/* ===========================================
   5. CASSE-BRIQUE
   ========================================== */

.breakout-game {
    padding: 20px;
}

.breakout-score {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #ffd93d;
}

#breakout-canvas {
    border: 3px solid #4ecdc4;
    border-radius: 10px;
    margin: 15px 0;
    background: #1a1a2e;
    cursor: none;
}

.breakout-controls {
    margin: 15px 0;
    color: #95e1d3;
}

/* ===========================================
   6. ATTRAPE-FLOCONS
   ========================================== */

.catch-game {
    padding: 20px;
}

.catch-stats {
    display: flex;
    justify-content: space-around;
    font-size: 1.2em;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 10px;
}

#catch-area {
    position: relative;
    width: 400px;
    height: 400px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #4ecdc4;
    border-radius: 10px;
    margin: 20px auto;
    overflow: hidden;
    cursor: crosshair;
}

.catch-snowflake {
    position: absolute;
    font-size: 2em;
    cursor: pointer;
    transition: transform 0.3s;
    user-select: none;
}

.catch-snowflake:hover {
    transform: scale(1.2);
}

.catch-snowflake.caught {
    animation: catchAnimation 0.3s forwards;
}

@keyframes catchAnimation {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2) rotate(360deg); opacity: 0; }
}

.catch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.catch-result {
    background: rgba(78, 205, 196, 0.2);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

.catch-result h3 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #ffd93d;
}

.catch-result p {
    font-size: 1.5em;
}

/* ===========================================
   7. PENDU
   ========================================== */

.hangman-game {
    padding: 20px;
}

.hangman-canvas-container {
    margin: 20px 0;
}

#hangman-canvas {
    border: 2px solid #4ecdc4;
    border-radius: 10px;
    background: #0f3460;
}

.hangman-word {
    font-size: 2.5em;
    letter-spacing: 10px;
    margin: 30px 0;
    font-family: monospace;
    color: #ffd93d;
}

.hangman-message {
    font-size: 1.3em;
    margin: 20px 0;
    color: #95e1d3;
}

.hangman-keyboard {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    max-width: 400px;
    margin: 20px auto;
}

.hangman-key {
    padding: 10px;
    font-size: 1em;
    min-width: 40px;
    background: rgba(78, 205, 196, 0.3);
    border: 2px solid #4ecdc4;
}

.hangman-key.used {
    background: #666;
    border-color: #444;
}

.hangman-reset {
    margin-top: 20px;
}

/* Icônes de jeux dans les cases */
.game-icon {
    font-size: 2.5em;
    cursor: pointer;
    transition: transform 0.3s;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.3) 0%, rgba(69, 183, 209, 0.3) 100%);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid rgba(78, 205, 196, 0.4);
    border-radius: 15px;
}

.game-icon::before {
    content: '🎮';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.5em;
    opacity: 0.7;
}

.game-icon::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.6) 0%, transparent 70%);
    border-radius: 50%;
}

.game-icon:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.4) 0%, rgba(69, 183, 209, 0.4) 100%);
}

/* Responsive pour les jeux */
@media (max-width: 768px) {
    .game-modal-content {
        padding: 15px;
        max-width: 95%;
    }
    
    .ttt-board {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(3, 80px);
    }
    
    .memory-board {
        grid-template-columns: repeat(4, 60px);
        grid-template-rows: repeat(4, 60px);
        gap: 5px;
    }
    
    #catch-area {
        width: 300px;
        height: 300px;
    }
    
    #snake-canvas,
    #breakout-canvas {
        max-width: 100%;
        height: auto;
    }
}
