*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --card-bg: #0f3460;
    --accent-color: #e94560;
    --text-color: #e0e0e0;
    --highlight-color: #53bf9d;
    --highlight-color-rgb: 83, 191, 157;
    --star-color: #f39c12;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --container-width-main: 1200px;
    --secondary-bg-transparent: rgba(22, 33, 62, 0.8);
    --font-body-initial: 'Roboto', sans-serif;
    --font-body: 'Roboto', sans-serif;
    --font-heading: 'Roboto', sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--primary-bg);
    color: var(--text-color);
    line-height: 1.7;
}

.container {
    max-width: var(--container-width-main);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.75em;
}

h1.page-title,
h1.game-title,
h1.front-page-main-title {
    color: var(--highlight-color);
}

.site-title-logo a, .site-title-logo a:hover {
    color: #fff;
}
h1.site-title-logo a, p.site-title-logo a {
    font-family: var(--font-heading);
    font-size: 1.8em;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}
.logo h1.site-title-logo {
    font-size: 1.8em;
}

h1 { font-size: 2.8em; }
h2 { font-size: 2.5em; color: var(--highlight-color); text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
h3 { font-size: 1.8em; }
h4 { font-size: 1.2em; }

h2, .h2 {
    margin-bottom: 0.4em;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}
a:hover {
    color: #fff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input[type="submit"],
input[type="button"] {
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.site-header {
    background-color: var(--secondary-bg);
    padding: 15px 0;
    border-bottom: 3px solid var(--accent-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

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

.logo {
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: auto;
}
.logo a {
    display: inline-block;
}
.logo img {
    height: 50px;
    width: auto;
    display: block;
}
.custom-logo-link img {
     height: 50px !important;
     width: auto !important;
}
h1.site-title-logo, p.site-title-logo {
    margin: 0;
}

.main-menu {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    display: flex;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.main-menu ul,
.footer-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.main-menu ul {
    justify-content: center;
}

.main-menu ul li,
.footer-links li {
    margin-left: 25px;
}
.main-menu ul li:first-child,
.footer-links li:first-child {
    margin-left: 0;
}

.main-menu ul a {
    color: var(--text-color);
    font-size: 1.1em;
    font-weight: 500;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-speed) ease, border-bottom-color var(--transition-speed) ease;
    white-space: nowrap;
}
.main-menu ul a:hover,
.main-menu ul .current-menu-item > a,
.main-menu ul .current_page_item > a {
    color: #fff;
    border-bottom-color: var(--accent-color);
}

.search-container {
    position: relative;
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 250px;
}
.search-form {
    display: flex;
    width: 100%;
}

.search-bar {
    display: flex;
    width: 100%;
    align-items: center;
}

.search-bar input[type="search"],
.search-bar input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #555;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    background-color: #333;
    color: #fff;
    outline: none;
    border-right: none;
    flex-grow: 1;
}
.search-bar button[type="submit"],
.search-bar button {
    padding: 8px 15px;
    border: 1px solid var(--accent-color);
    background-color: var(--accent-color);
    color: #fff;
    cursor: pointer;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    transition: background-color var(--transition-speed) ease;
    flex-shrink: 0;
}
.search-bar button:hover {
    background-color: #d03850;
}

#liveSearchResults {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--secondary-bg);
    border: 1px solid var(--card-bg);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    z-index: 999;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: none;
}
#liveSearchResults ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
#liveSearchResults li a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-color);
    border-bottom: 1px solid var(--card-bg);
    transition: background-color var(--transition-speed) ease;
    gap: 10px;
}
#liveSearchResults li:last-child a {
    border-bottom: none;
}
#liveSearchResults li a:hover {
    background-color: var(--card-bg);
    color: #fff;
}
#liveSearchResults li img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
#liveSearchResults li .title {
    font-size: 0.9em;
    line-height: 1.3;
}
#liveSearchResults p {
    padding: 15px;
    text-align: center;
    color: var(--text-color);
    margin: 0;
    font-size: 0.9em;
}

