/*!
Theme Name: OllGames
Author: OllGames
Description: Description
Version: 1.0.0
Tested up to: 5.4
Requires PHP: 5.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: ollgames
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Generic
	- Normalize
	- Box sizing
# Base
	- Typography
	- Elements
	- Links
	- Forms
## Layouts
# Components
	- Navigation
	- Posts and pages
	- Comments
	- Widgets
	- Media
	- Captions
	- Galleries
# plugins
	- Jetpack infinite scroll
# Utilities
	- Accessibility
	- Alignments

--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Generic
--------------------------------------------------------------*/

/* Normalize
--------------------------------------------- */

/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */

/* Document
	 ========================================================================== */

/**
 * 1. Correct the line height in all browsers.
 * 2. Prevent adjustments of font size after orientation changes in iOS.
 */
html {
	line-height: 1.15;
	-webkit-text-size-adjust: 100%;
	box-sizing: border-box;
	height: 100%;
	overflow-x: clip;
	overscroll-behavior-y: none;
}

/* Sections
	 ========================================================================== */

/**
 * Remove the margin in all browsers.
 * Высота только min-height: фиксированный height: 100% на body
 */
html, body {
    margin: 0;
    padding: 0;
}
 
body {
	background: #EBE8D7;
	min-height: 100%;
	min-height: 100dvh;
	min-height: -webkit-fill-available;
	margin: 0;
	padding: 0;
	overflow-x: clip;
	overscroll-behavior-y: none;
}

#page {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
}
/**
 * Render the `main` element consistently in IE.
 */
main {
	display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */
h1 {
	font-size: 2em;
	margin: 0.67em 0;
}

/* Grouping content
	 ========================================================================== */

/**
 * 1. Add the correct box sizing in Firefox.
 * 2. Show the overflow in Edge and IE.
 */
hr {
	box-sizing: content-box;
	height: 0;
	overflow: visible;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */
pre {
	font-family: monospace, monospace;
	font-size: 1em;
}

/* Text-level semantics
	 ========================================================================== */

/**
 * Remove the gray background on active links in IE 10.
 */

/**
 * 1. Remove the bottom border in Chrome 57-
 * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
 */
abbr[title] {
	border-bottom: none;
	text-decoration: underline;
	text-decoration: underline dotted;
}

/**
 * Add the correct font weight in Chrome, Edge, and Safari.
 */
b,
strong {
	font-weight: bolder;
}

/**
 * 1. Correct the inheritance and scaling of font size in all browsers.
 * 2. Correct the odd `em` font sizing in all browsers.
 */
code,
kbd,
samp {
	font-family: monospace, monospace;
	font-size: 1em;
}

/**
 * Add the correct font size in all browsers.
 */
small {
	font-size: 80%;
}

/**
 * Prevent `sub` and `sup` elements from affecting the line height in
 * all browsers.
 */
sub,
sup {
	font-size: 75%;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}

sub {
	bottom: -0.25em;
}

sup {
	top: -0.5em;
}

/* Embedded content
	 ========================================================================== */

/**
 * Remove the border on images inside links in IE 10.
 */
img {
	border-style: none;
}

/* Forms
	 ========================================================================== */

/**
 * 1. Change the font styles in all browsers.
 * 2. Remove the margin in Firefox and Safari.
 */
button,
input,
optgroup,
select,
textarea {
	font-family: inherit;
	font-size: 100%;
	line-height: 1.15;
	margin: 0;
}

/**
 * Show the overflow in IE.
 * 1. Show the overflow in Edge.
 */
button,
input {
	overflow: visible;
}

/**
 * Remove the inheritance of text transform in Edge, Firefox, and IE.
 * 1. Remove the inheritance of text transform in Firefox.
 */
button,
select {
	text-transform: none;
}

/**
 * Correct the inability to style clickable types in iOS and Safari.
 */
button,
[type="button"],
[type="reset"],
[type="submit"] {
	-webkit-appearance: button;
}

/**
 * Remove the inner border and padding in Firefox.
 */
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
	border-style: none;
	padding: 0;
}

/**
 * Restore the focus styles unset by the previous rule.
 */
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
	outline: 1px dotted ButtonText;
}

/**
 * Correct the padding in Firefox.
 */
fieldset {
	padding: 0.35em 0.75em 0.625em;
}

/**
 * 1. Correct the text wrapping in Edge and IE.
 * 2. Correct the color inheritance from `fieldset` elements in IE.
 * 3. Remove the padding so developers are not caught out when they zero out
 *		`fieldset` elements in all browsers.
 */
legend {
	box-sizing: border-box;
	color: inherit;
	display: table;
	max-width: 100%;
	padding: 0;
	white-space: normal;
}

/**
 * Add the correct vertical alignment in Chrome, Firefox, and Opera.
 */
progress {
	vertical-align: baseline;
}

/**
 * Remove the default vertical scrollbar in IE 10+.
 */
textarea {
	overflow: auto;
}

/**
 * 1. Add the correct box sizing in IE 10.
 * 2. Remove the padding in IE 10.
 */
[type="checkbox"],
[type="radio"] {
	box-sizing: border-box;
	padding: 0;
}

/**
 * Correct the cursor style of increment and decrement buttons in Chrome.
 */
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
	height: auto;
}

/**
 * 1. Correct the odd appearance in Chrome and Safari.
 * 2. Correct the outline style in Safari.
 */
[type="search"] {
	-webkit-appearance: textfield;
	outline-offset: -2px;
}

/**
 * Remove the inner padding in Chrome and Safari on macOS.
 */
[type="search"]::-webkit-search-decoration {
	-webkit-appearance: none;
}

/**
 * 1. Correct the inability to style clickable types in iOS and Safari.
 * 2. Change font properties to `inherit` in Safari.
 */
::-webkit-file-upload-button {
	-webkit-appearance: button;
	font: inherit;
}

/* Interactive
	 ========================================================================== */

/*
 * Add the correct display in Edge, IE 10+, and Firefox.
 */
details {
	display: block;
}

/*
 * Add the correct display in all browsers.
 */
summary {
	display: list-item;
}

/* Misc
	 ========================================================================== */

/**
 * Add the correct display in IE 10+.
 */
template {
	display: none;
}

/**
 * Add the correct display in IE 10.
 */
[hidden] {
	display: none;
}

/* Box sizing
--------------------------------------------- */

/* Inherit box-sizing to more easily change it's value on a component level.
@link http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/ */
*,
*::before,
*::after {
	box-sizing: inherit;
}

/*--------------------------------------------------------------
# Base
--------------------------------------------------------------*/

/* Typography
--------------------------------------------- */
body,
button,
input,
select,
optgroup,
textarea {
	color: #404040;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 1rem;
	line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	clear: both;
}

p {
	margin-bottom: 1.5em;
}

dfn,
cite,
em,
i {
	font-style: italic;
}

blockquote {
	margin: 0 1.5em;
}

address {
	margin: 0 0 1.5em;
}

pre {
	background: #eee;
	font-family: "Courier 10 Pitch", courier, monospace;
	line-height: 1.6;
	margin-bottom: 1.6em;
	max-width: 100%;
	overflow: auto;
	padding: 1.6em;
}

code,
kbd,
tt,
var {
	font-family: monaco, consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
}

abbr,
acronym {
	border-bottom: 1px dotted #666;
	cursor: help;
}

mark,
ins {
	/* background: #fff9c0; */
	text-decoration: none;
}

big {
	font-size: 125%;
}

/* Elements
--------------------------------------------- */

hr {
	background-color: #ccc;
	border: 0;
	height: 1px;
	margin-bottom: 1.5em;
}

ul,
ol {
	margin: 0 0 1.5em 0;
}

