/*
Theme Name: Blocksy FreePlayOn Child
Theme URI: https://FreePlayOn.com/
Description: A child theme for Blocksy, customized for FreePlayOn HTML5 games platform.
Author: FreePlayOn
Author URI: https://FreePlayOn.com/
Template: blocksy
Version: 1.2.0
Text Domain: blocksy-freeplayon
*/

/*
  This file is for your custom CSS.
  All styles defined here will override or extend the parent Blocksy theme's styles.

  You do NOT need to @import the parent theme's stylesheet here.
  The functions.php file handles enqueuing the parent's styles correctly.
*/

/* --- Global Styling Adjustments (Poki Inspired) --- */
body {
    font-family: 'Inter', sans-serif; /* Using Inter as a modern, clean font */
    background-color: #1a1a1a !important; /* Dark background for a gaming feel */
    color: #f0f0f0 !important; /* Light text color */
}

/* Ensure Blocksy's default header/footer colors are overridden if needed */
.ct-header, .ct-footer {
    background-color: #1a1a1a !important;
    color: #f0f0f0 !important;
}
.ct-header a, .ct-footer a {
    color: #4CAF50 !important;
}

a {
    color: #4CAF50; /* A vibrant green for links */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #66BB6A;
}

/* General button styling */
.button, .wp-block-button__link {
    background-color: #007bff; /* A standard blue */
    color: white;
    padding: 10px 20px;
    border-radius: 8px; /* Rounded corners */
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.button:hover, .wp-block-button__link:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Custom "Load More" Button Style */
.freeplayon-button {
    background-color: transparent;
    color: #4CAF50; /* Vibrant green */
    padding: 12px 30px;
    border-radius: 50px; /* Pill shape */
    border: 2px solid #4CAF50;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease; /* Transition all properties */
    cursor: pointer;
}

.freeplayon-button:hover:not(:disabled) {
    background-color: #4CAF50;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3); /* Green glow */
}

.freeplayon-button.loading {
    background-color: #4CAF50;
    cursor: wait;
}

/* --- Homepage (front-page.php) Specific Styles --- */
.game-home-container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.home-title {
    text-align: center;
    font-family: 'Russo One', sans-serif;
    color: #00c3ff; /* Bright blue for main titles */
    font-size: 2.2rem; /* Adjusted for desktop */
    margin-bottom: 15px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    text-transform: uppercase;
}

.freeplayon-button .button-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.freeplayon-button.loading .button-text {
    display: none;
}

.freeplayon-button.loading .button-spinner {
    display: block;
}

/* --- Loading Overlay for Game Grid --- */
.game-grid-wrapper {
    position: relative;
}

.grid-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 26, 0.7);
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.grid-loading-overlay.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.grid-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #00c3ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px; /* Increased gap for better spacing */
}

.game-card {
    position: relative; /* Required for pseudo-elements */
    z-index: 1;
    background: #1e1e1e; /* The main background color */
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* This is crucial */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* The background mask that sits on top of the animated border */
.game-card::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    background: #1e1e1e; /* Same as the card's main background */
    border-radius: 8px; /* Slightly smaller radius to create the border effect */
    z-index: -1; /* Sits behind the content but above the animated border */
}

/* The animated conic gradient for the border */
.game-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    background: conic-gradient(from 180deg, transparent 0deg 90deg, #00c3ff 270deg 360deg);
    animation: spin-border 2s linear infinite;
    transform: translate(-50%, -50%);
    opacity: 0; /* Hidden by default */
    transition: opacity 0.4s ease-in-out;
    z-index: -2; /* Sits behind everything */
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 195, 255, 0.2); /* Blue glow from search bar focus */
}

.game-card:hover::before {
    opacity: 1; /* Show the animated border on hover */
}

.game-card a {
    display: block; /* Make the whole card clickable */
    color: inherit;
}

.game-thumbnail {
    margin-bottom: 10px;
    line-height: 0;
    overflow: hidden; /* For the image zoom effect */
}

.game-thumbnail img {
    width: 100%;
    height: 120px; /* Fixed height for thumbnails */
    object-fit: cover; /* Ensures images cover the area without distortion */
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.1);
}

.game-card-details {
    padding: 0 5px;
}