.site-main {
    padding-top: 40px;
    padding-bottom: 40px;
}
.page-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-bg);
}
.page-header .page-title {
    text-align: center;
    margin-bottom: 10px;
}

.page-content, .index-content, .search-results-grid {
    background-color: var(--secondary-bg);
    padding: 25px 35px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.page-content h1.page-title,
.index-content h1.page-title {
    margin-bottom: 20px;
}

body:not(.game-as-front-page) .front-page-content-area {
    background-color: var(--secondary-bg);
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    margin-top: 40px;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
}
body.game-as-front-page .front-page-content-area {
    background-color: transparent;
    box-shadow: none;
    padding: 0;
    margin: 0;
}
body:not(.game-as-front-page) .front-page-content-area h1.front-page-main-title {
    margin-top: 0;
    margin-bottom: 30px;
    text-align: left;
}
body:not(.game-as-front-page) .front-page-content-area .page-editor-content {
    font-size: 1.1em;
    line-height: 1.7;
    text-align: left;
}
body:not(.game-as-front-page) .front-page-content-area .page-editor-content p {
    margin-bottom: 1em;
}
body:not(.game-as-front-page) .front-page-content-area .page-editor-content h2,
body:not(.game-as-front-page) .front-page-content-area .page-editor-content h3 {
    color: var(--highlight-color);
    margin-top: 1.5em;
    margin-bottom: 0.7em;
    text-align: left;
}

.page-entry h2,
.page-entry h3 {
    color: var(--highlight-color);
}

.index-entry, .search-result-item {
    border-bottom: 1px solid var(--card-bg);
    padding-bottom: 25px;
    margin-bottom: 25px;
}
.index-entry:last-child, .search-result-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.index-entry .entry-title a, .search-result-item .entry-title a {
    color: var(--highlight-color);
    font-size: 1.5em;
}
.index-entry .entry-title a:hover, .search-result-item .entry-title a:hover {
    color: var(--accent-color);
}
.index-entry .entry-thumbnail, .search-result-item .entry-thumbnail {
    margin: 15px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
}
.index-entry .read-more-link, .search-result-item .read-more-link {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.9em;
    margin-top: 10px;
}
.index-entry .read-more-link:hover, .search-result-item .read-more-link:hover {
    background-color: #d03850;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}
.pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--card-bg);
    color: var(--text-color);
    border-radius: var(--border-radius);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}
.pagination .prev, .pagination .next {
    font-weight: bold;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
}

.game-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    text-align: center;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: block;
    color: var(--text-color);
}
.game-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4), 0 0 15px var(--accent-color);
}
.game-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 3px solid var(--highlight-color);
    transition: opacity var(--transition-speed) ease;
}
.game-card:hover img {
    opacity: 0.7;
}
.game-card h3, .game-card h4 {
    margin: 15px 0;
    font-size: 1.1em;
    color: #fff;
    padding: 0 10px;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}
.similar-games-section .game-card h4 {
    font-size: 1em;
    margin: 10px 0;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(233, 69, 96, 0.7);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
    pointer-events: none;
}
.game-card:hover .game-overlay {
    opacity: 1;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 1.5em;
    color: var(--text-color);
    padding: 50px 20px;
}

.featured-game-section .section-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 25px;
}

.top-games .section-title {
    text-align: center;
}

.top-rated-games .section-title {
    text-align: center;
}

.featured-game-card {
    border-radius: var(--border-radius);
    overflow: hidden;
}
.game-card-featured-link {
    display: flex;
    flex-direction: row;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: background-color var(--transition-speed);
    border-radius: var(--border-radius);
}
.game-card-featured-link:hover {
    background-color: var(--primary-bg);
}
.game-card-featured-link .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.game-card-featured-link > div:first-child {
    width: 40%;
    flex-shrink: 0;
    border-right: 3px solid var(--highlight-color);
}

