/*
 * TheBrainPlay - Wordpress theme stylesheet
 *
 * Theme Name:        TheBrainPlay
 * Theme URI:         https://thebrainplay.com
 * Description:       WordPress blog theme matching the static TheBrainPlay.com
 *                    game site. Hardcoded navbar + footer that visually mirror
 *                    the static site 1:1, plus AdSense-ready widget areas.
 * Version:           1.0.0
 * Author:            TheBrainPlay
 * Author URI:        https://thebrainplay.com
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       thebrainplay
 * Domain Path:       /languages
 * Tags:              blog, games, custom-logo, custom-menu, featured-images,
 *                    threaded-comments, two-columns, right-sidebar, adsense
 * Tested up to:      6.6
 * Requires PHP:      7.4
*/

/* =========================================================
 * 1.  RESET & BASE (matches static site's common.css base)
 * ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, Oxygen, Ubuntu, sans-serif;
    color: #1f2937;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: #667eea; text-decoration: none; transition: color .2s ease; }
a:hover { color: #5a6fd8; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { color: #111827; line-height: 1.3; margin: 0 0 .75em; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
ul, ol { padding-left: 1.25em; }
button { font-family: inherit; cursor: pointer; }
*:focus-visible { outline: 2px solid #667eea; outline-offset: 2px; }

/* Container mirroring common.css (max-width + horizontal padding) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page content offset: fixed navbar is 70px tall; keep ~100px breathing room */
.page-content {
    padding-top: 100px;
    min-height: calc(100vh - 70px);
}
.tbp-site { min-height: 100vh; display: flex; flex-direction: column; }

/* Screen-reader helper */
.tbp-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* =========================================================
 * 2.  NAVBAR (mirror css/common.css .navbar + friends)
 * ========================================================= */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    overflow: visible !important;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    overflow: visible !important;
}
.site-header { display: block; overflow: visible !important; }

.nav-brand { display: flex; align-items: center; }
.nav-brand a { text-decoration: none; }
.logo-img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}
.logo-img:hover { transform: scale(1.05); }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    overflow: visible !important;
}
.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}
.nav-link:hover,
.nav-link.active { color: #667eea; }

.nav-item { position: relative; overflow: visible !important; }

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 240px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 9500;
    padding: 10px 0;
    display: block; /* never hide via display:none on desktop — only opacity/visibility so transitions work */
}
.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown,
.nav-item.has-dropdown.open > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-weight: 400;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 0.95rem;
}
.dropdown-link:hover { background-color: #f8f9fa; color: #667eea; }
.dropdown-link:first-child { border-radius: 8px 8px 0 0; }
.dropdown-link:last-child  { border-radius: 0 0 8px 8px; }

.dropdown-item { position: relative; }
.dropdown-sub-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.dropdown-sub-toggle::after {
    content: "\203A";
    color: #667eea;
    font-weight: 700;
    margin-left: auto;
}

/* Submenus (right-flyout from a dropdown-item) */
.submenu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 0;
    z-index: 9600;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    background: white;
    min-width: 240px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px 0;
    transition: all 0.3s ease;
}
.dropdown-item.has-submenu:hover > .submenu,
.dropdown-item.has-submenu:focus-within > .submenu,
.dropdown-item.has-submenu.open > .submenu,
.dropdown-item.has-submenu.active > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Label visibility for dropdown toggle labels on desktop */
.navbar .nav-item.has-dropdown > .nav-link,
.nav-link.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    color: #333;
    opacity: 1;
    visibility: visible;
    white-space: nowrap;
}

