/* 1. 디자인 시스템 변수 선언 (나중에 여기서 색만 바꾸면 다 바뀝니다) */
:root {
    --bg-dark: #0f0f12;       /* 메인 배경: 아주 진한 남색 계열 블랙 */
    --bg-card: #1a1a20;       /* 카드 배경 */
    --primary: #6c5ce7;       /* 메인 컬러: 네온 퍼플 */
    --primary-hover: #5649c0;
    --accent: #00cec9;        /* 강조 컬러: 민트 */
    --text-white: #ffffff;
    --text-gray: #a4b0be;
    --gradient-hero: linear-gradient(135deg, #1e1e24 0%, #000000 100%);
    --card-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* 2. 초기화 및 기본 폰트 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }

/* 3. 헤더 (글래스모피즘 효과 적용) */
header {
    background: rgba(15, 15, 18, 0.85); /* 반투명 배경 */
    backdrop-filter: blur(10px);        /* 블러 효과 */
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
}
.logo span { color: var(--primary); }

.pc-nav a {
    margin-left: 30px;
    font-weight: 500;
    color: var(--text-gray);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
}
.pc-nav a:hover, .pc-nav a.active { color: var(--accent); }

/* 모바일 메뉴 스타일 */
.mobile-menu-btn { display: none; font-size: 1.5rem; cursor: pointer; }
.mobile-nav {
    display: none;
    background: var(--bg-card);
    padding: 20px;
    border-top: 1px solid #333;
}
.mobile-nav.active { display: block; } /* 자바스크립트로 토글됨 */
.mobile-nav a { display: block; padding: 10px 0; border-bottom: 1px solid #333; }

/* 4. 히어로 섹션 (메인 배너) */
.hero {
    background: var(--gradient-hero);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 100px 20px;
}
/* 배경 네온 빛 효과 */
.hero-bg-glow {
    position: absolute;
    width: 300px; height: 300px;
    background: var(--primary);
    filter: blur(150px);
    opacity: 0.2;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; }

.badge {
    background: rgba(108, 92, 231, 0.2);
    color: var(--accent);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid var(--primary);
    margin-bottom: 20px;
    display: inline-block;
}

.hero h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
}
.hero h1 span {
    background: linear-gradient(to right, #fff, #a4b0be);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}
.hero p { color: var(--text-gray); font-size: 1.2rem; margin-bottom: 40px; }

.hero-btns { display: flex; gap: 15px; justify-content: center; }
.btn {
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 700;
    font-family: 'Rajdhani', sans-serif;
    letter-spacing: 1px;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); }
.btn-outline {
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
}
.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.05); }

/* 5. 게임 리스트 (고급 카드형) */
.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.5rem; font-family: 'Rajdhani', sans-serif; }
.section-header h2 span { color: var(--primary); }
.section-header p { color: var(--text-gray); margin-top: 10px; }

.game-grid {
    display: grid;
    /* 반응형 핵심: 화면 크기에 따라 자동 배치 */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
}

.card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
    position: relative;
}
.card:hover {
    transform: translateY(-10px); /* 붕 뜨는 효과 */
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
    border-color: var(--primary);
}

.card-thumb {
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
/* 카드 아이콘 효과 */
.card-icon { font-size: 3rem; color: rgba(255,255,255,0.8); z-index: 1; transition: 0.3s; }
.card:hover .card-icon { transform: scale(1.1); color: white; }

.tag {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(0,0,0,0.6);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--accent);
}

.card-body { padding: 25px; }
.card h3 { font-size: 1.2rem; margin-bottom: 5px; }
.card p { color: var(--text-gray); font-size: 0.9rem; margin-bottom: 15px; }

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-gray);
  margin-bottom: 0 !important;
    border-bottom: none !important;
   padding-bottom: 0 !important;
}
.card-meta i { color: var(--primary); margin-right: 5px; }

.btn-play {
    display: block;
    width: 100%;
    text-align: center;
    background: #2d2d35;
    padding: 10px 0;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}
.btn-play:hover { background: var(--primary); }

/* 6. 푸터 */
footer {
    background: #0a0a0c;
    padding: 50px 0;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: var(--text-gray);
}





/* 새로 추가된 버튼 그룹 스타일 */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-play {
    flex: 1; /* 남은 공간 다 차지 */
    text-align: center;
    background: #2d2d35;
    padding: 10px 0;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-play:hover { background: var(--primary); border-color: var(--primary); }

/* 공유 버튼 스타일 */
.btn-share {
    width: 40px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: var(--text-gray);
    cursor: pointer;
    transition: 0.3s;
}
.btn-share:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 206, 201, 0.1);
}