.featured-game-content {
    padding: 25px 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.featured-game-content h3 {
    font-size: 2.2em;
    color: #fff;
    margin-top: 0;
    margin-bottom: 15px;
}
.featured-game-content .game-excerpt {
    font-size: 1em;
    margin-bottom: 20px;
    line-height: 1.6;
    color: #ccc;
}
.featured-game-content .game-excerpt p {
    margin-bottom: 0;
}
.featured-game-content .play-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-weight: bold;
    text-align: center;
    transition: background-color var(--transition-speed);
    align-self: flex-start;
    margin-top: auto;
}
.featured-game-content .play-button:hover {
    background-color: var(--highlight-color);
}

.game-page-main {
    padding-top: 30px;
    padding-bottom: 30px;
}

.game-title {
    text-align: center;
}
.game-breadcrumbs {
    text-align: center;
    font-size: 0.9em;
    color: #aaa;
}
.game-breadcrumbs a { color: #ccc; }
.game-breadcrumbs a:hover { color: var(--accent-color); }

.star-rating-section {
    text-align: center;
}
.star-rating-section .stars {
    font-size: 2.5em;
    cursor: pointer;
    line-height: 1;
    color: #444;
}
.star-rating-section .stars .star {
    transition: color 0.2s ease, transform 0.1s ease;
    display: inline-block;
}
.star-rating-section .stars .star.hovered,
.star-rating-section .stars .star:hover {
    color: var(--star-color);
    opacity: 0.7;
    transform: scale(1.1);
}
.star-rating-section .stars .star.selected {
    color: var(--star-color);
    opacity: 1;
    transform: scale(1);
}
.rating-info { font-size: 0.9em; color: #ccc; margin-top: 8px; }

.game-interactive-area {
    margin: 0 auto;
}

.game-launch-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.game-placeholder-wrapper {
    width: 100%;
    position: relative;
    background-color: var(--card-bg);
    background-image:
        linear-gradient(
            100deg,
            transparent 20%,
            rgba(var(--highlight-color-rgb), 0.1) 45%,
            rgba(var(--highlight-color-rgb), 0.1) 55%,
            transparent 80%
        ),
        linear-gradient(
            rgba(255, 255, 255, 0.04) 1px,
            transparent 1px
        );
    background-size:
        250% 100%,
        100% 3px;
    background-repeat: no-repeat, repeat;
    border-radius: var(--border-radius);
    overflow: hidden;
    animation: shimmerEffect 5s infinite linear;
}
.game-placeholder-wrapper::before {
    content: "";
    display: block;
    padding-top: 56.25%;
}

.game-placeholder-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.game-placeholder-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    cursor: pointer;
    margin-bottom: 15px;
}

.game-play-button {
    padding: 10px 25px;
    font-size: 1.2em;
    font-weight: bold;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-speed) ease, transform 0.2s ease;
    flex-shrink: 0;
}
.game-play-button:hover {
    background-color: #d03850;
    transform: scale(1.05);
}

