/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://ingyenesjatekok.hu
 Description:  ingyenesjatekok.hu child theme (fork of the pexy.io child theme), design P3
 Author:       ingyenesjatekok.hu
 Template:     generatepress
 Version:      0.3
*/

/* ==========================================================================
   Design P3 (design/direction.md). This file is the single source of the colours:
   tools/gp-settings.php copies the tokens into GeneratePress's global colours,
   tools/contrast.py checks the text/background pairs.
   ========================================================================== */

:root {
  --ij-bg: #080911;
  --ij-surface: #12131c;
  --ij-surface-2: #242536;
  --ij-line: #383a52;
  --ij-text: #e9eaf2;
  --ij-strong: #ffffff;
  --ij-muted: #9a9eb0;
  --ij-accent: #7748dc;
  --ij-accent-hover: #6a3fd0;
  --ij-on-accent: #ffffff;
  --ij-pink: #da34b8;
  --ij-lavender: #b49cff;
  /* Link colour: used for links only, never for decoration, so anything lime is clickable. */
  --ij-link: #b6f04a;
  --ij-link-hover: #d4f78f;
  --ij-mint: #70e4c7;
  --ij-sky: #719fea;
  --ij-radius: 12px;
  --ij-radius-sm: 8px;
  --ij-font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ij-pixel: 'Press Start 2P', ui-monospace, monospace;
  color-scheme: dark;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/nunito/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/nunito/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Pixel font: only for short ASCII game-UI strings (GAME OVER?, IGEN/NEM), never for Hungarian running text. */
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/press-start-2p/press-start-2p-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF;
}

/* ---------- base ---------- */

body {
  background-color: var(--ij-bg);
  color: var(--ij-text);
  font-family: var(--ij-font);
}

body,
button,
input,
select,
textarea {
  font-family: var(--ij-font);
}

a {
  color: var(--ij-link);
  text-underline-offset: 3px;
}

a:hover,
a:focus {
  color: var(--ij-link-hover);
}

h1,
h2,
h3,
h4,
.entry-title {
  color: var(--ij-strong);
  text-transform: none;
}

h1 {
  font-weight: 900;
}

/* Section headings: the pink bar of the design. */
h2 {
  border-left: 5px solid var(--ij-pink);
  padding-left: 12px;
  font-size: 1.5em;
  font-weight: 900;
  margin-top: 1.6em;
  margin-bottom: 0.8em;
  line-height: 1.2;
}

/* Inside running text (game descriptions, pages) h2 keeps the bar but less space. */
.entry-content h2 {
  margin-top: 1.4em;
}

.entry-content h3 {
  color: var(--ij-strong);
  font-size: 1.15em;
  font-weight: 800;
}

hr {
  margin: 0 16px 8px;
  border: 0;
  border-bottom: 1px solid var(--ij-surface-2);
}

:focus-visible {
  outline: 2px solid var(--ij-link);
  outline-offset: 2px;
}

.ij-pixel {
  font-family: var(--ij-pixel);
  font-weight: 400;
  letter-spacing: 0;
}

