/* ====================================
   웹게임 프로토타입 - 푸른색 테마
   ==================================== */

/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0EA5E9;
    --primary-light: #38BDF8;
    --primary-dark: #0284C7;
    --text-emphasis: #0C4A6E;
    --background-gradient-start: #EFF6FF;
    --background-gradient-end: #DBEAFE;
    --card-background: #FFFFFF;
    --text-primary: #0C4A6E;
    --text-secondary: #475569;
    --shadow-color: rgba(14, 165, 233, 0.15);
    --shadow-hover: rgba(14, 165, 233, 0.25);

    --secondary-color: #059669;
    --secondary-light: #10b981;
    --secondary-dark: #047857;
    --secondary-shadow: rgba(5, 150, 105, 0.15);
    --secondary-hover-shadow: rgba(5, 150, 105, 0.25);

    --tertiary-color: #F97316;
    --tertiary-light: #FB923C;
    --tertiary-dark: #EA6C0A;
    --tertiary-shadow: rgba(249, 115, 22, 0.15);
    --tertiary-hover-shadow: rgba(249, 115, 22, 0.25);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--background-gradient-start) 0%, var(--background-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 컨테이너 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ====================================
   헤더
   ==================================== */
.header {
    text-align: center;
    margin-bottom: 1.25rem;
    animation: fadeInDown 0.8s ease-out;
}

.title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-emphasis);
    margin-bottom: 0.3rem;
    text-shadow: 2px 2px 4px rgba(14, 165, 233, 0.1);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.pc-notice {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 0.35rem 1.2rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 500;
    box-shadow: 0 4px 12px var(--shadow-color);
    margin-top: 0.5rem;
}

/* ====================================
   검색 바 및 컨트롤 컨테이너
   ==================================== */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    animation: fadeIn 0.8s ease-out;
}

.tools-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.search-bar {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: min(100%, 360px);
}

.search-combo {
    display: flex;
    align-items: stretch;
    flex: 1;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    border: 2px solid var(--primary-light);
    background: white;
    transition: all 0.3s ease;
}

.search-combo:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.search-scope {
    display: flex;
    flex-shrink: 0;
    border-right: 1px solid var(--primary-light);
}

.search-scope-btn {
    padding: 0.5rem 0.7rem;
    border: none;
    border-right: 1px solid rgba(56, 189, 248, 0.3);
    background: rgba(14, 165, 233, 0.04);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.search-scope-btn:last-child {
    border-right: none;
}

.search-scope-btn:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary-dark);
}

.search-scope-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.search-input-wrap {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.5rem 2.8rem 0.5rem 2rem;
    border: none;
    border-radius: 0;
    font-size: 0.9rem;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #a0aec0;
}

/* 검색 버튼 */
.search-btn {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
    flex-shrink: 0;
}
.search-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

/* X 버튼은 검색 버튼 왼쪽에 배치 */
.search-clear {
    position: absolute;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #a0aec0;
    font-size: 0.85rem;
    padding: 0.2rem;
    display: none;
    transition: color 0.2s;
    align-items: center;
}
.search-clear:hover {
    color: var(--primary-color);
}

/* 검색 결과 없음 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    animation: fadeIn 0.4s ease;
}

.no-results i {
    display: block;
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* ====================================
   장르 필터 탭 관련 스타일
   ==================================== */

.sort-select {
    background: white;
    border: 2px solid var(--primary-light);
    color: var(--primary-color);
    padding: 0.45rem 2rem 0.45rem 0.85rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
    box-shadow: 0 2px 8px var(--shadow-color);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%230EA5E9' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 01.753 1.659l-4.796 5.48a1 1 0 01-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 12px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
}

.sort-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--shadow-hover);
    transform: translateY(-2px);
}

