        @import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600&family=Outfit:wght@400;700;800&display=swap');

        :root {
            /* 2026 Trendy Palette: Digital Lavender, Soft Cyan, White */
            --bg-mesh-1: #e0c3fc;
            --bg-mesh-2: #8ec5fc;
            --bg-mesh-3: #9bebeb;

            --surface: #ffffff;
            --surface-hover: #f8f9fa;

            --text-main: #2d3436;
            --text-sub: #636e72;

            --accent-primary: #6c5ce7;
            --accent-secondary: #00b894;
            --accent-pink: #fd79a8;

            --shadow-soft: 0 10px 30px -5px rgba(100, 100, 250, 0.15);
            --shadow-hover: 0 20px 40px -10px rgba(100, 100, 250, 0.25);

            --radius-lg: 24px;
            --radius-md: 16px;
            --radius-pill: 50px;
        }

        body {
            margin: 0;
            background: radial-gradient(at 0% 0%, var(--bg-mesh-1) 0px, transparent 50%),
                radial-gradient(at 100% 0%, var(--bg-mesh-2) 0px, transparent 50%),
                radial-gradient(at 100% 100%, var(--bg-mesh-3) 0px, transparent 50%),
                radial-gradient(at 0% 100%, #f5f6fa 0px, transparent 50%);
            background-color: #f0f3f9;
            background-attachment: fixed;
            color: var(--text-main);
            font-family: 'Outfit', sans-serif;
            overflow-x: hidden;
            display: flex;
            /* Sidebar layout */
            height: 100vh;
        }

        /* --- Sidebar --- */
        .sidebar {
            width: 80px;
            height: 90vh;
            margin: auto 16px;
            background: rgba(255, 255, 255, 0.6);
            backdrop-filter: blur(16px);
            border-radius: var(--radius-pill);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 30px 0;
            box-shadow: var(--shadow-soft);
            z-index: 100;
        }

        .nav-icon {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: transparent;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 24px;
            cursor: pointer;
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            font-size: 1.2rem;
            color: var(--accent-primary);
        }

        .nav-icon:hover {
            background: #fff;
            transform: scale(1.2) rotate(5deg);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        }

        .nav-icon.active {
            background: var(--accent-primary);
            color: #fff;
            box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
        }

        /* --- Main Content --- */
        .main-content {
            flex: 1;
            height: 100vh;
            overflow-y: auto;
            padding: 40px;
            box-sizing: border-box;
        }

        header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 40px;
        }

        .logo {
            font-family: 'Fredoka', sans-serif;
            font-size: 2rem;
            font-weight: 600;
            color: var(--accent-primary);
            text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
            cursor: pointer;
            animation: bounce 2s infinite;
        }

        @keyframes bounce {

            0%,
            20%,
            50%,
            80%,
            100% {
                transform: translateY(0);
            }

            40% {
                transform: translateY(-5px);
            }

            60% {
                transform: translateY(-3px);
            }
        }

        .wallet-pill {
            background: #fff;
            padding: 10px 24px;
            border-radius: var(--radius-pill);
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 800;
            box-shadow: var(--shadow-soft);
            color: var(--text-main);
        }

        .coin {
            color: #ffd700;
            font-size: 1.2rem;
        }

        /* --- Hero Section --- */
        .hero {
            width: 100%;
            height: 400px;
            background: linear-gradient(120deg, #6c5ce7, #a29bfe);
            border-radius: var(--radius-lg);
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            padding: 60px;
            box-sizing: border-box;
            box-shadow: var(--shadow-soft);
            margin-bottom: 50px;
            transition: transform 0.3s;
        }

        .hero:hover {
            transform: scale(1.01);
        }

        .hero-pattern {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: radial-gradient(rgba(255, 255, 255, 0.2) 2px, transparent 2px);
            background-size: 30px 30px;
            opacity: 0.5;
        }

        .hero-text {
            color: #fff;
            z-index: 2;
            max-width: 500px;
        }

        .hero h1 {
            font-size: 3.5rem;
            margin: 0 0 16px 0;
            font-weight: 800;
            letter-spacing: -2px;
            line-height: 1;
        }

        .hero p {
            font-size: 1.2rem;
            margin-bottom: 32px;
            opacity: 0.9;
        }

        .play-btn {
            background: #fff;
            color: var(--accent-primary);
            border: none;
            padding: 16px 40px;
            font-size: 1.2rem;
            font-weight: 800;
            border-radius: var(--radius-pill);
            cursor: pointer;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .play-btn:hover {
            transform: scale(1.1) translateY(-4px);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
        }

        /* --- Updated Card Design for SEO --- */
        .game-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            /* Wider cards for text */
            gap: 30px;
            padding-bottom: 60px;
        }

        .card {
            background: var(--surface);
            border-radius: var(--radius-lg);
            overflow: hidden;
            box-shadow: var(--shadow-soft);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            display: flex;
            flex-direction: column;
            height: 100%;
            /* Match row height */
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-hover);
        }

        /* 카드 전체가 하나의 링크다. 카드가 세로로 늘어나도 클릭 영역이 따라 늘어나야 하므로
           앵커가 카드 높이를 그대로 채운다. */
        .card-link {
            display: flex;
            flex-direction: column;
            height: 100%;
            color: inherit;
            text-decoration: none;
        }

        .card-link:focus-visible {
            outline: 3px solid var(--accent-primary);
            outline-offset: 3px;
        }

        /* 3:4. 게임 내용이 플레이 밴드로 세로 비율에 묶여 있어서 가로 카드에서는
           게임이 폭의 32%밖에 못 채웠다. 카드를 세로로 세워 64%로 올린다. */
        .card-thumb {
            width: 100%;
            aspect-ratio: 3 / 4;
            overflow: hidden;
            position: relative;
        }

        .card-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s;
        }

        .card:hover .card-thumb img {
            transform: scale(1.1);
        }

        .card-content {
            padding: 20px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }

        .card-title {
            font-size: 1.3rem;
            font-weight: 800;
            color: var(--text-main);
            margin-bottom: 8px;
        }

        .card-tag {
            font-size: 0.8rem;
            color: var(--accent-primary);
            font-weight: 700;
            text-transform: uppercase;
            margin-bottom: 12px;
            letter-spacing: 1px;
        }

        .card-desc {
            font-size: 0.95rem;
            color: var(--text-sub);
            line-height: 1.5;
            margin-bottom: 15px;
        }

        .play-link {
            margin-top: auto;
            align-self: flex-start;
            font-weight: 700;
            color: var(--accent-primary);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .play-link:hover {
            text-decoration: underline;
        }

        /* Mobile adjustments for new cards */
        @media (max-width: 768px) {
            .game-grid {
                grid-template-columns: 1fr;
            }
        }

        /* --- Ad Slots --- */
        .ad-slot {
            background-color: #f0f3f9;
            border: 2px dashed #cbd5e0;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #a0aec0;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 0.9rem;
            position: relative;
            overflow: hidden;
        }

        .ad-slot::after {
            content: 'Advertisement';
            position: absolute;
            z-index: 1;
        }

        /* --- Refactored Modal (Game Player) --- */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(45, 52, 54, 0.9);
            /* Darker backdrop for focus */
            backdrop-filter: blur(10px);
            z-index: 200;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

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

        .player-layout {
            display: flex;
            width: 95%;
            max-width: 1400px;
            height: 90vh;
            gap: 20px;
            align-items: flex-start;
        }

        .game-container {
            flex: 1;
            height: 100%;
            background: #000;
            border-radius: 20px;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
            overflow: hidden;
            position: relative;
            display: flex;
            flex-direction: column;
        }

        .game-frame-wrapper {
            flex: 1;
            position: relative;
            width: 100%;
        }

        .game-controls {
            height: 60px;
            background: #fff;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
        }

        .ad-sidebar {
            width: 320px;
            height: 100%;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .ad-rect {
            width: 100%;
            height: 250px;
            background: #fff;
            border-radius: 16px;
        }

        .ad-sky {
            width: 100%;
            flex: 1;
            /* Fills remaining height */
            background: #fff;
            border-radius: 16px;
        }

        .close-btn-player {
            background: #ff7675;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 8px;
            font-weight: bold;
            cursor: pointer;
            font-family: inherit;
        }

        .game-title-bar {
            font-weight: 800;
            font-size: 1.2rem;
            color: var(--text-main);
        }

        /* Mobile Responsive Player */
        @media (max-width: 1024px) {
            .player-layout {
                flex-direction: column;
                width: 100%;
                height: 100%;
            }

            .ad-sidebar {
                display: none;
                /* Hide sidebar ads on small screens */
            }

            .game-container {
                border-radius: 0;
            }

            .modal-overlay {
                background: #000;
            }
        }

        /* --- MOBILE LAYOUT FIX (New) --- */
        @media (max-width: 768px) {
            body {
                flex-direction: column-reverse;
                /* Put sidebar (Nav) at bottom implicitly if we keep flex, but easier to just use fixed positioning or simple stack */
                display: block;
                /* Disable the side-by-side flex */
            }

            /* Convert Sidebar to Bottom Navigation */
            .sidebar {
                width: 100%;
                height: 70px;
                margin: 0;
                position: fixed;
                bottom: 0;
                left: 0;
                border-radius: 20px 20px 0 0;
                flex-direction: row;
                justify-content: space-around;
                padding: 0;
                background: rgba(255, 255, 255, 0.95);
                backdrop-filter: blur(20px);
                box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
                z-index: 1000;
            }

            .nav-icon {
                margin: 0;
                flex: 1;
                border-radius: 0;
                font-size: 1.5rem;
            }

            .nav-icon:hover {
                transform: none;
                /* No hover effects on touch */
                background: transparent;
                box-shadow: none;
            }

            .nav-icon.active {
                box-shadow: inset 0 -4px 0 var(--accent-primary);
                /* Bottom pill indicator */
                background: transparent;
                color: var(--accent-primary);
                border-radius: 0;
            }

            /* Adjust Main Content */
            .main-content {
                width: 100%;
                height: auto;
                min-height: 100vh;
                padding: 20px;
                padding-bottom: 100px;
                /* Safe area for bottom nav */
                overflow-y: visible;
                /* Let body scroll */
            }

            /* Hero Section Mobile */
            .hero {
                height: auto;
                padding: 40px 20px;
                flex-direction: column;
                text-align: center;
                border-radius: var(--radius-md);
            }

            .hero h1 {
                font-size: 2.2rem;
            }

            .hero p {
                font-size: 1rem;
            }

            .play-btn {
                width: 100%;
                padding: 14px;
            }

            /* Grid Mobile */
            .game-grid {
                grid-template-columns: 1fr 1fr;
                gap: 15px;
                /* 행 높이를 160px로 못 박아 두었더니 카드가 그 안에 갇혀 썸네일이 사라지고
                   설명이 잘렸다. 카드는 내용만큼 자란다. (.card.wide / .card.tall 규칙도
                   함께 걷어냈다 — 지금 빌더는 그 클래스를 만들지 않는다) */
            }

            header {
                flex-direction: row;
                margin-bottom: 20px;
            }

            .logo {
                font-size: 1.5rem;
            }

            .wallet-pill {
                padding: 8px 16px;
            }
        }

/* --- added: landing pages & layout fixes --- */
.site-copy { margin-top: 40px; line-height: 1.7; color: var(--text-secondary); }
.site-copy h2 { margin: 24px 0 12px; font-size: 1.2rem; }
.site-copy ul { padding-left: 20px; line-height: 1.9; }
.site-footer { margin-top: 60px; padding: 20px; border-top: 1px solid rgba(0,0,0,0.05);
  text-align: center; color: #888; font-size: 0.9rem; }
.site-footer a { color: #888; text-decoration: none; font-weight: 600; }
.landing { max-width: 900px; margin: 0 auto; padding: 20px; }
.landing h1 { margin: 8px 0; }
.landing .lede { color: var(--text-secondary); margin-bottom: 20px; }
.breadcrumb { font-size: 0.85rem; color: #888; margin-bottom: 12px; }
.breadcrumb a { color: #888; text-decoration: none; }
.landing-frame { position: relative; width: 100%; aspect-ratio: 4 / 3;
  border-radius: 16px; overflow: hidden; background: #000; }
.landing-body { margin-top: 32px; line-height: 1.7; }
.landing-body h2 { margin: 28px 0 12px; font-size: 1.25rem; }
.landing-body ul { padding-left: 20px; line-height: 1.9; }
.controls-table { width: 100%; border-collapse: collapse; }
.controls-table th { text-align: left; width: 120px; padding: 8px 0; vertical-align: top; }
.controls-table td { padding: 8px 0; }
.more-games { margin-top: 48px; }
.more-link { margin-top: 20px; }
.more-link a { color: var(--accent-primary); font-weight: 700; }
.faq { margin-top: 40px; line-height: 1.7; }
.faq h2 { margin: 28px 0 12px; font-size: 1.25rem; }
.faq h3 { margin: 20px 0 6px; font-size: 1rem; font-weight: 700; color: var(--text-main); }
.faq p { margin: 0; color: var(--text-sub); }
@media (max-width: 640px) { .landing-frame { aspect-ratio: 3 / 4; } }

/* links that replaced buttons must not look like default links */
.play-btn { text-decoration: none; display: inline-block; }
.logo a { color: inherit; text-decoration: none; }

/* share — sits right under the frame, where the player is when a run ends */
.share { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
/* the daily line takes the whole row so the button stays on its own line */
.daily-note { flex-basis: 100%; margin: 0; color: var(--text-sub); font-size: .95rem; }
.daily-note b { color: var(--accent-primary); }
.share-btn { font: inherit; font-weight: 700; cursor: pointer;
  padding: 12px 24px; min-height: 44px; border-radius: var(--radius-pill);
  border: 2px solid var(--accent-primary); background: transparent;
  color: var(--accent-primary); transition: background .15s, color .15s; }
.share-btn:hover { background: var(--accent-primary); color: #fff; }
.share-btn:focus-visible { outline: 3px solid var(--accent-primary); outline-offset: 3px; }
.share-note { color: var(--text-sub); font-size: .9rem; }
@media (max-width: 640px) { .share-btn { flex: 1; } }