/* Rounded boxes and fields. */
.inside-article,
.widget-area .widget,
button,
html input[type="button"],
input[type="reset"],
input[type="submit"],
a.button,
a.wp-block-button__link:not(.has-background),
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
textarea,
select {
  border-radius: var(--ij-radius) !important;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
textarea,
select {
  background-color: var(--ij-surface-2);
  border: 1px solid var(--ij-line);
  color: var(--ij-text);
}

input::placeholder,
textarea::placeholder {
  color: var(--ij-muted);
  opacity: 1;
}

button,
input[type="submit"],
a.button {
  background-color: var(--ij-accent);
  color: var(--ij-on-accent);
  font-weight: 800;
}

button:hover,
button:focus,
input[type="submit"]:hover,
a.button:hover {
  background-color: var(--ij-accent-hover);
  color: var(--ij-on-accent);
}

/* WPForms (contact form): its modern style reads these variables. */
div.wpforms-container-full {
  --wpforms-field-background-color: var(--ij-surface-2);
  --wpforms-field-border-color: var(--ij-line);
  --wpforms-field-border-color-spare: var(--ij-line);
  --wpforms-field-text-color: var(--ij-text);
  --wpforms-field-menu-color: var(--ij-surface-2);
  --wpforms-field-border-radius: 10px;
  --wpforms-label-color: var(--ij-text);
  --wpforms-label-sublabel-color: var(--ij-muted);
  --wpforms-button-background-color: var(--ij-accent);
  --wpforms-button-border-color: var(--ij-accent);
  --wpforms-button-text-color: var(--ij-on-accent);
  --wpforms-button-border-radius: 999px;
  --wpforms-button-size-height: 48px;
}

.wpforms-field-label,
.wpforms-field-sublabel {
  color: var(--ij-text) !important;
}

.screen-reader-text:focus {
  background: var(--ij-surface);
  color: var(--ij-strong);
}

/* ---------- layout ---------- */

.entry-content:not(:first-child),
.entry-summary:not(:first-child),
.page-content:not(:first-child) {
  margin-top: 0;
}

.separate-containers .inside-article > .featured-image {
  margin-bottom: 0;
}

.games-section {
  margin-top: 16px;
}

.align-right-link-div {
  text-align: right;
  margin-top: 12px;
}

.align-right-link {
  text-decoration: none;
  font-weight: 800;
}

/* Wide tables scroll inside their own box instead of widening the page. */
.table-scroll {
  overflow-x: auto;
  margin-bottom: 1.5em;
}

.table-scroll table {
  min-width: 640px;
  margin-bottom: 0;
}

/* Archive pages: page links (pexy hid them; with 24 games per page they are the way on). */
.paging-navigation .nav-links,
nav.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 24px 0 8px;
}

nav.pagination .page-numbers,
.paging-navigation .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--ij-radius-sm);
  background: var(--ij-surface-2);
  color: var(--ij-text);
  font-weight: 800;
  text-decoration: none;
}

nav.pagination .page-numbers.current,
.paging-navigation .page-numbers.current {
  background: var(--ij-accent);
  color: var(--ij-on-accent);
}

nav.pagination a.page-numbers:hover,
.paging-navigation a.page-numbers:hover {
  background: var(--ij-line);
  color: var(--ij-strong);
}

/* Phones: 16px side margin for everything below the header (the header keeps its own padding). */
@media (max-width: 768px) {
  #page.site {
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  .separate-containers .inside-article,
  .one-container .site-content {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* ---------- header (parts/header.php) ---------- */

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(18, 19, 28, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--ij-surface-2);
  color: var(--ij-text);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 6px 12px;
}

.top-bar-left,
.top-bar-center,
.top-bar-right {
  display: flex;
  align-items: center;
}

.top-bar-left {
  flex: 0 1 auto;
  gap: 6px;
  min-width: 0;
}

.top-bar-center {
  flex: 1 1 auto;
  justify-content: center;
}

.top-bar-right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

#menu-toggle,
#search-toggle,
.favorites-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--ij-radius-sm) !important;
  background: transparent;
  color: var(--ij-text);
  cursor: pointer;
  text-decoration: none;
}

#menu-toggle:hover,
#search-toggle:hover,
.favorites-link:hover {
  background: var(--ij-surface-2);
  color: var(--ij-strong);
}

.ij-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ij-strong);
  text-decoration: none;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.ij-logo:hover,
.ij-logo:focus {
  color: var(--ij-strong);
}

.ij-logo-mark {
  flex: 0 0 auto;
}

.ij-logo-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ij-logo-tld {
  color: var(--ij-pink);
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 420px;
}

#typeahead-search {
  width: 100%;
  padding: 9px 14px;
  font-size: 16px;
}

#search-toggle {
  display: none;
}

#search-results,
#mobile-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 6px;
  padding: 6px 0;
  background-color: var(--ij-surface);
  color: var(--ij-text);
  border: 1px solid var(--ij-line);
  border-radius: var(--ij-radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 1100;
  display: none;
}

#search-results ul,
#mobile-search-results ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#search-results li,
#mobile-search-results li {
  padding: 0;
  font-size: 15px;
}

#search-results li a,
#mobile-search-results li a,
#search-results li.ij-empty,
#mobile-search-results li.ij-empty {
  display: block;
  padding: 10px 14px;
  color: var(--ij-text);
  text-decoration: none;
}

#search-results li a:hover,
#search-results li a:focus,
#mobile-search-results li a:hover,
#mobile-search-results li a:focus {
  background-color: var(--ij-surface-2);
  color: var(--ij-strong);
}

.hidden {
  display: none !important;
}

.mobile-search-container {
  display: none;
}