ul {
	list-style: disc;
}

ol {
	list-style: decimal;
}

li > ul,
li > ol {
	margin-bottom: 0;
	margin-left: 1.5em;
}

dt {
	font-weight: 700;
}

dd {
	margin: 0 1.5em 1.5em;
}

/* Make sure embeds and iframes fit their containers. */
embed,
iframe,
object {
	max-width: 100%;
}

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

/* Миниатюры в сетке выводятся из потока (absolute) и не должны
   наследовать height: auto — иначе без src контейнер схлопывается. */
.site-main .games-grid .game-thumbnail img {
	height: 100%;
	max-width: none;
}

figure {
	margin: 1em 0;
}

table {
	margin: 0 0 1.5em;
	width: 100%;
}

/* Links
--------------------------------------------- */
a {
	color: #2a8c1d;
	background-color: transparent;
	text-decoration: none;
}

a:visited {
	color: #800080;
}

a:hover,
a:focus,
a:active {
	color: #191970;
	text-decoration: none; 
}

a:focus {
	outline: thin dotted;
}

a:hover,
a:active {
	outline: 0;
}

/* Forms
--------------------------------------------- */
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
	border: 1px solid;
	border-color: #ccc #ccc #bbb;
	border-radius: 3px;
	background: #e6e6e6;
	color: rgba(0, 0, 0, 0.8);
	line-height: 1;
	padding: 0.6em 1em 0.4em;
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
	border-color: #ccc #bbb #aaa;
}

button:active,
button:focus,
input[type="button"]:active,
input[type="button"]:focus,
input[type="reset"]:active,
input[type="reset"]:focus,
input[type="submit"]:active,
input[type="submit"]:focus {
	border-color: #aaa #bbb #bbb;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="range"],
input[type="date"],
input[type="month"],
input[type="week"],
input[type="time"],
input[type="datetime"],
input[type="datetime-local"],
input[type="color"],
textarea {
	color: #666;
	border: 1px solid #ccc;
	border-radius: 3px;
	padding: 3px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="range"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
input[type="time"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="color"]:focus,
textarea:focus {
	color: #111;
}

select {
	border: 1px solid #ccc;
}

textarea {
	width: 100%;
}

/*--------------------------------------------------------------
# Layouts
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Components
--------------------------------------------------------------*/

/* Navigation
--------------------------------------------- */
.main-navigation {
	display: block;
	width: 100%;
    background-color: #3b7367; 
    border-bottom: 1px solid #2e5b51;
}

.main-navigation ul {
	display: none;
	list-style: none;
	margin: 0;
	padding-left: 0;
}

.main-navigation ul ul {
	box-shadow: 0 3px 3px rgba(0, 0, 0, 0.2);
	float: left;
	position: absolute;
	top: 100%;
	left: -999em;
	z-index: 99999;
}

.main-navigation ul ul ul {
	left: -999em;
	top: 0;
}

.main-navigation ul ul li:hover > ul,
.main-navigation ul ul li.focus > ul {
	display: block;
	left: auto;
}

.main-navigation ul ul a {
	width: 200px;
}

.main-navigation ul li:hover > ul,
.main-navigation ul li.focus > ul {
	left: auto;
}

.main-navigation li {
	position: relative;
}

.main-navigation a {
	display: block;
	text-decoration: none;
}

/* Small menu. */
.menu-toggle,
.main-navigation.toggled ul {
	display: block;
}

@media screen and (min-width: 37.5em) {

	.menu-toggle {
		display: none;
	}

	.main-navigation ul {
		display: flex;
	}
}

.site-main .comment-navigation,
.site-main
.posts-navigation,
.site-main
.post-navigation {
	margin: 0 0 1.5em;
}

.comment-navigation .nav-links,
.posts-navigation .nav-links,
.post-navigation .nav-links {
	display: flex;
}

.comment-navigation .nav-previous,
.posts-navigation .nav-previous,
.post-navigation .nav-previous {
	flex: 1 0 50%;
}

.comment-navigation .nav-next,
.posts-navigation .nav-next,
.post-navigation .nav-next {
	text-align: end;
	flex: 1 0 50%;
}

/* Posts and pages
--------------------------------------------- */
.sticky {
	display: block;
}

.post,
.page {
	margin: 0 0 1.5em;
}

/* Карточки сетки — это тоже .post (post_class). Без сброса нижний margin */
.site-main .games-grid .post.game-card {
	margin: 0;
}

.updated:not(.published) {
	display: none;
}

.page-content,
.entry-content,
.entry-summary {
	margin: 1.5em 0 0;
}

.page-links {
	clear: both;
	margin: 0 0 1.5em;
}

/* Comments
--------------------------------------------- */
.comment-content a {
	word-wrap: break-word;
}

.bypostauthor {
	display: block;
}

/* Widgets
--------------------------------------------- */
.widget {
	margin: 0 0 1.5em;
}

.widget select {
	max-width: 100%;
}

/* Media
--------------------------------------------- */
.page-content .wp-smiley,
.entry-content .wp-smiley,
.comment-content .wp-smiley {
	border: none;
	margin-bottom: 0;
	margin-top: 0;
	padding: 0;
}

/* Make sure logo link wraps around logo image. */
.custom-logo-link {
	display: inline-block;
}

/* Captions
--------------------------------------------- */
.wp-caption {
	margin-bottom: 1.5em;
	max-width: 100%;
}

.wp-caption img[class*="wp-image-"] {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.wp-caption .wp-caption-text {
	margin: 0.8075em 0;
}

.wp-caption-text {
	text-align: center;
}

/* Galleries
--------------------------------------------- */
.gallery {
	margin-bottom: 1.5em;
	display: grid;
	grid-gap: 1.5em;
}

.gallery-item {
	display: inline-block;
	text-align: center;
	width: 100%;
}

.gallery-columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.gallery-columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.gallery-columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.gallery-columns-5 {
	grid-template-columns: repeat(5, 1fr);
}

.gallery-columns-6 {
	grid-template-columns: repeat(6, 1fr);
}

.gallery-columns-7 {
	grid-template-columns: repeat(7, 1fr);
}

.gallery-columns-8 {
	grid-template-columns: repeat(8, 1fr);
}

.gallery-columns-9 {
	grid-template-columns: repeat(9, 1fr);
}

.gallery-caption {
	display: block;
}

/*--------------------------------------------------------------
# Plugins
--------------------------------------------------------------*/

/* Jetpack infinite scroll
--------------------------------------------- */

/* Hide the Posts Navigation and the Footer when Infinite Scroll is in use. */
.infinite-scroll .posts-navigation,
.infinite-scroll.neverending .site-footer {
	display: none;
}

/* Re-display the Theme Footer when Infinite Scroll has reached its end. */
.infinity-end.neverending .site-footer {
	display: block;
}

/*--------------------------------------------------------------
# Utilities
--------------------------------------------------------------*/

/* Accessibility
--------------------------------------------- */

/* Text meant only for screen readers. */
.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;
	width: 1px;
	word-wrap: normal;
}

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

/* Do not show the outline on the skip link target. */
#primary[tabindex="-1"]:focus {
	outline: 0;
}

/* Alignments
--------------------------------------------- */
.alignleft {

	/*rtl:ignore*/
	float: left;

	/*rtl:ignore*/
	margin-right: 1.5em;
	margin-bottom: 1.5em;
}

.alignright {

	/*rtl:ignore*/
	float: right;

	/*rtl:ignore*/
	margin-left: 1.5em;
	margin-bottom: 1.5em;
}

.aligncenter {
	clear: both;
	display: block;
	margin-left: auto;
	margin-right: auto;
	margin-bottom: 1.5em;
}


/* Контейнер, который объединяет контент и сайдбар */
.site-content, 
#content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex: 1 0 auto;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    gap: 30px;
    background-color: #EBE8D7; /* бежевый фон */
    box-sizing: border-box;
}

