/* ==========================================================================
   8-bit Dark Theme - Design Tokens
   Source: @fcstudio/fc-ui v0.1.0 (cute theme) + dark color overrides
   Spec: docs/superpowers/specs/2026-05-14-8bit-theme-design.md
   ========================================================================== */

/* 한국어 픽셀 폰트 fallback */
@font-face {
  font-family: 'DungGeunMo';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.2/DungGeunMo.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root,
[data-fc-theme="dark8bit"] {
  /* ── Color tokens (dark variant) ───────────────────────────── */
  --fc-bg: #0a0a1a;
  --fc-surface: #12122a;
  --fc-elev: #1a1a3a;
  --fc-ink: #fff8e7;
  --fc-ink-2: #c0c0d8;
  --fc-ink-3: #7d92c4;
  --fc-accent: #ff6b9d;
  --fc-accent-2: #3a1530;
  --fc-line: #ff6b9d;
  --fc-line-2: #2a2a4a;
  --fc-success: #22c55e;
  --fc-success-2: #0e3d1f;
  --fc-warn: #ff8c00;
  --fc-warn-2: #3d2400;
  --fc-danger: #e63946;
  --fc-danger-2: #3d0a0d;

  /* ── System tokens (8-bit pixel system, unchanged) ─────────── */
  --fc-font-display: 'Press Start 2P', 'DungGeunMo', monospace;
  --fc-font-body: 'Pixelify Sans', 'DungGeunMo', sans-serif;
  --fc-font-mono: 'VT323', 'DungGeunMo', monospace;

  --fc-r-sm: 0px;
  --fc-r-md: 0px;
  --fc-r-lg: 0px;
  --fc-r-xl: 0px;
  --fc-r-pill: 0px;

  --fc-border-width: 2px;
  --fc-density: 0.55;
  --fc-display-tracking: 0.02em;
  --fc-grid-gap: 16px;

  --fc-shadow-card: 3px 3px 0 0 #ff6b9d;
  --fc-shadow-pop: 5px 5px 0 0 #ff6b9d;
  --fc-sk-from: #1a1a3a;
  --fc-sk-to: #2a2a4a;
  --fc-pulse-shadow: rgba(255, 107, 157, 0.3);
}

/* ==========================================================================
   8-bit Dark Theme - Global Effects & Common Classes
   ========================================================================== */

/* 픽셀 렌더링 */
html[data-fc-theme="dark8bit"],
body[data-fc-theme="dark8bit"] {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: var(--fc-bg);
  color: var(--fc-ink);
  font-family: var(--fc-font-body);
}

/* 스캔라인 오버레이 */
html[data-fc-theme="dark8bit"]::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    transparent 0,
    transparent 2px,
    rgba(255, 107, 157, 0.05) 2px,
    rgba(255, 107, 157, 0.05) 3px
  );
  mix-blend-mode: screen;
}

/* 픽셀 누름 효과 — 모든 버튼에 적용 */
[data-fc-theme="dark8bit"] button:not(:disabled):active,
[data-fc-theme="dark8bit"] .fc8-button:not(:disabled):active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--fc-line);
}

/* 공통 컴포넌트 클래스 (선택 사용) */
.fc8-card {
  background: var(--fc-surface);
  border: var(--fc-border-width) solid var(--fc-line);
  border-radius: 0;
  box-shadow: var(--fc-shadow-card);
  padding: 16px;
}

.fc8-button {
  font-family: var(--fc-font-body);
  background: var(--fc-accent);
  color: #fff;
  border: var(--fc-border-width) solid var(--fc-line);
  border-radius: 0;
  box-shadow: var(--fc-shadow-card);
  padding: 10px 16px;
  cursor: pointer;
  transition: none;
}

.fc8-panel {
  background: var(--fc-elev);
  border: var(--fc-border-width) solid var(--fc-line-2);
  border-radius: 0;
  padding: 12px;
}

/* 픽셀 폰트 가독성 보호 — 큰 숫자/좌표용 */
.fc8-numeric {
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif !important;
}

/* 애니메이션 — 부드러운 보간 대신 계단형 */
@keyframes fc-shimmer {
  0% { background-position: 0% 0%; }
  100% { background-position: -200% 0%; }
}

