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

:root {
    --primary-color: #7ec249;
    --primary-hover: #487c20;
    --bg-color: #ffffff;
    --text-color: #222;
    --card-bg: #ffffff;
    --nav-bg: #fff;
    --border-color: #e0e0e0;
    --category-bg: #f5f5f5;
    --category-hover: #ebebeb;
    --footer-bg: #2c3e50;
    --border-radius: 12px;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e4e4e4;
    --card-bg: #2d2d2d;
    --nav-bg: #1c1c1c;
    --border-color: #404040;
    --category-bg: #2d2d2d;
    --category-hover: #3d3d3d;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER & NAVBAR */

.site-header {
    background: var(--nav-bg);
}

.navbar {
    background: var(--nav-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
}

.navbar .container.nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* brand */

.nav-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-brand .brand-link {
    text-decoration: none;
}

.nav-brand .logo-text,
.footer-logo-wordmark {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

.nav-brand .site-logo {
    height: 45px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    transition: var(--transition);
}

.brand-tagline {
    font-size: 13px;
    color: #777;
}

@media (max-width: 768px) {
    .nav-brand .site-logo {
        height: 35px;
        max-width: 150px;
    }
    .nav-brand .logo-text {
        font-size: 20px;
    }
}

/* nav links & actions */

.nav-menu {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link-active {
    color: var(--primary-color);
}

.nav-link-active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    border-radius: 999px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* search */

.search-bar {
    display: flex;
    gap: 5px;
    align-items: center;
}

.search-bar input {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    width: 200px;
    transition: var(--transition);
    background: var(--bg-color);
    color: var(--text-color);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-btn {
    background: var(--primary-color);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--primary-hover);
}

/* hamburger */

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
}

/* theme toggle (new button) */

.theme-toggle,
.theme-toggle-btn {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    width: 46px;
    height: 26px;
    position: relative;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover,
.theme-toggle-btn:hover {
    border-color: var(--primary-color);
}

.theme-icon {
    position: absolute;
    font-size: 12px;
    opacity: 0.4;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-icon-moon {
    left: 8px;
}

.theme-icon-sun {
    right: 8px;
}

[data-theme="dark"] .theme-icon-moon {
    opacity: 1;
    transform: scale(1.1);
}

[data-theme="dark"] .theme-icon-sun {
    opacity: 0.25;
}

[data-theme="light"] .theme-icon-sun {
    opacity: 1;
    transform: scale(1.1);
}

[data-theme="light"] .theme-icon-moon {
    opacity: 0.25;
}

/* breadcrumbs */

.breadcrumbs {
    background: #f8f8f8;
    padding: 12px 0;
    font-size: 14px;
}

.breadcrumbs .container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumbs .separator {
    color: #999;
}

/* CATEGORY BAR */

.category-bar-wrapper {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
    position: sticky;
    top: 73px;
    z-index: 999;
}

.category-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    -webkit-overflow-scrolling: touch;
}

.category-bar::-webkit-scrollbar {
    height: 6px;
}

.category-bar::-webkit-scrollbar-track {
    background: transparent;
}

.category-bar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.category-bar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .category-chip {
    background: #3a3a3a;
    color: #e4e4e4;
    border-color: #555;
}

.category-chip:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.category-chip.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

/* LAYOUT */

.main-content {
    min-height: 70vh;
    padding: 30px 0;
}

/* HERO + SECTIONS */

.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-copy {
    max-width: 780px;
    margin: 0 auto;
}

.hero-section h1 {
    font-size: 36px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.hero-section p {
    font-size: 18px;
    color: #666;
}

.games-section {
    margin-bottom: 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 28px;
    margin-bottom: 6px;
    color: var(--text-color);
}

.section-subtitle {
    font-size: 15px;
    color: #777;
}

/* GAME GRID & CARDS */

.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.game-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    height: auto;
    min-height: 440px;
}

.game-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.game-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.game-thumbnail {
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: #f0f0f0;
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-info {
    padding: 15px;
}

.game-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-category {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
}

.game-plays {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-size: 12px;
    color: #777;
}

/* PLAY BUTTON */

.play-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    font-weight: 600;
    font-size: 17px;
    cursor: pointer;
    transition: var(--transition);
}

.play-btn:hover {
    background: var(--primary-hover);
}

/* IN-FEED ADS / BANNERS */

.infeed-ad {
    grid-column: 1 / -1;
    margin: 20px 0;
}

.adsense-ad-banner {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* LOAD MORE */

.load-more-container {
    text-align: center;
    margin: 40px 0;
}

.load-more-btn {
    padding: 15px 40px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.load-more-btn:hover {
    background: var(--primary-hover);
}

.loading-spinner {
    display: inline-block;
    margin-top: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* GAME PAGE */

.game-page {
    max-width: 1200px;
    margin: 0 auto;
}

.game-header {
    margin-bottom: 30px;
}

.game-header-main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px;
    align-items: flex-start;
}

.game-title-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-page-title {
    font-size: 32px;
    margin-bottom: 0;
    color: var(--text-color);
}

.game-category-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    align-items: center;
    font-size: 14px;
    color: #777;
}

.game-meta-item i {
    margin-right: 5px;
}

.game-tip-bar {
    margin-top: 18px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f5f8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5a3a;
}

.game-tip-label {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.game-tip-label i {
    color: var(--primary-color);
}

.game-tip-text {
    opacity: 0.95;
}

/* GAME FRAME */

.game-play-section {
    margin: 25px 0 10px;
}

.game-frame-wrapper {
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    background: #000;
    overflow: hidden;
}

.game-frame-aspect {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.game-frame-aspect iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* GAME DETAILS & SIDEBAR */

.game-details-section {
    margin: 30px 0 10px;
}

.game-details-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}

.game-description {
    padding: 25px;
    background: #f8f8f8;
    border-radius: var(--border-radius);
}

.game-description h2 {
    margin-bottom: 15px;
    font-size: 24px;
}

.game-description p {
    margin-bottom: 10px;
}

.game-stats {
    font-size: 14px;
    color: #777;
}

.game-side-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.game-side-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 18px 16px;
    font-size: 14px;
}

.game-side-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

/* RELATED GAMES */

.related-games {
    margin-top: 50px;
}

.related-games .section-title {
    font-size: 24px;
}

/* CATEGORY PAGES */

.category-header {
    text-align: center;
    margin-bottom: 30px;
}

.category-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.filter-btn {
    padding: 10px 20px;
    background: #f0f0f0;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.filter-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.no-games {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
}

/* FOOTER (CENTERED) */

.footer {
    background: #222;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: 60px;
    text-align: center;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.footer-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.footer-logo-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-logo-icon {
    font-size: 18px;
}

.footer-tagline {
    font-size: 14px;
    color: #ccc;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

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

.footer-bottom {
    font-size: 14px;
    color: #999;
}

.footer-copy {
    margin-bottom: 4px;
}

.footer-note {
    font-size: 13px;
    color: #aaa;
}

[data-theme="dark"] .footer {
    background: #0d0d0d;
}

/* BACK TO TOP */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: var(--transition);
    z-index: 999;
}

.back-to-top:hover {
    background: var(--primary-hover);
}

.back-to-top.visible {
    display: flex;
}

/* STATIC PAGES */

.static-page {
    padding: 60px 0;
    min-height: 70vh;
}

.static-page .page-content {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.static-page h1 {
    font-size: 36px;
    color: var(--text-color);
    margin-bottom: 10px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

.static-page .last-updated {
    color: #666;
    font-size: 14px;
    font-style: italic;
    margin-bottom: 30px;
}

.static-page .content-section {
    margin-bottom: 35px;
}

.static-page h2 {
    font-size: 26px;
    color: var(--text-color);
    margin-bottom: 15px;
    margin-top: 30px;
}

.static-page h3 {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 12px;
    margin-top: 20px;
}

.static-page p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #444;
}

.static-page ul {
    margin-bottom: 15px;
    padding-left: 30px;
    line-height: 1.8;
}

.static-page ul li {
    margin-bottom: 8px;
    color: #444;
}

.static-page a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.static-page a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.static-page .contact-info {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.static-page .contact-info h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.static-page strong {
    color: var(--text-color);
    font-weight: 600;
}

/* SEO ARTICLE SECTION */

.content-section {
    margin: 60px 0 40px;
    padding: 0;
}

.seo-article {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    max-width: 900px;
    margin: 0 auto;
}

[data-theme="dark"] .seo-article {
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.seo-article h2 {
    font-size: 32px;
    color: var(--text-color);
    margin-bottom: 20px;
    line-height: 1.3;
    font-weight: 700;
}

.seo-article h3 {
    font-size: 24px;
    color: var(--text-color);
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.seo-article p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 18px;
    text-align: justify;
    opacity: 0.9;
}

/* PAGINATION */

ul.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

ul.pagination li {
    display: inline-block;
}

ul.pagination a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 500;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
}

ul.pagination a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* RESPONSIVE */

@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .game-details-layout {
        grid-template-columns: 1.5fr 1fr;
    }
}

@media (max-width: 768px) {
    .navbar .container.nav-inner {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .nav-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .search-bar input {
        width: 150px;
    }

    .category-bar-wrapper {
        top: 73px;
        padding: 10px 0;
    }

    .category-bar {
        gap: 8px;
    }

    .category-chip {
        padding: 6px 14px;
        font-size: 13px;
    }

    .hero-section h1 {
        font-size: 28px;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .game-page-title {
        font-size: 26px;
    }

    .category-header h1 {
        font-size: 28px;
    }

    .game-details-layout {
        grid-template-columns: 1fr;
    }

    .static-page {
        padding: 30px 0;
    }

    .static-page .page-content {
        padding: 25px 20px;
    }

    .static-page h1 {
        font-size: 28px;
    }

    .static-page h2 {
        font-size: 22px;
    }

    .static-page h3 {
        font-size: 18px;
    }

    .content-section {
        margin: 40px 0 30px;
    }

    .seo-article {
        padding: 25px 20px;
    }

    .seo-article h2 {
        font-size: 26px;
    }

    .seo-article h3 {
        font-size: 20px;
    }

    .seo-article p {
        font-size: 15px;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .search-bar {
        width: 100%;
    }

    .search-bar input {
        width: 100%;
    }

    .footer-links {
        gap: 16px;
    }
}