/* Основной блок с играми (левая колонка) */
#primary {
    flex: 0 0 73%;
    width: 73%;
    min-width: 0;
}

/* Сайдбар (правая колонка) */
#secondary {
    flex: 0 0 23%;
    width: 23%;
    background-color: #F7F7F7;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    padding: 5px;
    box-sizing: border-box;
	position: sticky;
	top: 10px;
}

/* Сетка игр: высота ряда задаётся grid (align-items: stretch),
   а не наличием картинки внутри карточки. */
.site-main .games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 30px;
    align-items: stretch;
}

.site-main .games-grid .game-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    margin: 0;
    padding: 10px;
    background-color: #f7f7f7;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.site-main .games-grid .game-card:hover {
    border-color: #00556a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Фиксированные пропорции 4:3 даже без img / при битом src.
   Картинка выведена из потока, чтобы не было цикла height: 100% ↔ auto. */
.site-main .games-grid .game-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    margin: 0 0 10px 0;
    background-color: #e2e6eb;
    flex: 0 0 auto;
}

@supports not (aspect-ratio: 4 / 3) {
    .site-main .games-grid .game-thumbnail {
        height: 0;
        padding-bottom: 75%;
    }
}

.site-main .games-grid .game-thumbnail a {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.site-main .games-grid .game-thumbnail img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    display: block;
    object-fit: cover;
    transform-origin: center center;
    transition: transform 0.3s ease-in-out;
}

.site-main .games-grid .game-card:hover .game-thumbnail img {
    transform: scale(1.08);
}

.site-main .games-grid .game-card-admin-edit {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 5;
}

.site-main .games-grid .game-card-admin-edit a.post-edit-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background-color: #ffd863;
    color: #004455;
    border-radius: 50%;
    border: 1px solid #e0be52;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.site-main .games-grid .game-card-admin-edit a.post-edit-link .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.site-main .games-grid .game-card-admin-edit a.post-edit-link:hover {
    background-color: #004455;
    color: #F7F7F7;
    border-color: #003344;
    transform: scale(1.1);
}

.site-main .games-grid .game-title {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: normal;
    font-family: Arial, sans-serif;
    text-align: center;
    line-height: 1.3;
}

.site-main .games-grid .game-title a {
    color: #00556a;
    text-decoration: none;
}

.site-main .games-grid .game-title a:hover {
    text-decoration: underline;
}
/* Вся шапка становится опорной точкой для абсолютных элементов */
.site-header {
    font-family: Arial, sans-serif;
    width: 100%;
    position: relative;
    max-width: 100%;
}

/* --- МАГИЯ ДЛЯ СОВЫ: Привязка к сетке сайта 1200px --- */
.site-logo-owl {
    position: absolute;
    top: 5px;
    left: calc(50% - 580px);
}
@media screen and (max-width: 1220px) {
    .site-logo-owl {
        left: 20px;
    }
}
/* Жестко задаем размеры для любой картинки-логотипа внутри контейнера */
.site-logo-owl img {
    width: 180px; 
    height: 180px;
    object-fit: contain;
    background-color: transparent;
    border: none;
    display: block;
    border-radius: 0;
}

/* --- ВЕРХНИЙ ЯРУС: НАВИГАЦИЯ (МЕНЮ) --- */
/* Контейнер для списка меню */
#primary-menu {
    max-width: 1140px;
    margin: 0 auto;
    padding: 6px 20px 6px 200px; 
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 4px;
}

#primary-menu a {
    display: block;
    color: #F7F7F7;
    text-decoration: none;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0.5px;
    padding: 10px 12px; 
    margin: 0;
    border-radius: 4px;
    box-sizing: border-box;
    transition: background 0.1s ease, color 0.1s ease;
}

#primary-menu a:hover {
    color: #a3e4d7;
}
/* --- АВТОМАТИЧЕСКАЯ СТРЕЛОЧКА ДЛЯ ПУНКТОВ С ПОДМЕНЮ --- */
/* Подготавливаем родительские ссылки, у которых есть подменю */
#primary-menu .menu-item-has-children > a {
    position: relative;
    padding-right: 32px; 
}
/* 1. Добавляем аккуратную стрелочку после текста ссылки */
#primary-menu .menu-item-has-children > a::after {
    content: "▾";              
    font-size: 20px; 
    opacity: 0.8;               
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%); 
    display: block;
    line-height: 1;             
    margin: 0;
    padding: 0;
    transition: transform 0.15s ease, opacity 0.15s ease; 
    transform-origin: center center;
}

/* Эффект при наведении: стрелочка аккуратно крутится вокруг своего центра */
#primary-menu .menu-item-has-children:hover > a::after {
    opacity: 1;                 
    transform: translateY(-50%) rotate(180deg);  
}

/* Убираем стрелочку внутри самого белого выпадающего окна */
#primary-menu .sub-menu .menu-item-has-children > a::after {
    display: none;
}

/* --- НИЖНИЙ ЯРУС --- */
.header-bottom-row {
    background-color: #004455;
    max-width: 100%;
    padding: 12px 0;
}

/* Внутренняя обертка контента */
.header-bottom-row .site-branding-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 0 200px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    min-height: 50px;
    flex-wrap: wrap;
}

/* Название сайта */
/* Полное обнуление блочных отступов и выравнивание высоты строки */
h1.site-title,
div.site-title,
.site-title {
    margin-top: 25px;
    margin-bottom: 25px;
    display: block;
    line-height: 1; /* Управляет высотой строки родителя */
}

/* Идеально точные настройки для текста-ссылки */
h1.site-title a,
div.site-title a {
    color: #ffd863;
    text-decoration: none;
    font-size: 38px;
    font-weight: normal;
    line-height: 1; /* Гарантирует одинаковую высоту букв */
    font-family: Arial, sans-serif;
    display: inline-block; /* Делает рамку ссылки стабильной */
}

/* Слоган в правой части */
.header-slogan {
    text-align: right;
    color: #DECD87;
    font-size: 15px;
    max-width: 500px;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.header-slogan p {
    margin: 0;
    padding: 0;
}

/* Обертка формы поиска внутри шапки */
.header-search-box {
    width: 280px;
}

/* Сама форма WordPress */
.header-search-box .search-form {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.header-search-box .search-form label {
    display: flex;
    flex-grow: 1;
    margin: 0;
}

/* Поле ввода текста (Инпут) */
.header-search-box .search-field {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #003344;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 18px;
    color: #333333;
    outline: none;
    box-sizing: border-box;
    transition: background-color 0.15s;
}

/* Подсветка инпута при клике */
.header-search-box .search-field:focus {
    background-color: #F7F7F7;
    border-color: #4cb02a;  /* Зеленая каемочка при фокусе */
}

/* Маленькая аккуратная кнопка поиска */
.header-search-box .search-submit {
    background: #4cb02a; 
    background: linear-gradient(to bottom, #5cd034 0%, #3ca020 100%);
    color: #F7F7F7;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: filter 0.15s;
}

.header-search-box .search-submit:hover {
    filter: brightness(1.1); /* Слегка подсвечиваем кнопку при наведении */
}

.menu-toggle {
    display: none;
}

/* --- СТИЛИЗАЦИЯ ВЫПАДАЮЩЕГО МЕНЮ (SUB-MENU) --- */

/* 1. Готовим родительские пункты меню */
#primary-menu li {
    position: relative;
    list-style: none;
}

/* 2. Эффект кнопки при наведении на родительский пункт (например, "Для девочек") */
#primary-menu li:hover > a {
    background: #4cb02a; 
    background: linear-gradient(to bottom, #5cd034 0%, #3ca020 100%);
    color: #F7F7F7;
    padding: 10px 12px; 
    margin: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 2px 4px rgba(0,0,0,0.15);
}

/* 6. Эффект наведения ИСКЛЮЧИТЕЛЬНО для кнопок, у которых ЕСТЬ подменю */
#primary-menu li.menu-item-has-children:hover > a {
    padding: 10px 32px 10px 12px;
}

/* 3. Начальное состояние выпадающего списка (скрыто) */
#primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #F7F7F7;
    min-width: 220px;   
    padding: 5px 0; 
    margin: 0; 
    list-style: none;
    border: 3px double #ccc;
    border-radius: 6px;
    box-shadow: 0px 5px 22px -8px rgba(4, 13, 26, 1);
    display: block; 
    opacity: 0;
    visibility: hidden;
    z-index: 99999;
}