/* 좋아요 버튼 스타일 */
.like-btn {
    cursor: pointer;
    transition: 0.2s;
}
.like-btn:hover { color: #ff7675; } /* 마우스 올리면 분홍색 */

.like-btn.active { color: #ff6b6b; font-weight: bold; } /* 클릭하면 빨간색 */
.like-btn.active i { transform: scale(1.2); } /* 클릭 시 하트 커짐 */


/* 1. 모달 배경 (화면 전체를 덮고, 내용을 가운데 정렬) */
.modal-overlay {
    display: none; /* 평소에는 숨김 */
    position: fixed; /* 화면에 딱 고정 (스크롤해도 따라다님) */
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* 배경을 어둡게 */
    z-index: 9999; /* 제일 위에 뜨도록 */
    
    /* 내용물(게임기)을 정중앙에 놓는 마법의 코드 */
    justify-content: center;
    align-items: center;
}

/* 2. 자바스크립트가 'active' 클래스를 붙이면 나타남 */
.modal-overlay.active {
    display: flex; /* flex로 바뀌면서 중앙 정렬이 작동함 */
}

/* 3. 스마트폰 모양 프레임 디자인 */
.mobile-frame {
   
    aspect-ratio: 10 / 18.5; /* 최신 스마트폰 비율에 가까움 */
    width: auto; /* 비율에 맡김 */
    height: 80vh;     /* 화면 높이의 80% */
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.5); /* 보라색 네온 효과 */
    display: flex;
    flex-direction: column;
}

/* --- 모달 상단 헤더 디자인 (White Text/Icon) --- */
.frame-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    padding: 0 15px;
    
    /* 배경은 투명하게 설정 */
    background: transparent !important; 
    
    /* 위치는 게임 화면 위에 겹치도록 */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    box-sizing: border-box;
}

/* 제목 스타일 (정중앙) */
#modal-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #191919; /* 블랙 텍스트 */
    text-shadow: 0 0 10px rgba(255,255,255,0.8); /* 밝은 배경/어두운 배경 모두 대응 */
}

/* 좌우 버튼 디자인 */
.header-btn, .close-btn {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: #333333; /* 블랙 아이콘 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 10px;
}

/* 닫기 버튼 전용 (X버튼 아이디나 클래스가 다를 수 있어 추가) */
.close-btn {
    color: #333333;
    font-weight: bold;
}


/* --- 카테고리 필터 버튼 --- */
/* main.css에 추가 */
.category-filters {
    display: flex;
    justify-content: space-between; /* 왼쪽 그룹과 오른쪽 그룹을 양끝으로 */
    align-items: center;
    flex-wrap: wrap; /* 화면 작으면 줄바꿈 */
    margin-bottom: 30px;
    gap: 15px;
}

/* 왼쪽 필터 버튼 그룹 */
.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 오른쪽 정렬 그룹 */
.sort-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #888;
}

/* 필터 버튼 (기본) */
.filter-btn {
    padding: 8px 16px;
    border: 1px solid #444;
    background: #222;
    color: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn:hover {
    border-color: #6C5DD3;
}

/* 필터 버튼 (활성화) */
.filter-btn.active {
    background: #6C5DD3;
    border-color: #6C5DD3;
    font-weight: bold;
}

/* 정렬 버튼 (텍스트 형태) */
.sort-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
}

.sort-btn.active {
    color: #fff;
    font-weight: bold;
    text-decoration: underline;
}

.divider {
    color: #444;
    margin-bottom: 2px;
}

