/**
 * 쌤풀실험실 게임 모달 스타일
 * fullscreen 모달로 게임을 표시
 */

/* 게임 바로가기 버튼 */
.game-play-button-wrapper {
    text-align: center;
    margin: 32px 0;
}

.btn-game-play {
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(108, 48, 237, 0.2);
}

.btn-game-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 48, 237, 0.3);
}

.btn-game-play i {
    font-size: 20px;
    vertical-align: middle;
}

/* 레이어 게임 모달 */
.game-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.game-modal-container {
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    max-height: 900px;
    position: relative;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.game-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.game-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-modal-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-modal-title i {
    font-size: 24px;
}

.game-modal-close {
    /*background: rgba(255, 255, 255, 0.1);*/
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 24px;
}

.game-modal-fullscreen {
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 22px;
    font-weight: 700;
    background: transparent;
}

.game-modal-fullscreen:hover {
    transform: scale(1.08);
}

.game-modal-fullscreen-icon {
    line-height: 1;
    display: inline-block;
    font-size: 28px;
}

.game-modal-close:hover {
    /*background: rgba(255, 255, 255, 0.2);*/
    transform: rotate(90deg);
}

.game-modal-body {
    flex: 1;
    background: white;
    overflow: hidden;
    position: relative;
}

.game-modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.game-modal-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.game-modal-loading .spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6c30ed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.game-modal-loading p {
    color: #666;
    font-size: 14px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .game-modal-overlay {
        padding: 10px;
    }

    .game-modal-container {
        width: 95%;
        height: 85vh;
        border-radius: 12px;
    }

    .game-modal-header {
        padding: 12px 16px;
    }

    .game-modal-title {
        font-size: 16px;
    }

    .game-modal-title i {
        font-size: 20px;
    }

    .game-modal-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .game-modal-fullscreen {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .game-modal-fullscreen-icon {
        font-size: 24px;
    }

    .btn-game-play {
        padding: 14px 32px;
        font-size: 16px;
    }
}

/* hanoi-tower 게임 내부 스타일 모바일 최적화 */
@media (max-width: 768px) {
    .game-modal-iframe {
        /* iframe 내부 콘텐츠의 rules-and-controls를 세로 배치 */
    }
}

/* CSS 가짜 전체화면 (Fullscreen API 미사용 → 파일 업로드 충돌 없음) */
.game-modal-overlay.fakefullscreen {
    padding: 0;
    background-color: #000;
}
.game-modal-overlay.fakefullscreen .game-modal-container {
    width: 100% !important;
    max-width: none !important;
    height: 100vh !important;
    max-height: none !important;
    border-radius: 0 !important;
    animation: none;
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