/* 4. Показываем выпадающий список при наведении мыши */
#primary-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 5. Пункты и ссылки ВНУТРИ белого выпадающего окна */
#primary-menu .sub-menu li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 3. Фиксируем размеры ссылок внутри подменю (в спокойном состоянии) */
#primary-menu .sub-menu a {
    color: #4cb02a;
    font-size: 14px;
    font-weight: normal;
    text-transform: none;
    padding: 10px 20px 10px 25px; 
    margin: 0;
    border: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Эффект при наведении на ссылку внутри белого окна */
#primary-menu .sub-menu a:hover {
    background-color: #4cb02a;
    color: #F7F7F7;            
    padding: 10px 20px 10px 25px;
    margin: 0;
    text-decoration: none;
}

/* Контейнер, который объединяет контент и сайдбар */
#content.site-content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0 20px;
    background-color: #EBE8D7;
    box-sizing: border-box;
}

.mobile-header-search {
    display: none;
}
/* --- СТИЛИЗАЦИЯ ИГРОВОЙ ПАГИНАЦИИ (НОМЕРА СТРАНИЦ) --- */
.site-pagination,
.navigation.pagination {
    margin: 40px 0 20px 0;
    width: 100%;
    clear: both;
}

/* Контейнер со ссылками-цифрами */
.site-pagination .nav-links,
.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Общие стили для всех кнопок страниц (цифр и стрелок) */
.site-pagination .page-numbers,
.pagination .page-numbers {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background-color: #F7F7F7;
    border: 1px solid #ccd1d9;
    border-radius: 4px;
    color: #004455;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.15s ease-on-out;
}

/* Эффект наведения мыши на цифру страницы */
.site-pagination a.page-numbers:hover,
.pagination a.page-numbers:hover {
    background: #4cb02a; 
    background: linear-gradient(to bottom, #5cd034 0%, #3ca020 100%); /* Наш любимый зеленый градиент */
    color: #F7F7F7;
    border-color: #3ca020;
    box-shadow: 0 3px 8px rgba(76, 176, 42, 0.3);
}

/* Стили для ТЕКУЩЕЙ страницы (активная кнопка, где сейчас находится пользователь) */
.site-pagination .page-numbers.current,
.pagination .page-numbers.current {
    background: #004455;
    color: #F7F7F7;
    border-color: #003344;
    cursor: default;
    box-shadow: none;
}

/* Стили для троеточия (...), если страниц на сайте очень много */
.site-pagination .page-numbers.dots,
.pagination .page-numbers.dots {
    background-color: transparent;
    border: none;
    box-shadow: none;
    color: #888888;
    cursor: default;
}

/* --- СТИЛИЗАЦИЯ СТРАНИЦЫ ОШИБКИ ПОИСКА --- */
.error-search-box {
    background-color: #F7F7F7;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    padding: 25px;
    font-size: 16px;
    color: #404040;
    line-height: 1.6;
}

.error-search-box p {
    margin-bottom: 20px;
}

/* Делаем форму поиска на странице ошибки аккуратной и центрированной */
.error-search-box .search-form {
    max-width: 400px;
}

/* --- ЦЕНТРИРОВАНИЕ ЗАГОЛОВКОВ РУБРИК --- */
.page-header {
    margin-top: 10px; 
    margin-bottom: 25px;
    width: 100%;
}

/* Центрируем ИСКЛЮЧИТЕЛЬНО сам текст заголовка */
.page-title {
    text-align: center;
    font-size: 26px;
    color: #004455;
    font-family: Arial, sans-serif;
    font-weight: bold;
    margin: 0 0 10px 0;
    padding: 0;
}

/* Описание рубрики возвращаем к левому краю */
.archive-description {
    text-align: left;
    font-size: 14px;
    color: #555555;
    line-height: 1.5;
    margin: 0;
}
/* --- СТИЛИЗАЦИЯ ИГРОВОГО ФУТЕРА (ПОДВАЛА САЙТА) --- */
.site-footer {
    background-color: #0F4F5F;
    width: 100%;
    max-width: 100%;
    margin-top: auto;
    padding: 15px 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    clear: both;
    display: block;
    flex-shrink: 0;
}

.footer-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 80px;
    box-sizing: border-box;
}

/* Стилизация текстового блока в подвале */
.site-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between; /* Разносим копирайт влево, политику вправо */
    align-items: center;            /* Выравниваем элементы строго по одной оси */
    width: 100%;
    color: #ffffff;
    font-size: 14px;
}

/* Стили отдельных блоков */
.footer-copyright strong {
    color: #ffd863; /* Название OllGames золотистым */
}

/* Контейнер ссылки на политику конфиденциальности */
.footer-custom-text a, .footer-privacy-link a {
    color: #a3e4d7;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-custom-text a:hover, .footer-privacy-link a:hover {
    color: #ffd863;
    text-decoration: underline;
}

.site-info strong {
    color: #ffd863;
    font-weight: bold;
}

.footer-subtext {
    display: block;
    font-size: 13px;
    opacity: 0.75;
    margin-top: 4px;
}

/* --- СТИЛИЗАЦИЯ ОПИСАНИЯ РУБРИКИ В ВИДЕ КАРТОЧКИ --- */
.archive-description-card {
    background-color: #f7f7f7;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    padding: 20px 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    max-width: 100%;
    box-sizing: border-box;
    margin: -10px auto 25px auto;
    display: block;
}

/* Сам текст внутри новой бежево-серой коробочки */
.archive-description {
    text-align: left;
    font-size: 15px;
    color: #404040;
    line-height: 1.6;
    margin: 0;
}

/* Убираем лишние отступы у абзацев, если они добавлены через админку */
.archive-description p {
    margin: 0 0 1em 0;
}
.archive-description p:last-child {
    margin-bottom: 0;
}

/* --- БЛОК КНОПОК ПЕРЕКЛЮЧЕНИЯ ИГР --- */

/* Общий прямоугольный контейнер-плашка */
.navigation.post-navigation {
    background-color: #f7f7f7; 
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    padding: 20px;
    margin: 25px 0;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.navigation.post-navigation .screen-reader-text {
    display: none;
}

/* Внутренний контейнер флекс-ряда */
.navigation.post-navigation .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
}

/* Элементы-обертки для кнопок (задаем им ширину 50%) */
.navigation.post-navigation .nav-previous,
.navigation.post-navigation .nav-next {
    width: 50%;              /* Кнопки займут ровно половину ширины */
    max-width: 50%;
    display: flex;
    justify-content: center; /* Выравниваем содержимое внутри обертки */
    box-sizing: border-box;
}

