/* Memory Match Game Specific Styles */

.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
    margin-bottom: 40px;
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

.game-header h1 {
    color: #333;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.game-header p {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.stat .label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.stat span:last-child {
    font-size: 1.5rem;
    font-weight: 600;
}

.difficulty-selector {
    text-align: center;
    margin-bottom: 2rem;
}

.difficulty-selector h3 {
    color: #333;
    margin-bottom: 1rem;
    font-weight: 600;
}

.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-difficulty {
    background: #e0e7ff;
    color: #4f46e5;
    border: 2px solid transparent;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
}

.btn-difficulty:hover {
    background: #c7d2fe;
    transform: translateY(-2px);
}

.btn-difficulty.active {
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    border-color: #4f46e5;
    box-shadow: 0 5px 15px rgba(79, 70, 229, 0.4);
}

.game-board {
    display: grid;
    gap: 15px;
    margin: 2rem auto;
    justify-content: center;
    perspective: 1000px;
}

.game-board.easy {
    grid-template-columns: repeat(4, 80px);
    grid-template-rows: repeat(2, 80px);
}

.game-board.medium {
    grid-template-columns: repeat(4, 75px);
    grid-template-rows: repeat(3, 75px);
}

.game-board.hard {
    grid-template-columns: repeat(4, 70px);
    grid-template-rows: repeat(4, 70px);
}

.memory-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
    border-radius: 12px;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    animation: matchFound 0.8s ease-in-out;
    pointer-events: none;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-front {
    background: linear-gradient(45deg, #FF6B35, #F7931E);
    color: white;
    transform: rotateY(180deg);
}

.card-back {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.card-back::after {
    content: '🦊';
    font-size: 1.5rem;
}

@keyframes matchFound {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.1); }
    100% { transform: rotateY(180deg) scale(1); }
}

.game-controls {
    text-align: center;
    margin-top: 2rem;
}

.game-controls .btn {
    margin: 0 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 3rem;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
}

.modal-content p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.win-stats {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.win-stats p {
    margin: 0.5rem 0;
    font-weight: 600;
    color: #333;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Educational Information Styles */
.educational-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 15px;
    margin: 2rem 0;
    text-align: center;
}

.educational-info h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.learning-objectives {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.objective {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
}

.age-recommendation {
    color: #666;
    font-weight: 600;
    margin-top: 1rem;
}

/* Game States */
.game-paused .memory-card {
    pointer-events: none;
}

.game-paused .card-face {
    filter: blur(5px);
}

/* Fullscreen Styles */
.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    overflow: auto !important;
    margin: 0 !important;
}

.fullscreen-mode .game-container {
    width: 100% !important;
    max-width: none !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.fullscreen-mode .header {
    position: relative !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

.fullscreen-exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(255, 107, 53, 0.9);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.fullscreen-exit-btn:hover {
    background: rgba(255, 107, 53, 1);
    transform: scale(1.05);
}

/* Co-op Mode Styles */
.game-mode-selector {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

.game-mode-selector h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.mode-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-mode {
    padding: 0.8rem 1.5rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.btn-mode:hover {
    background: #f8f9fa;
    border-color: #4ECDC4;
    transform: translateY(-2px);
}

.btn-mode.active {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
    color: white;
    border-color: #4ECDC4;
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.3);
}

.player-info {
    background: linear-gradient(45deg, #FF6B6B, #FF8E53);
    color: white;
    padding: 1rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.current-player {
    margin-bottom: 1rem;
}

.current-player .label {
    font-size: 1rem;
    margin-right: 0.5rem;
    opacity: 0.9;
}

#current-player-name {
    font-size: 1.3rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.player-scores {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.player-score {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.player-score .label {
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.coop-score-breakdown {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    border: 2px solid #e9ecef;
}

.coop-score-breakdown p {
    margin: 0.5rem 0;
    font-size: 1rem;
    color: #333;
}

.coop-score-breakdown strong {
    color: #FF6B35;
}

/* Win Modal Co-op Styles */
.coop-stats {
    margin-top: 1rem;
}

.winner-announcement {
    text-align: center;
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1rem 0 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: celebrateWin 0.8s ease-out;
}

.winner-announcement.player1-winner {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    color: white;
    border: 3px solid #ff4757;
}

.winner-announcement.player2-winner {
    background: linear-gradient(45deg, #4ecdc4, #6bcf7f);
    color: white;
    border: 3px solid #26d0ce;
}

.winner-announcement.tie-game {
    background: linear-gradient(45deg, #a29bfe, #6c5ce7);
    color: white;
    border: 3px solid #5f27cd;
}

.winner-announcement h3 {
    font-size: 2rem;
    margin: 0;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: bounce 1s infinite;
}

@keyframes celebrateWin {
    0% { 
        transform: scale(0.8) rotate(-10deg);
        opacity: 0;
    }
    50% { 
        transform: scale(1.1) rotate(5deg);
        opacity: 0.8;
    }
    100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Final Scores Styles */
.final-scores {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.player-final-score {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e9ecef;
    min-width: 120px;
    transition: transform 0.3s ease;
}

.player-final-score:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.player-label {
    font-weight: 600;
    color: #333;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.player-final-score span:not(.player-label) {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF6B35;
}

/* Single Player Stats */
.single-player-stats {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 1rem 0;
}

/* Co-op Stats */
.coop-stats {
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 2px solid #e9ecef;
}

/* Modal enhancements */
.modal-content {
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        margin: 20px;
        padding: 15px;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .stat {
        width: 200px;
    }
    
    .difficulty-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-difficulty {
        width: 200px;
    }
    
    .game-board.easy {
        grid-template-columns: repeat(4, 70px);
        grid-template-rows: repeat(2, 70px);
    }
    
    .game-board.medium {
        grid-template-columns: repeat(4, 65px);
        grid-template-rows: repeat(3, 65px);
    }
    
    .game-board.hard {
        grid-template-columns: repeat(4, 60px);
        grid-template-rows: repeat(4, 60px);
    }
    
    .modal-content {
        margin: 20% auto;
        padding: 2rem;
    }
    
    .modal-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .modal-buttons .btn {
        width: 200px;
    }
    
    .mode-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-mode {
        width: 100%;
        max-width: 200px;
    }
    
    .player-scores {
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-mode-selector {
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-stats {
        gap: 0.5rem;
    }
    
    .stat {
        width: 150px;
        padding: 0.75rem 1rem;
    }
    
    .game-board.easy {
        grid-template-columns: repeat(4, 60px);
        grid-template-rows: repeat(2, 60px);
        gap: 10px;
    }
    
    .game-board.medium {
        grid-template-columns: repeat(4, 55px);
        grid-template-rows: repeat(3, 55px);
        gap: 10px;
    }
    
    .game-board.hard {
        grid-template-columns: repeat(4, 50px);
        grid-template-rows: repeat(4, 50px);
        gap: 10px;
    }
    
    .card-face {
        font-size: 1.5rem;
    }
    
    .card-back::after {
        font-size: 1.2rem;
    }
    
    .final-scores {
        flex-direction: column;
        gap: 1rem;
    }
    
    .winner-announcement h3 {
        font-size: 1.5rem;
    }
    
    .player-final-score {
        min-width: auto;
    }
}
