@font-face {
    font-family: 'PlayFreeGames';
    src: url('https://hellomangames.github.io/hmg/assets/play-free-games-free-font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Color Palette - Vibrant Kid-Friendly Premium */
    --primary-blue: #00BFFF; /* Deep Sky Blue */
    --primary-purple: #9D50BB;
    --primary-pink: #FF69B4; /* Hot Pink */
    --primary-yellow: #FFD700; /* Gold */
    --accent-green: #32CD32;
    
    --bg-gradient-start: #E0F7FA;
    --bg-gradient-end: #87CEEB;
    
    --text-main: #2c3e50;
    --text-light: #ffffff;
    
    --card-bg: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 4px solid #ffffff;
    
    --shadow-pop: 0 8px 0 rgba(0,0,0,0.15);
    --shadow-hover: 0 15px 25px rgba(0,0,0,0.1);

    --header-height: 90px;
    --container-width: 1200px;
}

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'PlayFreeGames', 'Comic Sans MS', sans-serif;
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background-attachment: fixed;
}

a { text-decoration: none; color: inherit; transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
a:hover { transform: scale(1.05); }
ul { list-style: none; }

/* Typography */
h1, h2, h3, h4 {
    text-transform: uppercase;
    text-shadow: 2px 2px 0px rgba(255,255,255,0.5);
    letter-spacing: 1px;
}

/* Header */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 5px solid var(--primary-blue);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.nav-container {
    width: 100%;
    max-width: var(--container-width);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.secondary-logo {
    height: 50px;
    width: auto;
    filter: drop-shadow(0 4px 0 rgba(0,0,0,0.1));
    animation: bounce 2s infinite;
}

.main-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 0 rgba(0,0,0,0.1));
}

@media(max-width: 600px) {
    .main-logo { display: none; }
}

/* More Games Button */
.more-games-btn {
    background: linear-gradient(to bottom, #FFD700, #FFA500);
    color: #4a3b00;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    border: 3px solid #fff;
    box-shadow: 0 6px 0 #cc8400, 0 10px 10px rgba(0,0,0,0.2);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.more-games-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 10px 0 #cc8400, 0 15px 20px rgba(0,0,0,0.2);
    filter: brightness(1.1);
}

.more-games-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #cc8400, 0 4px 4px rgba(0,0,0,0.2);
}

/* Main Content */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 40px 20px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 40px 0;
}

.hero h1 {
    font-size: 4rem;
    color: white;
    text-shadow: 
        4px 4px 0 var(--primary-pink),
        -2px -2px 0 var(--primary-blue),
        0 0 20px rgba(255,255,255,0.5);
    margin-bottom: 10px;
    animation: pulse 3s infinite;
}

.hero p {
    font-size: 1.3rem;
    color: #024;
    font-weight: bold;
    max-width: 700px;
    margin: 0 auto;
    background: rgba(255,255,255,0.6);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

/* Ad Container */
.ad-wrapper {
    background: rgba(255, 255, 255, 0.4);
    border: 3px dashed var(--primary-blue);
    border-radius: 20px;
    margin: 30px auto;
    padding: 10px;
    max-width: 900px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Controls (Search & Random) */
.controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.search-input {
    padding: 15px 25px;
    font-size: 1.2rem;
    border-radius: 50px;
    border: 3px solid var(--primary-purple);
    width: 100%;
    max-width: 400px;
    font-family: 'PlayFreeGames', sans-serif;
    outline: none;
    box-shadow: 0 5px 0 rgba(157, 80, 187, 0.3);
    transition: all 0.2s;
}

.search-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 rgba(157, 80, 187, 0.3);
    border-color: var(--primary-pink);
}

.random-btn {
    background: var(--accent-green);
    color: white;
    border: 3px solid white;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 5px 0 #228B22;
    transition: all 0.1s;
    font-family: 'PlayFreeGames', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.random-btn:hover {
    transform: scale(1.05);
    background: #40e040;
}

.random-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}


/* Games Grid */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 30px;
    color: var(--primary-purple);
    text-align: center;
    background: white;
    display: inline-block;
    padding: 10px 40px;
    border-radius: 50px;
    box-shadow: var(--shadow-pop);
    transform: rotate(-2deg);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
    margin-bottom: 60px;
}

.game-card {
    background: var(--card-bg);
    border-radius: 25px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 5px solid white;
    box-shadow: 0 10px 0 #ddd, 0 15px 20px rgba(0,0,0,0.1);
    transform: translateY(0);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.game-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 0 #ccc, 0 25px 30px rgba(0,0,0,0.15);
    z-index: 10;
}

.card-image-wrapper {
    height: 220px;
    overflow: hidden;
    border-bottom: 5px solid var(--primary-blue);
    background: #eee;
}

.card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.game-card:hover .card-thumb {
    transform: scale(1.1) rotate(2deg);
}

.card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.card-title {
    font-size: 1.6rem;
    color: var(--primary-blue);
    margin-bottom: 10px;
    line-height: 1.1;
}

.card-desc {
    font-size: 1rem;
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.4;
}

.play-btn {
    background: linear-gradient(to bottom, #FF69B4, #d1478c);
    color: white;
    border: 3px solid white;
    padding: 12px;
    border-radius: 15px;
    font-size: 1.3rem;
    text-transform: uppercase;
    box-shadow: 0 5px 0 #a0356a;
    transition: all 0.1s;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.game-card:hover .play-btn {
    background: linear-gradient(to bottom, #ff8bc4, #e65c9e);
    box-shadow: 0 7px 0 #a0356a;
    transform: scale(1.05);
}

.play-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #a0356a;
}

/* Locked State */
.game-card.locked {
    filter: grayscale(0.5);
    cursor: default;
}
.game-card.locked:hover {
    transform: none;
    box-shadow: 0 10px 0 #ddd, 0 15px 20px rgba(0,0,0,0.1);
}
.game-card.locked .play-btn {
    background: #ccc;
    box-shadow: 0 5px 0 #999;
}

/* SEO Content Area */
.seo-section {
    background: white;
    border-radius: 30px;
    padding: 40px;
    border: 5px solid var(--primary-yellow);
    box-shadow: var(--shadow-hover);
    margin-top: 60px;
    text-align: left;
}

.seo-section h2 {
    color: var(--primary-pink);
    border-bottom: 3px dashed var(--primary-blue);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px;
    justify-content: center;
}

.tag {
    background: #E0F7FA;
    color: var(--primary-blue);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 2px solid var(--primary-blue);
    font-weight: bold;
}

/* Footer */
footer {
    background: var(--text-main);
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-top: auto;
    border-top: 10px solid var(--primary-purple);
}

.support-btn {
    display: inline-block;
    background: #FFDD00;
    color: #000;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 20px;
    border: 3px solid #000;
    box-shadow: 5px 5px 0 #000;
    margin-bottom: 20px;
}

.support-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 #000;
}

.support-btn:active {
    transform: translate(0, 0);
    box-shadow: 0 0 0 #000;
}

.footer-logo {
    height: 60px;
    margin-bottom: 20px;
    transition: transform 0.3s;
}


.footer-logo:hover { transform: rotate(-5deg) scale(1.1); }

/* Animations */
@keyframes bounce { 
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    .nav-container { padding: 0 15px; }
    .main-logo { display: none; }
}