.game-iframe-wrapper {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    background-color: #000;
    border: 3px solid var(--secondary-bg);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

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

.game-controls {
    text-align: center;
    display: none;
}
.fullscreen-button {
    padding: 10px 20px;
    font-size: 1em;
    background-color: var(--highlight-color);
    color: var(--primary-bg);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: inline-flex;
}
.fullscreen-button:hover { background-color: #47a88a; transform: scale(1.05);}

.game-iframe-wrapper:-webkit-full-screen { padding-bottom: 100vh !important; height: 100vh !important; }
.game-iframe-wrapper:-moz-full-screen { padding-bottom: 100vh !important; height: 100vh !important; }
.game-iframe-wrapper:-ms-fullscreen { padding-bottom: 100vh !important; height: 100vh !important; }
.game-iframe-wrapper:fullscreen { padding-bottom: 100vh !important; height: 100vh !important; }

.game-categories-list, .game-tags-list {
    padding: 20px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
}
.game-categories-list h4, .game-tags-list h4 {
    color: var(--highlight-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}
.game-categories-list ul, .game-tags-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.game-categories-list ul li a, .game-tags-list ul li a {
    display: inline-block;
    background-color: var(--secondary-bg);
    color: var(--text-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    transition: background-color 0.3s, color 0.3s;
}
.game-categories-list ul li a:hover, .game-tags-list ul li a:hover {
    background-color: var(--accent-color);
    color: #fff;
}

.game-description-section {
    background-color: var(--secondary-bg);
    padding: 25px 30px;
    border-radius: var(--border-radius);
    text-align: justify;
    font-size: 1.05em;
    line-height: 1.7;
}
.game-description-section h3 {
    margin-top: 0;
    color: var(--highlight-color);
    margin-bottom: 15px;
    text-align: left;
}
.game-description-section p { margin-bottom: 1em; }
.game-description-section a { color: var(--highlight-color); }
.game-description-section a:hover { color: var(--accent-color); }

.local-comments-section {
    background-color: var(--secondary-bg);
    padding: 25px 30px;
    border-radius: var(--border-radius);
}
.local-comments-section h3,
.local-comments-section h4 {
    color: var(--highlight-color);
    text-align: center;
    margin-bottom: 20px;
}
.local-comments-section h4 {
    font-size: 1.6em;
    margin-top: 30px;
}

#localCommentsList .comment-item {
    background-color: var(--card-bg);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-color);
}
#localCommentsList .comment-author {
    font-weight: bold;
    color: var(--highlight-color);
    margin-bottom: 5px;
    font-size: 1.05em;
}
#localCommentsList .comment-date {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 8px;
}
#localCommentsList .comment-text p {
    font-size: 0.95em;
    margin-bottom: 0.5em;
    word-break: break-word;
    line-height: 1.6;
}

#localCommentForm div {
    margin-bottom: 15px;
}
#localCommentForm label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9em;
    color: #ccc;
    font-weight: 500;
}
#localCommentForm input[type="text"],
#localCommentForm textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--border-radius);
    border: 1px solid #444;
    background-color: #333;
    color: var(--text-color);
    font-family: var(--font-body-original);
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}
#localCommentForm input[type="text"]:focus,
#localCommentForm textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 5px var(--accent-color);
    outline: none;
}
#localCommentForm textarea {
    min-height: 100px;
    resize: vertical;
}
#localCommentForm button[type="submit"] {
    padding: 12px 25px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
}
#localCommentForm button[type="submit"]:hover {
    background-color: #d03850;
}

.similar-games-section h3 {
    text-align: center;
    color: var(--highlight-color);
    margin-bottom: 25px;
    font-size: 2em;
}
.similar-games-section .game-card img { height: 120px; }

.site-footer {
    background-color: var(--footer-bg, #0d0d1a);
    color: #888;
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid #333;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-links ul {
    justify-content: center;
}
.footer-links a {
    color: #888;
    margin: 0 10px;
    font-size: 0.9em;
}
.footer-links a:hover {
    color: var(--accent-color);
}
.copyright {
    font-size: 0.9em;
    flex-basis: 100%;
    text-align: center;
    margin-top: 10px;
}
.footer-content > .footer-links, .footer-content > .copyright {
    flex-basis: auto;
}

.ad-placement {
    padding: 10px;
    display: block;
    width: 100%;
    text-align: center;
    min-height: 50px;
    background-color: rgba(0,0,0,0.15);
    border-radius: var(--border-radius);
    box-sizing: border-box;
    margin: 20px auto;
}
.ad-placement iframe,
.ad-placement img,
.ad-placement ins {
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    z-index: 1005;
    order: 2;
}

.mobile-menu-toggle .hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-color);
    position: relative;
    transition: all 0.3s ease;
}

.mobile-menu-toggle .hamburger-icon::before,
.mobile-menu-toggle .hamburger-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

.mobile-menu-toggle .hamburger-icon::before {
    top: -7px;
}

.mobile-menu-toggle .hamburger-icon::after {
    bottom: -7px;
}