.game-card .game-title {
    margin-top: 10px;
    font-family: sans-serif; /* New font for card titles */
    font-size: 0.9rem; /* Increased size for better readability */
    font-weight: 700; /* Make it bold */
    color: #fff;
    white-space: nowrap; /* Prevent title from wrapping */
    overflow: hidden; /* Hide overflow text */
    text-overflow: ellipsis; /* Add ellipsis for overflow text */
    margin-bottom: 5px; /* Add space for view count */
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-card:hover .game-title {
    color: #00c3ff; /* Highlight title with the accent color */
}

.game-card-views {
    font-size: 0.85rem;
    color: #aaa;
    display: block; /* Ensure it's on its own line */
}

.view-all-games-button-container {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

@keyframes spin-border {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.view-all-games-button-container {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.load-more-button-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* --- Most Popular Section --- */
.popular-games-section {
    margin-bottom: 20px; /* Reduced margin to bring sections closer */
}

.section-title-toggle {
    cursor: pointer;
    transition: color 0.3s ease;
}

.section-title-toggle:hover {
    color: #66BB6A; /* Use a hover color consistent with links */
}

.popular-games-grid {
    display: flex;
    overflow-x: auto; /* Enable horizontal scrolling */
    overflow-y: hidden; /* Prevent vertical scrollbar */
    padding-top: 10px; /* Add space for the hover effect to prevent clipping */
    gap: 20px; /* Space between cards */
    padding-bottom: 20px; /* Make space for the scrollbar so it doesn't overlap content */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS devices */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: #4CAF50 #1e1e1e; /* Scrollbar thumb and track color for Firefox */
}

/* Aesthetically hide the scrollbar in WebKit browsers (Chrome, Safari) but keep functionality */
.popular-games-grid::-webkit-scrollbar {
    height: 8px;
}

.popular-games-grid::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 4px;
}

.popular-games-grid::-webkit-scrollbar-thumb {
    background-color: #4CAF50;
    border-radius: 4px;
    border: 2px solid #1e1e1e; /* Creates padding around the thumb */
}

.popular-games-grid > .popular-card {
    flex: 0 0 250px; /* Prevent cards from shrinking/growing, set a fixed width */
    width: 250px;
    /* Re-apply hardware acceleration specifically for popular cards to fix mobile rendering glitches */
    transform: translateZ(0);
}

.popular-card .game-thumbnail {
    position: relative; /* For positioning the badge */
}

.popular-card .game-thumbnail img {
    height: 150px; /* Taller images for popular cards */
}

.popular-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff4500; /* A fiery orange-red */
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.popular-badge .fa-fire {
    font-size: 0.9em;
}

/* Visually hide an element, but leave it available for screen readers and crawlers */
.visually-hidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/* --- Single Game Page (single-game.php) Specific Styles --- */
.game-page-container {
    margin: 0;
    padding: 0;
    max-width: 100vw; /* Ensure it takes full viewport width */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.game-page-container > .game-title { /* Targeting the h1 directly under main */
    text-align: center;
    font-family: 'Russo One', sans-serif;
    padding: 20px;
    color: #00c3ff;
    font-size: 2.2rem; /* Adjusted for desktop */
    margin-bottom: 20px;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    text-transform: uppercase;
}

.game-meta-info {
    text-align: center;
    margin-bottom: 20px;
    color: #ccc;
    font-size: 1.1rem;
}

.game-meta-info .view-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #2a2a2a;
    padding: 5px 15px;
    border-radius: 20px;
}

.game-meta-info .fa-eye {
    color: #4CAF50;
}

.game-iframe-wrapper {
    position: relative; /* For positioning loading indicator and full-screen button */
    margin: 0 auto; /* Center the wrapper */
    max-width: 1200px; /* Max width for the game iframe area */
    padding: 0 20px; /* Padding on sides for smaller screens */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Style for the iframe container, ensuring responsiveness */
.game-embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio (height / width * 100) */
    height: 0;
    overflow: hidden;
    background-color: #000; /* Black background while game loads */
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.game-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px; /* Match container border-radius */
    display: block; /* Remove extra space below iframe */
}

/* Full-screen button styling */
.fullscreen-button {
    position: absolute;
    bottom: 20px;
    right: 40px; /* Adjusted from 20px to account for wrapper padding */
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 20; /* Above iframe and loading indicator */
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fullscreen-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translateY(-2px);
}

/* Style for a loading indicator */
.game-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.2em;
    z-index: 15; /* Above iframe but below full-screen button */
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #4CAF50; /* Green spinner */
    border-radius: 50%;
    width: 50px; /* Slightly larger spinner */
    height: 50px;
    animation: spin 1s linear infinite;
    display: flex; /* Use flex for centering text if added */
    justify-content: center;
    align-items: center;
}

/* --- iOS Fullscreen Workaround --- */
body.ios-fullscreen-mode {
	overflow: hidden !important; /* Prevent scrolling of the page behind the game */
}

/* Hide header and footer, which are outside the main container */
body.ios-fullscreen-mode .ct-header,
body.ios-fullscreen-mode .ct-footer {
	display: none !important;
}

/* Make the main game page container fill the screen */
body.ios-fullscreen-mode .game-page-container {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 99999 !important;
	padding: 0 !important;
	margin: 0 !important;
	background-color: #000 !important;
	max-width: none !important;
	overflow: hidden !important; /* Hide anything that might overflow */
}

/* Hide all sections inside the main container EXCEPT the game wrapper */
body.ios-fullscreen-mode .game-page-container > *:not(.game-iframe-wrapper) {
	display: none !important;
}

/* Ensure the game wrapper and its contents fill the new fullscreen container */
body.ios-fullscreen-mode .game-iframe-wrapper {
	position: static !important; /* Reset position to flow within the new fixed parent */
	height: 100% !important;
	padding: 0 !important;
	max-width: none !important;
}

body.ios-fullscreen-mode .game-embed-container {
	height: 100% !important;
	padding-bottom: 0 !important;
	border-radius: 0 !important;
}

body.ios-fullscreen-mode .game-embed-container iframe {
	border-radius: 0 !important;
}

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

.game-description {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-description h2 {
    font-family: 'Russo One', sans-serif;
    color: #00c3ff;
    font-size: 1.6rem; /* Adjusted for desktop */
    margin-bottom: 15px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 5px;
    text-transform: uppercase;
}

.game-description p, .game-content {
    color: #ddd;
    line-height: 1.7;
    font-size: 1.1rem;
}

.game-tags {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #ddd;
}

.game-tags strong {
    color: #00c3ff;
    margin-right: 5px;
}

.game-tags a {
    background-color: #333;
    color: #eee;
    padding: 5px 10px;
    border-radius: 5px;
    margin-right: 8px;
    margin-bottom: 8px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.game-tags a:hover {
    background-color: #4CAF50;
    color: #fff;
}

/* --- Breadcrumbs and Search (from existing style.css) --- */
.breadcrumbs {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 15px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px; /* Add padding for consistency */
}
.breadcrumbs a {
    color: #00c3ff;
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}
.live-search-container {
    margin-bottom: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px; /* Add padding for consistency */
    position: relative; /* For positioning search results */
}
.live-search-container input[type="search"] {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background-color: #333;
    color: #ffffff; /* Set default text color to white */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease;
}
.live-search-container input[type="search"]:focus {
    outline: none;
    background-color: #2a2a2a; /* Darken background slightly on focus */
}
.live-search-container input[type="search"]::placeholder {
    color: #aaa;
}

/* Live Search Results Dropdown */
.live-search-results {
    position: absolute;
    top: 100%; /* Position below the search input */
    left: 20px; /* Align with input padding */
    width: calc(100% - 40px); /* Adjust for padding */
    max-width: 400px;
    background-color: #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    z-index: 100; /* Ensure it's above other content */
    overflow: hidden; /* For rounded corners */
    max-height: 300px; /* Limit height and add scroll if many results */
    overflow-y: auto;
    border: 1px solid #4CAF50; /* Green border for emphasis */
    display: none; /* Hidden by default, shown by JS */
}

.live-search-result-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #3a3a3a;
    transition: background-color 0.2s ease;
}

.live-search-result-item:last-child {
    border-bottom: none;
}

.live-search-result-item:hover {
    background-color: #3a3a3a;
}

.live-search-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 10px;
}

.live-search-title {
    color: #f0f0f0;
    font-size: 1rem;
    font-weight: bold;
}

.live-search-results .no-results {
    padding: 15px;
    text-align: center;
    color: #ccc;
}

/* --- Header Search Bar (Enhanced Design) --- */
.header-search-container {
    position: relative;
    width: 100%;
    max-width: 350px; /* Adjust as needed for your header layout */
    margin: 0; /* Reset margin for header placement */
    padding: 0;
}

.header-search-container .search-icon {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    color: #aaa;
    z-index: 2;
    transition: color 0.3s ease;
    pointer-events: none; /* Ensures clicking the icon still focuses the input */
}

.header-search-container input[type="search"] {
    width: 100%;
    padding: 12px 20px 12px 48px; /* Top, Right, Bottom, Left (space for icon) */
    border-radius: 50px; /* Pill shape */
    background-color: #2a2a2a;
    color: #ffffff;
    border: 2px solid #333;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: none; /* Remove inset shadow for a flatter look */
}

.header-search-container input[type="search"]:focus {
    outline: none;
    color: #ffffff; /* Ensure text color stays white on focus */
    border-color: #00c3ff; /* Use the bright blue accent on focus */
    background-color: #1e1e1e;
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.2); /* Add a subtle glow */
}

.header-search-container input[type="search"]:focus ~ .search-icon {
    color: #00c3ff; /* Make icon blue on focus */
}

.header-search-container .live-search-results {
    top: calc(100% + 8px); /* Position slightly below the input */
    left: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 12px; /* Softer corners */
    border: 2px solid #00c3ff; /* Match the focus color */
    margin-top: 0;
}

/* Related Games Section */
.related-games-section {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.related-games-section h2 {
    font-family: 'Russo One', sans-serif;
    color: #00c3ff;
    font-size: 1.6rem; /* Adjusted for desktop */
    margin-bottom: 15px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 5px;
    text-transform: uppercase;
}

.related-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* Slightly smaller for related */
    gap: 15px;
}

/* Re-using .game-card styles for related games, but can override if needed */
.related-games-grid .game-card {
    /* Specific overrides for related game cards if desired */
}

/* --- Game Categories (front-page.php) --- */
.game-categories-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto 20px auto;
    background-color: #1e1e1e;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-categories-container .section-title {
    font-family: 'Russo One', sans-serif;
    color: #00c3ff;
    font-size: 1.6rem; /* Adjusted for desktop */
    margin-bottom: 15px;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 5px;
    text-align: left;
    text-transform: uppercase;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-filter-button {
    background-color: #333;
    color: #eee;
    padding: 8px 15px;
    border-radius: 20px; /* Pill shape */
    transition: background-color 0.3s ease, color 0.3s ease;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit; /* Ensure consistent font */
    font-size: 0.95rem;
}

.category-filter-button:hover {
    background-color: #4CAF50;
    color: #fff;
}

.category-filter-button.active {
    background-color: #00c3ff; /* Active filter color */
    color: #1a1a1a; /* Dark text for better contrast on active button */
    font-weight: bold;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .home-title, .game-page-container > .game-title {
        font-size: 2rem;
    }
    .game-grid {
        gap: 15px;
    }
    .game-card .game-title {
        font-size: 1rem;
    }
    .game-description h2, .related-games-section h2, .game-categories-container .section-title {
        font-size: 1.5rem;
    }
    .game-description p, .game-content {
        font-size: 1rem;
    }
    .related-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .game-home-container, .game-description, .game-tags, .breadcrumbs, .live-search-container, .related-games-section {
        padding: 15px;
    }
    .home-title, .game-page-container > .game-title {
        font-size: 1.8rem;
    }
    .game-description h2, .related-games-section h2, .game-categories-container .section-title {
        font-size: 1.4rem; /* Add responsive size for tablets */
    }
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Smaller cards on mobile */
        gap: 10px;
    }
    .game-thumbnail img {
        height: 100px; /* Adjust thumbnail height for mobile */
    }
    .game-iframe-wrapper {
        padding: 0 10px; /* Less padding on very small screens */
    }
    .fullscreen-button {
        bottom: 10px;
        right: 20px;
        padding: 8px 12px;
        font-size: 1rem;
    }
    .game-loading-indicator {
        width: 40px;
        height: 40px;
    }
    .live-search-results {
        left: 15px; /* Adjust for smaller screen padding */
        width: calc(100% - 30px);
    }
    .related-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .popular-games-grid > .popular-card {
        flex-basis: 220px; /* Adjust popular card size for tablets */
        width: 220px;
    }
}

