/* ================================== */
/* Global & Layout Styles       */
/* ================================== */

/* 기본 스타일 초기화 및 전체 페이지 높이 설정 */
html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* 가로 스크롤 방지 */
    -webkit-overflow-scrolling: touch; /* iOS에서 부드러운 스크롤 */
}

/* 모바일에서 기본 스크롤 허용 */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        overflow-y: auto;
    }
}

main {
    display: block;
    padding-top: 120px; /* 헤더 높이를 고려한 여백 */
    flex-grow: 1; /* 메인 콘텐츠가 남는 공간을 모두 차지하도록 함 */
}

#main-title {
  word-break: keep-all;
}

/* Home 페이지에서는 main의 상단 여백 제거 */
body.home main {
    padding-top: 0;
}

/* 중간 크기 화면에서 헤더 높이에 맞춰 패딩 조정 */
@media (max-width: 1100px) {
    main {
        padding-top: 100px;
    }
}

@media (max-width: 870px) {
    main {
        padding-top: 90px;
    }
}

/* 모바일에서 헤더 높이에 맞춰 패딩 조정 */
@media (max-width: 768px) {
    main {
        padding-top: 80px;
    }
    
    body.home main {
        padding-top: 0;
    }
    
    .header-container {
        min-height: 80px;
    }
    
    header {
        padding: 5px 0;
    }
}