/* Hamburger menu (only visible on mobile via media query) */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: transparent;
    border: 0;
    padding: 6px;
}
.bar {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* =========================================================
 * 3.  FOOTER (mirror css/common.css .footer / .footer-* )
 * ========================================================= */
.footer {
    background: #2c3e50;
    color: #fff;
    padding: 40px 0 20px;
    margin-top: auto;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-section h3 {
    margin-bottom: 1rem;
    color: #667eea;
    font-size: 1.25rem;
}
.footer-section h4 {
    margin-bottom: 1rem;
    color: #fff;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.footer-section p { margin: 0 0 .75em; color: rgba(255,255,255,.85); }
.footer-section a { color: rgba(255,255,255,.85); }
.footer-section a:hover { color: #667eea; }
.footer-section ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.footer-section ul li { margin-bottom: 0.5rem; }
.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-section ul li a:hover { color: #667eea; }
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: .9rem;
}
.footer-bottom a { color: #fff; }
.footer-bottom a:hover { color: #667eea; }

/* =========================================================
 * 4.  CONTENT WRAPPER / CARDS (WP templates expect tbp-* ones)
 * ========================================================= */
.tbp-main {
    padding: 110px 0 60px;
    width: 100%;
    flex: 1 0 auto;
}
.tbp-front-page { padding-top: 100px; }

/* Layout: content + sidebar (used by archive, home, search, single, page) */
.tbp-layout,
.tbp-layout-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2rem;
    align-items: start;
    margin-bottom: 1rem;
}
.tbp-layout .tbp-content,
.tbp-layout-sidebar .tbp-content {
    min-width: 0;
}

/* Blog grid alias (archive, home, search templates use tbp-blog-grid) */
.tbp-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

/* Archive + single content area inherits tbp-section-inner white background */
.tbp-content > .tbp-section-inner,
.tbp-archive .tbp-section-inner,
.tbp-search .tbp-section-inner,
.tbp-single-post .tbp-section-inner {
    background: #fff !important;
}
.tbp-content > .tbp-section-inner h1,
.tbp-content > .tbp-section-inner h2,
.tbp-content > .tbp-section-inner h3,
.tbp-content > .tbp-section-inner h4,
.tbp-content > .tbp-section-inner .tbp-archive-title,
.tbp-content > .tbp-section-inner .tbp-page-title {
    color: #111827 !important;
    margin: 0 0 .75em;
}
.tbp-content > .tbp-section-inner p,
.tbp-content > .tbp-section-inner li,
.tbp-content > .tbp-section-inner span,
.tbp-content > .tbp-section-inner .tbp-archive-description,
.tbp-content > .tbp-section-inner .tbp-section-sub {
    color: #4b5563 !important;
}

/* Archive/Page/Single/404 white card already via tbp-card class — force text */
.tbp-archive-header,
.tbp-single,
.tbp-page-card,
.tbp-404-card,
.tbp-single-card {
    background: #fff !important;
}
.tbp-archive-header *,
.tbp-single *,
.tbp-page-card *,
.tbp-404-card *,
.tbp-single-card * {
    color: #111827;
}
.tbp-archive-header p,
.tbp-single p,
.tbp-page-card p,
.tbp-404-card p,
.tbp-single-card p {
    color: #4b5563 !important;
}
.tbp-archive-title,
.tbp-page-title,
.entry-title {
    color: #111827 !important;
}

.tbp-content-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 2rem;
    align-items: start;
}

.tbp-hero {
    color: #fff;
    padding: 0 0 2rem;
}
.tbp-hero h1,
.tbp-hero h2,
.tbp-hero p { color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.15); }

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

.tbp-ad {
    margin: 1rem auto;
    text-align: center;
    max-width: 100%;
}
.tbp-ad iframe,
.tbp-ad ins { max-width: 100%; display: block; margin: 0 auto; }

/* Blog card (for archive grid / featured) */
.tbp-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.tbp-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
    transition: transform .3s ease, box-shadow .3s ease;
    display: flex;
    flex-direction: column;
}
.tbp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
.tbp-card__media { aspect-ratio: 16/9; overflow: hidden; }
.tbp-card__media img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s ease;
}
.tbp-card:hover .tbp-card__media img { transform: scale(1.04); }
.tbp-card__body { padding: 1.25rem 1.25rem 1.5rem; display: flex; flex-direction: column; flex: 1 1 auto; }
.tbp-card__meta { font-size: .82rem; color: #6b7280; margin-bottom: .5rem; }
.tbp-card__meta a { color: inherit; }
.tbp-card__title { font-size: 1.15rem; margin: 0 0 .5rem; }
.tbp-card__title a { color: #111827; }
.tbp-card__title a:hover { color: #667eea; }
.tbp-card__excerpt { font-size: .93rem; color: #4b5563; margin: 0 0 1rem; }
.tbp-card__footer { margin-top: auto; }

/* Single post */
.tbp-single {
    background: #fff;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
}
.tbp-single__thumbnail {
    margin: 0 0 1.5rem;
    border-radius: 12px;
    overflow: hidden;
}
.tbp-single__meta {
    font-size: .9rem;
    color: #6b7280;
    margin-bottom: 1rem;
}
.tbp-single__content p { margin: 0 0 1.1em; }
.tbp-single__content blockquote {
    border-left: 4px solid #667eea;
    padding: .5rem 1rem;
    background: #f8f9ff;
    margin: 1.25em 0;
    color: #374151;
}
.tbp-single__content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}
.tbp-single__content img { border-radius: 8px; margin: 1rem 0; }
.tbp-single__tags {
    margin-top: 1.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}
.tbp-tag {
    display: inline-block;
    padding: .25rem .6rem;
    margin: 0 .25rem .35rem 0;
    background: #eef2ff;
    color: #4f46e5;
    border-radius: 999px;
    font-size: .8rem;
}
.tbp-tag:hover { background: #e0e7ff; }

.tbp-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}
.tbp-post-nav a {
    display: block;
    padding: 1rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    font-size: .92rem;
    color: #1f2937;
}
.tbp-post-nav a:hover { box-shadow: 0 8px 20px rgba(0,0,0,.12); }
.tbp-post-nav .tbp-post-nav__dir {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #667eea;
    font-weight: 600;
    margin-bottom: .25rem;
}

/* Sidebar + widgets */
.tbp-sidebar-card {
    background: #fff;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
}
.tbp-sidebar-card > h3,
.tbp-sidebar-card h3.widget-title {
    font-size: 1.05rem;
    margin: 0 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid #eef2ff;
}
.tbp-sidebar-card ul { padding-left: 1.1em; }
.tbp-sidebar-card ul li { margin-bottom: .35rem; }

/* Comments */
.tbp-comments { margin-top: 2.5rem; background: #fff; border-radius: 15px; padding: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,.1); }
.tbp-comments h3,
.tbp-comments h2 { margin-bottom: 1.25rem; }
.tbp-comment-list { list-style: none; padding-left: 0; }
.tbp-comment-list li { margin-bottom: 1.5rem; border-bottom: 1px solid #f0f0f0; padding-bottom: 1rem; }
.tbp-comment-list li:last-child { border-bottom: 0; }
.tbp-comment__head { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.tbp-comment__avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; }
.tbp-comment__avatar img { width: 100%; height: 100%; object-fit: cover; }
.tbp-comment__author { font-weight: 600; color: #111827; }
.tbp-comment__date   { color: #6b7280; font-size: .8rem; }
.tbp-comment__body { margin-left: calc(44px + .75rem); color: #374151; }

/* Form styles (search, comment, contact-like) */
.tbp-form .form-group { margin-bottom: 1rem; }
.tbp-form label { display: block; margin-bottom: .35rem; font-weight: 500; color: #374151; }
.tbp-form input[type="text"],
.tbp-form input[type="email"],
.tbp-form input[type="url"],
.tbp-form input[type="search"],
.tbp-form textarea,
.tbp-form select {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-family: inherit;
    font-size: .95rem;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.tbp-form input:focus,
.tbp-form textarea:focus,
.tbp-form select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}
.tbp-form textarea { min-height: 140px; resize: vertical; }

.tbp-btn,
.tbp-btn-primary,
button.tbp-btn,
input[type="submit"].tbp-btn {
    display: inline-block;
    padding: .75rem 1.75rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
    font-family: inherit;
    font-size: .95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.tbp-btn:hover,
.tbp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.tbp-search-form {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.tbp-search-form input[type="search"] {
    flex: 1 1 180px;
    min-width: 0;
}

/* Pagination (WP default the_posts_pagination) */
.tbp-pagination { margin: 2rem 0; text-align: center; }
.tbp-pagination .page-numbers {
    display: inline-block;
    padding: .5rem .9rem;
    margin: 0 .15rem;
    background: #fff;
    color: #111827;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    font-size: .92rem;
}
.tbp-pagination .page-numbers.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.tbp-pagination a.page-numbers:hover {
    background: #eef2ff;
    color: #667eea;
}

/* Archives / no results */
.tbp-no-results,
.tbp-archive-header {
    background: #fff;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.1);
}

/* Editor styles helper */
.wp-block-quote {
    border-left: 4px solid #667eea;
    padding: .5rem 1rem;
    background: #f8f9ff;
    color: #374151;
}

/* =========================================================
 * 5.  FRONT PAGE — hero, sections, grids, game cards, etc.
 *     These are WordPress-blog-specific; common.css is only
 *     used for the shared header/footer nav.
 * ========================================================= */

/* Hero banner ------------------------------------------------- */
.tbp-hero-section {
    padding: 2.5rem 0 3.5rem;
    margin-top: 1.5rem;
}
.tbp-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 2.5rem;
    align-items: center;
}
.tbp-hero-card {
    background: #fff;
    border-radius: 24px;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 20px 50px rgba(0,0,0,.12);
    position: relative;
    overflow: hidden;
}
.tbp-hero-card::before {
    content: "";
    position: absolute;
    top: -60%; left: -30%;
    width: 70%; height: 220%;
    background: radial-gradient(circle at top left, rgba(102,126,234,.16), transparent 60%);
    pointer-events: none;
}
.tbp-hero-eyebrow {
    display: inline-block;
    padding: .35rem .85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(102,126,234,.12), rgba(118,75,162,.12));
    color: #4f46e5;
    font-weight: 600;
    font-size: .85rem;
    letter-spacing: .02em;
    margin-bottom: 1rem;
    position: relative;
}
.tbp-hero-title {
    font-size: clamp(1.85rem, 3vw, 2.75rem);
    line-height: 1.18;
    margin: 0 0 1rem;
    color: #111827;
    position: relative;
}
.tbp-hero-brand {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.tbp-hero-subtitle {
    font-size: 1.02rem;
    color: #4b5563;
    margin: 0 0 1.6rem;
    position: relative;
}
.tbp-hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.75rem;
    position: relative;
}
.tbp-btn-ghost {
    display: inline-block;
    padding: .75rem 1.55rem;
    border-radius: 999px;
    border: 2px solid rgba(102,126,234,.35);
    color: #4f46e5;
    background: rgba(102,126,234,.05);
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}
.tbp-btn-ghost:hover {
    background: rgba(102,126,234,.12);
    border-color: rgba(102,126,234,.65);
}
.tbp-btn-outline {
    display: inline-block;
    padding: .7rem 1.4rem;
    border-radius: 999px;
    border: 2px solid #667eea;
    color: #667eea;
    background: #fff;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}
.tbp-btn-outline:hover {
    background: #667eea;
    color: #fff;
}
.tbp-hero-stats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
    position: relative;
}
.tbp-hero-stats li {
    display: flex;
    flex-direction: column;
    padding: .75rem .9rem;
    background: #f8faff;
    border-radius: 12px;
    border: 1px solid #eef2ff;
}
.tbp-hero-stats li strong {
    font-size: 1.4rem;
    color: #4f46e5;
    line-height: 1.1;
    margin-bottom: .2rem;
}
.tbp-hero-stats li span {
    font-size: .85rem;
    color: #6b7280;
}

.tbp-hero-art {
    position: relative;
    aspect-ratio: 5 / 4;
    max-height: 440px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(102,126,234,.22), rgba(118,75,162,.22));
    box-shadow: 0 20px 50px rgba(102,126,234,.25);
    overflow: hidden;
}
.tbp-hero-art::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,.55), transparent 45%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,.35), transparent 45%);
}
.tbp-hero-emoji {
    position: absolute;
    background: #fff;
    width: clamp(48px, 6vw, 72px);
    height: clamp(48px, 6vw, 72px);
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    box-shadow: 0 12px 26px rgba(0,0,0,.14);
}
.tbp-hero-emoji-main {
    width: clamp(96px, 11vw, 140px);
    height: clamp(96px, 11vw, 140px);
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    border-radius: 32px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffffff, #f5f7ff);
}
.tbp-hero-emoji-a { top: 10%; left: 12%; animation: tbpFloatA 6s ease-in-out infinite; }
.tbp-hero-emoji-b { top: 18%; right: 14%; animation: tbpFloatB 7s ease-in-out infinite; }
.tbp-hero-emoji-c { bottom: 18%; left: 10%; animation: tbpFloatB 6.5s ease-in-out infinite; }
.tbp-hero-emoji-d { bottom: 12%; right: 12%; animation: tbpFloatA 7.5s ease-in-out infinite; }
@keyframes tbpFloatA { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes tbpFloatB { 0%,100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

/* Section shared ------------------------------------------------- */
.tbp-section {
    padding: 1.75rem 0 2.75rem;
}
.tbp-section + .tbp-section {
    padding-top: 1.25rem;
}

/* Solid-white inner wrapper so NO CONTENT ever sits directly on the
   purple gradient body. 100% contrast guarantee vs cached/legacy text. */
.tbp-section-inner {
    background: #ffffff;
    border-radius: 22px;
    padding: 2.2rem;
    box-shadow: 0 18px 45px rgba(0,0,0,.10);
    margin-bottom: 1.5rem;
    position: relative;
}

/* Hero section wrapper — same white bg treatment with extra padding */
.tbp-hero-section .tbp-section-inner {
    padding: 1.5rem;
}

/* EXPLICIT DARK TEXT COLORS inside every section wrapper.
   These use !important as a last-resort defence against cached
   body-text-on-gradient rules (the exact "text still not visible" bug). */
.tbp-section-inner .tbp-section-header,
.tbp-section-inner .tbp-section-title,
.tbp-section-inner h1,
.tbp-section-inner h2,
.tbp-section-inner h3,
.tbp-section-inner h4,
.tbp-section-inner h5,
.tbp-section-inner h6 {
    color: #111827 !important;
}
.tbp-section-inner p,
.tbp-section-inner li,
.tbp-section-inner span,
.tbp-section-inner .tbp-section-sub,
.tbp-section-inner .tbp-card__excerpt,
.tbp-section-inner .tbp-card__title,
.tbp-section-inner .tbp-card__meta {
    color: #111827 !important;
}
.tbp-section-inner .tbp-section-sub,
.tbp-section-inner .tbp-card__excerpt,
.tbp-section-inner .tbp-card__meta {
    color: #4b5563 !important;
}
.tbp-section-inner .tbp-hero-subtitle {
    color: #4b5563 !important;
}

.tbp-section-header {
    text-align: left;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    background: #fff;  /* fallback defence */
    position: relative;
}
.tbp-section-title {
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    margin: 0;
    color: #111827;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.tbp-section-title-accent {
    display: inline-grid;
    place-items: center;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(102,126,234,.12), rgba(118,75,162,.12));
    font-size: 1.25rem;
}
.tbp-section-sub {
    margin: 0;
    color: #4b5563;
    max-width: 760px;
}
.tbp-section-footer {
    margin-top: 2rem;
    text-align: left;
}

/* Blog cards grid (shared with home.php/archive) ---------------- */
.tbp-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Game card grid (home page popular games) ---------------------- */
.tbp-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.4rem;
}
.tbp-game-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
    color: inherit;
    text-decoration: none;
}
.tbp-game-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0,0,0,.14);
    color: inherit;
}
.tbp-game-media {
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
    position: relative;
    overflow: hidden;
}
.tbp-game-icon {
    font-size: 3rem;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,.10));
}

