@import url('https://fonts.googleapis.com/css2?family=Bungee&family=Outfit:wght@300;400;600;700;900&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    --bg-dark: #070711;
    --card-bg: rgba(18, 16, 38, 0.65);
    --card-border: rgba(255, 255, 255, 0.1);
    
    --neon-pink: #ff007f;
    --neon-cyan: #00f0ff;
    --neon-purple: #9d4edd;
    --neon-yellow: #ffee00;
    --neon-green: #00ff88;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a5c0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Background canvas for interactive particles */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Ambient glow spheres */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.35;
    pointer-events: none;
    animation: orbFloat 14s ease-in-out infinite alternate;
}

.orb-1 {
    width: 450px;
    height: 450px;
    background: var(--neon-pink);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--neon-cyan);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: var(--neon-purple);
    top: 40%;
    left: 60%;
    animation-delay: -3.5s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -60px) scale(1.1); }
    100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Header & Container (Mobile 480px App Alignment) */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 16px 80px;
    width: 100%;
    flex: 1;
}

header {
    text-align: center;
    margin-bottom: 28px;
    position: relative;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: rgba(255, 0, 127, 0.12);
    border: 1px solid rgba(255, 0, 127, 0.3);
    border-radius: 50px;
    color: var(--neon-pink);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 16px rgba(255, 0, 127, 0.2);
}

.badge-dot {
    width: 7px;
    height: 7px;
    background-color: var(--neon-pink);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-pink);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

h1.hero-title {
    font-family: 'Pretendard Variable', 'Noto Sans KR', 'Outfit', sans-serif;
    font-size: clamp(2.0rem, 8vw, 2.75rem);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 20%, var(--neon-cyan) 60%, var(--neon-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 24px rgba(0, 240, 255, 0.3);
}

p.hero-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #D8D9E6;
    max-width: 390px;
    margin: 0 auto;
    line-height: 1.65;
    word-break: keep-all;
}

.arcade-symbols {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.arcade-symbols span {
    min-width: 112px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(255, 255, 255, .09);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 18px rgba(255, 0, 127, .16);
}

.arcade-symbols b {
    margin-right: 5px;
    font-size: 20px;
}

/* Quick Bar / Category */
.quick-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.random-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(157, 78, 221, 0.3));
    border: 1px solid rgba(0, 240, 255, 0.4);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.random-play-btn:active {
    transform: scale(0.97);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(157, 78, 221, 0.5));
}

/* Games Grid (1-Column Mobile Optimized) */
.games-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

.game-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 18px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1.5px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.game-card:active {
    transform: scale(0.98);
}

/* Card Themes */
.game-card.pinball:hover, .game-card.pinball:active {
    border-color: rgba(69, 243, 255, 0.6);
    box-shadow: 0 10px 25px rgba(69, 243, 255, 0.2);
}
.game-card.roulette:hover, .game-card.roulette:active {
    border-color: rgba(255, 0, 127, 0.6);
    box-shadow: 0 10px 25px rgba(255, 0, 127, 0.2);
}
.game-card.mines:hover, .game-card.mines:active {
    border-color: rgba(0, 255, 136, 0.6);
    box-shadow: 0 10px 25px rgba(0, 255, 136, 0.2);
}
.game-card.card369:hover, .game-card.card369:active {
    border-color: rgba(220, 38, 38, 0.72);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.24);
}

.card-thumbnail {
    width: 100%;
    height: 140px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.card-thumbnail-icon {
    font-size: 64px;
    filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.3));
    transition: transform 0.3s ease;
}

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

.pinball .card-thumbnail {
    background: radial-gradient(circle at center, rgba(69, 243, 255, 0.22), rgba(11, 12, 16, 0.85));
    border: 1px solid rgba(69, 243, 255, 0.2);
}
.roulette .card-thumbnail {
    background: radial-gradient(circle at center, rgba(255, 0, 127, 0.22), rgba(11, 12, 16, 0.85));
    border: 1px solid rgba(255, 0, 127, 0.2);
}
.mines .card-thumbnail {
    background: radial-gradient(circle at center, rgba(0, 255, 136, 0.22), rgba(11, 12, 16, 0.85));
    border: 1px solid rgba(0, 255, 136, 0.2);
}
.card369 .card-thumbnail {
    background: radial-gradient(circle at center, rgba(220, 38, 38, 0.30), rgba(11, 12, 16, 0.88));
    border: 1px solid rgba(248, 113, 113, 0.32);
}

.card-badge-container {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
}

.card-badge {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    font-size: 10.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    color: #fff;
}

.card-header-info {
    margin-bottom: 8px;
}

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-desc {
    font-size: 16px;
    color: #D3D5E2;
    line-height: 1.65;
    margin-bottom: 12px;
    min-height: 52px;
    word-break: keep-all;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tag {
    font-size: 13px;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-weight: 500;
}

.play-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
}

.pinball .play-btn {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    box-shadow: 0 4px 14px rgba(0, 198, 255, 0.3);
}
.roulette .play-btn {
    background: linear-gradient(135deg, #f857a6, #ff5858);
    box-shadow: 0 4px 14px rgba(255, 88, 88, 0.3);
}
.mines .play-btn {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    box-shadow: 0 4px 14px rgba(56, 239, 125, 0.3);
}
.card369 .play-btn {
    background: linear-gradient(135deg, #991b1b, #ef4444);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.32);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 12.5px;
}

footer span {
    color: var(--neon-pink);
}

/* Top Navigation Bar (Mobile Header Container) */
.top-nav {
    width: 100%;
    background: rgba(7, 7, 17, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.top-nav::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, #B84A32 0 56%, #E8A020 56% 100%);
    opacity: .95;
}

.nav-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #fff;
    text-decoration: none;
    transition: background 0.2s;
}

.nav-back-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.back-icon {
    font-size: 27px;
    font-weight: 900;
    line-height: 1;
}

.nav-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.nav-country-mark {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(232, 160, 32, .18));
}

.nav-brand em {
    color: #E8A020;
    font-style: normal;
    letter-spacing: .4px;
}

.nav-links {
    display: flex;
    gap: 6px;
}

.nav-link {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:active {
    transform: scale(0.95);
    color: #fff;
}

@media (max-width: 360px) {
    .nav-link {
        font-size: 11px;
        padding: 4px 8px;
    }
}