.sort-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.genre-tabs-wrap {
    background: rgba(14, 165, 233, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 16px;
    padding: 0.6rem 1rem;
}

.genre-tabs {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.genre-tab {
    background: white;
    border: 1.5px solid var(--primary-light);
    color: var(--primary-color);
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 1px 4px var(--shadow-color);
    font-family: 'Noto Sans KR', sans-serif;
}

.genre-tab i {
    font-size: 0.95rem;
}

.genre-tab:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.genre-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

/* WebGL 탭 관련 스타일 */
.genre-tab.webgl-tab {
    border-color: var(--secondary-light);
    color: var(--secondary-color);
}

.genre-tab.webgl-tab:hover {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 3px 10px var(--secondary-hover-shadow);
}

.genre-tab.webgl-tab.active {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px var(--secondary-hover-shadow);
}

/* Sites 탭 관련 스타일 */
.genre-tab.interactive-tab {
    border-color: var(--tertiary-light);
    color: var(--tertiary-color);
}

.genre-tab.interactive-tab:hover {
    background: var(--tertiary-color);
    color: white;
    box-shadow: 0 3px 10px var(--tertiary-hover-shadow);
}

.genre-tab.interactive-tab.active {
    background: linear-gradient(135deg, var(--tertiary-color), var(--tertiary-light));
    color: white;
    border-color: var(--tertiary-color);
    box-shadow: 0 4px 12px var(--tertiary-hover-shadow);
}



/* ====================================
   줌 컨트롤 (그리드 열 개수 조절)
   ==================================== */
.zoom-control {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: white;
    padding: 0.35rem 0.7rem;
    border-radius: 50px;
    border: 2px solid var(--primary-light);
    box-shadow: 0 2px 8px var(--shadow-color);
    color: var(--primary-color);
}

.zoom-control i {
    font-size: 0.85rem;
}

.zoom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    background: var(--background-gradient-end);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s;
}

.zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* ====================================
   게임들 그리드
   ==================================== */
.games-grid {
    display: grid;
    --grid-cols: 5; /* 기본 5열 */
    grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    flex: 1;
    align-content: start;
}

/* 게임 카드 */
.game-card {
    background: var(--card-background);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 8px 24px var(--shadow-color);
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out backwards;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    container-type: inline-size;
}

/* 필터링된 카드 숨김 */
.game-card.hidden {
    display: none;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px var(--shadow-hover);
}

.game-card:hover::before {
    transform: scaleX(1);
}

/* 페이드아웃 상태: 투명해지면서 작아짐 */
.game-card.hiding {
    opacity: 0 !important;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; /* 사라지는 동안 클릭 방지 */
}

/* 페이드인 상태: CSS Keyframe 애니메이션 사용 */
.game-card.showing {
    /* opacity: 0; 여기서 opacity를 주지 않고 animation에 맡깁니다 */
    animation: fadeInScale 0.4s ease-out forwards;
    display: block; /* 강제 표시 */
}

/* 게임 아이콘 */
.game-icon {
    width: clamp(60px, 25px + 12cqw, 64px);
    height: clamp(60px, 25px + 12cqw, 64px);
    margin: 0 auto 1rem;
    padding: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: clamp(1.5rem, 0.5rem + 5cqw, 1.7rem);
    transition: all 0.3s ease;
}

/* 이미지 아이콘: 배경 제거, 테두리만 표시 */
.game-icon:has(img) {
    background: transparent;
    border: 2px solid var(--primary-color);
}

.game-card.webgl-card .game-icon:has(img) {
    background: transparent;
    border: 2px solid var(--secondary-color);
    box-shadow: none;
}

.game-card.interactive-card .game-icon:has(img) {
    background: transparent;
    border: 2px solid var(--tertiary-color);
    box-shadow: none;
}

.game-card:hover .game-icon {
    transform: scale(1.1) rotate(5deg);
}

.game-title {
    font-size: clamp(1rem, 0.6rem + 2.5cqw, 1.25rem);
    font-weight: 600;
    color: var(--text-emphasis);
    margin-bottom: 0.35rem;
}

.game-description {
    color: var(--text-secondary);
    font-size: clamp(0.8rem, 0.5rem + 1.5cqw, 0.95rem);
    margin-bottom: 0.2rem;
}

.game-date {
    color: var(--text-secondary);
    font-size: clamp(0.7rem, 0.4rem + 1.2cqw, 0.85rem);
    opacity: 0.9;
    margin-bottom: 1rem;
    text-align: center;
}

/* 플레이 버튼 */
.play-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: clamp(0.4rem, 0.2rem + 1cqw, 0.6rem) clamp(1.2rem, 0.4rem + 1.2cqw, 1.2rem);
    border-radius: 50px;
    font-size: clamp(0.7rem, 0.4rem + 1.5cqw, 0.88rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    box-shadow: 0 4px 12px var(--shadow-color);
    margin-top: auto;
    width: fit-content;
    align-self: center;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--shadow-hover);
}

.play-btn i {
    transition: transform 0.3s ease;
}

.play-btn:hover i {
    transform: translateX(4px);
}

/* WebGL 카드 관련 스타일 */
.game-card.webgl-card .game-icon {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    box-shadow: 0 8px 24px var(--secondary-shadow);
}

.game-card.webgl-card .play-btn {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    box-shadow: 0 4px 12px var(--secondary-shadow);
}

.game-card.webgl-card .play-btn:hover {
    box-shadow: 0 6px 16px var(--secondary-hover-shadow);
}

.game-card.webgl-card::before {
    background: linear-gradient(90deg, var(--secondary-color), var(--secondary-light));
}

.game-card.webgl-card:hover {
    box-shadow: 0 12px 32px var(--secondary-hover-shadow);
}