@media (max-width: 480px) {
    .home-title, .game-page-container > .game-title {
        font-size: 1.5rem;
    }
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Even smaller cards */
    }
    .game-thumbnail img {
        height: 80px;
    }
    .game-card .game-title {
        font-size: 0.9rem;
    }
    .game-description h2, .related-games-section h2, .game-categories-container .section-title {
        font-size: 1.3rem;
    }
    .game-description p, .game-content {
        font-size: 0.9rem;
    }
    .related-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    .popular-games-grid > .popular-card {
        flex-basis: 180px; /* Make popular cards smaller on mobile */
        width: 180px;
    }
}
/* Change all WPForms field labels to blue */
.wpforms-form .wpforms-field-label,
.wpforms-form .wpforms-field-sublabel {
    color: #00d084 !important;
}

/* Make input and textarea background gray */
.wpforms-form input[type="text"],
.wpforms-form input[type="email"],
.wpforms-form input[type="url"],
.wpforms-form input[type="tel"],
.wpforms-form textarea {
    background-color: #f0f0f0 !important;
    color: #000 !important; /* Optional: set text color to black */
}

/* --- Styling for Blocksy Theme's Default Search Form --- */
/* This targets the search form on archive pages (like tags) to match the site's aesthetic. */

/* Main form container - center it and give it a max-width */
.ct-search-form {
    position: relative; /* Needed for positioning the button */
    width: 100%;
    max-width: 450px;
    margin: 20px auto 40px auto; /* Center on page with vertical spacing */
}