/* --- 네이티브 광고 카드 디자인 --- */
.card.ad-card {
    border: 2px solid #ffd700; /* 황금색 테두리 */
    background: linear-gradient(135deg, #2d3436 0%, #1a1a1a 100%);
    position: relative;
}

.card.ad-card .tag {
    background: #ffd700;
    color: #000;
    font-weight: 800;
}

.card.ad-card h3 {
    color: #ffd700; /* 제목도 황금색 */
}

/* 광고 버튼 */
.btn-ad {
    width: 100%;
    padding: 12px;
    background: #ffd700;
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-ad:hover {
    background: #ffeb3b;
}



/* 1. 기본 상태 (PC 화면): 모바일용 버튼 숨기기 */
.mobile-overlay-btns {
    display: none; /* PC에서는 안 보임 */
}

/* 2. 모바일용 버튼 디자인 미리 정의 (숨겨져 있다가 모바일에서 짠! 하고 나옴) */
.mobile-overlay-btns {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    gap: 8px;
    align-items: center;
    z-index: 10;
}

.btn-play-overlay {
    flex: 1;
    background: #fff;
    color: #000;
    border: none;
    padding: 8px 0;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}

.btn-share-overlay {
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}



/* =========================================
   [PC 공유 알림] 카드 오버레이 토스트 메시지
   ========================================= */

.copy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* 진한 반투명 검정 */
    border-radius: 12px; /* 카드 둥글기와 맞춤 */
    z-index: 50; /* 버튼들보다 위에 */
    
    /* 내용물 정중앙 배치 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    /* 애니메이션 효과 */
    opacity: 0;
    pointer-events: none; /* 안 보일 땐 클릭 통과 */
    transition: opacity 0.3s ease;
}

.copy-overlay.active {
    opacity: 1;
    pointer-events: all; /* 보일 땐 클릭 막음 */
}

/* 알림창 내부 아이콘과 글자 */
.copy-overlay i {
    font-size: 2.5rem;
    color: #00b894; /* 민트색 체크 */
    margin-bottom: 10px;
    transform: scale(0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.copy-overlay.active i {
    transform: scale(1); /* 뿅! 하고 커지는 효과 */
}

.copy-overlay span {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Noto Sans KR', sans-serif;
}





//* =========================================
   [신규] 랭킹 결과 모달 디자인 (여기서부터 끝까지 복사)
   ========================================= */

/* 모달 배경 (어두운 반투명) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none; /* 평소엔 숨김 */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* 하얀색 카드 박스 */
.ranking-card {
    background: white;
    width: 90%;
    max-width: 360px;
    padding: 30px 25px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 쫀득한 애니메이션 */
    position: relative;
}

@keyframes slideUp {
    from { transform: translateY(50px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* 텍스트 스타일 */
.rank-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #2d3436;
    margin: 0 0 5px 0;
    letter-spacing: -1px;
}

.rank-subtitle {
    font-size: 1rem;
    color: #636e72;
    margin-bottom: 20px;
}

/* 점수 강조 박스 */
.score-box {
    margin: 20px 0;
    padding: 15px;
    background: #f1f2f6;
    border-radius: 15px;
    border: 2px solid #dfe6e9;
}

.highlight-score {
    font-size: 2.5rem;
    font-weight: 800;
    color: #00b894; /* 민트색 포인트 */
    line-height: 1;
    margin-right: 5px;
}

.unit {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3436;
}

.event-text {
    font-size: 0.95rem;
    color: #2d3436;
    line-height: 1.5;
    margin-bottom: 20px;
    word-break: keep-all;
}

.highlight {
    color: #d63031;
    font-weight: bold;
    background: rgba(214, 48, 49, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 버튼 및 입력창 */
.btn-group-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rank-input {
    width: 100%;
    padding: 14px;
    margin-bottom: 10px;
    border: 2px solid #dfe6e9;
    border-radius: 12px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.rank-input:focus {
    border-color: #00b894;
    outline: none;
}

.btn-primary-rank {
    width: 100%;
    padding: 16px;
    background: #00b894;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 0 #009174; /* 입체감 */
    transition: all 0.1s;
}

.btn-primary-rank:active { 
    transform: translateY(4px); 
    box-shadow: none; 
}

.btn-secondary-rank {
    width: 100%;
    padding: 15px;
    background: #f1f2f6;
    color: #636e72;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.btn-text-only {
    background: none;
    border: none;
    color: #b2bec3;
    font-size: 0.85rem;
    margin-top: 15px;
    cursor: pointer;
    text-decoration: underline;
}




/* =========================================
   [신규] 게임 실행 시 슬라이드 애니메이션 (오른쪽 -> 왼쪽)
   ========================================= */

/* 1. 모달 배경 (어두운 뒷배경)은 부드럽게 페이드 인 */
#game-modal.active {
    display: flex !important; /* JS에서 active 클래스를 붙이면 나타남 */
    animation: fadeInBg 0.4s ease-out forwards;
}

/* 2. 게임 창(내용물)은 오른쪽에서 슬라이드 되어 들어옴 */
/* 주의: index.html에서 iframe을 감싸고 있는 div의 클래스나 ID를 확인하세요.
   보통 .modal-container 또는 .game-wrapper 같은 이름일 겁니다. 
   여기서는 #game-modal 바로 아래 자식 div를 타겟팅합니다. */
#game-modal.active > div {
    transform: translateX(100%); /* 처음엔 오른쪽 화면 밖에 숨어있음 */
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; /* 0.5초 동안 쫀득하게 들어옴 */
}

/* --- 애니메이션 키프레임 정의 --- */

@keyframes fadeInBg {
    from { background-color: rgba(0, 0, 0, 0); backdrop-filter: blur(0px); }
    to { background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.95); /* 오른쪽 + 약간 작게 시작 */
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1); /* 제자리 + 원래 크기 */
    }
}


/* 1. 모달 배경 (어두운 뒷배경)은 부드럽게 페이드 인 */
#game-modal.active {
    display: flex !important; /* JS에서 active 클래스를 붙이면 나타남 */
    animation: fadeInBg 0.4s ease-out forwards;
}

/* 2. 게임 창(내용물)은 오른쪽에서 슬라이드 되어 들어옴 */
/* 주의: index.html에서 iframe을 감싸고 있는 div의 클래스나 ID를 확인하세요.
   보통 .modal-container 또는 .game-wrapper 같은 이름일 겁니다. 
   여기서는 #game-modal 바로 아래 자식 div를 타겟팅합니다. */
#game-modal.active > div {
    transform: translateX(100%); /* 처음엔 오른쪽 화면 밖에 숨어있음 */
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; /* 0.5초 동안 쫀득하게 들어옴 */
}

/* --- 애니메이션 키프레임 정의 --- */

@keyframes fadeInBg {
    from { background-color: rgba(0, 0, 0, 0); backdrop-filter: blur(0px); }
    to { background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(100%) scale(0.95); /* 오른쪽 + 약간 작게 시작 */
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1); /* 제자리 + 원래 크기 */
    }
}



/* =========================================
   [통일됨] 여는 속도 & 닫는 속도 동일하게 (0.5초)
   ========================================= */

/* 1. 여는 애니메이션 (0.5s) */
#game-modal.active > div {
    /* 0.5초 동안 부드럽게 들어옵니다 */
    animation: slideInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 2. 닫는 애니메이션 (0.5s) */
#game-modal.closing > div {
    /* 0.5초 동안 부드럽게 나갑니다 */
    animation: slideOutRight 0.5s ease-in forwards;
}