/* Per-game tinted headers so the 12 cards feel distinct. */
.tbp-tint-wordle    .tbp-game-media { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.tbp-tint-sudoku    .tbp-game-media { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.tbp-tint-mine      .tbp-game-media { background: linear-gradient(135deg, #111827 0%, #374151 100%); }
.tbp-tint-2048      .tbp-game-media { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); }
.tbp-tint-bubble    .tbp-game-media { background: linear-gradient(135deg, #22d3ee 0%, #0891b2 100%); }
.tbp-tint-jigsaw    .tbp-game-media { background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%); }
.tbp-tint-snake     .tbp-game-media { background: linear-gradient(135deg, #84cc16 0%, #4d7c0f 100%); }
.tbp-tint-memory    .tbp-game-media { background: linear-gradient(135deg, #ec4899 0%, #be185d 100%); }
.tbp-tint-crossword .tbp-game-media { background: linear-gradient(135deg, #f97316 0%, #c2410c 100%); }
.tbp-tint-aim       .tbp-game-media { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.tbp-tint-typing    .tbp-game-media { background: linear-gradient(135deg, #64748b 0%, #334155 100%); }
.tbp-tint-color     .tbp-game-media { background: linear-gradient(135deg, #f472b6 0%, #c026d3 50%, #6366f1 100%); }

.tbp-tint-wordle    .tbp-game-icon,
.tbp-tint-sudoku    .tbp-game-icon,
.tbp-tint-mine      .tbp-game-icon,
.tbp-tint-2048      .tbp-game-icon,
.tbp-tint-bubble    .tbp-game-icon,
.tbp-tint-jigsaw    .tbp-game-icon,
.tbp-tint-snake     .tbp-game-icon,
.tbp-tint-memory    .tbp-game-icon,
.tbp-tint-crossword .tbp-game-icon,
.tbp-tint-aim       .tbp-game-icon,
.tbp-tint-typing    .tbp-game-icon,
.tbp-tint-color     .tbp-game-icon {
    color: #fff;
}

.tbp-game-play {
    display: inline-block;
    margin-top: auto;
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

/* =========================================================
   DEFENSIVE CONTRAST OVERRIDES (last-resort, fight cache)
   These explicitly force white card backgrounds + dark text
   so even if an old cached style.css or common.css leaks,
   the home page remains 100% readable.
   ========================================================= */
.tbp-front-page .tbp-card,
.tbp-front-page .tbp-game-card,
.tbp-front-page .tbp-related-card {
    background: #ffffff !important;
    box-shadow: 0 12px 32px rgba(0,0,0,.10) !important;
}
.tbp-front-page .tbp-game-card .tbp-card__body,
.tbp-front-page .tbp-card .tbp-card__body {
    background: #ffffff !important;
}
.tbp-front-page .tbp-card .tbp-card__title,
.tbp-front-page .tbp-game-card .tbp-card__title,
.tbp-front-page .tbp-related-card h3,
.tbp-front-page .tbp-hero-title,
.tbp-front-page .tbp-hero-eyebrow,
.tbp-front-page .tbp-hero-stats li strong,
.tbp-front-page .tbp-hero-stats li span,
.tbp-front-page .tbp-game-play {
    color: #111827 !important;
}
.tbp-front-page .tbp-card .tbp-card__excerpt,
.tbp-front-page .tbp-game-card .tbp-card__excerpt,
.tbp-front-page .tbp-related-card p,
.tbp-front-page .tbp-hero-subtitle,
.tbp-front-page .tbp-hero-stats li span,
.tbp-front-page .tbp-empty {
    color: #4b5563 !important;
}
.tbp-front-page .tbp-game-play { color: #667eea !important; }
.tbp-front-page .tbp-hero-stats li strong { color: #4f46e5 !important; }
.tbp-front-page .tbp-hero-brand {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
}
.tbp-front-page .tbp-empty { background: #fff !important; }

/* Cross-links / guides grid ---------------------------------- */
.tbp-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.3rem;
}
.tbp-related-card {
    display: block;
    padding: 1.3rem 1.35rem;
    color: inherit;
    text-decoration: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border: 1px solid #eef2ff;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tbp-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0,0,0,.10);
    border-color: #c7d2fe;
    color: inherit;
}
.tbp-related-card h3 {
    font-size: 1.1rem;
    margin: 0 0 .4rem;
    color: #111827;
}
.tbp-related-card p { margin: 0; color: #4b5563; font-size: .95rem; }

/* Empty state card -------------------------------------------- */
.tbp-empty {
    padding: 1.75rem 2rem;
    color: #4b5563;
}

/* =========================================================
 * 6.  RESPONSIVE (mobile menu opens from hamburger)
 * ========================================================= */
@media (max-width: 1024px) {
    .tbp-hero-layout { grid-template-columns: 1fr; }
    .tbp-hero-art { max-height: 360px; order: -1; }
}
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: #fff;
        width: 100%;
        text-align: left;
        transition: .3s left ease;
        box-shadow: 0 10px 27px rgba(0,0,0,.05);
        padding: 1rem 0 1rem 1.5rem;
        gap: 0;
        max-height: 80vh;
        overflow-y: auto;
    }
    .nav-menu.active { left: 0; }
    .nav-menu li { margin: .4rem 0; }

    .hamburger { display: flex; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .nav-container { padding: 0 14px; }
    .tbp-content-wrap,
    .tbp-layout,
    .tbp-layout-sidebar {
        grid-template-columns: 1fr;
    }
    .tbp-post-nav { grid-template-columns: 1fr; }

    /* Reduce section-inner padding on tablets */
    .tbp-section-inner { padding: 1.5rem; border-radius: 18px; }
    .tbp-hero-section .tbp-section-inner { padding: 1.1rem; }

    /* Mobile dropdowns open inline when parent has .active */
    .navbar .nav-item > .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0;
        display: none;
        min-width: 0;
        border-radius: 0;
        background: transparent;
    }
    .navbar .nav-item.has-dropdown.active > .dropdown { display: block; }
    .navbar .dropdown-item > .submenu {
        display: none;
        padding-left: 10px;
        border-left: 2px solid rgba(17, 24, 39, .10);
        position: static;
        left: auto;
        top: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: transparent;
        border-radius: 0;
        padding-top: 4px;
        padding-bottom: 4px;
    }
    .navbar .dropdown-item.has-submenu.active > .submenu { display: block; }
    .navbar .dropdown-link {
        padding: 10px 16px 10px 0;
        border-top: 1px solid #eee;
        border-radius: 0 !important;
    }
}
@media (max-width: 480px) {
    .tbp-single, .tbp-comments, .tbp-sidebar-card, .tbp-no-results, .tbp-archive-header {
        padding: 1.25rem;
        border-radius: 12px;
    }
    .tbp-section-inner { padding: 1.1rem !important; border-radius: 14px; margin-bottom: 1rem; }
    .tbp-hero-section .tbp-section-inner { padding: .9rem !important; }
    .tbp-hero-card { padding: 1.5rem 1.25rem !important; }
}
