@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Patrick+Hand&display=swap');

/* =========================================
   Reset & Base Styles - Childlike Doodle Theme
   ========================================= */
:root {
    /* Colors */
    --bg-color: #ffffff;
    --surface-color: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    
    /* Crayon Accents */
    --accent-yellow: #FFEB3B;
    --accent-red: #FF5252;
    --accent-blue: #448AFF;
    --accent-green: #69F0AE;
    --accent-orange: #FFAB40;
    --accent-purple: #E040FB;
    
    /* UI Elements */
    --border-color: #333;
    --border-width: 3px;
    --hand-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    
    /* Fonts */
    --font-main: 'Patrick Hand', cursive; /* Text */
    --font-title: 'Fredoka One', cursive; /* Headings */
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(#ddd 1px, transparent 1px),
        radial-gradient(#ddd 1px, transparent 1px);
    background-position: 0 0, 25px 25px;
    background-size: 50px 50px; /* Dot grid pattern */
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 18px;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px; /* Slightly narrower for better reading on this theme */
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   Navbar - Crayon Style
   ========================================= */
.navbar {
    background-color: var(--accent-yellow);
    border-bottom: var(--border-width) solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo h1 {
    font-family: var(--font-title);
    font-weight: 400;
    font-size: 2rem;
    color: var(--accent-red);
    text-shadow: 2px 2px 0 #fff, 4px 4px 0 var(--border-color);
    letter-spacing: 2px;
    transform: rotate(-2deg);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-title);
    font-size: 1.1rem;
    position: relative;
    padding: 5px 10px;
    border-radius: 20px;
    transition: transform 0.2s;
}

.nav-links a:hover {
    transform: scale(1.1) rotate(2deg);
    color: var(--accent-blue);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 10%;
    width: 80%;
    height: 3px;
    background-color: var(--accent-blue);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.nav-links a:hover::after {
    opacity: 1;
}

/* Hamburger */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}

.hamburger .bar {
    width: 30px;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 4px;
    transition: 0.3s;
}

/* =========================================
   Ads
   ========================================= */
#adv1, #adv2, #adv3 {
    margin: 20px auto;
    background: #fff;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    padding: 10px;
    position: relative;
}
#adv1::before, #adv2::before, #adv3::before {
    content: 'AD';
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--accent-orange);
    padding: 2px 8px;
    font-family: var(--font-title);
    font-size: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    transform: rotate(-5deg);
}

/* =========================================
   Main Content & Categories
   ========================================= */
.article-categories {
    padding: 2rem 0;
}

.category {
    margin-bottom: 3rem;
    background: #fff;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--hand-radius);
    padding: 20px;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.1);
    position: relative;
}

/* Random rotation for categories to look playful */
.category:nth-child(odd) { transform: rotate(0.5deg); }
.category:nth-child(even) { transform: rotate(-0.5deg); }

.category h3 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: inline-block;
    background: var(--accent-green);
    padding: 5px 15px;
    border: 2px solid var(--border-color);
    border-radius: 20px 5px 20px 5px;
    transform: rotate(-1deg);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.1);
}

.category-icon {
    margin-right: 10px;
}

/* =========================================
   Accordion Styles (Replaces Grid/Carousel)
   ========================================= */
.accordion-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.accordion-item {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 3px 3px 0 #eee;
}

.accordion-item.active {
    box-shadow: 5px 5px 0 var(--accent-blue);
    border-color: var(--accent-blue);
    transform: scale(1.01);
}

/* Header (Always Visible) */
.accordion-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #fafafa;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: #f0f0f0;
}

.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.accordion-mini-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.accordion-title {
    font-family: var(--font-title);
    font-size: 1.2rem;
    color: var(--text-primary);
}

.accordion-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.accordion-item.active .accordion-arrow {
    transform: rotate(180deg);
    color: var(--accent-blue);
}

/* Body (Expandable) */
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background: #fff;
}

.accordion-item.active .accordion-body {
    max-height: 500px; /* Arbitrary large height */
    border-top: 2px dashed var(--border-color);
}

.accordion-content-inner {
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.accordion-img-container {
    flex: 0 0 200px;
    border: 3px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transform: rotate(-2deg);
    box-shadow: 4px 4px 0 var(--accent-yellow);
}

.accordion-img-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.accordion-item.active:hover .accordion-img-container img {
    transform: scale(1.1);
}

.accordion-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.accordion-info p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.play-btn {
    align-self: flex-start;
    background: var(--accent-red);
    color: #fff;
    font-family: var(--font-title);
    font-size: 1.2rem;
    padding: 10px 30px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 4px 4px 0 var(--border-color);
    transition: all 0.2s;
    display: inline-block;
    animation: pulse 2s infinite;
    cursor: pointer;
}

.play-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 6px 6px 0 var(--border-color);
    background: var(--accent-orange);
}

.play-button-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* =========================================
   Detail Page Styles
   ========================================= */
.game-detail-info {
    background: #fff;
    padding: 2rem;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--hand-radius);
    box-shadow: 8px 8px 0 var(--accent-purple);
    margin-bottom: 2rem;
}

.game-detail-info h2 {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    text-align: center;
    text-transform: uppercase;
}

.game-detail-image {
    border: 4px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 5px 5px 0 var(--accent-yellow);
    transform: rotate(1deg);
    width: 100%;
}

.game-detail-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   Related Articles (Grid Layout)
   ========================================= */
.may-like h3 {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.games-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.game-card {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    width: 220px; /* Fixed width */
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 3px 3px 0 #eee;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 5px 5px 0 var(--accent-blue);
    border-color: var(--accent-blue);
}

.game-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 2px solid var(--border-color);
}

.game-card-content {
    padding: 15px;
    text-align: center;
}

.game-card h4 {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* =========================================
   Footer
   ========================================= */
.footer {
    background: var(--accent-blue);
    border-top: var(--border-width) solid var(--border-color);
    padding: 3rem 0;
    margin-top: auto;
    color: #fff;
    background-image: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.2) 2px, transparent 2px);
    background-size: 20px 20px;
}

.footer-content p {
    font-family: var(--font-main);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    font-family: var(--font-title);
    font-size: 1.1rem;
    border-bottom: 2px dashed rgba(255,255,255,0.5);
    transition: all 0.3s;
}

.footer-links a:hover {
    color: var(--accent-yellow);
    border-bottom-style: solid;
    transform: rotate(-2deg);
}

/* =========================================
   Responsive Design
   ========================================= */
@media (max-width: 768px) {
    /* Navbar Mobile */
    .navbar .container {
        position: relative;
    }

    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--accent-yellow);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.3s;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 1001;
        border-left: 3px solid var(--border-color);
    }

    .nav-links.active {
        right: 0;
    }
    
    .accordion-content-inner {
        flex-direction: column;
    }
    
    .accordion-img-container {
        width: 100%;
        flex: none;
    }
    
    .accordion-item.active .accordion-body {
        max-height: 800px; /* Allow more height for stacked content */
    }
    
    .games-grid {
        gap: 15px;
    }
    
    .game-card {
        width: 45%; /* 2 per row on mobile */
    }
}

@media (max-width: 480px) {
    .game-card {
        width: 100%; /* 1 per row on small screens */
    }
}