/* Sites 카드 관련 스타일 */
.game-card.interactive-card .game-icon {
    background: linear-gradient(135deg, var(--tertiary-color), var(--tertiary-light));
    box-shadow: 0 8px 24px var(--tertiary-shadow);
}

.game-card.interactive-card .play-btn {
    background: linear-gradient(135deg, var(--tertiary-color), var(--tertiary-light));
    box-shadow: 0 4px 12px var(--tertiary-shadow);
}

.game-card.interactive-card .play-btn:hover {
    box-shadow: 0 6px 16px var(--tertiary-hover-shadow);
}

.game-card.interactive-card::before {
    background: linear-gradient(90deg, var(--tertiary-color), var(--tertiary-light));
}

.game-card.interactive-card:hover {
    box-shadow: 0 12px 32px var(--tertiary-hover-shadow);
}

/* 장르 배지 */
.genre-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: transparent;
}

/* NEW 배지 */
.new-badge {
    position: absolute;
    top: 13px;
    left: 13px;
    background: linear-gradient(135deg, #f43f5e, #fb7185);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.22rem 0.55rem;
    border-radius: 20px;
    letter-spacing: 0.06em;
    box-shadow: 0 3px 8px rgba(244, 63, 94, 0.45);
    animation: newBadgePulse 2s ease-in-out infinite;
    z-index: 5;
}

@keyframes newBadgePulse {
    0%, 100% { box-shadow: 0 3px 8px rgba(244, 63, 94, 0.45); }
    50%       { box-shadow: 0 3px 16px rgba(244, 63, 94, 0.8); }
}

/* WIP 배지 */
.wip-badge {
    position: absolute;
    top: 13px;
    left: 13px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.22rem 0.55rem;
    border-radius: 20px;
    letter-spacing: 0.06em;
    box-shadow: 0 3px 8px rgba(245, 158, 11, 0.45);
    animation: wipBadgePulse 2s ease-in-out infinite;
    z-index: 5;
}

@keyframes wipBadgePulse {
    0%, 100% { box-shadow: 0 3px 8px rgba(245, 158, 11, 0.45); }
    50%       { box-shadow: 0 3px 16px rgba(245, 158, 11, 0.8); }
}

/* 일반 게임 배지 공통 스타일 (Genre 상관없이 통합) */
.action-badge,
.arcade-badge,
.board-badge,
.mystery-badge {
    color: var(--primary-color);
}

/* WebGL 배지 (Secondary Color 적용) */
.webgl-badge {
    color: var(--secondary-color);
}

/* Sites 배지 (Tertiary Color 적용) */
.interactive-badge {
    color: var(--tertiary-color);
}



/* ====================================
   방문자 카운터
   ==================================== */
.visitor-counter {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 4px 12px var(--shadow-color);
    animation: fadeIn 1s ease-out;
    font-size: 0.85rem;
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.counter-item i {
    font-size: 1.2rem;
}

.counter-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 0.3rem;
}

.counter-value {
    font-weight: 700;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.6rem;
    border-radius: 20px;
    min-width: 40px;
    text-align: center;
}

.counter-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5rem;
}

/* ====================================
   푸터
   ==================================== */
.footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    max-width: 300px;
    margin: 0 auto;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    width: 100%;
    justify-content: center;
}

.footer-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.3s ease;
}

.footer-content a:hover {
    color: var(--primary-dark);
}

.separator {
    color: var(--text-secondary);
    opacity: 0.5;
}

.footer-content hr {
    border: none;
    border-top: 1px solid var(--primary-light);
    margin: 0.5rem 0;
    opacity: 0.3;
}

.footer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
}

.footer-info-line {
    display: flex;
    justify-content: center;
    gap: 0;
}

.footer-label {
    width: 60px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    flex-shrink: 0;
}

.footer-label::after {
    content: '|';
    margin: 0 0.5rem;
    opacity: 0.4;
}

.footer-value {
    width: 180px;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.85rem;
}