/* ОБНОВЛЕННЫЕ ЗЕЛЕНЫЕ КНОПКИ (50% ширины, перенос текста и центрирование стрелок) */
.navigation.post-navigation .nav-links a {
    display: block;
    width: 100%;               
    box-sizing: border-box;
    background: #4cb02a; 
    background: linear-gradient(to bottom, #5cd034 0%, #3ca020 100%);
    border: 1px solid #36901c;
    border-radius: 6px;        
    padding: 12px 35px; 
    color: #ffffff;            
    text-decoration: none;
    font-size: 18px;           
    font-family: Arial, sans-serif;
    text-align: center;        /* Текст красиво центрируется, даже если ложится в 2 строки */
    position: relative;        /* База для абсолютного позиционирования стрелок */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); 
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: filter 0.15s ease;
}

.navigation.post-navigation .nav-links a:hover {
    filter: brightness(1.08);  
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 10px rgba(76, 176, 42, 0.3);
}

/* ФИКС СТРЕЛОЧЕК: сбрасываем межстрочную высоту, чтобы поднять их к центру */
.navigation.post-navigation .nav-arrow {
    font-size: 24px;
    font-weight: bold;
    line-height: 1;            
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-block;
}

/* Отступы стрелочек от текста */
.navigation.post-navigation .nav-previous .nav-arrow {
    left: 15px;
}
.navigation.post-navigation .nav-next .nav-arrow {
    right: 15px;
}

/* --- АДАПТИВНОСТЬ ДЛЯ СМАРТФОНОВ --- */
@media screen and (max-width: 600px) {
    .site-main .games-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .site-main .games-grid .game-card {
        padding: 12px;
    }

    .site-main .games-grid .game-title {
        font-size: 15px;
    }	
	
    /* На маленьких экранах телефонов 50% ширины сделают кнопки слишком узкими. 
       Растянем их до 90%, чтобы текст читался комфортно */
    .navigation.post-navigation .nav-previous,
    .navigation.post-navigation .nav-next {
        width: 90%;
        max-width: 90%;
    }
    .navigation.post-navigation .nav-links a {
        font-size: 16px;      /* Чуть уменьшаем шрифт на мобильных */
        padding: 10px 15px;
    }
}

/* --- СТИЛИЗАЦИЯ ИГРОВОГО БЛОКА КОММЕНТАРИЕВ --- */

/* 1. Общий контейнер списка комментариев и формы отправки */
#comments,
.comment-respond {
    background-color: #f7f7f7;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    padding: 25px;
    margin: 25px 0;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 100%;
    clear: both;
}

/* Заголовки блоков (например, "Добавить комментарий" или "2 комментария") */
#comments .comments-title,
.comment-respond .comment-reply-title {
    font-size: 22px;
    color: #004455;
    font-family: Arial, sans-serif;
    font-weight: bold;
    margin: 0 0 20px 0;
    padding: 0;
}

/* 2. СТИЛИЗАЦИЯ ФОРМЫ ОТПРАВКИ (ПОЛЯ ВВОДА) */

/* Текстовое поле ввода самого комментария */
.comment-form textarea {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #ccd1d9;
    border-radius: 4px;
    padding: 12px;
    font-size: 15px;
    color: #333333;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 15px;
    transition: border-color 0.15s ease;
}

/* Подсветка поля при клике (фокусе) */
.comment-form textarea:focus {
    border-color: #004455;
    box-shadow: 0 0 4px rgba(0, 68, 85, 0.2);
}

/* 3. КРУПНАЯ ИГРОВАЯ КНОПКА ОТПРАВКИ КОММЕНТАРИЯ */
.comment-form .submit {
    display: inline-block;
    cursor: pointer;
    background: #4cb02a; 
    background: linear-gradient(to bottom, #5cd034 0%, #3ca020 100%);
    border: 1px solid #36901c;
    border-radius: 6px;
    padding: 12px 28px;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: filter 0.15s ease;
}

.comment-form .submit:hover {
    filter: brightness(1.08);  /* Подсветка при наведении */
}

/* 4. СТИЛИЗАЦИЯ УЖЕ НАПИСАННЫХ КОММЕНТАРИЕВ (СПИСОК) */
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Отдельный чужой комментарий в списке */
.comment-list .comment-body {
    background-color: #ffffff;
    border: 1px solid #e2e6eb;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* Имя автора и аватарка в одну строчку */
.comment-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

/* Круглая аватарка пользователя */
.comment-meta .avatar {
    border-radius: 50%;
    border: 1px solid #ccd1d9;
}

/* Ник автора */
.comment-author .fn {
    font-weight: bold;
    color: #004455;
}

/* Текст самого отзыва */
.comment-content {
    font-size: 14px;
    line-height: 1.5;
    color: #444444;
}

/* --- КНОПКИ-РУБРИКИ С ИКОНКАМИ ВНУТРИ ЗАПИСИ --- */

/* Общий горизонтальный контейнер для кнопок */
.game-post-categories-badges {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px; 
    padding-top: 5px;
}

/* Отдельная кнопочка-рубрика */
.category-badge-item {
    display: inline-flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #ccd1d9;
    border-radius: 4px;
    padding: 6px 14px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

/* Эффект при наведении мышки на кнопку рубрики */
.category-badge-item:hover {
    border-color: #004455;
    background-color: #f7f7f7;
    box-shadow: 0 2px 6px rgba(0, 68, 85, 0.08);
}

/* Маленькая картинка-иконка внутри кнопки */
.category-badge-item .badge-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 8px;
    display: block;
}

/* Встроенная иконка-заглушка WordPress (если файла картинки нет в папке) */
.category-badge-item .badge-dashicon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    color: #3b7367;
    margin-right: 8px;
}

/* Текст названия рубрики на кнопке */
.category-badge-item .badge-text {
    font-size: 13px;
    color: #555555;
    font-family: Arial, sans-serif;
    font-weight: normal;
    line-height: 1;
}

/* При наведении текст становится бирюзовым */
.category-badge-item:hover .badge-text {
    color: #004455;
}

/* --- СТИЛИЗАЦИЯ СТАНДАРТНЫХ СТРАНИЦ (PAGE.PHP) --- */

/* Оборачиваем все статические страницы в красивую фирменную карточку */
.page main#primary .post,
.page main#primary .page {
    background-color: #f7f7f7;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    margin-bottom: 25px;
    width: 100%;
}

/* Заголовок страницы (например, "Политика конфиденциальности") */
.page .entry-header {
    margin-bottom: 25px;
    border-bottom: 1px solid #ccd1d9;
    padding-bottom: 15px;
}

.page .entry-title {
    font-size: 28px;
    color: #004455;
    font-family: Arial, sans-serif;
    font-weight: bold;
    margin: 0;
    padding: 0;
}

/* Текстовое содержимое страницы */
.page .entry-content {
    font-size: 15px;
    line-height: 1.6;
    color: #404040;
    margin: 0;
}
/* Ссылки внутри обычных страниц */
.page .entry-content a {
    text-decoration: none;
    color: #2a8c1d;
    transition: color 0.15s ease;
}

/* Ховер для страниц */
.page .entry-content a:hover,
.page .entry-content a:focus {
    text-decoration: none;
    color: #4cb02a;
}
/* Красивые отступы для абзацев текста на страницах */
.page .entry-content p {
    margin-bottom: 1.5em;
}
.page .entry-content p:last-child {
    margin-bottom: 0;
}

/* --- КНОПКА СТАТИЧНОЙ ПРОКРУТКИ НАВЕРХ (SCROLL TO TOP) --- */
.scroll-to-top-btn {
    position: fixed;
    bottom: 70px;
    right: 30px;
    z-index: 999999;
    display: block;
    width: 50px;
    height: 50px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
}