/* --- 퇴장 애니메이션 키프레임 수정 --- */
@keyframes fadeOutBg {
    from { background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); }
    to { background-color: rgba(0, 0, 0, 0); backdrop-filter: blur(0px); }
}

/* ▼▼▼ 여기가 수정된 핵심 부분입니다 ▼▼▼ */
@keyframes slideOutRight {
    0% {
        /* 현재 위치 (가운데) */
        transform: translateX(0);
    }
    100% {
        /* 화면 오른쪽 밖으로 100% 이동 */
        transform: translateX(100%);
    }
}


/* 메인 포털: 게임을 감싸는 프레임의 헤더 삭제 */
.frame-header {
    /*display: none !important;*/
}

/* 헤더가 사라진 만큼 게임 화면(iframe)을 위로 밀착 */
#game-frame {
    height: 100% !important;
}



/* 7. 반응형 모바일  미디어 쿼리 */
@media (max-width: 768px) {
    .pc-nav { display: none; } /* 모바일에서 PC메뉴 숨김 */
    .mobile-menu-btn { display: block; } /* 햄버거 버튼 표시 */
    .hero h1 { font-size: 2.5rem; }
    .hero-btns { flex-direction: column; }
    .btn { width: 100%; }
    /* 화면이 좁을 때(모바일)는 꽉 채우기 */

.pc-btns {
        display: none !important;
    }

    /* 2. 모바일용 오버레이 버튼 보여주기 (핵심!) */
    .mobile-overlay-btns {
        display: flex !important;
    }


    .container {
        max-width: 1200px;
        margin: 0px auto;
        padding: 20px 20px;
    }

  .category-filters {
        /* 가로 스크롤 기능 활성화 */
        display: flex;             /* flex로 변경 (중요!) */
        flex-wrap: nowrap;         /* 줄바꿈 금지 */
        overflow-x: auto;          /* 옆으로 스크롤 가능 */
        
        /* 스크롤바 숨기기 (파이어폭스, IE, 구형 엣지용) */
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;     /* Firefox */
        
        /* 디자인 다듬기 */
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch; /* 아이폰 부드러운 스크롤 */
        padding-bottom: 5px; 
        gap: 8px;
        
        /* 화면 꽉 차게 */
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* 스크롤바 숨기기 (크롬, 사파리, 오페라용) */
    .category-filters::-webkit-scrollbar {
        display: none;
    }

    /* 버튼 찌그러짐 방지 */
    .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }


    .mobile-frame {
        width: 100% !important;
        height: 100vh !important;
        max-width: none !important;
        border-radius: 0 !important;
    }

   
    .card-thumb {
        height: auto; /* 고정 높이 해제 */
        aspect-ratio: 4 / 3; /* 가로 4 : 세로 3 비율 유지 (PC와 가장 비슷함) */
        
        /* 아이콘 위치 다시 중앙으로 */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }


    /* 1. 한 줄에 3개 강제 배치 */
    .game-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 3등분 */
        gap: 10px; /* 카드 사이 간격 좁히기 */
        padding: 10px; /* 전체 여백 줄이기 */
    }

    .card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 10px;
    }

    /* 11. 모바일에서 터치 시 움직임(호버 효과) 끄기 */
    /* 11. (수정됨) 모바일 터치 피드백: 움직임은 끄고, 테두리만 켜기 */
    .card:active, .card:focus {
        /* 1. 움직임 및 확대 방지 (돌부처 모드) */
        transform: none !important; 
        box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important; /* 기본 그림자 유지 */
        background: #2d3436 !important; 
        
        /* 2. ★ 핵심: 보라색 테두리(스트로크)만 강제로 적용 */
        border: 1px solid var(--primary) !important; 
    }

    /* (참고) 모바일에서 :hover는 손가락 뗀 후에도 남을 수 있어서 
       보통 :active(누르는 순간) 위주로 적용하지만, 
       원하시면 아래 hover도 같이 두셔도 됩니다. */
    .card:hover {
        transform: none !important; 
        border: 1px solid var(--primary) !important; /* 호버시에도 테두리 */
    }

    /* 3. 내부 요소(아이콘, 썸네일) 커지는 것 방지 */
    .card:hover .card-thumb,
    .card:active .card-thumb,
    .card:hover .card-icon,
    .card:active .card-icon {
        transform: none !important; /* 위치 이동 금지 */
        scale: 1 !important;        /* 크기 확대 금지 (1배율 고정) */
    }

    /* 광고 카드(노란색)는 노란 테두리 유지 */
    .card.ad-card {
        border: 2px solid #ffd700 !important;
    }


    /* 2. 카드 내부 여백 다이어트 */
    .card-body {
        padding: 12px 10px !important;
    }

    /* 3. 제목 글자 크기 줄이기 */
    .card h3 {
        font-size: 0.8rem; /* 글자 작게 */
        margin-bottom: 5px;
        white-space: nowrap; /* 줄바꿈 방지 */
        overflow: hidden;
        text-overflow: ellipsis; /* 길면 ... 처리 */
    }

    /* 4. 설명글(작은 글씨)은 공간 부족하니 숨기기 */
    .card p {
        font-size: 0.7rem; /* 글자 작게 */
        margin-bottom: 5px !important;
    }

    /* 5. 태그(카테고리) 크기 조절 */
    .tag {
        font-size: 0.6rem;
        padding: 1px 3px;
    }

    /* 6. 아이콘 크기 조절 */
    .card-icon {
        font-size: 2.53rem; /* 아이콘 좀 작게 */
        margin-bottom: 25px;
    }

    /* 7. 버튼 그룹 (PLAY / 공유) 정렬 */
    .btn-group {
        gap: 3px; /* 버튼 사이 간격 좁힘 */
    }

    .btn-play {
        font-size: 0.7rem; /* 버튼 글씨 작게 */
        padding: 5px 0;    /* 패딩 줄임 */
        height: 30px;      /* 높이 고정 */
    }

    .btn-share {
        width: 30px;       /* 정사각형 유지 */
        height: 30px;
        font-size: 0.8rem;
    }
    
    /* 8. 좋아요/조회수 아이콘 숨기기 (너무 좁아서) */
    /* 필요하면 이 부분은 지우세요 */
    

    

}