@keyframes fc-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* 모바일에서 FcSegmented가 캐릭터 단위로 줄바꿈 되지 않도록 보호 */
.fc8-segmented-scroll {
  -ms-overflow-style: none;  /* IE/Edge */
  scrollbar-width: thin;
}
.fc8-segmented-scroll > [data-fc-slot],
.fc8-segmented-scroll > div {
  flex-wrap: nowrap !important;
  white-space: nowrap;
}
.fc8-segmented-scroll button {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  word-break: keep-all;
}

/* 8-bit 다크 테마 토큰 — games 폴더와 공유 */

/* ============================================================ */

:root {
            --bg-primary: var(--fc-bg, #0a0a1a);
            --bg-secondary: var(--fc-surface, #12122a);
            --accent-gold: #ffd700;
            --accent-pink: var(--fc-accent, #ff6b9d);
            --accent-cyan: #00d4ff;
            --accent-purple: #a855f7;
            --accent-green: var(--fc-success, #22c55e);
            --accent-orange: var(--fc-warn, #ff8c00);
            --text-primary: var(--fc-ink, #ffffff);
            --text-secondary: var(--fc-ink-2, rgba(255,255,255,0.7));
            --card-bg: rgba(255,255,255,0.05);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            min-height: 100vh;
            background: var(--bg-primary);
            font-family: 'Noto Sans KR', sans-serif;
            color: var(--text-primary);
            overflow-x: hidden;
        }

        /* 배경 효과 */
        .bg-effects {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
            overflow: hidden;
        }

        .bg-orb {
            position: absolute;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.4;
            animation: float 20s ease-in-out infinite;
        }

        .bg-orb:nth-child(1) {
            width: 400px;
            height: 400px;
            background: var(--accent-purple);
            top: -100px;
            left: -100px;
        }

        .bg-orb:nth-child(2) {
            width: 300px;
            height: 300px;
            background: var(--accent-cyan);
            top: 50%;
            right: -100px;
            animation-delay: -5s;
        }

        .bg-orb:nth-child(3) {
            width: 350px;
            height: 350px;
            background: var(--accent-pink);
            bottom: -100px;
            left: 30%;
            animation-delay: -10s;
        }

        @keyframes float {
            0%, 100% { transform: translate(0, 0) scale(1); }
            33% { transform: translate(30px, -30px) scale(1.05); }
            66% { transform: translate(-20px, 20px) scale(0.95); }
        }

        /* 그리드 패턴 오버레이 */
        .grid-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: 
                linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
            background-size: 50px 50px;
            pointer-events: none;
            z-index: 1;
        }

        /* 페이지 레이아웃 (사이드바 광고 포함) */
        .page-layout {
            display: flex;
            justify-content: center;
            position: relative;
            z-index: 10;
        }

        .ad-sidebar {
            width: 160px;
            flex-shrink: 0;
            display: flex;
            align-items: flex-end;
        }

        .ad-sticky {
            position: sticky;
            bottom: 20px;
        }

        .container {
            position: relative;
            max-width: 1200px;
            width: 100%;
            padding: 40px 20px;
        }

        /* 인피드 광고 카드 (PC + 모바일) */
        .ad-card-inline {
            background: rgba(255, 255, 255, 0.03);
            border-radius: var(--fc-r-lg);
            overflow: hidden;
            min-height: 100px;
        }

        /* 광고 미로드 확인 후 숨김 (JS에서 ad-unfilled 클래스 추가) */
        .ad-card-inline.ad-unfilled,
        .ad-sidebar.ad-unfilled {
            display: none;
        }

        @media (max-width: 1560px) {
            .ad-sidebar { display: none; }
        }

        /* 헤더 */
        header {
            text-align: center;
            margin-bottom: 60px;
            position: relative;
        }

        .logo {
            display: inline-flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
            position: relative;
        }


        .logo-icon {
            font-size: 3.5rem;
            animation: bounce 2s ease-in-out infinite;
        }

        @keyframes bounce {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
        }

        h1 {
            font-family: var(--fc-font-display), 'Black Han Sans', sans-serif;
            font-size: clamp(2.5rem, 8vw, 4.5rem);
            background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange), var(--accent-pink));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            letter-spacing: 2px;
            text-shadow: 0 0 60px rgba(255,215,0,0.3);
        }

        .subtitle {
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 1.3rem;
            color: var(--text-secondary);
            margin-top: 15px;
            letter-spacing: 3px;
        }

        .logo-mascot {
            animation: mascotBounce 1.5s ease-in-out infinite;
        }

        @keyframes mascotBounce {
            0%, 100% { transform: translateY(0) rotate(0deg); }
            25% { transform: translateY(-4px) rotate(-3deg); }
            75% { transform: translateY(-4px) rotate(3deg); }
        }

        .subtitle span {
            display: inline-block;
            animation: wave 2s ease-in-out infinite;
        }

        .subtitle span:nth-child(2) { animation-delay: 0.1s; }
        .subtitle span:nth-child(3) { animation-delay: 0.2s; }
        .subtitle span:nth-child(4) { animation-delay: 0.3s; }
        .subtitle span:nth-child(5) { animation-delay: 0.4s; }

        @keyframes wave {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-5px); }
        }

        /* 소개 섹션 */
        .intro-section {
            text-align: center;
            max-width: 800px;
            margin: 0 auto 30px;
            padding: 0 20px;
        }

        .intro-section h2 {
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 1.6rem;
            color: var(--text-primary);
            margin-bottom: 10px;
        }

        .intro-section p {
            color: var(--text-secondary);
            line-height: 1.5;
            font-size: 1rem;
            word-break: keep-all;
            margin-bottom: 16px;
        }

        .intro-section strong {
            color: var(--accent-gold);
        }

        .intro-cta {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 22px;
            border-radius: var(--fc-r-lg);
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 0.95rem;
            text-decoration: none;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        .intro-cta--facebook {
            background: linear-gradient(135deg, #1877f2, #0866ff);
            color: #fff;
            box-shadow: 0 4px 14px rgba(24, 119, 242, 0.35);
        }
        .intro-cta--facebook:hover,
        .intro-cta--facebook:focus-visible {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(24, 119, 242, 0.55);
            outline: none;
        }

        /* 게임 그리드 */
        .games-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 25px;
            padding: 10px;
        }

        /* 게임 카드 */
        .game-card {
            position: relative;
            background: var(--card-bg);
            border-radius: var(--fc-r-lg);
            padding: 30px;
            border: 1px solid rgba(255,255,255,0.1);
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            overflow: hidden;
            text-decoration: none;
            color: inherit;
            display: block;
        }

        .game-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, var(--card-accent) 0%, transparent 60%);
            opacity: 0;
            transition: opacity 0.4s;
            border-radius: var(--fc-r-lg);
        }

        .game-card:hover {
            transform: translateY(-10px) scale(1.02);
            border-color: var(--card-accent);
            box-shadow: 
                0 20px 40px rgba(0,0,0,0.4),
                0 0 30px var(--card-glow);
        }

        .game-card:hover::before {
            opacity: 0.15;
        }

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

        .game-card:hover .play-btn {
            opacity: 1;
            transform: translateX(0);
        }

        /* 카드 상단 */
        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 20px;
        }

        .card-meta-cluster {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 6px;
        }

        .card-tech-icons {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .card-tech-icon {
            width: 20px;
            height: 20px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            font-size: 0.72rem;
            line-height: 1;
            border: 1px solid rgba(255, 255, 255, 0.25);
            background: rgba(255, 255, 255, 0.08);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
        }

        .card-tech-icon.new {
            border-color: rgba(34, 197, 94, 0.7);
            background: rgba(34, 197, 94, 0.2);
        }

        .card-tech-icon.update {
            border-color: rgba(0, 212, 255, 0.7);
            background: rgba(0, 212, 255, 0.2);
        }

        .card-tech-icon.hot {
            border-color: rgba(251, 146, 60, 0.75);
            background: rgba(251, 146, 60, 0.22);
        }

        .card-icon {
            font-size: 3.5rem;
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            filter: drop-shadow(0 5px 15px var(--card-glow));
        }

        .card-icon.pixel-hero-icon {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .card-icon.pixel-hero-icon svg {
            width: 56px;
            height: 56px;
            filter: drop-shadow(0 3px 8px rgba(74, 144, 217, 0.6));
        }

        .game-card:hover .card-icon.pixel-hero-icon svg {
            filter: drop-shadow(0 5px 15px rgba(255, 215, 0, 0.8));
        }

        .card-badge {
            background: var(--card-accent);
            color: #000;
            font-size: 0.7rem;
            font-weight: bold;
            padding: 5px 12px;
            border-radius: var(--fc-r-lg);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .card-badge.new {
            background: var(--accent-green);
            animation: pulse 2s infinite;
        }

        .card-badge.hot {
            background: var(--accent-orange);
        }

        .card-badge.coming {
            background: rgba(255,255,255,0.2);
            color: var(--text-secondary);
        }

        .card-badge.construction {
            background: var(--accent-orange);
            color: #000;
        }

        .card-badge.update {
            background: var(--accent-cyan);
            animation: pulse-update 2s infinite;
        }

        @keyframes pulse-update {
            0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
            50% { box-shadow: 0 0 0 10px rgba(0, 212, 255, 0); }
        }

        @keyframes pulse {
            0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
            50% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
        }

        /* 카드 내용 */
        .card-title {
            font-family: var(--fc-font-display), 'Black Han Sans', sans-serif;
            font-size: 1.6rem;
            margin-bottom: 10px;
            color: var(--text-primary);
        }

        .card-description {
            font-size: 0.95rem;
            color: var(--text-secondary);
            line-height: 1.6;
            margin-bottom: 20px;
        }

        /* 플레이 버튼 */
        .play-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: var(--card-accent);
            color: #000;
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 1rem;
            padding: 10px 20px;
            border-radius: 25px;
            opacity: 0;
            transform: translateX(-20px);
            transition: all 0.3s;
        }

        .play-btn svg {
            width: 16px;
            height: 16px;
        }

        /* 개별 카드 색상 */
        .game-card[data-game="lotto"] {
            --card-accent: var(--accent-gold);
            --card-glow: rgba(255, 215, 0, 0.3);
        }

        .game-card[data-game="2048"] {
            --card-accent: #f67c5f;
            --card-glow: rgba(246, 124, 95, 0.3);
        }


        .game-card[data-game="roulette"] {
            --card-accent: var(--accent-pink);
            --card-glow: rgba(255, 107, 157, 0.3);
        }

        .game-card[data-game="dice"] {
            --card-accent: var(--accent-cyan);
            --card-glow: rgba(0, 212, 255, 0.3);
        }

        .game-card[data-game="coin"] {
            --card-accent: #fbbf24;
            --card-glow: rgba(251, 191, 36, 0.3);
        }

        .game-card[data-game="fortune"] {
            --card-accent: var(--accent-purple);
            --card-glow: rgba(168, 85, 247, 0.3);
        }

        .game-card[data-game="rps"] {
            --card-accent: var(--accent-green);
            --card-glow: rgba(34, 197, 94, 0.3);
        }

        .game-card[data-game="slots"] {
            --card-accent: #ef4444;
            --card-glow: rgba(239, 68, 68, 0.3);
        }

        .game-card[data-game="tarot"] {
            --card-accent: #8b5cf6;
            --card-glow: rgba(139, 92, 246, 0.3);
        }

        .game-card[data-game="othello"] {
            --card-accent: #22c55e;
            --card-glow: rgba(34, 197, 94, 0.3);
        }

        .game-card[data-game="minesweeper"] {
            --card-accent: #6b7280;
            --card-glow: rgba(107, 114, 128, 0.3);
        }

        .game-card[data-game="1010"] {
            --card-accent: #a855f7;
            --card-glow: rgba(168, 85, 247, 0.3);
        }

        .game-card[data-game="flighter"] {
            --card-accent: #f97316;
            --card-glow: rgba(249, 115, 22, 0.3);
        }

        .game-card[data-game="hero-path"] {
            --card-accent: #60a5fa;
            --card-glow: rgba(96, 165, 250, 0.3);
        }

        .game-card[data-game="moon_cave_2"] {
            --card-accent: #7c3aed;
            --card-glow: rgba(124, 58, 237, 0.3);
        }

        .game-card[data-game="rhythm"] {
            --card-accent: #ec4899;
            --card-glow: rgba(236, 72, 153, 0.3);
        }

        .game-card[data-game="roguelike"] {
            --card-accent: #ef4444;
            --card-glow: rgba(239, 68, 68, 0.3);
        }

        .game-card[data-game="moon_cave"] {
            --card-accent: #38bdf8;
            --card-glow: rgba(56, 189, 248, 0.3);
        }

        .game-card[data-game="go"] {
            --card-accent: #a78bfa;
            --card-glow: rgba(167, 139, 250, 0.3);
        }

        .game-card[data-game="sudoku"] {
            --card-accent: #818cf8;
            --card-glow: rgba(129, 140, 248, 0.3);
        }

        .game-card[data-game="omok"] {
            --card-accent: #94a3b8;
            --card-glow: rgba(148, 163, 184, 0.3);
        }

        .game-card[data-game="chess"] {
            --card-accent: #d4a574;
            --card-glow: rgba(212, 165, 116, 0.3);
        }

        .game-card[data-game="defense"] {
            --card-accent: #dc2626;
            --card-glow: rgba(220, 38, 38, 0.3);
        }

        .game-card[data-game="vampire"] {
            --card-accent: #a21caf;
            --card-glow: rgba(162, 28, 175, 0.3);
        }

        /* Coming Soon 카드 */
        .game-card.coming-soon {
            opacity: 0.7;
            cursor: default;
            filter: grayscale(1);
            background: rgba(100, 100, 100, 0.15);
            border-color: rgba(150, 150, 150, 0.2);
        }

        .game-card.coming-soon:hover {
            transform: none;
            box-shadow: none;
            filter: grayscale(1);
        }

        .game-card.coming-soon .card-icon {
            filter: none;
        }

        .game-card.coming-soon .play-btn {
            background: #888;
        }

        /* Contact Section */
        .contact-section {
            position: relative;
            background: var(--card-bg);
            border-radius: var(--fc-r-lg);
            padding: 40px;
            margin-top: 60px;
            border: 1px solid rgba(255,255,255,0.1);
            text-align: center;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.7s ease-out, padding 0.7s ease-out, opacity 0.5s ease-out;
            opacity: 0;
            padding-top: 0;
            padding-bottom: 0;
        }

        .contact-section .close-btn {
            position: absolute;
            top: 20px;
            right: 20px;
            background: none;
            border: none;
            color: white;
            font-size: 2rem;
            cursor: pointer;
            opacity: 0.7;
            transition: opacity 0.3s;
        }

        .contact-section .close-btn:hover {
            opacity: 1;
        }
        
        .contact-section.visible {
            max-height: 1000px; /* A large enough value */
            opacity: 1;
            padding: 40px;
        }

        .contact-section .section-title {
            font-family: var(--fc-font-display), 'Black Han Sans', sans-serif;
            font-size: clamp(2rem, 6vw, 3rem);
            color: var(--accent-gold);
            margin-bottom: 15px;
            text-shadow: 0 0 30px rgba(255,215,0,0.2);
        }

        .contact-section .section-description {
            font-size: 1.1rem;
            color: var(--text-secondary);
            margin-bottom: 30px;
        }

        .contact-form {
            max-width: 600px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            gap: 20px;
            text-align: left;
        }

        .contact-form .form-group {
            display: flex;
            flex-direction: column;
        }

        .contact-form label {
            font-size: 0.95rem;
            color: var(--text-primary);
            margin-bottom: 8px;
            font-weight: bold;
        }

        .contact-form input[type="text"],
        .contact-form input[type="email"],
        .contact-form textarea {
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.15);
            border-radius: var(--fc-r-md);
            padding: 12px 18px;
            font-size: 1rem;
            color: var(--text-primary);
            width: 100%;
            transition: border-color 0.3s, background-color 0.3s;
        }

        .contact-form input:focus,
        .contact-form textarea:focus {
            border-color: var(--accent-gold);
            background-color: rgba(255,255,255,0.15);
            outline: none;
        }

        .contact-form textarea {
            resize: vertical;
            min-height: 120px;
        }

        .contact-form .submit-btn {
            background: linear-gradient(45deg, var(--accent-gold), var(--accent-orange));
            color: #000;
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 1.2rem;
            padding: 14px 25px;
            border: none;
            border-radius: 25px;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 10px;
            box-shadow: 0 5px 20px rgba(255,215,0,0.3);
        }

        .contact-form .submit-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(255,215,0,0.5);
            filter: brightness(1.1);
        }


        /* 푸터 */
        footer {
            text-align: center;
            margin-top: 80px;
            padding: 30px;
            border-top: 1px solid rgba(255,255,255,0.1);
        }

        .footer-text {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .footer-links {
            margin-top: 15px;
            display: flex;
            justify-content: center;
            gap: 20px;
        }

        .footer-links a {
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.85rem;
            transition: color 0.3s;
        }

        .footer-links a:hover {
            color: var(--accent-gold);
        }

        /* 모바일 대응 */
        @media (max-width: 768px) {
            .container {
                padding: 30px 15px;
            }

            header {
                margin-bottom: 40px;
            }

            .logo-icon {
                font-size: 2.5rem;
            }

            .logo-mascot {
                width: 36px !important;
                height: 36px !important;
            }

            .subtitle {
                font-size: 1rem;
            }

            .games-grid {
                grid-template-columns: 1fr;
                gap: 20px;
            }

            .game-card {
                padding: 25px;
            }

            .card-icon {
                font-size: 2.8rem;
            }

            .play-btn {
                opacity: 1;
                transform: translateX(0);
            }

            .contact-section {
                padding: 30px 20px;
            }

            .contact-section .section-title {
                font-size: 2rem;
            }

            .contact-section .section-description {
                font-size: 1rem;
            }
        }

        /* 로딩 애니메이션 */
        .game-card {
            opacity: 0;
            transform: translateY(30px);
            animation: cardAppear 0.6s forwards;
        }

        .game-card:nth-child(1) { animation-delay: 0.05s; }
        .game-card:nth-child(2) { animation-delay: 0.1s; }
        .game-card:nth-child(3) { animation-delay: 0.15s; }
        .game-card:nth-child(4) { animation-delay: 0.2s; }
        .game-card:nth-child(5) { animation-delay: 0.25s; }
        .game-card:nth-child(6) { animation-delay: 0.3s; }
        .game-card:nth-child(7) { animation-delay: 0.35s; }
        .game-card:nth-child(8) { animation-delay: 0.4s; }
        .game-card:nth-child(9) { animation-delay: 0.45s; }
        .game-card:nth-child(10) { animation-delay: 0.5s; }
        .game-card:nth-child(11) { animation-delay: 0.55s; }
        .game-card:nth-child(12) { animation-delay: 0.6s; }
        .game-card:nth-child(13) { animation-delay: 0.65s; }
        .game-card:nth-child(14) { animation-delay: 0.7s; }
        .game-card:nth-child(15) { animation-delay: 0.75s; }
        .game-card:nth-child(16) { animation-delay: 0.8s; }

        @keyframes cardAppear {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 반짝이 효과 */
        .sparkle {
            position: absolute;
            width: 4px;
            height: 4px;
            background: white;
            border-radius: 50%;
            pointer-events: none;
            animation: sparkle 1.5s ease-out forwards;
        }

        @keyframes sparkle {
            0% { transform: scale(0); opacity: 1; }
            100% { transform: scale(2); opacity: 0; }
        }

        /* fc-ui FcProvider가 island로 박힐 때 강제되는 100vh 무력화.
           원인: @fcstudio/fc-ui@0.1.0이 .fc-root에 인라인 style={ minHeight: '100vh' }을
           박아두어 #react-portal-root이 viewport 높이만큼 차지하고, 그만큼 .games-grid가
           아래로 밀려나 필터와 카드 사이에 약 691px의 빈 공간이 생김.
           인라인 style이라 일반 셀렉터로는 못 이겨서 !important 필요.
           fc-ui에서 `fullScreen` opt-in prop이 도입되면 이 블록 제거 가능. */
        #react-portal-root .fc-root {
            min-height: 0 !important;
        }

        /* 필터 바 */
        .filter-bar {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            max-width: 1200px;
            margin: 0 auto 30px;
            padding: 0 20px;
            gap: 12px;
        }

        .filter-actions {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-shrink: 0;
        }

        .filter-group {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }

        .filter-label {
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 1px;
            padding-left: 5px;
        }

        .filter-buttons {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .filter-btn {
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.2);
            color: var(--text-secondary);
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 0.88rem;
            padding: 7px 14px;
            border-radius: 18px;
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s, color 0.2s;
            white-space: nowrap;
            flex-shrink: 0;
        }

        .filter-btn:hover {
            background: rgba(255,255,255,0.15);
            border-color: var(--accent-cyan);
            color: var(--accent-cyan);
        }

        .filter-btn.active {
            background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
            border-color: var(--accent-gold);
            color: #000;
            font-weight: bold;
            box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
        }

        .filter-btn.filter-new {
            border-color: var(--accent-green);
            color: var(--accent-green);
        }

        .filter-btn.filter-new:hover {
            background: rgba(34, 197, 94, 0.15);
        }

        .filter-btn.filter-new.active {
            background: var(--accent-green);
            color: #000;
            box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
        }

        .filter-btn.filter-update {
            border-color: var(--accent-cyan);
            color: var(--accent-cyan);
        }

        .filter-btn.filter-update:hover {
            background: rgba(0, 212, 255, 0.15);
        }

        .filter-btn.filter-update.active {
            background: var(--accent-cyan);
            color: #000;
            box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
        }

        /* 커뮤니티 필터 버튼 */
        .filter-btn.filter-community {
            color: var(--accent-pink);
        }

        .filter-btn.filter-community:hover {
            background: rgba(255, 107, 157, 0.15);
        }

        .filter-btn.filter-community.active {
            background: linear-gradient(135deg, #ff6b9d, #e0558a);
            color: #fff;
            box-shadow: 0 0 20px rgba(255, 107, 157, 0.4);
        }

        /* 인기순 정렬 버튼 */
        .sort-btn {
            background: rgba(255, 107, 157, 0.1);
            border: 1px solid rgba(255, 107, 157, 0.4);
            color: #ff6b9d;
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 0.88rem;
            padding: 7px 14px;
            border-radius: 18px;
            cursor: pointer;
            transition: background 0.2s, border-color 0.2s, color 0.2s;
            white-space: nowrap;
        }

        .sort-btn:hover {
            background: rgba(255, 107, 157, 0.2);
            border-color: #ff6b9d;
        }

        .sort-btn.active {
            background: linear-gradient(135deg, #ff6b9d, #ff4081);
            border-color: #ff6b9d;
            color: #fff;
            font-weight: bold;
            box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
        }

        /* 도전 버튼 */
        .challenge-btn {
            background: linear-gradient(135deg, #ff6b9d, #a855f7);
            border: none;
            color: #fff;
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 0.88rem;
            padding: 7px 16px;
            border-radius: 18px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            box-shadow: 0 3px 12px rgba(168, 85, 247, 0.3);
            white-space: nowrap;
            animation: challengePulse 2s ease-in-out infinite;
        }

        .challenge-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 6px 25px rgba(168, 85, 247, 0.5);
        }

        .challenge-btn:active {
            transform: scale(0.95);
        }

        @keyframes challengePulse {
            0%, 100% { box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3); }
            50% { box-shadow: 0 4px 25px rgba(255, 107, 157, 0.5); }
        }

        /* 도전 버튼으로 선택된 카드 하이라이트 */
        .game-card.challenge-highlight {
            animation: challengeHighlight 0.8s ease-in-out;
            z-index: 10;
        }

        @keyframes challengeHighlight {
            0% { transform: scale(1); box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
            50% { transform: scale(1.1); box-shadow: 0 0 40px rgba(168, 85, 247, 0.8), 0 0 60px rgba(255, 107, 157, 0.5); }
            100% { transform: scale(1); box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
        }

        /* 검색 컨테이너 */
        .search-container {
            display: flex;
            align-items: center;
            position: relative;
        }

        .search-toggle {
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.2);
            color: var(--text-secondary);
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            z-index: 2;
            flex-shrink: 0;
        }

        .search-toggle:hover {
            background: rgba(255,255,255,0.15);
            border-color: var(--accent-cyan);
            color: var(--accent-cyan);
        }

        .search-toggle svg {
            width: 16px;
            height: 16px;
        }

        .search-input {
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            width: 0;
            padding: 0;
            opacity: 0;
            background: rgba(18, 18, 42, 0.95);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 25px;
            color: var(--text-primary);
            font-family: 'Noto Sans KR', sans-serif;
            font-size: 0.95rem;
            height: 44px;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            outline: none;
            z-index: 20;
        }

        .search-container.open .search-input {
            width: 220px;
            padding: 0 20px;
            opacity: 1;
        }

        .search-input:focus {
            border-color: var(--accent-cyan);
            background: rgba(255,255,255,0.12);
        }

        .search-input::placeholder {
            color: var(--text-secondary);
        }

        /* 카드 필터링 애니메이션 */
        .game-card.filtered-out {
            opacity: 0 !important;
            transform: scale(0.8) !important;
            pointer-events: none;
            position: absolute !important;
            visibility: hidden;
        }

        /* 검색 결과 없음 */
        .no-results {
            grid-column: 1 / -1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 20px;
            color: var(--text-secondary);
            text-align: center;
        }

        .no-results-icon {
            font-size: 3rem;
            margin-bottom: 15px;
            opacity: 0.5;
        }

        .no-results p {
            font-family: var(--fc-font-body), 'Jua', sans-serif;
            font-size: 1.2rem;
        }

        /* 필터 바 모바일 반응형 */
        @media (max-width: 768px) {
            .filter-bar {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
                padding: 0 12px;
            }

            .filter-group {
                width: 100%;
                align-items: center;
            }

            /* 필터 칩 가로 스크롤 — 4~5줄 wrap 방지 */
            .filter-buttons {
                flex-wrap: nowrap;
                overflow-x: auto;
                overflow-y: hidden;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: thin;
                scrollbar-color: rgba(168, 85, 247, 0.4) transparent;
                padding: 4px 4px 8px;
                margin: 0 -4px;
                justify-content: flex-start;
                width: 100%;
                max-width: 100%;
                min-width: 0;
            }
            .filter-buttons::-webkit-scrollbar { height: 4px; }
            .filter-buttons::-webkit-scrollbar-thumb {
                background: rgba(168, 85, 247, 0.4);
                border-radius: 2px;
            }

            .filter-btn {
                padding: 7px 13px;
                font-size: 0.82rem;
            }

            /* 액션 버튼 가로 1줄 정렬 */
            .filter-actions {
                justify-content: center;
                gap: 6px;
                width: 100%;
                max-width: 100%;
                min-width: 0;
                flex-wrap: wrap;
            }
            .sort-btn,
            .challenge-btn {
                padding: 7px 12px;
                font-size: 0.82rem;
            }

            .search-container {
                justify-content: center;
            }

            .search-container.open .search-input {
                width: calc(100vw - 80px);
                max-width: 240px;
            }

            .intro-section {
                margin-bottom: 24px;
            }
            .intro-section h2 { font-size: 1.35rem; }
            .intro-section p { font-size: 0.9rem; }
            .intro-cta {
                padding: 9px 18px;
                font-size: 0.88rem;
            }
        }

        /* 키보드 포커스 스타일 */
        .game-card:focus-visible {
            outline: 2px solid var(--accent-gold);
            outline-offset: 3px;
            box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
        }

        .filter-btn:focus-visible {
            outline: 2px solid var(--accent-cyan);
            outline-offset: 2px;
        }

        .challenge-btn:focus-visible {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }

        .search-toggle:focus-visible {
            outline: 2px solid var(--accent-cyan);
            outline-offset: 2px;
        }

        .contact-form .submit-btn:focus-visible {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }

        .footer-links a:focus-visible {
            outline: 2px solid var(--accent-cyan);
            outline-offset: 2px;
            border-radius: 4px;
        }

        /* ===== 커뮤니티 카드 ===== */

        /* Per-community card accent */
        .community-game-card {
            --card-accent: var(--accent-pink);
            --card-glow: rgba(255, 107, 157, 0.3);
        }

        .community-card-author {
            display: block;
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-top: -6px;
            margin-bottom: 10px;
            font-style: italic;
            opacity: 0.75;
        }

        .community-badge {
            display: inline-block;
            background: #ff6b9d;
            color: #fff;
            font-size: 0.6rem;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            padding: 2px 6px;
            border-radius: 4px;
            vertical-align: middle;
            margin-left: 4px;
        }

        /* 모션 감소 접근성 */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }

            .game-card {
                opacity: 1;
                transform: none;
            }
        }

/* ========================================
   카드 하단 역대 1위 표시 (.card-top-rank)
   ======================================== */
.card-top-rank {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 2px solid var(--fc-line);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--fc-font-body);
    font-size: 0.85rem;
    color: var(--fc-ink);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.card-top-rank__icon {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
}

.card-top-rank__name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--fc-ink);
}

.card-top-rank__score {
    flex-shrink: 0;
    color: #ffd700;
    font-weight: 600;
    font-family: var(--fc-font-display);
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.card-top-rank--empty {
    color: rgba(255, 248, 231, 0.5);
    font-style: italic;
}

.card-top-rank--empty .card-top-rank__name {
    color: inherit;
}

@media (max-width: 600px) {
    .card-top-rank {
        font-size: 0.78rem;
        margin-top: 8px;
        padding-top: 8px;
    }
    .card-top-rank__score {
        font-size: 0.6rem;
    }
}