/* Сама картинка scrollup.png внутри ссылки */
.scroll-to-top-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Этот класс автоматически добавится через JavaScript при прокрутке вниз */
.scroll-to-top-btn.is-visible {
    opacity: 0.85;
    visibility: visible;
}

/* Эффект при наведении курсора мыши на стрелочку */
.scroll-to-top-btn.is-visible:hover {
    opacity: 1; 
    transform: scale(1.1);
}
/* --- СКВОЗНОЙ КАНАЛ ВИДЖЕТА ПОД ШАПКОЙ (НА ВСЮ ШИРИНУ) --- */
.site-under-header-wide-zone {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    clear: both;
}

/* Внутренний контейнер для кастомного HTML-кода */
.wide-under-header-widget {
    width: 100%;
    text-align: center; /* Автоматически центрирует баннеры или код внутри плашки */
    line-height: 0;     /* Убирает невидимые нижние зазоры у картинок-баннеров */
}

/* Защита: любые картинки или фреймы внутри этой зоны будут резиновыми и адаптивными */
.wide-under-header-widget img,
.wide-under-header-widget iframe {
    max-width: 100%;
    height: auto;
}

/* Защита на смартфонах: на телефонах кнопка может перекрывать пальцам важный контент, 
   поэтому её отступ снизу можно немного скорректировать */
@media screen and (max-width: 768px) {
    .scroll-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* --- АДАПТИВНОСТЬ ДЛЯ СМАРТФОНОВ --- */

@media screen and (max-width: 1024px) {
    .main-navigation {
        width: 100%;
        max-width: 100%;
        overflow: hidden; /* Обрезает случайные микро-вылеты кнопок */
        box-sizing: border-box;
    }
    .site-logo-owl {
        /* Оставляем абсолютную привязку к левому краю, но сдвигаем на безопасные 15px */
        left: 15px;
        top: 5px;
    }
    
    /* Делаем размеры совы компактными, чтобы она не перекрывала пункты */
    .site-logo-owl img {
        width: 100px;
        height: 100px;
        object-fit: contain;
    }

    /* --- БЕЗОПАСНЫЙ СДВИГ МЕНЮ НА ПЛАНШЕТАХ --- */
    #primary-menu {
        padding: 6px 20px 6px 120px;
        gap: 8px 4px; 
        justify-content: flex-start;
    }
    
    /* --- КОРРЕКТИРУЕМ НИЖНИЙ БИРЮЗОВЫЙ БЛОК НАЗВАНИЯ --- */
    .header-bottom-row .site-branding-wrapper {
        /* Название сайта OllGames тоже аккуратно сдвигаем на 120px вслед за меню */
        padding: 0 20px 0 120px;
    }
    
    h1.site-title a,
    div.site-title a {
        font-size: 28px; /* Делаем шрифт названия чуть компактнее на планшетах */
    }
    /* Мобильные фиксы для статических страниц */
    .page main#primary .post,
    .page main#primary .page {
        padding: 20px 15px;
    }
    .page .entry-title {
        font-size: 22px;
    }
    
    /* Главный контейнер сбрасывает flex-ряд, переводя контент в блочный режим */
    #content.site-content {
        display: block; 
        padding: 15px;
    }

    /* Левая колонка с играми расширяется на ВСЮ ширину сайта (100%) */
    #primary {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Сайдбар полностью убирается с экрана, больше он не упадет вниз */
    #secondary {
        display: none;
    }

    .site-main .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        width: 100%;
    }
	
    /* Мобильные фиксы для страницы одиночного поста */
    .game-single-article {
        padding: 15px;
    }
    .game-main-title {
        font-size: 22px;
    }
	
    .site-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

}
@media screen and (max-width: 768px) {
    html, body {
        overflow-x: clip;
        overscroll-behavior-y: none;
    }
    .site-main .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        width: 100%;
    }

    .site-main .games-grid .game-card {
        padding: 15px;
    }

    .site-main .games-grid .game-title {
        font-size: 16px;
    }

    /* Сбрасываем лишние верхние отступы у страницы на мобильных */
    .site-header {
        display: flex;
        flex-direction: column;
        position: relative;
        background-color: #004455; /* Убираем белый просвет */
    }

    /* --- МАГИЯ ДЛЯ СОВЫ: Переносим её внутрь блока названия --- */
    .site-logo-owl {
        position: absolute;
        /* Точечно позиционируем сову внутри бирюзового блока телефона */
        top: 12px;
        left: 15px;
    }
    
    /* Делаем сову аккуратной и маленькой на экранах смартфонов */
    .site-logo-owl img {
        width: 85px;
        height: 85px;
        object-fit: contain;
    }

    /* --- ВЕРХНИЙ БЛОК: НАЗВАНИЕ И ОПИСАНИЕ --- */
    .header-bottom-row {
        background-color: #004455;
        padding: 15px 0;
        width: 100%;
        /* Свойство order: 1 поднимает бирюзовый блок на самый верх, выше зеленого меню */
        order: 1; 
    }

    .header-bottom-row .site-branding-wrapper {
        padding: 0 15px 0 110px; /* Сдвигаем контент вправо на 90px, чтобы освободить место под маленькую сову */
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        text-align: left;
        min-height: 60px;
    }

    .site-branding {
        display: block;
        width: 100%;
    }

    /* Название сайта адаптируется под размер мобильного экрана */
    h1.site-title a,
    div.site-title a  {
        font-size: 30px;
        display: block;
        line-height: 1.1;
        word-break: break-all;
        overflow-wrap: break-word;
    }

    /* Прячем длинный слоган на мобильных, чтобы не загромождать шапку */
    .header-slogan {
        display: none;
    }

    /* --- НИЖНИЙ БЛОК: ЗЕЛЕНОЕ МЕНЮ, ПОИСК И КНОПКА --- */
    .main-navigation {
        background-color: #3b7367;
        width: 100%;
        padding: 8px 15px;
        box-sizing: border-box;
        order: 2; 
        
        /* Включаем флекс, чтобы выстроить инпут слева, а кнопку справа */
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        flex-wrap: wrap; /* Разрешает меню падать вниз при открытии */
    }

    /* Активируем контейнер поиска на смартфонах */
    .mobile-header-search {
        display: block;
        
        /* 1. Flex-grow: 1 заставляет поле занять ВСЁ свободное пространство слева от кнопки */
        flex: 1 1 auto; 
        
        /* 2. Защищаем блок от наплыва на кнопку меню */
        max-width: calc(100% - 110px); 
        
        /* 3. Ограничиваем минимальную ширину контейнера (в пикселях), ниже которой он не сожмется */
        min-width: 160px; 
    }

    /* Корректируем форму внутри мобильного контейнера */
    .mobile-header-search .search-form {
        display: flex;
        align-items: center;
        width: 100%;
    }
    .mobile-header-search .search-form label {
        display: flex;
        width: 100%;
        margin: 0;
    }

    /* Компактное и аккуратное мобильное поле ввода */
    .mobile-header-search .search-field {
        width: 100%; 
        min-width: 160px; 
        background-color: #F7F7F7;
        border: 1px solid #ccd1d9;
        border-radius: 4px;
        padding: 6px 10px;
        font-size: 15px; 
        color: #333333;
        outline: none;
        box-sizing: border-box;
    }

    /* Прячем кнопку отправки "Найти" в мобильной шапке для экономии места */
    /* Пользователь сможет запустить поиск, нажав кнопку "Go/Найти" на самой экранной клавиатуре смартфона */
    .mobile-header-search .search-submit {
        display: none;
    }

    /* Стилизация кнопки меню «гамбургер» (она автоматически встанет справа) */
    .menu-toggle {
        display: block;
        background: #F7F7F7;
        border: 1px solid #ccd1d9;
        border-radius: 4px;
        padding: 10px 20px;
        margin: 0; /* Сбрасываем margin-left, так как flex сам разнесет элементы */
        cursor: pointer;
        color: #555555;
        font-size: 14px;
        flex-shrink: 0; /* Запрещаем кнопке сжиматься */
    }

    .menu-toggle::before {
        content: "☰ ";
        font-weight: bold;
    }

    /* Гарантируем, что при клике выпадающий список меню займет 100% ширины и упадет строго ПОД поиск и кнопку */
    #primary-menu {
        display: none; 
        flex-direction: column;
        width: 100%;
        padding: 10px 0 0 0;
        margin: 0;
        gap: 0;
        order: 3; /* Принудительно сдвигаем список вниз */
    }
	
    /* Отключаем поворот стрелочки на телефонах при ховере */
    #primary-menu .menu-item-has-children:hover > a::after {
        transform: none;
        opacity: 0.7;
    }

    /* Когда JavaScript темы навесит класс .toggled, меню плавно откроется */
    .main-navigation.toggled #primary-menu {
        display: flex;
    }
	
    /* Мобильное субменю: всегда развернуто внутри открытого меню */
    .main-navigation.toggled #primary-menu .sub-menu {
        display: block;
        position: static;
        opacity: 1;
        visibility: visible;
        background-color: rgba(0, 0, 0, 0.15);
        padding: 5px 0 5px 20px;
        margin: 5px 0;
        min-width: 100%;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    /* Ссылки внутри мобильного субменю */
    .main-navigation.toggled #primary-menu .sub-menu a {
        color: #F7F7F7;
        font-size: 13px;
        font-weight: normal;
        padding: 10px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .main-navigation.toggled #primary-menu .sub-menu li:last-child a {
        border-bottom: none;
    }
    
    .main-navigation.toggled #primary-menu .sub-menu a:hover {
        background-color: transparent;
        color: #F7F7F7;
    }

    /* Ссылки основного меню в мобильном списке */
    #primary-menu li {
        width: 100%;
    }
    
    #primary-menu a {
        padding: 10px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        box-sizing: border-box;
    }
    
    #primary-menu li:last-child a {
        border-bottom: none;
    }
}
@media screen and (max-width: 490px) {
    /* 1. Делаем главный контейнер полностью резиновым */
    #content.site-content, 
    .site-content {
        display: block;       /* Сбрасываем флекс-ряд */
        width: 100%;          /* Занимаем ровно ширину экрана */
        max-width: 100%;
        min-width: 0;         /* Разрешаем контенту сжиматься */
        padding: 10px;        /* Минимальные аккуратные отступы по бокам */
        box-sizing: border-box;
    }

    /* 2. Заставляем основную колонку сжиматься и не выходить за рамки */
    #primary {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* 3. Проверяем карточку игры, если она оформлена как статическая страница */
    .page main#primary .post, 
    .page main#primary .page,
    .game-single-article {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 15px 10px;  /* Слегка сужаем внутренние падинги */
    }

    /* 4. Защита от вылетов: убираем горизонтальную прокрутку на уровне всего сайта */
    html, body {
        max-width: 100%;
        overflow-x: clip;
        overscroll-behavior-y: none;
    }
    #comments textarea,
    #comments input,
    .comment-form textarea,
    .comment-form input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box; /* Упаковывает padding внутрь 100% ширины */
    }

    /* Уменьшаем боковые отступы у самого блока комментариев, чтобы освободить место */
    #comments, 
    .comment-respond {
        padding: 15px 10px; 
    }
	
	.game-single-thumbnail {
        float: none !important;
		max-width: 100% !important;
		height: auto !important;
		display: block !important;
    }
}

