/* 전체 페이지 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 50%, #fd79a8 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

/* 헤더 스타일 */
.game-header {
    margin-bottom: 30px;
}

.game-title {
    font-size: 2.5rem;
    color: #6c5ce7;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    padding: 12px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.stat-label {
    margin-right: 8px;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.stat-total {
    font-size: 0.9rem;
    opacity: 0.8;
}

.restart-btn {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 67, 147, 0.3);
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 67, 147, 0.4);
}

/* 게임 보드 스타일 */
.game-board {
    margin-bottom: 30px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(116, 185, 255, 0.1);
    border-radius: 20px;
}

/* 카드 스타일 */
.card {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: scale(1.05);
}

.card.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

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

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

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-back {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.3) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
    background-size: 20px 20px;
}

.card-back::before {
    content: '🐻';
    font-size: 2.5rem;
    opacity: 0.8;
}

.card-front {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    transform: rotateY(180deg);
    border: 3px solid #74b9ff;
}

.card-front img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    border-radius: 10px;
}

.card.matched {
    transform: scale(0.95);
    opacity: 0.8;
}

.card.matched .card-back {
    background: linear-gradient(135deg, #00b894, #00a085);
}

/* 승리 모달 스타일 */
.win-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.win-modal.hidden {
    display: none;
}

.win-content {
    background: linear-gradient(135deg, #fff, #f8f9fa);
    padding: 40px;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.5s ease;
    max-width: 400px;
    width: 90%;
}

.win-content h2 {
    color: #e17055;
    margin-bottom: 20px;
    font-size: 2rem;
}

.win-content p {
    color: #636e72;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.win-stats {
    background: rgba(116, 185, 255, 0.1);
    padding: 15px;
    border-radius: 15px;
    margin: 20px 0;
}

.win-stats p {
    color: #0984e3;
    font-weight: 600;
    margin: 0;
}

.play-again-btn {
    background: linear-gradient(135deg, #00b894, #00a085);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 168, 133, 0.3);
}

.play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 133, 0.4);
}

/* 푸터 스타일 */
.game-footer {
    color: #636e72;
    font-size: 0.9rem;
    font-style: italic;
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 반응형 디자인 */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .game-grid {
        gap: 10px;
        padding: 15px;
    }
    
    .game-stats {
        gap: 15px;
    }
    
    .stat-item {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .card-back::before {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.5rem;
    }
    
    .game-grid {
        gap: 8px;
        padding: 10px;
    }
    
    .card-back::before {
        font-size: 1.5rem;
    }
    
    .win-content {
        padding: 30px 20px;
    }
    
    .win-content h2 {
        font-size: 1.5rem;
    }
}