/* The search input field - this is the main part to style */
.ct-search-form input[type="search"] {
	width: 100%;
	padding: 12px 50px 12px 20px !important;
	border-radius: 50px !important;
	background-color: #2a2a2a !important;
	color: #ffffff !important;
	border: 2px solid #333 !important;
	font-size: 1rem;
	transition: all 0.3s ease;
	box-shadow: none !important;
}

/* Placeholder text style */
.ct-search-form input[type="search"]::placeholder {
	color: #aaa;
}

/* Focus state for the input */
.ct-search-form input[type="search"]:focus {
	outline: none;
	border-color: #00c3ff !important;
	background-color: #1e1e1e !important;
	box-shadow: 0 0 15px rgba(0, 195, 255, 0.2) !important;
}

/* The container for the submit button, positioned on the right */
.ct-search-form .ct-search-form-controls {
	position: absolute;
	top: 0;
	right: 5px;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* The submit button itself */
.ct-search-form .wp-element-button {
	background: transparent !important;
	border: none !important;
	padding: 0 12px !important;
	cursor: pointer;
	height: 100%;
	display: flex;
	align-items: center;
	box-shadow: none !important;
}

/* The SVG search icon inside the button */
.ct-search-form .ct-search-form-controls .ct-icon {
	color: #aaa !important;
	width: 18px;
	height: 18px;
	transition: color 0.3s ease;
}

/* Change icon color when the input is focused */
.ct-search-form input[type="search"]:focus ~ .ct-search-form-controls .ct-icon {
	color: #00c3ff !important;
}

/* Also change color on button hover for better UX */
.ct-search-form .wp-element-button:hover .ct-icon {
	color: #00c3ff !important;
}

/* --- Styling for Blocksy Theme's Live Search Results Dropdown --- */
/* This ensures the results match the custom search bar's aesthetic. */

/* The main results container */
.ct-search-form .ct-search-results {
	background-color: #1e1e1e !important;
	border: 2px solid #00c3ff !important;
	border-radius: 12px !important;
	box-shadow: 0 5px 15px rgba(0, 195, 255, 0.2) !important;
	margin-top: 8px;
	overflow: hidden;
	max-height: 400px;
	overflow-y: auto;
}

/* Individual result item */
.ct-search-results .ct-search-item {
	display: flex;
	align-items: center;
	padding: 10px 15px !important;
	border-bottom: 1px solid #3a3a3a !important;
	transition: background-color 0.2s ease;
	color: #f0f0f0 !important;
}

.ct-search-results .ct-search-item:last-of-type {
	border-bottom: none !important;
}

.ct-search-results .ct-search-item:hover {
	background-color: #3a3a3a !important;
	color: #00c3ff !important;
}

/* Thumbnail image container and image */
.ct-search-item .ct-media-container {
	margin-right: 15px;
	flex-shrink: 0;
}

.ct-search-item .ct-media-container img {
	width: 50px !important;
	height: 50px !important;
	object-fit: cover;
	border-radius: 8px !important;
	display: block;
}

/* Title text */
.ct-search-item > span:not(.ct-media-container) {
    font-weight: 500;
    font-size: 1rem;
}

/* "Show more" link styling */
.ct-search-results .ct-search-more {
	display: block;
	padding: 12px 15px !important;
	text-align: center;
	font-weight: bold;
	color: #00c3ff !important;
	background-color: #2a2a2a !important;
	transition: background-color 0.2s ease, color 0.2s ease;
	border-top: 1px solid #3a3a3a !important;
}

.ct-search-results .ct-search-more:hover {
	background-color: #333 !important;
	color: #fff !important;
}

/* --- Placeholder for screenshot.png ---
   Create a screenshot.png file (600x450 pixels) in your child theme folder.
   This image will be displayed in the WordPress Appearance > Themes section.
   You can create a simple image representing your FreePlayOn site.
*/