/* --- УНИВЕРСАЛЬНАЯ СТРАНИЦА ИГРЫ (SINGLE PAGE) --- */
.single-game-main {
    width: 100%;
}

.game-single-article {
    background-color: #F7F7F7;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    padding: 25px;
    box-sizing: border-box;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.game-entry-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e6eb;
    padding-bottom: 15px;
}

.game-main-title {
    font-size: 28px;
    color: #004455;
    font-family: Arial, sans-serif;
    margin: 0;
}

/* Главный контейнер вывода (текст, картинки, фреймы) */
.game-entry-content {
    font-size: 15px;
    line-height: 1.6;
    color: #404040;
}
/* Ссылки внутри контента игры */
.game-entry-content a {
    text-decoration: none;
    color: #2a8c1d;
    transition: color 0.15s ease;
}
/* Эффект при наведении на ссылку в игре */
.game-entry-content a:hover,
.game-entry-content a:focus {
    text-decoration: none;
    color: #4cb02a;
}
/* Стили для обычных абзацев текста внутри описания игры */
.game-entry-content p {
    margin-bottom: 1.5em;
}
/* Сброс обтекания для элементов, которые должны идти строго с новой строки под картинкой */
.game-entry-content::after {
    content: "";
    display: table;
    clear: both;
}
/* Контейнер миниатюры на внутренней странице игры */
.game-single-thumbnail {
    float: left;
    width: 200px;               
    height: 140px;
    margin-right: 20px;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 5px;         
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	border: 1px solid #ccc;
	padding: 5px;
}

/* Сама картинка внутри этого контейнера */
.game-single-thumbnail img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* Бережно вписывает изображение в рамки 300х210 без деформации совы или графики */
}

/* Мои стили */
ins.adsbygoogle[data-ad-status="unfilled"]{display:none!important}/* Схлопываем блок адсенса если он не отображается*/