@media (max-width: 768px) {
  .top-bar-inner {
    padding: 4px 8px;
    gap: 4px;
  }

  .top-bar-center {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .top-bar-center .search-wrapper {
    display: none;
  }

  #search-toggle {
    display: inline-flex;
  }

  .ij-logo {
    font-size: 17px;
    gap: 6px;
  }

  .ij-logo-mark {
    width: 28px;
    height: 28px;
  }

  .mobile-search-container.active {
    display: block;
    position: relative;
    padding: 8px 12px 12px;
    background-color: var(--ij-surface);
    animation: ij-slide-down 0.2s ease-out;
  }

  #mobile-search-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    box-sizing: border-box;
  }

  #mobile-search-results {
    left: 12px;
    width: calc(100% - 24px);
  }
}

@keyframes ij-slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- side menu ---------- */

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  width: 270px;
  max-width: 85vw;
  padding: 72px 8px 24px;
  box-sizing: border-box;
  background-color: var(--ij-surface);
  border-right: 1px solid var(--ij-surface-2);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
  z-index: 999;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-menu.open {
  transform: none;
  visibility: visible;
  transition: transform 0.25s ease;
}

.side-menu ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.side-menu li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--ij-radius-sm);
  color: var(--ij-text);
  font-weight: 700;
  text-decoration: none;
}

.side-menu .ij-ico {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-right: 12px;
  transition: transform 0.15s ease;
}

.side-menu li a:hover .ij-ico,
.side-menu li a:focus .ij-ico {
  transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
  .side-menu .ij-ico {
    transition: none;
  }
}

.side-menu li a:hover,
.side-menu li a:focus {
  background: var(--ij-surface-2);
  color: var(--ij-strong);
}

.side-menu-head {
  margin: 16px 14px 4px;
  color: var(--ij-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.side-menu-small li a {
  min-height: 40px;
  color: var(--ij-muted);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .side-menu,
  .side-menu.open,
  .mobile-search-container.active {
    transition: none;
    animation: none;
  }
}

/* ---------- game cards (inc/ij-cards.php) ---------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 20px 16px;
}

.ij-card {
  min-width: 0;
}

.ij-card-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ij-text);
  text-decoration: none;
}

.ij-card-link:hover,
.ij-card-link:focus {
  color: var(--ij-strong);
}

.ij-card-img {
  position: relative;
  display: block;
  aspect-ratio: 25 / 14;
  border-radius: var(--ij-radius);
  border: 2px solid var(--ij-surface-2);
  overflow: hidden;
  background: var(--ij-surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ij-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* P3: CRT scanlines and a play pill on hover/focus. */
.ij-card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(0deg, rgba(8, 9, 17, 0.35) 0 1px, transparent 1px 3px);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.ij-card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--ij-accent);
  color: var(--ij-on-accent);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ij-card-link:hover .ij-card-img,
.ij-card-link:focus-visible .ij-card-img {
  border-color: var(--ij-accent);
  transform: translateY(-2px);
}

.ij-card-link:hover .ij-card-img::after,
.ij-card-link:focus-visible .ij-card-img::after,
.ij-card-link:hover .ij-card-play,
.ij-card-link:focus-visible .ij-card-play {
  opacity: 1;
}

.ij-card-link:hover .ij-card-play,
.ij-card-link:focus-visible .ij-card-play {
  transform: translate(-50%, -50%);
}

.ij-card-link:focus-visible {
  outline: none;
}

.ij-card-link:focus-visible .ij-card-img {
  outline: 2px solid var(--ij-link);
  outline-offset: 2px;
}

.ij-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ij-card-title {
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ij-card-platform {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  color: var(--ij-lavender);
}

.ij-p-flash { color: var(--ij-pink); }
.ij-p-html5 { color: var(--ij-mint); }
.ij-p-dos { color: var(--ij-lavender); }
.ij-p-c64 { color: var(--ij-sky); }

@media (prefers-reduced-motion: reduce) {
  .ij-card-img,
  .ij-card-play {
    transition: none;
  }

  .ij-card-link:hover .ij-card-img {
    transform: none;
  }
}

@media (max-width: 480px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }

  .ij-card-title {
    font-size: 14px;
    -webkit-line-clamp: 4;
  }

  /* Two narrow columns: the platform label goes under the title, so long series titles keep their numbers. */
  .ij-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .ij-card-play {
    display: none;
  }
}

/* Older card markup still used by shortcodes (cross-platform hub). */
.entry-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 25 / 14;
  border-radius: var(--ij-radius);
  overflow: hidden;
  border: 2px solid var(--ij-surface-2);
  transition: border-color 0.2s ease;
}