.mobile-menu-toggle.active .hamburger-icon {
    background-color: transparent;
}
.mobile-menu-toggle.active .hamburger-icon::before {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active .hamburger-icon::after {
    transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}

@media (max-width: 1024px) {
    .featured-game-content h3 {
        font-size: 1.8em;
    }
}

@media (max-width: 768px) {
    h1, h1.page-title, h1.game-title, h1.front-page-main-title { font-size: 2.2em; }
    h2, .featured-game-section .section-title, .similar-games-section h3 { font-size: 1.8em; }
    h3, .featured-game-content h3 { font-size: 1.5em; }

    .header-content {
        align-items: center;
    }

    .logo {
        flex-grow: 1;
        flex-shrink: 1;
    }

    .mobile-menu-toggle {
        display: block;
        order: 2;
        margin-left: 15px;
    }

    .main-menu {
        order: 3;
        width: 100%;
        position: relative;
        flex-grow: 0;
        flex-basis: 100%;
        justify-content: flex-start;
        overflow: visible;
    }

    .main-menu.active ul#primary-menu-ul {
        display: flex;
    }

    .main-menu ul#primary-menu-ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 15px);
        left: 0;
        right: 0;
        background-color: var(--secondary-bg);
        padding: 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
        border-top: 1px solid var(--card-bg);
        z-index: 1000;
    }

    .main-menu ul#primary-menu-ul li {
        margin-left: 0;
        width: 100%;
    }

    .main-menu ul#primary-menu-ul li a {
        display: block;
        padding: 12px 20px;
        border-bottom: 1px solid var(--card-bg);
        text-align: left;
        font-size: 1em;
        border-bottom-color: var(--card-bg) !important;
    }
    .main-menu ul#primary-menu-ul li:last-child a {
        border-bottom: none;
    }

    .main-menu ul#primary-menu-ul a:hover,
    .main-menu ul#primary-menu-ul .current-menu-item > a,
    .main-menu ul#primary-menu-ul .current_page_item > a {
        color: #fff;
        background-color: var(--accent-color);
    }

    .search-container {
        order: 4;
        margin-top: 15px;
        flex-grow: 0;
        flex-basis: 100%;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }

    .game-card-featured-link {
        flex-direction: column;
    }
    .game-card-featured-link > div:first-child {
        width: 100%;
        height: 220px;
        border-right: none;
        border-bottom: 3px solid var(--highlight-color);
    }
    .featured-game-content {
        padding: 20px;
    }
    .featured-game-content .play-button {
        align-self: center;
    }

    body:not(.game-as-front-page) .front-page-content-area,
    .page-content, .index-content, .search-results-grid,
    .game-description-section, .local-comments-section, .featured-game-section,
    .archive-description-top {
        padding: 20px;
    }

    .game-placeholder-content {
        padding: 15px;
    }

    .game-play-button {
        font-size: 1.1em;
        padding: 8px 20px;
    }
}

@media (max-width: 480px) {
    h1, h1.page-title, h1.game-title, h1.front-page-main-title { font-size: 1.8em; }
    h2, .featured-game-section .section-title, .similar-games-section h3 { font-size: 1.6em; }
    h3, .featured-game-content h3 { font-size: 1.3em; }

     .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }
    .game-card h3, .game-card h4 {
        font-size: 1em;
        min-height: 2em;
    }

    .search-bar input[type="search"] {
    }

    .star-rating-section .stars {
        font-size: 2em;
    }

    .footer-content {
        flex-direction: column;
        gap: 15px;
    }
    .footer-links ul {
        flex-direction: column;
        gap: 8px;
    }
    .footer-links li {
        margin-left: 0;
    }

    .game-placeholder-content {
        padding: 10px;
    }

     .game-play-button {
        font-size: 1em;
        padding: 8px 18px;
    }
}