@media (max-width: 480px) {
    main {
        padding-top: 80px;
    }
    
    .header-container {
        min-height: 80px;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================================== */
/* Header & Footer Styles       */
/* ================================== */

header {
    position: fixed;
    width: 100%;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 0;
    transition: padding 0.3s ease; /* 패딩 변화 애니메이션 */
}

/* 중간 크기에서 헤더 패딩 조정 */
@media (max-width: 1100px) {
    header {
        padding: 8px 0;
    }
    
    .header-container {
        min-height: 100px;
    }
}

@media (max-width: 870px) {
    header {
        padding: 5px 0;
    }
    
    .header-container {
        min-height: 80px;
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: end;
    max-width: 1200px;
    margin: 20px;
    padding: 0 20px;
    position: relative;
    min-height: 100px; /* 최소 높이 설정 */
}

.header-logo {
    height: 100px;
    width: auto;
    vertical-align: middle;
    transition: height 0.3s ease; /* 부드러운 크기 변화 */
}

header h1 {
    margin: 0;
    flex-shrink: 0; /* 로고가 줄어들지 않도록 */
}

header h1 a {
    color: #fff;
    text-decoration: none;
    font-size: 1.8em;
}

/* 데스크톱 네비게이션 */
.desktop-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

.desktop-nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 0 35px;
    font-size: 1.5em;
    transition: color 0.3s ease;
}

.desktop-nav ul li a:hover {
    color: #ff4757;
}

/* 모바일 메뉴 버튼 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 101;
}

.burger-icon {
    width: 30px;
    height: 30px;
    filter: invert(1); /* 아이콘을 흰색으로 만들기 */
    transition: transform 0.3s ease;
}

.mobile-menu-btn.active .burger-icon {
    transform: rotate(90deg);
}

/* 모바일 네비게이션 */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    transition: right 0.3s ease;
    z-index: 99;
    padding-top: 120px;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav ul li a {
    color: #fff;
    text-decoration: none;
    display: block;
    padding: 20px 30px;
    font-size: 1.3em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.mobile-nav ul li a:hover {
    background-color: rgba(255, 71, 87, 0.2);
    color: #ff4757;
}

footer {
    position: relative;
    width: 100%;
    background-color: #1a1a1a;
    color: #bbb;
    padding: 40px 0;
    text-align: center;
    font-size: 0.9em;
    min-height: 10vh; /* 자동스크롤에서 footer를 볼 수 있도록 충분한 높이 제공 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

footer ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

footer ul li a {
    color: #bbb;
    text-decoration: none;
}

footer ul li a:hover {
    color: #fff;
}


/* ================================== */
/* Hero Section (Home) Styles   */
/* ================================== */

.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    z-index: 1;
    /* 삭제: JS 스크롤을 사용하므로 더 이상 필요 없습니다. */
    /* scroll-snap-align: start; */
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.video-background iframe {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    min-width: 100%;
    min-height: 100%;
    width: 177.77vh;
    height: 56.25vw;
}

.video-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 800px;
    padding: 20px;
}

.studio-logo {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: 3.5em;
    margin-bottom: 30px;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.download-section {
    margin-top: 10vh;
}

.download-text {
    font-size: 1.5em;
    margin-bottom: 15px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.wishlist-button,
.appstore-button {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.3em;
    font-weight: bold;
    transition: transform 0.3s ease, background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.wishlist-button {
    background-color: #ff4757;
    color: #fff;
}

.appstore-button {
    background-color: #ffffff;
    color: #1a1a1a;
}

.wishlist-button:hover,
.appstore-button:hover {
    transform: scale(1.05);
}

.wishlist-button:hover {
    background-color: #e63946;
}

/* ================================== */
/* Page Section Styles          */
/* ================================== */

/* 모든 페이지 섹션에 공통으로 적용될 스타일 */
.page-section {
    padding: 80px 0;
    min-height: 100vh;
    box-sizing: border-box;
    /* 삭제: JS 스크롤을 사용하므로 더 이상 필요 없습니다. */
    /* scroll-snap-align: start; */
}


/* ================================== */
/* Games Section Styles         */
/* ================================== */
.featured-games {
    background-color: #1a1a1a;
    text-align: center;
}

.featured-games h2 {
    font-size: 2.5em;
    margin-bottom: 50px;
    color: #ffffff;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.game-card {
    background-color: #2b2b2b;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.5);
}

.game-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.game-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 1.5em;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 10px;
}

.card-content p {
    font-size: 1em;
    color: #cccccc;
    line-height: 1.6;
    margin: 0;
}


/* ================================== */
/* About Section Styles         */
/* ================================== */

.about-section {
    background-color: #f0f0f0;
    text-align: center;
}

.about-intro h2 {
    font-size: 2.5em;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.about-intro p {
    font-size: 1.2em;
    color: #555;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

.vision-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3열 그리드 */
    gap: 40px;
    margin-top: 60px; /* 상단 소개 문구와의 간격 */
    text-align: left;
}

.vision-item {
    background-color: #ffffff; /* 밝은 카드 배경 */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.vision-item h3 {
    font-size: 1.8em;
    color: #1a1a1a;
    margin-top: 0;
    margin-bottom: 15px;
}

.vision-item p {
    font-size: 1.1em;
    color: #555;
    line-height: 1.8;
    margin: 0;
}

/* ================================== */
/* Community Section Styles     */
/* ================================== */
.community-section {
    background-color: #f0f0f0;
    text-align: center;
}

.community-section h2 {
    font-size: 2.5em;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.community-subtitle {
    font-size: 1.2em;
    color: #555;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 50px auto;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.community-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border-radius: 10px;
    text-decoration: none;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 250px;
}

.community-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.community-card.naver { background-color: #00c73c; }
.community-card.discord { background-color: #7289d9; }
.community-card.twitter { background-color: #1a1a1a; }

.community-card img {
    height: 60px;
    margin-bottom: 20px;
}

.community-card h3 {
    font-size: 1.8em;
    margin: 0 0 10px 0;
}

.community-card p {
    font-size: 1em;
    line-height: 1.6;
    margin: 0;
    opacity: 0.9;
}


/* ================================== */
/* Contact Section Styles       */
/* ================================== */
.contact-section {
    background-color: #ffffff;
    text-align: center;
}

.contact-section h2,
.contact-subtitle {
    color: #1a1a1a;
}

.contact-subtitle {
    margin-bottom: 50px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    text-align: left;
}

.contact-info h3 {
    font-size: 1.8em;
    color: #1a1a1a;
    margin-top: 0;
    margin-bottom: 15px;
}

.contact-info p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 30px;
}

.info-item {
    margin-bottom: 20px;
}

.info-item h4 {
    margin: 0 0 5px 0;
    color: #1a1a1a;
}

.info-item a {
    color: #ff4757;
    text-decoration: none;
    font-weight: bold;
}

.info-item a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
}

.submit-button {
    display: inline-block;
    background-color: #ff4757;
    color: #fff;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
}

.submit-button:hover {
    background-color: #e63946;
}

/* 성공 메시지 스타일 */
.success-message {
    margin-top: 20px;
    padding: 20px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    color: #155724;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.success-message.show {
    opacity: 1;
    transform: translateY(0);
}

.success-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.success-icon {
    font-size: 1.5em;
    font-weight: bold;
    color: #28a745;
}

.success-message p {
    margin: 0;
    font-weight: 500;
}

/* 로딩 버튼 스타일 */
.submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.submit-button.loading {
    position: relative;
    color: transparent;
}

.submit-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}


/* ================================== */
/* Responsive Styles            */
/* ================================== */

/* 중간 크기 화면 (1100px) - 로고 크기 조정 시작 */
@media (max-width: 1100px) {
    .header-logo {
        height: 90px;
    }
    
    .desktop-nav ul li a {
        padding: 0 25px;
        font-size: 1.4em;
    }
}

/* 태블릿 가로 (992px) */
@media (max-width: 992px) {
    .games-grid,
    .vision-grid,
    .community-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero-content h1 {
        font-size: 3em;
    }

    .desktop-nav ul li a {
        padding: 0 20px;
        font-size: 1.3em;
    }

    .header-logo {
        height: 80px;
    }
}

/* 중간 태블릿 크기 (870px) - 로고 더 작게 */
@media (max-width: 870px) {
    .header-logo {
        height: 70px;
    }
    
    .desktop-nav ul li a {
        padding: 0 15px;
        font-size: 1.2em;
    }
}

/* 태블릿 세로/모바일 가로 (768px) */
@media (max-width: 768px) {
    /* 모바일에서 햄버거 메뉴 표시 */
    .mobile-menu-btn {
        display: block;
    }
    
    .desktop-nav {
        display: none;
    }

    /* 헤더 조정 */
    .header-container {
        padding: 0 15px;
        min-height: 80px;
    }

    .header-logo {
        height: 70px;
    }

    /* 히어로 섹션 모바일 최적화 */
    .hero-content {
        padding: 15px;
    }

    .hero-content h1 {
        font-size: 2.5em;
        margin-bottom: 20px;
    }

    .studio-logo {
        width: 120px;
    }

    .download-section {
        margin-top: 5vh;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .wishlist-button,
    .appstore-button {
        padding: 12px 25px;
        font-size: 1.1em;
        width: 200px;
        text-align: center;
    }

    /* 섹션 패딩 조정 */
    .page-section {
        padding: 60px 0;
    }

    .container {
        padding: 0 15px;
    }

    /* Games 섹션 */
    .featured-games h2 {
        font-size: 2em;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* About 섹션 */
    .about-intro h2 {
        font-size: 2em;
    }

    .vision-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        margin-top: 40px;
    }

    .vision-item {
        padding: 25px;
    }

    /* Community 섹션 */
    .community-section h2 {
        font-size: 2em;
    }

    .community-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .community-card {
        padding: 30px 20px;
        min-height: 200px;
    }

    /* Contact 섹션 */
    .contact-section h2 {
        font-size: 2em;
    }

    /* 비디오 배경 모바일 최적화 */
    .video-background iframe {
        width: 100%;
        height: 100%;
        min-width: 100%;
        min-height: 100%;
        left: 0;
        transform: none;
    }
}

/* 모바일 세로 (480px) */
@media (max-width: 480px) {
    .header-logo {
        height: 60px;
    }

    .hero-content h1 {
        font-size: 1.8em;
        line-height: 1.3;
    }

    .studio-logo {
        width: 100px;
    }

    .download-text {
        font-size: 1.3em;
    }

    .wishlist-button,
    .appstore-button {
        padding: 10px 20px;
        font-size: 1em;
        width: 180px;
    }

    .page-section {
        padding: 40px 0;
    }

    .container {
        padding: 0 10px;
    }

    .featured-games h2,
    .about-intro h2,
    .community-section h2,
    .contact-section h2 {
        font-size: 1.8em;
    }

    .card-content {
        padding: 15px;
    }

    .card-content h3 {
        font-size: 1.3em;
    }

    .vision-item {
        padding: 20px;
    }

    .vision-item h3 {
        font-size: 1.5em;
    }

    .community-card {
        padding: 25px 15px;
        min-height: 180px;
    }

    .community-card h3 {
        font-size: 1.5em;
    }

    .form-group input,
    .form-group textarea {
        padding: 10px;
    }

    .submit-button {
        padding: 12px 25px;
        font-size: 1em;
    }

    /* 모바일 네비게이션 조정 */
    .mobile-nav {
        width: 90%;
        max-width: none;
    }

    .mobile-nav ul li a {
        padding: 15px 20px;
        font-size: 1.2em;
    }
}

/* 매우 작은 화면 (360px) */
@media (max-width: 360px) {
    .hero-content h1 {
        font-size: 1.5em;
    }

    .wishlist-button,
    .appstore-button {
        width: 160px;
        font-size: 0.9em;
    }

    .container {
        padding: 0 8px;
    }
}

/* ================================== */
/* Game Modal Styles                */
/* ================================== */

/* 모바일 브라우저 하단 네비게이션 바 높이 변수 */
:root {
    --mobile-nav-height: 60px; /* Android 브라우저 하단 네비게이션 바 예상 높이 */
}

.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-modal.active {
    opacity: 1;
}

/* 모달이 열렸을 때 body 스크롤 방지 */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: touch; /* iOS에서 부드러운 스크롤 */
}

/* 모바일에서 추가 스크롤 방지 */
@media (max-width: 768px) {
    body.modal-open {
        touch-action: none; /* 터치 스크롤 완전 방지로 되돌림 */
        overflow: hidden; /* 확실한 스크롤 방지 */
    }
    
    .game-modal {
        touch-action: auto; /* 모달 내부에서만 터치 허용 */
    }
    
    .modal-mobile {
        touch-action: pan-y; /* 수직 스크롤만 허용 */
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    /* 모바일 safe area 고려 */
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

    .modal-content {
        background: white;
        border-radius: 12px;
        max-width: 1200px;
        max-height: 90vh;
        width: 100%;
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        transform: scale(0.9);
        transition: transform 0.3s ease;
    }
    
    /* 모바일에서는 높이 제한 제거 */
    @media (max-width: 768px) {
        .modal-content {
            max-height: none; /* 높이 제한 제거 */
            height: auto; /* 내용에 따라 자동 조정 */
            min-height: calc(var(--vh, 1vh) * 100 - env(safe-area-inset-top) - max(var(--mobile-nav-height), env(safe-area-inset-bottom)));
            border-radius: 0;
            margin-bottom: 0; /* 마진 제거 */
        }
    }.game-modal.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1; /* 텍스트 중앙 정렬을 위한 line-height */
    font-family: Arial, sans-serif; /* 일관된 폰트 */
}

.modal-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: rotate(90deg);
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 1200px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Desktop Layout */
.modal-desktop {
    display: flex;
    height: 80vh;
    min-height: 600px;
}

.modal-mobile {
    display: none;
}

.modal-gallery {
    flex: 1;
    background: #000;
    position: relative;
    overflow: hidden; /* 미디어가 넘어가지 않도록 제한 */
}

.modal-info {
    flex: 0 0 400px;
    padding: 40px;
    overflow-y: auto; /* PC에서는 설명 구역만 스크롤 */
    background: #fff;
    border-left: 1px solid #e0e0e0; /* 구분선 추가 */
    -webkit-overflow-scrolling: touch; /* 부드러운 스크롤 */
    max-height: 100%; /* 모달 높이 내에서만 스크롤 */
}

.gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden; /* 갤러리 콘텐츠가 넘어가지 않도록 제한 */
}

.gallery-slides {
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.3s ease;
    /* overflow: hidden 제거 - 슬라이드가 보이도록 함 */
}

.gallery-slide {
    min-width: 100%;
    width: 100%; /* 명시적 width 추가 */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    flex-shrink: 0; /* 슬라이드 축소 방지 */
}

.gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-slide iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
    left: 20px;
}

.gallery-nav.next {
    right: 20px;
}

.gallery-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.gallery-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-indicator.active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.2);
}

.game-title {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.game-tags {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.game-description {
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #333;
    font-weight: 500;
}

.game-details {
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 30px;
    color: #555;
}

.game-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-link {
    display: inline-block;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

.game-link:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.game-link.disabled {
    background: #ccc;
    cursor: not-allowed;
}

.game-link.disabled:hover {
    background: #ccc;
    transform: none;
}

/* Mobile Layout */
@media (max-width: 768px) {
    .modal-container {
        padding: 0;
        /* 모바일에서 safe area만 고려 */
        padding-top: env(safe-area-inset-top);
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        /* iOS Safari 뷰포트 대응 */
        height: 100vh;
        height: -webkit-fill-available;
        /* 추가 하단 여백으로 브라우저 네비게이션 바 회피 */
        box-sizing: border-box;
    }
    
    .modal-desktop {
        display: none;
    }
    
    .modal-mobile {
        display: flex;
        flex-direction: column;
        height: 100vh; /* 고정 높이로 되돌림 */
        height: calc(var(--vh, 1vh) * 100);
        overflow-y: auto; /* 모바일에서는 전체 모달이 스크롤 */
        -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
    }
    
    .modal-gallery-mobile {
        flex: 0 0 auto; /* 고정 크기 */
        height: 40vh; /* 화면 높이의 40%로 줄임 */
        height: calc(var(--vh, 1vh) * 40);
        background: #000;
        position: relative;
        overflow: hidden;
    }
    
    .modal-info-mobile {
        flex: 0 0 auto; /* 내용 크기에 맞게 자동 조정 */
        min-height: 60vh; /* 최소 높이를 크게 설정 */
        padding: 30px 20px; /* 상단 패딩 증가 */
        padding-bottom: 150px; /* 하단 패딩을 고정값으로 크게 설정 */
        background: #fff;
        border-top: 1px solid #e0e0e0;
        /* 모바일에서는 내부 스크롤 제거 */
        overflow-y: visible;
        box-sizing: border-box;
    }
    
    .modal-close {
        position: fixed; /* 모바일에서 스크롤과 무관하게 고정 */
        top: max(10px, env(safe-area-inset-top, 10px));
        right: max(10px, env(safe-area-inset-right, 10px));
        width: 35px;
        height: 35px;
        font-size: 20px;
        z-index: 10002; /* 모달 내용보다 위에 표시 */
        line-height: 1; /* 모바일에서도 텍스트 중앙 정렬 */
    }
    
    /* PC에서는 닫기 버튼을 absolute로 */
    @media (min-width: 769px) {
        .modal-close {
            position: absolute;
            z-index: 10001;
        }
    }
    
    .game-title {
        font-size: 1.8em;
        margin-bottom: 12px; /* 간격 증가 */
    }
    
    .game-tags {
        font-size: 1em;
        margin-bottom: 20px; /* 간격 증가 */
    }
    
    .game-description {
        font-size: 1.1em;
        line-height: 1.6; /* 줄간격 증가 */
        margin-bottom: 25px; /* 간격 증가 */
    }
    
    .game-details {
        font-size: 0.95em; /* 크기 약간 증가 */
        line-height: 1.7; /* 줄간격 증가 */
        margin-bottom: 25px; /* 간격 증가 */
    }
    
    .game-links {
        gap: 15px; /* 링크 간격 증가 */
        margin-bottom: 50px; /* 모바일에서 하단 여백 추가 */
    }
    
    .game-link {
        padding: 12px 20px; /* 패딩 증가 */
        font-size: 0.95em; /* 크기 약간 증가 */
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .gallery-nav.prev {
        left: 10px;
    }
    
    .gallery-nav.next {
        right: 10px;
    }
    
    .gallery-indicators {
        bottom: 10px;
    }
    
    .gallery-indicator {
        width: 10px;
        height: 10px;
    }
}