.entry-thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entry-thumbnail:hover {
  border-color: var(--ij-accent);
}

.thumbnail-title {
  position: absolute;
  left: 6px;
  bottom: 6px;
  max-width: 90%;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(8, 9, 17, 0.75);
  color: var(--ij-strong);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- home (page-home.php) ---------- */

.ij-hero {
  position: relative;
  margin-top: 40px;
  padding: 28px 32px;
  border-radius: 14px;
  background: var(--ij-surface);
}

.ij-hero h1 {
  margin: 0 0 12px;
  padding-left: 16px;
  border-left: 5px solid var(--ij-pink);
  font-size: 34px;
  line-height: 1.12;
}

.ij-hero-lead {
  margin: 0 0 18px;
  max-width: 62ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ij-text);
}

.ij-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ij-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--ij-surface-2);
  color: var(--ij-strong);
  font-weight: 800;
  text-decoration: none;
}

.ij-btn:hover,
.ij-btn:focus {
  background: var(--ij-line);
  color: var(--ij-strong);
}

.ij-btn-primary {
  background: var(--ij-accent);
  color: var(--ij-on-accent);
}

.ij-btn-primary:hover,
.ij-btn-primary:focus {
  background: var(--ij-accent-hover);
  color: var(--ij-on-accent);
}

/* P3 mascot: a pixel space invader peeking over the hero box. */
.ij-mascot {
  position: absolute;
  top: -30px;
  right: 40px;
  width: 77px;
  height: 56px;
}

.ij-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ij-muted);
  font-size: 14px;
  font-weight: 700;
}

.ij-hero-stats strong {
  color: var(--ij-strong);
}

.ij-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ij-section-head h2 {
  margin-bottom: 0.8em;
}

.ij-more {
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.ij-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ij-chips a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--ij-line);
  background: var(--ij-surface);
  color: var(--ij-text);
  font-weight: 700;
  text-decoration: none;
}

.ij-chips a:hover,
.ij-chips a:focus {
  border-color: var(--ij-accent);
  color: var(--ij-strong);
}

.ij-chips .ij-count {
  color: var(--ij-muted);
  font-size: 13px;
}

.ij-intro {
  margin-top: 40px;
  padding: 24px 28px;
  border-radius: 14px;
  background: var(--ij-surface);
  line-height: 1.65;
}

.ij-intro h2:first-child {
  margin-top: 0;
}

@media (max-width: 768px) {
  .ij-hero {
    margin-top: 36px;
    padding: 22px 18px;
  }

  .ij-hero h1 {
    font-size: 26px;
    padding-left: 12px;
  }

  .ij-mascot {
    right: 16px;
    top: -26px;
    width: 55px;
    height: 40px;
  }

  .ij-intro {
    padding: 18px 16px;
  }
}

/* ---------- footer (parts/footer.php) ---------- */

.site-footer {
  margin-top: 40px;
}

.ij-footer {
  background: var(--ij-surface);
  color: var(--ij-muted);
  padding: 0;
  text-align: center;
}

.ij-gameover {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 18px;
  padding: 16px 16px;
  border-bottom: 1px solid var(--ij-surface-2);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ij-muted);
}

.ij-gameover-q {
  color: var(--ij-pink);
}

.ij-gameover a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  text-decoration: none;
}

.ij-gameover-yes,
.ij-gameover-no {
  color: var(--ij-link);
}

.ij-gameover a:hover,
.ij-gameover a:focus {
  color: var(--ij-strong);
}

.ij-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.ij-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
}

.ij-footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ij-text);
  font-weight: 700;
  text-decoration: none;
}

.ij-footer-links a:hover,
.ij-footer-links a:focus {
  color: var(--ij-link-hover);
}

.ij-copyright {
  margin: 8px 0 0;
  font-size: 14px;
}

/* ---------- sidebar ---------- */

.widget-area .widget {
  background-color: var(--ij-surface);
  padding: 18px;
}

.widget-area .widget h2,
.widget-area .widget h3,
.widget-area .widget h4 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 17px;
  font-weight: 900;
}