/* ====================================
   모달
   ==================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 74, 110, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(14, 165, 233, 0.3);
    animation: scaleIn 0.3s ease-out;
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
}

.modal-content h3 {
    color: var(--text-emphasis);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.3s ease;
}

.modal-content a:hover {
    color: var(--primary-dark);
}

.modal-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--shadow-hover);
}

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

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ====================================
   다크 모드
   ==================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #818CF8;
        --primary-light: #A5B4FC;
        --primary-dark: #6366F1;
        --text-emphasis: #F1F5F9;
        --background-gradient-start: #0F172A;
        --background-gradient-end: #1E293B;
        --card-background: rgba(30, 41, 59, 0.7);
        --text-primary: #E2E8F0;
        --text-secondary: #94A3B8;
        --shadow-color: rgba(0, 0, 0, 0.3);
        --shadow-hover: rgba(129, 140, 248, 0.3);

        --secondary-color: #2DD4BF;
        --secondary-light: #5EEAD4;
        --secondary-dark: #14B8A6;
        --secondary-shadow: rgba(45, 212, 191, 0.2);
        --secondary-hover-shadow: rgba(45, 212, 191, 0.3);

        --tertiary-color: #FB923C;
        --tertiary-light: #FDBA74;
        --tertiary-dark: #F97316;
        --tertiary-shadow: rgba(251, 146, 60, 0.2);
        --tertiary-hover-shadow: rgba(251, 146, 60, 0.3);
    }

    .search-scope-btn,
    .genre-tab {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(148, 163, 184, 0.12);
        backdrop-filter: blur(8px);
    }

    .genre-tab.webgl-tab,
    .genre-tab.interactive-tab {
        border-color: rgba(148, 163, 184, 0.12);
    }

    .genre-tabs-wrap {
        background: rgba(30, 41, 59, 0.4);
        border-color: rgba(148, 163, 184, 0.08);
    }

    .search-combo {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(148, 163, 184, 0.12);
    }

    .search-scope {
        border-color: rgba(148, 163, 184, 0.12);
    }

    .search-scope-btn {
        background: rgba(30, 41, 59, 0.6);
        border-color: rgba(148, 163, 184, 0.08);
    }

    .search-input {
        color: #E2E8F0;
    }

    .sort-select {
        background-color: rgba(30, 41, 59, 0.8);
        border-color: rgba(148, 163, 184, 0.12);
        background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23818CF8' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 01.753 1.659l-4.796 5.48a1 1 0 01-1.506 0z'/%3E%3C/svg%3E");
        backdrop-filter: blur(8px);
    }

    .sort-select option {
        background: #1E293B;
        color: #E2E8F0;
    }

    .zoom-control {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(148, 163, 184, 0.12);
        backdrop-filter: blur(8px);
    }

    .game-card {
        border: 1px solid rgba(148, 163, 184, 0.12);
        backdrop-filter: blur(12px);
    }

    .game-card:hover {
        border-color: rgba(129, 140, 248, 0.3);
    }

    .game-card.webgl-card:hover {
        border-color: rgba(45, 212, 191, 0.3);
    }

    .game-card.interactive-card:hover {
        border-color: rgba(251, 146, 60, 0.3);
    }

    .modal {
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(8px);
    }

    .modal-content {
        background: rgba(30, 41, 59, 0.9);
        border: 1px solid rgba(148, 163, 184, 0.12);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(16px);
    }

    .footer-content hr {
        border-color: rgba(148, 163, 184, 0.12);
        opacity: 1;
    }
}

/* ====================================
   반응형 디자인
   ==================================== */

/* 태블릿 (1024px 이하) */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .genre-tabs {
        gap: 0.4rem;
    }
    
    .genre-tab {
        padding: 0.45rem 0.9rem;
        font-size: 0.82rem;
    }

    .sort-select {
        padding: 0.45rem 2rem 0.45rem 0.85rem;
        font-size: 0.82rem;
    }
    
    .visitor-counter {
        flex-direction: column;
        gap: 0.6rem;
        padding: 0.4rem 0.8rem;
    }
    
    .counter-separator {
        display: none;
    }
}

/* 모바일 (768px 이하) */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .header {
        margin-bottom: 1.5rem;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .pc-notice {
        font-size: 0.85rem;
        padding: 0.4rem 1.2rem;
    }
    
    .genre-tabs {
        gap: 0.3rem;
    }
    
    .genre-tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.78rem;
    }

    .tools-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-combo {
        border-radius: 12px;
    }

    .search-scope {
        border-right: none;
        border-bottom: 1px solid var(--primary-light);
    }

    .search-combo {
        flex-direction: column;
    }

    .search-scope {
        justify-content: stretch;
    }

    .search-scope-btn {
        flex: 1;
        text-align: center;
        border-right: 1px solid rgba(56, 189, 248, 0.3);
    }

    .view-controls {
        justify-content: center;
    }

    .sort-select {
        font-size: 0.78rem;
        padding: 0.4rem 1.8rem 0.4rem 0.7rem;
    }
    
    .genre-tab i {
        font-size: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .footer-text {
        white-space: normal;
        text-align: center;
    }
    
    .visitor-counter {
        width: 100%;
        justify-content: center;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .title {
        font-size: 1.5rem;
    }
    
    .game-card {
        padding: 1.5rem;
    }
    
    .game-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .game-title {
        font-size: 1.2rem;
    }
    
    .genre-tab {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .modal-content {
        margin: 1rem;
        padding: 2rem;
    }
}