@keyframes shimmerEffect {
    0% {
        background-position:
            -150% center,
            0 0;
    }
    100% {
        background-position:
            250% center,
            0 0;
    }
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: #21759b;
	display: block;
	font-size: 14px;
	font-weight: bold;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

.client-filter-container {
    position: relative;
}

.client-game-filter-input {
    box-sizing: border-box;
    width: 100%;
    height: 50px;
    padding: 10px 20px 10px 50px;
    background-color: var(--secondary-bg, #16213e);
    border: 1px solid var(--card-bg, #0f3460);
    border-radius: 8px;
    color: var(--text-color, #e0e0e0);
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.client-game-filter-input::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

.client-game-filter-input:focus {
    outline: none;
    border-color: var(--highlight-color, #53bf9d);
    box-shadow: 0 0 0 3px rgba(83, 191, 157, 0.2);
}

.client-filter-container .filter-icon-GF {
    position: absolute;
    top: 50%;
    left: 18px;
    transform: translateY(-50%);
    color: var(--text-color);
    opacity: 0.5;
    pointer-events: none;
    font-size: 18px;
}

@media (max-width: 768px) {
    .ad-placement.ad-placement-single_above_title {
        display: none !important;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .game-placeholder-wrapper::before {
        padding-top: 0;
    }
    .game-placeholder-wrapper {
        height: 65vh;
        min-height: 480px;
    }
}

.star-rating-section.disabled .stars {
    cursor: not-allowed;
    opacity: 0.7;
}
.star-rating-section.processing .stars {
    cursor: wait;
}
.user-vote-status {
    display: block;
    font-size: 0.8em;
    margin-top: 5px;
    color: #999;
    min-height: 1em;
}

.social-share-section {
    background-color: var(--secondary-bg);
    padding: 20px 25px;
    border-radius: var(--border-radius);
    text-align: center;
}

.social-share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: #fff !important;
    font-size: 1.2em;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-share-button:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.social-share-button.facebook { background-color: #3b5998; }
.social-share-button.twitter { background-color: #1da1f2; }
.social-share-button.telegram { background-color: #0088cc; }
.social-share-button.vk { background-color: #4a76a8; }

.game-placeholder-wrapper {
    contain: paint layout style;
}

.game-placeholder-content .game-play-button {
    min-height: 44px;
    min-width: 100px; 
}

.game-loader {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--highlight-color, #53bf9d);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -30px;
    margin-left: -30px;
    z-index: 10;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.search-loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-color, #e94560);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

.scroll-to-top-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: var(--accent-color, #e94560);
    color: var(--text-color, #e0e0e0);
    width: 45px;
    height: 45px;
    text-align: center;
    line-height: 45px;
    font-size: 20px;
    border-radius: 50%;
    z-index: 1000;
    cursor: pointer;
    display: none;
    transition: opacity 0.4s ease-in-out, background-color 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.scroll-to-top-btn:hover {
    background-color: var(--highlight-color, #53bf9d);
    color: #fff;
}

.archive-description-top {
    background-color: var(--secondary-bg, #16213e);
    padding: 25px;
    border-radius: 8px;
    font-size: 1.05em;
    line-height: 1.7;
    border: 1px solid var(--card-bg, #0f3460);
}

.archive-description-top p:first-child {
    margin-top: 0;
}

.archive-description-top p:last-child {
    margin-bottom: 0;
}

.game-page-main,
body.tax-game_category .site-main,
body.home:not(.game-as-front-page) .site-main {
    display: flex;
    flex-direction: column;
}

.game-page-main > * { margin-bottom: 40px; }
.game-page-main > *:last-child { margin-bottom: 0; }
.game-page-main > .game-breadcrumbs { margin-bottom: 20px; }
.game-page-main > .game-title { margin-bottom: 20px; }
.game-page-main > .game-controls { margin-bottom: 20px; }
.game-page-main > #local-comments-section { margin-bottom: 60px; }
.game-page-main > .similar-games-section { margin-bottom: 0; }
.game-page-main > .popular-games-section { margin-bottom: 0; }

body.tax-game_category .site-main > * { margin-bottom: 40px; }
body.tax-game_category .site-main > *:last-child { margin-bottom: 0; }
body.tax-game_category .site-main > .archive-description-top { margin-top: 40px; } 

body.home:not(.game-as-front-page) .site-main > .featured-game-section { margin-bottom: 40px; }
body.home:not(.game-as-front-page) .site-main > .top-rated-games { margin-bottom: 20px; } 
body.home:not(.game-as-front-page) .site-main > .top-games { margin-bottom: 20px; }
body.home:not(.game-as-front-page) .site-main > .front-page-content-area { margin-bottom: 0; }

.game-page-main > .game-breadcrumbs { order: 1; }
.game-page-main > .game-title { order: 2; }
.game-page-main > .star-rating-section { order: 3; }
.game-page-main > .ad-placement-single_above_iframe { order: 4; }
.game-page-main > .game-interactive-area { order: 5; width: 100%; }
.game-page-main > .game-controls { order: 6; }
.game-page-main > .game-meta-container { order: 7; }
.game-page-main > .game-description-section { order: 8; }
.game-page-main > .social-share-section { order: 9; }
.game-page-main > #local-comments-section { order: 10; }
.game-page-main > .similar-games-section { order: 11; }
.game-page-main > .popular-games-section { order: 12; }

body.tax-game_category .site-main > .page-header { order: 1; }
body.tax-game_category .site-main > .client-filter-container { order: 2; }
body.tax-game_category .site-main > .ad-placement-category_above_grid { order: 3; }
body.tax-game_category .site-main > .games-grid { order: 4; }
body.tax-game_category .site-main > .pagination { order: 5; }
body.tax-game_category .site-main > .archive-description-top { order: 6; }

body.home:not(.game-as-front-page) .site-main > .front-page-content-area {
    order: 99;
}

.game-description-section h2,
.page-editor-content h2,
.archive-description h2 {
    margin-bottom: 0.5em;
}

.exit-immersive-mode-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50px;
    padding: 8px 12px;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    text-decoration: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.exit-immersive-mode-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

body.immersive-mode-active .site-header,
body.immersive-mode-active .site-footer,
body.immersive-mode-active #wpadminbar,
body.immersive-mode-active .game-page-main > *:not(.game-interactive-area),
body.immersive-mode-active #scrollToTopBtn {
    display: none !important;
}

body.immersive-mode-active #exitImmersiveModeBtn,
body.immersive-mode-active .game-page-main,
body.immersive-mode-active .game-page-main > .game-interactive-area {
    display: block !important;
}

body.immersive-mode-active .game-interactive-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    z-index: 9999;
}

body.immersive-mode-active .game-iframe-wrapper {
    height: 100%;
    padding-bottom: 0;
    border-radius: 0;
    border: none;
}

.game-description-section h2,
.page-editor-content h2,
.page-entry h2,
.archive-description-top h2 {
    margin-bottom: 0.5em;
}

.game-description-section h3,
.page-editor-content h3,
.page-entry h3,
.archive-description-top h3 {
    margin-bottom: 15px;
}

.game-description-section h4,
.page-editor-content h4,
.page-entry h4,
.archive-description-top h4 {
    margin-bottom: 0.75em;
}

.game-description-section p,
.page-editor-content p,
.page-entry p,
.archive-description-top p {
    margin-bottom: 1em;
}

.game-description-section ul,
.page-editor-content ul,
.page-entry ul,
.archive-description-top ul {
    list-style-type: none;
    padding-left: 0;
}

.archive-description-top ul li::before {
    display: none;
}

.archive-description-top ul li {
    padding-left: 0;
}

body.home:not(.game-as-front-page) .site-main > .top-games {
    margin-top: 20px;
}

.ad-placement-single_above_title {
    padding-top: 55px;
    padding-bottom: 35px;
    margin-bottom: 20px;
}

.ad-placement-single_above_iframe {
    margin-top: 0;
    margin-bottom: 25px;
}

body.tax-game_category .page-header {
    margin-bottom: 10px;
}

body.tax-game_category .site-main {
    padding-top: 20px;
}

.comment-status-message {
    padding: 15px;
    margin-top: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.comment-status-message.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.comment-status-message.success {
    color: #e0e0e0;
    background-color: var(--highlight-color);
    border: 1px solid #47a88a;
}

.comment-status-message.error {
    color: #fff;
    background-color: var(--accent-color);
    border: 1px solid #d03850;
}

.games-grid.grid-is-centered {
    justify-content: center;
    margin-top: 40px;
}

.game-meta-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.game-categories-container {
    flex: 1 1 30%;
    min-width: 280px;
}

.game-popular-searches-container {
    flex: 2 1 60%;
    min-width: 280px;
}

.game-categories-container .game-categories-list,
.game-popular-searches-container .game-tags-list {
    background-color: var(--secondary-bg);
    padding: 20px 25px;
    border-radius: var(--border-radius);
    height: 100%;
}

.game-categories-container h4,
.game-popular-searches-container h4 {
    color: var(--highlight-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.game-categories-container ul,
.game-popular-searches-container ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
}

.game-categories-container ul {
    flex-direction: column;
}

.game-popular-searches-container ul {
    flex-direction: row;
    flex-wrap: wrap;
}

.game-categories-container ul li a,
.game-popular-searches-container ul li a {
    display: inline-block;
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 1px solid transparent;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.game-categories-container ul li a:hover,
.game-popular-searches-container ul li a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.tag-featured-game {
    max-width: 750px;
    margin: 60px auto 0 auto;
}

.tag-featured-game-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
    background-color: var(--secondary-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease;
    color: var(--text-color);
}

.tag-featured-game-link:hover {
    background-color: var(--card-bg);
}

.tag-featured-col-image {
    flex: 0 0 250px;
}

.tag-featured-col-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    display: block;
}

.tag-featured-col-content {
    flex: 1;
    min-width: 280px;
    text-align: left;
}

.tag-featured-col-content h3 {
    font-size: 2.2em;
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.2;
}

.tag-featured-col-content .tag-featured-game-excerpt {
    font-size: 1em;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 30px;
}

.tag-featured-col-content .play-button {
    display: inline-block;
    background-color: var(--accent-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.tag-featured-col-content .play-button:hover {
    background-color: var(--highlight-color);
}

@media (max-width: 600px) {
    .tag-featured-game-link {
        flex-direction: column;
        text-align: center;
    }

    .tag-featured-col-image {
        flex-basis: 100%;
        max-width: 300px;
    }

    .tag-featured-col-content {
        text-align: center;
    }
}

body.tax-game_category .client-filter-container {
    margin-bottom: 25px;
}
body.tax-game_category .ad-placement-category_above_grid {
    margin-top: 0;
    margin-bottom: 25px;
}

body.home:not(.game-as-front-page) .page-editor-content h2,
body.home:not(.game-as-front-page) .page-editor-content h3,
body.home:not(.game-as-front-page) .page-editor-content h4 {
    margin-top: 1em;
}

body.home:not(.game-as-front-page) .page-editor-content h2 {
    margin-bottom: 0.4em;
}

body.home:not(.game-as-front-page) .page-editor-content h3 {
    margin-bottom: 0.3em;
}

body.home:not(.game-as-front-page) .page-editor-content p {
    margin-bottom: 0.6em;
}

body.home:not(.game-as-front-page) .site-main > .ad-placement-home_above_top_rated_grid {
    order: 2;
}

body.home:not(.game-as-front-page) .site-main > .top-rated-games {
    order: 3;
}

body.home:not(.game-as-front-page) .site-main > .top-games {
    order: 4;
}

body.home:not(.game-as-front-page) .site-main > .featured-game-section {
    order: 1;
}

.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1em;
}
.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1em;
}
.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1em;
}
img.alignleft, img.alignright, img.aligncenter {
    margin-bottom: 1em;
}