.widget-area .widget p {
  color: var(--ij-text);
  font-size: 15px;
  line-height: 1.55;
}

/* ---------- game page (single-game.php) ---------- */

.game-container,
.crt-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: auto;
  overflow: hidden;
  background-color: var(--ij-surface);
}

.game-container::before,
.crt-wrapper::before {
  content: "";
  display: block;
  padding-top: 65%;
}

.game-container {
  height: 100%;
}

.crt-wrapper.pseudo-fullscreen,
.crt-wrapper:fullscreen {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: calc(var(--vh, 1vh) * 100);
  background: #000;
  z-index: 1001; /* above the sticky site header (1000) */
}

.crt-wrapper.pseudo-fullscreen::before,
.crt-wrapper:fullscreen::before {
  display: none;
}

.crt-wrapper.crt-effect-disabled .crt-overlay {
  display: none;
}

.crt-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.4) 100%),
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0.05) 2px, rgba(0, 0, 0, 0.9) 3px);
  animation: flicker 0.1s infinite;
}

@keyframes flicker {
  0% { opacity: 0.95; }
  50% { opacity: 1; }
  100% { opacity: 0.88; }
}

@media (prefers-reduced-motion: reduce) {
  .crt-overlay {
    animation: none;
  }
}

.game-intro-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.game-content {
  position: absolute;
  inset: 0;
  background-color: #000;
}

.game-thumbnail {
  padding: 10px;
  box-sizing: border-box;
}

.game-thumbnail img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--ij-radius);
  object-fit: cover;
}

.game-title {
  font-weight: 900;
  font-size: 1.4rem;
}

.playnow-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 11px 24px;
  border-radius: 999px !important;
  background: var(--ij-accent);
  color: var(--ij-on-accent);
  font-size: 18px;
  font-weight: 900;
  text-transform: none;
  cursor: pointer;
  transition: transform 0.2s ease-in-out, background-color 0.2s ease;
}

.playnow-btn:hover,
.playnow-btn:focus {
  transform: scale(1.06);
  background: var(--ij-accent-hover);
}

.game-toolbar {
  display: flex;
  flex-flow: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 52px;
  background: var(--ij-surface-2);
  user-select: none;
  z-index: 1;
}

.toolbar-title {
  display: flex;
  align-items: center;
  margin-left: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  font-weight: 900;
}

.toolbar-buttons {
  display: flex;
  gap: 6px;
  margin-right: 6px;
}

@media (max-width: 768px) {
  .toolbar-title {
    display: none;
  }

  .toolbar-buttons {
    width: 100%;
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
  }
}

.svg-btn-icon {
  width: 20px;
  height: 20px;
  fill: #fff;
  transition: transform 0.2s ease-in-out;
}

.svg-btn,
.simplefavorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  vertical-align: middle;
  padding: 5px;
  border: none;
  background-color: var(--ij-surface-2);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.svg-btn:active,
.svg-btn:focus,
.simplefavorite-button:focus {
  background-color: var(--ij-surface-2);
}

/* hover only; the rounded corners come from the shared button rule */
.svg-btn:hover,
.simplefavorite-button:hover,
.vote-btn:hover {
  background-color: var(--ij-accent) !important;
}

.svg-btn:focus-visible,
.playnow-btn:focus-visible {
  outline: 2px solid var(--ij-link);
  outline-offset: 2px;
}

.gi-row {
  display: flex;
}

.gi-1 {
  flex-shrink: 0;
  width: 130px;
  color: var(--ij-muted);
}

.gi-2 {
  align-items: baseline;
  color: var(--ij-strong);
  font-weight: 700;
  text-transform: none;
}

.game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--ij-line);
  border-radius: 999px;
  background-color: var(--ij-surface);
  color: var(--ij-text);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.tag-button:hover,
.tag-button:focus {
  border-color: var(--ij-accent);
  background-color: var(--ij-surface);
  color: var(--ij-strong);
}

.tag-num {
  color: var(--ij-muted);
}

.pseudo-fullscreen {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  background-color: #000;
}

.pexy-toolbar-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.pexy-icon-favorite { background-image: url('img/favorite.svg'); }
.pexy-icon-favorited { background-image: url('img/favorited.svg'); }
.pexy-icon-crton { background-image: url('img/crton.svg'); }
.pexy-icon-crtoff { background-image: url('img/crtoff.svg'); }
.pexy-icon-fullscreen { background-image: url('img/fullscreen.svg'); }
.pexy-icon-feedback { background-image: url('img/feedback.svg?v=2'); }

