/* 翻牌記憶遊戲樣式 */

/* 遊戲標題區 */ 
.game-header {
    background: linear-gradient(135deg, #70a6b1 0%, #70a6b8 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    color: white;
}

.game-info h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-align: center;
    color: white;
}

.game-info p {
    text-align: center;
    font-size: 1.2rem;
    opacity: 0.9;
    margin: 0;
}

/* 遊戲統計 */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #FFD700;
}

.stat-label {
    font-size: 0.9rem;
    margin-top: 5px;
    opacity: 0.9;
}

/* 遊戲控制按鈕 */
.game-controls {
    text-align: center;
    margin-top: 20px;
}

.control-button {
    background: #F39F5F;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 159, 95, 0.4);
}

.control-button:hover {
    background: #e58a47;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 159, 95, 0.6);
}

/* 遊戲板 */
.game-board {
    display: grid;
    gap: 15px;
    padding: 20px;
    max-width: 900px;
    margin: 0 auto;
}

/* 記憶卡片 */
.memory-card {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.memory-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    opacity: 0.6;
    pointer-events: none;
}

.memory-card.matched .card-face {
    background: linear-gradient(135deg, #D7EED6 0%,#D7EED6 100%);
}

/* 卡片面 */
.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px;
    box-sizing: border-box;
}

.card-back {
    background: linear-gradient(135deg, #A7D9D9 0%, #A7D9D9 100%);
    color: white;
    font-size: 3rem;
}

.card-front {
    background: white;
    transform: rotateY(180deg);
    border: 3px solid #e0e0e0;
}

.card-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
}

.card-word {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    word-break: break-word;
}

/* 完成遊戲彈窗 */
.game-complete {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.complete-modal {
    background: white;
    border-radius: 30px;
    padding: 50px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.complete-title {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 30px;
    font-weight: bold;
}

.complete-stats {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.complete-stats p {
    font-size: 1.2rem;
    margin: 10px 0;
    color: #333;
}

.complete-stats span {
    font-weight: bold;
    color: #667eea;
}

.complete-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-button {
    padding: 15px 35px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #667eea;
    color: white;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.modal-button.secondary {
    background: #95a5a6;
}

.modal-button.secondary:hover {
    background: #7f8c8d;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .game-header {
        padding: 20px;
    }

    .game-info h1 {
        font-size: 1.8rem;
    }

    .game-stats {
        gap: 20px;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .game-board {
        gap: 10px;
        padding: 10px;
    }

    .card-word {
        font-size: 1.2rem;
    }

    .complete-modal {
        padding: 30px;
        margin: 20px;
    }

    .complete-title {
        font-size: 2rem;
    }
}