.button-fs{font-weight:400;text-transform:none;margin:10px auto 0;width:100%;border:none;border-radius:3px;text-decoration:none;cursor:pointer;display:inline-block;padding:7px 0;font-size:26px;line-height:32px;color:#fff!important;text-align:center;text-shadow:0 1px 1px rgba(0,0,0,0.5);background:#0c9c0d linear-gradient(#82d18d,#0c9c0d);box-shadow:inset #72de26 0 -1px 1px,inset 0 1px 1px #98ff98,#3caa3c 0 0 0 1px,rgba(0,0,0,.3) 0 2px 5px;-moz-user-select:none;user-select:none}

.button-fs:hover{background:#0c9c0d linear-gradient(#82d18d,#0A800A);text-decoration:none;text-shadow:0 -1px rgba(0,0,0,.3),0 0 5px #ffd,0 0 8px #fff}

.button-fs:active{box-shadow:0 -1px 3px rgba(0,0,0,.3),0 1px 1px #fff,inset 0 1px 2px rgba(0,0,0,.8),inset 0 -1px 0 rgba(0,0,0,.05);color:#fff!important;text-decoration:none;top:1px}

.type50,.type51,.type52,.type53,.type54,.type55,.type56,.type57,.type58,.type59,.type60,.type61,.type62,.type625,.type63,.type64,.type65,.type66,.type67,.type68,.type69,.type70,.type71,.type72,.type73,.type74,.type75,.type76,.type77,.type78,.type79,.type80,.type81,.type82,.type83,.type84,.type85,.type86,.type87,.type88,.type89,.type90,.type91,.type92,.type93,.type94,.type95{position:relative;height:0;margin-bottom:30px}

.type95{padding-bottom:95%}.type94{padding-bottom:94%}.type93{padding-bottom:93%}.type92{padding-bottom:92%}.type91{padding-bottom:91%}.type90{padding-bottom:90%}.type89{padding-bottom:89%}.type88{padding-bottom:88%}.type87{padding-bottom:87%}.type86{padding-bottom:86%}.type85{padding-bottom:85%}.type84{padding-bottom:84%}.type83{padding-bottom:83%}.type82{padding-bottom:82%}.type81{padding-bottom:81%}.type80{padding-bottom:80%}.type79{padding-bottom:79%}.type78{padding-bottom:78%}.type77{padding-bottom:77%}.type76{padding-bottom:76%}.type75{padding-bottom:75%}.type74{padding-bottom:74%}.type73{padding-bottom:73%}.type72{padding-bottom:72%}.type71{padding-bottom:71%}.type70{padding-bottom:70%}.type69{padding-bottom:69%}.type68{padding-bottom:68%}.type67{padding-bottom:67%}.type66{padding-bottom:66%}.type65{padding-bottom:65%}.type64{padding-bottom:64%}.type63{padding-bottom:63%}.type625{padding-bottom:62.5%}.type62{padding-bottom:62%}.type61{padding-bottom:61%}.type60{padding-bottom:60%}.type59{padding-bottom:59%}.type58{padding-bottom:58%}.type57{padding-bottom:57%}.type56{padding-bottom:56%}.type55{padding-bottom:55%}.type54{padding-bottom:54%}.type53{padding-bottom:53%}.type52{padding-bottom:52%}.type51{padding-bottom:51%}.type50{padding-bottom:50%}

.gameplayer{position:absolute;top:0;left:0;width:100%;height:100%}
.gamecenter{display:flex;justify-content:center;align-items:center;margin-bottom:30px}

/* Перекрашиваем подложку для современных браузеров для Fullscreen API*/
#fs::backdrop {
  background-color: #000; 
}

/* Фолбек подложки для Safari */
#fs:-webkit-full-screen-backdrop {
  background-color: #000;
}


/* ==========================================================================
   🎮 СТИЛИЗАЦИЯ HTML-ВИДЖЕТА В САЙДБАРЕ
   ========================================================================== */

/* 1. ГЛАВНЫЙ КОНТЕЙНЕР СЕТКИ */
.myblock,
.wrapper-image.column-3.all.myblock {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Строго 3 одинаковые колонки */
    gap: 3px;                             /* Фиксированный зазор между плитками */
    width: 100%;
    max-width: 100%;                        /* Снимаем жесткое ограничение 210px */
    margin: 15px 0 0 0;
    box-sizing: border-box;
}

/* 2. ОТДЕЛЬНАЯ КВАДРАТНАЯ ПЛИТКА КАТЕГОРИИ */
.wrapper-image .element.effect-category,
.element {
    position: relative; 
    width: 100%;                           /* GRID сам рассчитает ширину ячеек */
    max-width: 100%;
    aspect-ratio: 1 / 1;                   
    height: auto;                          /* Отменяем фиксированные 64px */
    background-color: #ffffff;             /* Чистый белый фон под иконкой */
    border: 1px solid #ccd1d9;             /* Тонкая серая рамка в цвет карточек игр */
    border-radius: 6px;                    /* Аккуратное скругление углов */
    overflow: hidden;                      /* Обрезает края маски при наведении */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* Эффект при наведении мыши на отдельную ячейку */
.element:hover {
    border-color: #004455;                 /* Наша фирменная бирюзовая каемочка */
    box-shadow: 0 3px 8px rgba(0, 68, 85, 0.15); /* Легкая тень */
    transform: scale(1.03);                /* Микро-увеличение плитки для живости */
    z-index: 2;
}

/* 3. САМА КАРТИНКА-ИКОНКА ВНУТРИ ПЛИТКИ */
.element img {
    display: block;
    width: 90%;                            /* Картинка аккуратно занимает 80% пространства ячейки */
    height: 90%;
    object-fit: contain;                   /* Бережно вписывает иконку без искажений */
    transition: transform 0.2s ease-in-out;
}

/* При наведении картинка делает легкий интерактивный наплыв */
.element:hover img {
    transform: scale(1.08);
}

/* 4. ПОЛУПРОЗРАЧНАЯ МАСКА С НАЗВАНИЕМ (ПОЯВЛЯЕТСЯ ПРИ НАВЕДЕНИИ) */
.element .hover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 68, 85, 0.85); 
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    /* Плавное проявление маски */
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease; 
}

/* Показываем маску при наведении на ячейку */
.element:hover .hover {
    opacity: 1;
    visibility: visible;
}

/* Ссылка-обертка внутри маски */
.hover-a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    padding: 4px;
    box-sizing: border-box;
}

/* 5. ТЕКСТ НАЗВАНИЯ РУБРИКИ НА МАСКЕ */
.mylink {
    color: #ffd863;
    font-family: Arial, sans-serif;
    font-size: 11px;                        /* Компактный шрифт, чтобы слова не ломались */
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    display: block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); /* Тень под буквами для идеальной читаемости */
}


/* ==========================================================================
   🎮 ПОЛНОЭКРАННОЕ ОФОРМЛЕНИЕ СТРАНИЦЫ ОШИБКИ 404
   ========================================================================== */

/* 1. РАЗРУШАЕМ ГРАНИЦЫ 1200px ДЛЯ ВСЕХ ЭКРАНОВ: 
   Жестко сбрасываем боковые отступы контента только когда открыта 404, 
   чтобы миньоны прилипли к краям и на ПК, и на телефонах */
.error404 #content.site-content {
    max-width: 100%;
    width: 100%;
    padding: 0; 
    gap: 0;
    display: block;
}

.error404 #primary {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
}

.error-404-main {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* 2. РАСТЯГИВАЕМ КАРТИНКУ */
.error-404-container {
    width: 100%;
    min-height: calc(100vh - 250px); 
    
    background-image: url('images/404.png');
    background-position: center center; 
    background-repeat: no-repeat;
    background-size: cover; /* Картинка масштабируется на 100% ширины и высоты */
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    box-sizing: border-box;
}

/* 3. ФИКСИРУЕМ ПРОПОРЦИИ БАННЕРА БЕЗ ДЕФОРМАЦИИ */
.error-404-content-box {
    background-color: rgba(0, 68, 85, 0.9); 
    border: 2px solid #ffd863;                
    border-radius: 8px;
    padding: 35px 30px;
    
    /* Фиксированная ширина: баннер ВСЕГДА будет аккуратным прямоугольником 450px */
    width: 450px;
    max-width: 100%; 
    
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

/* Название ошибки внутри баннера */
.error-404-title {
    font-size: 30px; 
    color: #ffd863; 
    font-family: Arial, sans-serif;
    font-weight: bold;
    margin: 0 0 15px 0;
}

/* Текст ошибки */
.error-404-text {
    font-size: 15px;
    color: #ffffff;
    line-height: 1.5;
    margin: 0 0 25px 0;
}

/* Строка поиска по центру баннера */
.error-404-search-form {
    margin-bottom: 25px;
    width: 100%;
}
.error-404-search-form .search-form {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.error-404-search-form .search-form label {
    display: flex;
    flex-grow: 1;
    margin: 0;
}

.error-404-search-form .search-field {
    flex-grow: 1;
    background-color: #f7f7f7;
    border: 1px solid #ccd1d9;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 16px;
    outline: none;
    color: #333333;
    width: 100%;
    box-sizing: border-box;
}

.error-404-search-form .search-submit {
    flex-shrink: 0;
    padding: 8px 14px;
}

/* Кнопка "На главную" */
.error-404-home-btn-wrapper {
    width: 100%;
}
.error-404-home-btn {
    display: inline-block;
    background: #4cb02a; 
    background: linear-gradient(to bottom, #5cd034 0%, #3ca020 100%);
    border: 1px solid #36901c;
    border-radius: 4px;
    padding: 10px 24px;
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 2px 4px rgba(0,0,0,0.2);
    transition: filter 0.15s ease;
}
.error-404-home-btn:hover {
    filter: brightness(1.08);
}