.has-tooltip,
.tooltip-favorite {
  position: relative;
  cursor: pointer;
}

.has-tooltip::after,
.tooltip-favorite::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 125%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--ij-surface);
  border: 1px solid var(--ij-line);
  color: var(--ij-text);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.tooltip-favorite::after {
  content: 'Kedvencekhez';
  top: 155%;
}

.has-tooltip:hover::after,
.has-tooltip:focus-visible::after,
.tooltip-favorite:hover::after {
  opacity: 1;
}

ruffle-player,
ruffle-embed,
ruffle-object {
  --logo-display: none;
}

/* Rating */
.vote-buttons {
  display: inline-block;
}

.vote-count {
  font-size: x-small;
}

.pexy-icon-thumb {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: middle;
  line-height: 0;
}

.pexy-icon-thumbs-up { background-image: url('img/thumbs-up-white.svg'); }
.pexy-icon-thumbs-down { background-image: url('img/thumbs-down-white.svg'); }
.vote-btn.voted-up .pexy-icon-thumbs-up { background-image: url('img/thumbs-up-green.svg'); }
.vote-btn.voted-down .pexy-icon-thumbs-down { background-image: url('img/thumbs-down-red.svg'); }

/* Feedback button in the game toolbar: a link styled like the other icon buttons. */
a.feedback-btn,
a.feedback-btn:visited {
  color: #fff;
  text-decoration: none;
  align-items: center;
}

a.feedback-btn:hover,
a.feedback-btn:focus-visible {
  color: #fff;
  background-color: var(--ij-accent);
}

.top-rated-intro {
  margin-bottom: 1.2em;
}

/* ---------- ad places (inc/pexy-ads.php): fixed heights, so the page does not move when an ad arrives ---------- */

.pexy-ad {
  margin: 20px 0;
  text-align: center;
}

.pexy-ad-label {
  display: block;
  font-size: 11px;
  line-height: 18px;
  letter-spacing: 0.08em;
  color: var(--ij-muted);
}

.pexy-ad-unit {
  display: block;
  width: 100%;
  margin: 0 auto;
}

.pexy-ad-g1 .pexy-ad-unit,
.pexy-ad-a1 .pexy-ad-unit {
  height: 90px;
}

.pexy-ad-g2 {
  margin: 2em 0;
  min-height: 250px;
}

.pexy-ad-s1 {
  position: sticky;
  top: 80px;
}

/* The sidebar is 220px wide: a 160x600 skyscraper. */
.pexy-ad-s1 .pexy-ad-unit {
  width: 160px;
  height: 600px;
}

@media (min-width: 769px) {
  .inside-right-sidebar {
    height: 100%;
  }
}

@media (max-height: 760px) {
  .pexy-ad-s1 {
    position: static;
  }
}

@media (max-width: 768px) {
  .pexy-ad-g1 .pexy-ad-unit,
  .pexy-ad-a1 .pexy-ad-unit {
    height: 250px;
  }

  .pexy-ad-s1 {
    display: none;
  }
}

.pexy-ad:has(ins[data-ad-status="unfilled"]) {
  display: none;
}

.pexy-ad-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  background: repeating-linear-gradient(45deg, #3a3a48, #3a3a48 10px, #44445a 10px, #44445a 20px);
  color: #fff;
  font-weight: 700;
}

.pexy-ad-g1 .pexy-ad-preview,
.pexy-ad-a1 .pexy-ad-preview,
.pexy-ad-s1 .pexy-ad-preview {
  min-height: 0;
}

/* ---------- cross-platform hub (shortcode kept from pexy) ---------- */

.cp-platforms {
  margin-top: 4px;
  text-align: center;
  font-size: 13px;
  color: var(--ij-muted);
}

.cp-platforms .cp-name {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--ij-strong);
  text-decoration: none;
}

/* Kept last: it must win over the component rules above. */
/* Phones: every tap target at least 44px high (plan 3 global constraint). */
@media (max-width: 768px) {
  .ij-chips a,
  .tag-button,
  .ij-logo,
  .ij-more,
  .game-breadcrumb a,
  .gi-2 a {
    min-height: 44px;
  }

  .ij-more,
  .game-breadcrumb a,
  .gi-2 a {
    display: inline-flex;
    align-items: center;
  }
}
