/* Motion, interaction effects, image rhythm, and rendering optimizations. */

/* BUTTON INTERACTIONS AND SMOOTH REPEATING SHEEN                              */
/* -------------------------------------------------------------------------- */

/* Use existing button classes for links. role="button" is for actual actions. */
body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transform-origin: center;
  text-decoration: none !important;
  transition: transform var(--dafy-duration-fast) var(--dafy-ease),
    border-color var(--dafy-duration-fast) var(--dafy-ease),
    background-color var(--dafy-duration-fast) var(--dafy-ease),
    color var(--dafy-duration-fast) var(--dafy-ease),
    box-shadow var(--dafy-duration-fast) var(--dafy-ease);
}

body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible, :active) {
  animation: none;
  border-color: var(--dafy-button-hover-border) !important;
  background: var(--dafy-button-hover-bg) !important;
  color: var(--dafy-button-hover-text) !important;
  box-shadow: var(--dafy-button-hover-shadow) !important;
  filter: none;
}

body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible, :active) * {
  color: var(--dafy-button-hover-text) !important;
}

@media (hover: hover) and (pointer: fine) {
body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
):not(:disabled):not([aria-disabled="true"]):hover {
  transform: translateY(-2px) !important;
}

}

body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
):focus-visible {
  outline: 2px solid var(--dafy-yellow);
  outline-offset: 3px;
}

body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
):not(:disabled):not([aria-disabled="true"]):active {
  transform: translateY(0) scale(0.99) !important;
  box-shadow: none !important;
}

body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
):is(:disabled, [aria-disabled="true"]) {
  animation: none !important;
  transform: none !important;
  opacity: 0.55;
  cursor: not-allowed;
}

body :is(.ct-search-form button, .ct-header-search, .ct-header-trigger,
  .ct-toggle-dropdown-desktop, .ct-toggle-dropdown-desktop-ghost,
  [data-button="icon"], .dafy-no-pulse):is(:hover, :focus-visible, :active) {
  transform: none !important;
}

/* A soft band crosses the surface for ~1.7 seconds, followed by a pause.
   The decoration never intercepts clicks or changes button geometry. */
@keyframes dafy-button-sheen {
  0%, 62% { transform: translateX(-180%) skewX(-18deg); opacity: 0; }
  66% { opacity: 0.55; }
  87% { opacity: 0.55; }
  92%, 100% { transform: translateX(360%) skewX(-18deg); opacity: 0; }
}

/* Native inputs do not reliably render pseudo-elements. */
@keyframes dafy-input-sheen {
  0%, 62% { background-position: 150% 0; }
  92%, 100% { background-position: -150% 0; }
}

@media (prefers-reduced-motion: no-preference) {
body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
):not(:disabled):not([aria-disabled="true"]):not(input):not(.dafy-no-sheen):not(:where(#header *, .ct-header-search, .ct-header-trigger, .ct-menu-link, .ct-toggle-dropdown-desktop, .ct-toggle-dropdown-desktop-ghost))::after {
  content: "";
  position: absolute;
  top: -25%;
  left: 0;
  z-index: 2;
  width: 45%;
  height: 150%;
  border: 0;
  border-radius: 0;
  margin: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  pointer-events: none;
  opacity: 0;
  animation: dafy-button-sheen var(--dafy-sheen-duration) ease-in-out infinite;
}

body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
):is(input):not(:disabled):not([aria-disabled="true"]):not(.dafy-no-sheen):not(:where(#header *, .ct-header-search, .ct-header-trigger, .ct-menu-link, .ct-toggle-dropdown-desktop, .ct-toggle-dropdown-desktop-ghost)) {
  background-image: linear-gradient(110deg, transparent 42%, rgba(255, 255, 255, 0.16) 50%, transparent 58%) !important;
  background-size: 250% 100% !important;
  background-repeat: no-repeat !important;
  animation: dafy-input-sheen var(--dafy-sheen-duration) ease-in-out infinite;
}

}

@media (prefers-reduced-motion: reduce), (hover: none) {
body :is(a, button, input, [role="button"]):is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  [role="button"],
  .wp-block-button__link,
  .wp-element-button,
  .ct-button,
  .ct-button-outline,
  .button,
  .btn,
  a[class*="button"],
  a[class*="btn"],

  
  .cta-link-button,
  .entry-button,
  .game-buy-box__button,
  .ct-load-more,
  .ct-cookies-accept-button,
  .ct-cookies-decline-button,
  .dark-button,
  .dark-outline-button,
  .gog-button,
  .gmg-button,
  .dg-button,
  .dg-hero__nav a,
  .dg-card__link,
  .dg-game__button,
  .dafy-support-card__button,
  .ct-pagination a.page-numbers:not(.current):not(.dots)
):is(:hover, :focus-visible, :active) {
  transform: none !important;
}

}

/* BLOCKSY: STABLE CONTENT BUTTON GEOMETRY */
body .entry-content :is(
  a.wp-block-button__link, a.wp-element-button, a.ct-button,
  a.ct-button-outline, a.button, a.btn, a.dark-button,
  a.dark-outline-button, a.gog-button, a.gmg-button,
  button.wp-element-button
):not(:where(.ct-search-form *, [data-button="icon"])),
body .entry-content :is(
  a.wp-block-button__link, a.wp-element-button, a.ct-button,
  a.ct-button-outline, a.button, a.btn, a.dark-button,
  a.dark-outline-button, a.gog-button, a.gmg-button,
  button.wp-element-button
):not(:where(.ct-search-form *, [data-button="icon"])):is(:hover, :focus, :focus-visible, :active) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: var(--dafy-control-height) !important;
  padding: 11px 22px !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-radius: var(--dafy-button-radius, var(--dafy-radius-md)) !important;
  line-height: 1.25 !important;
}

/* -------------------------------------------------------------------------- */
/* EVEN IMAGE SPACING IN ARTICLE SECTIONS                                      */
/* -------------------------------------------------------------------------- */

/* One rhythm for normal article images, including images outside Group blocks. */
.entry-content {
  --dafy-image-spacing: clamp(24px, 4vw, 32px);
}

.entry-content :where(figure.wp-block-image, figure.wp-caption):not(.alignleft):not(.alignright) {
  margin-top: var(--dafy-image-spacing) !important;
  margin-bottom: var(--dafy-image-spacing) !important;
}

/* The load-more button belongs to the image above and should not receive
   the general editorial spacing between standalone blocks. */
.entry-content :where(figure.wp-block-image, figure.wp-caption):not(.alignleft):not(.alignright):has(+ .wp-block-buttons) {
  margin-bottom: 16px !important;
}

.entry-content :where(figure.wp-block-image, figure.wp-caption):not(.alignleft):not(.alignright) + .wp-block-buttons {
  margin-top: 0 !important;
}

/* Standalone editor images without a figure wrapper. */
.entry-content > img:not(.author-image),
.entry-content > a:has(> img:only-child) {
  display: block;
  margin-top: var(--dafy-image-spacing) !important;
  margin-bottom: var(--dafy-image-spacing) !important;
}

/* The media block owns the gap, so adjacent paragraph margins cannot double it. */
@supports selector(p:has(+ figure)) {
  .entry-content p:has(+ :where(figure.wp-block-image, figure.wp-caption):not(.alignleft):not(.alignright)) {
    margin-bottom: 0 !important;
  }
}

/* Captions remain attached to the image inside the spaced figure. */
.entry-content :where(figure.wp-block-image, figure.wp-caption) > figcaption {
  margin-bottom: 0 !important;
}

/* Floated editorial images keep text wrapping and receive a safe text gutter. */
.entry-content :where(figure.wp-block-image, figure.wp-caption).alignleft {
  margin: 0.35em clamp(20px, 3vw, 32px) 1.25em 0 !important;
}

.entry-content :where(figure.wp-block-image, figure.wp-caption).alignright {
  margin: 0.35em 0 1.25em clamp(20px, 3vw, 32px) !important;
}

@media (max-width: 600px) {
  .entry-content {
    --dafy-image-spacing: 24px;
  }

  .entry-content :where(figure.wp-block-image, figure.wp-caption):not(.alignleft):not(.alignright):has(+ .wp-block-buttons) {
    margin-bottom: 14px !important;
  }

  .entry-content :where(figure.wp-block-image, figure.wp-caption):is(.alignleft, .alignright) {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: var(--dafy-image-spacing) 0 !important;
  }
}

/* Related posts block. */
.ct-related-posts {
	padding: 32px 28px 28px;
}

/* Spacing between the block top and its heading. */
.ct-related-posts .ct-module-title {
	margin: 0 0 28px;
	line-height: 1.15;
}

/* Keep grid rows at a consistent height. */
.ct-related-posts-items[data-layout="grid"] {
	align-items: stretch;
	grid-auto-rows: minmax(210px, auto);
}

/* Card styles. */
.ct-related-posts-items article,
.ct-related-posts-items article > div {
	position: relative;
	height: 100%;
	min-height: 210px;
	overflow: hidden;
	border-radius: 22px;
}

/* Let the image fill the enlarged card. */
.ct-related-posts .ct-media-container {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

.ct-related-posts .ct-media-container img {
	width: 100%;
	height: 100%;
	aspect-ratio: auto !important;
	object-fit: cover;
}

/* Overlay improves text contrast. */
.ct-related-posts article > div::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.78) 0%,
		rgba(0, 0, 0, 0.22) 65%,
		rgba(0, 0, 0, 0.12) 100%
	);
}

/* Card title styles. */
.ct-related-posts .related-entry-title {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
	margin: 0;
	padding: 22px 18px;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.ct-related-posts .related-entry-title a {
	display: block;
	color: #fff;
	text-decoration: none;
}

/* Tablet styles. */
@media (max-width: 999px) {
	.ct-related-posts-items[data-layout="grid"] {
		grid-auto-rows: minmax(230px, auto);
	}
}

/* Phone styles. */
@media (max-width: 689px) {
	.ct-related-posts {
		padding: 26px 18px 20px;
	}

	.ct-related-posts .ct-module-title {
		margin-bottom: 22px;
	}

	.ct-related-posts-items[data-layout="grid"] {
		grid-template-columns: 1fr;
		grid-auto-rows: minmax(220px, auto);
	}

	.ct-related-posts-items article,
	.ct-related-posts-items article > div {
		min-height: 220px;
	}
}

/* Top spacing for the related-posts heading. */
body .ct-related-posts > h2.ct-module-title {
	position: static !important;
	transform: none !important;
	margin: 0 0 28px !important;
	padding: 18px 0 0 !important;
	line-height: 1.25 !important;
}

/* ==========================================================================
   STEAM SIDEBAR AD
   ========================================================================== */

.steam-sidebar-ad {
  position: relative;
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto 24px;
  overflow: hidden;

  border-radius: var(--dafy-radius-sm, 8px);
  line-height: 0;
  text-decoration: none;
  isolation: isolate;
}

.steam-sidebar-ad img {
  display: block !important;
  width: 100% !important;
  height: auto !important;

  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;

  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: inherit;

  float: none !important;

  object-fit: contain !important;
  object-position: center !important;

  transform: scale(1);
  transform-origin: center;

  transition:
    transform var(--dafy-duration-base, 280ms)
      var(--dafy-ease, cubic-bezier(0.2, 0.7, 0.2, 1)),
    filter var(--dafy-duration-base, 280ms)
      var(--dafy-ease, cubic-bezier(0.2, 0.7, 0.2, 1));
}

/* Scale on hover. */
@media (hover: hover) and (pointer: fine) {
  .steam-sidebar-ad:hover img {
    transform: scale(1.06);
    filter: saturate(1.06) contrast(1.04);
  }
}

/* Scale on keyboard focus. */
.steam-sidebar-ad:focus-visible img {
  transform: scale(1.06);
  filter: saturate(1.06) contrast(1.04);
}

/* Periodic sheen effect. */
@media (prefers-reduced-motion: no-preference) {
  .steam-sidebar-ad::after {
    content: "";
    position: absolute;
    top: -25%;
    left: 0;
    z-index: 2;

    width: 45%;
    height: 150%;

    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.28),
      transparent
    );

    border: 0;
    margin: 0;
    opacity: 0;
    pointer-events: none;

    animation:
      dafy-button-sheen
      var(--dafy-sheen-duration, 6.4s)
      ease-in-out
      infinite;
  }
}

/* Disable motion when requested by system preferences. */
@media (prefers-reduced-motion: reduce) {
  .steam-sidebar-ad img {
    transition: none;
    transform: none;
    filter: none;
  }

  .steam-sidebar-ad::after {
    display: none;
  }
}

/* ==========================================================================
   GOOGLE PREFERRED SOURCES CTA
   ========================================================================== */

.dafy-preferred-source {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 22px auto 38px;
  padding: 18px 20px;
  overflow: visible;
  isolation: isolate;
  border: 1px solid rgba(255, 176, 45, .25);
  border-radius: var(--dafy-radius-lg, 16px);
  background: linear-gradient(135deg, #1d1d1d, #151515);
  box-shadow: var(--dafy-shadow-md, 0 10px 28px rgba(0, 0, 0, .25));
}

/* The light segment moves only along the CTA border. */
.dafy-preferred-source__fuse {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.dafy-preferred-source__fuse-line {
  /* Use the live SVG viewport so portrait layouts do not stretch the path. */
  width: calc(100% - 2px);
  height: calc(100% - 2px);
  rx: calc(var(--dafy-radius-lg, 16px) - 1px);
  ry: calc(var(--dafy-radius-lg, 16px) - 1px);
  fill: none;
  stroke: #ffd133;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 9 91;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 3px rgba(255, 209, 51, .85));
  animation: dafy-preferred-fuse 4.8s linear infinite;
}

.dafy-preferred-source__copy,
.dafy-preferred-source__badge-link {
  position: relative;
  z-index: 1;
}

.dafy-preferred-source__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.dafy-preferred-source__copy strong {
  color: var(--dafy-text, #fff);
  font-size: 1rem;
  line-height: 1.35;
}

.dafy-preferred-source__copy span {
  color: var(--dafy-text-muted, #c7c7c7);
  font-size: .9rem;
  line-height: 1.45;
}

/* A regular link with a transparent badge is not styled as a button. */
.dafy-preferred-source__badge-link {
  display: block;
  flex: 0 0 auto;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible;
  border: 0 !important;
  border-radius: 12px;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  line-height: 0;
  text-decoration: none;
}

.dafy-preferred-source__badge-link::before,
.dafy-preferred-source__badge-link::after {
  display: none !important;
  content: none !important;
}

.dafy-preferred-source__badge-link:focus-visible {
  outline: 2px solid #fff3a0 !important;
  outline-offset: 4px;
}

.dafy-preferred-source__badge-link img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  border: 0 !important;
  border-radius: 12px;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
}

/* The image's hover-zoom class uses the site's shared hover effect. */
@keyframes dafy-preferred-fuse {
  to {
    stroke-dashoffset: -100;
  }
}

@media (max-width: 768px) {
  .dafy-preferred-source {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .dafy-preferred-source__badge-link img {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dafy-preferred-source__fuse-line {
    animation: none;
  }
}

/* ==========================================================================
   LIGHTBOX — full-screen image enlargement on click.
   Append this section to the custom stylesheet.
   Works with assets/js/dafy-lightbox.js.
   ========================================================================== */

.dafy-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgb(0 0 0 / 85%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.dafy-lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dafy-lightbox img {
    display: block;
    max-width: min(96vw, 1600px);
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.dafy-lightbox__close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgb(0 0 0 / 65%);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

img[data-dafy-lightbox] {
    cursor: zoom-in;
}


/* ==========================================================================
   Yandex side banner ads (skyscrapers).
   ========================================================================== */
.dafy-side-banner {
    position: fixed;
    top: 140px;
    z-index: 90;
    width: 300px;
    display: none; /* Hidden by default on mobile and laptop screens. */
}

/* Show only above 1550px, where there is room for 300px banners. */
@media screen and (min-width: 1510px) {
    .dafy-side-banner {
        display: block;
    }

    /* Align the left banner's right edge with the content boundary. */
    .dafy-side-banner-left {
        left: auto;
        right: calc(50% + 445px);
    }

    /* Align the right banner's left edge with the content boundary. */
    .dafy-side-banner-right {
        right: auto;
        left: calc(50% + 445px);
    }
}

/* ========================================================================== */
/* FLOATING SIDEBAR NEWS DRAWER (DAFY.SITE)                                   */
/* ========================================================================== */

.dafy-news-widget {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 99999;
  font-family: inherit;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.dafy-news-widget__content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.dafy-news-widget__restore {
  display: none;
  background: var(--dafy-surface-4, #1c1c1e);
  border: 1px solid rgba(255, 102, 0, 0.4);
  border-right: none;
  border-radius: 8px 0 0 8px;
  padding: 16px 4px;
  cursor: pointer;
  color: var(--dafy-orange, #ff6600);
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.5);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dafy-news-widget__restore:hover {
  background: var(--dafy-orange, #ff6600);
  color: #000000;
}

.dafy-news-widget.is-minimized .dafy-news-widget__content {
  display: none;
}

.dafy-news-widget.is-minimized .dafy-news-widget__restore {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dafy-news-drawer__trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 12px;
  background: var(--dafy-surface-4, #1c1c1e);
  border-left: 2px solid var(--dafy-orange, #ff6600);
  border-top: 1px solid rgba(255, 102, 0, 0.4);
  border-bottom: 1px solid rgba(255, 102, 0, 0.4);
  border-right: none;
  border-radius: 12px 0 0 12px;
  color: var(--dafy-text, #ffffff);
  cursor: pointer;
  list-style: none;
  user-select: none;
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.5);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.dafy-news-drawer__trigger::-webkit-details-marker {
  display: none;
}

.dafy-news-drawer__trigger:hover {
  background: var(--dafy-orange, #ff6600);
  color: #000000;
  border-top-color: var(--dafy-orange, #ff6600);
  border-bottom-color: var(--dafy-orange, #ff6600);
  opacity: 1;
}

.dafy-news-drawer__trigger-title {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dafy-news-drawer__trigger-badge {
  font-size: 0.68rem;
  background: var(--dafy-yellow, #ffcc00);
  color: #000000;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 1px;
}

.dafy-news-widget__hide-bar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--dafy-surface-4, #1c1c1e);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-right: none;
  border-radius: 6px 0 0 6px;
  padding: 4px 8px 4px 10px;
  color: var(--dafy-text-secondary, #a1a1aa);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.dafy-news-widget__hide-bar:hover {
  color: #ffffff;
  background: #252528;
  border-color: var(--dafy-orange, #ff6600);
}

.dafy-news-widget__hide-bar svg {
  transition: transform 0.2s ease;
}

.dafy-news-widget__hide-bar:hover svg {
  transform: translateX(2px);
  color: var(--dafy-orange, #ff6600);
}

.dafy-news-drawer__body {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: 320px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: radial-gradient(circle at top left, var(--dafy-orange-10, rgba(255, 102, 0, 0.12)), transparent 40%),
              linear-gradient(180deg, var(--dafy-surface-4, #1c1c1e) 0%, var(--dafy-surface-1, #121214) 100%);
  border: 1px solid var(--dafy-border-soft, #2a2a2a);
  border-radius: 16px 0 0 16px;
  box-shadow: -12px 0 35px rgba(0, 0, 0, 0.65);
  padding: 16px;
  margin-right: 4px;
  box-sizing: border-box;
}

.dafy-news-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--dafy-border-soft, #2a2a2a);
}

.dafy-news-drawer__heading {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--dafy-yellow, #ffcc00);
}

.dafy-news-drawer__hide-btn {
  background: transparent;
  border: none;
  color: var(--dafy-text-secondary, #999999);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dafy-news-drawer__hide-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.dafy-news-drawer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dafy-news-drawer__item {
  margin: 0;
  padding: 0;
}

.dafy-news-drawer__card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  color: var(--dafy-text-secondary, #d4d4d8);
  transition: color 0.15s ease, transform 0.15s ease;
}

.dafy-news-drawer__card:hover {
  color: var(--dafy-orange, #ff6600) !important;
  transform: translateX(-2px);
}

.dafy-news-drawer__thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--dafy-surface-2, #242426);
  border: 1px solid var(--dafy-border-soft, #2a2a2a);
}

.dafy-news-drawer__thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.dafy-news-drawer__card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.dafy-news-drawer__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  margin-top: 12px;
  border: 1px solid var(--dafy-button-border, #ff6600);
  border-radius: var(--dafy-radius-md, 8px);
  background: var(--dafy-button-bg, #ff6600);
  color: var(--dafy-button-text, #ffffff) !important;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  box-sizing: border-box;
}

.dafy-news-drawer__btn:hover {
  background: var(--dafy-button-hover-bg, #ffcc00);
  border-color: var(--dafy-button-hover-border, #ffcc00);
  color: var(--dafy-button-hover-text, #000000) !important;
}

/* Mobile styles. */
@media (max-width: 768px) {
  .dafy-news-widget.is-minimized .dafy-news-widget__content {
    display: none;
  }

  .dafy-news-widget.is-minimized .dafy-news-widget__restore {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .dafy-news-drawer__trigger {
    padding: 10px 8px;
    opacity: 0.85;
  }

  .dafy-news-drawer__trigger-title {
    font-size: 0.75rem;
  }

  .dafy-news-drawer__trigger-badge {
    font-size: 0.6rem;
  }

  .dafy-news-drawer__body {
    position: fixed;
    right: 52px;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    max-width: calc(100vw - 65px);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 20px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px;
    margin-right: 0;
  }

  .dafy-news-drawer__card-title {
    font-size: 0.78rem;
  }
}

/* -------------------------------------------------------------------------- */
/* PERFORMANCE OPTIMIZATIONS                                                   */
/* -------------------------------------------------------------------------- */

/* Defer rendering of heavy components outside the initial viewport. */
.ct-related-posts,
.custom-faq-item,
.dafy-news-drawer__body,
.author-box.is-width-constrained,
.steam-chart-wrapper {
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
}

/* ---------------------------------------------------------- */
/* Ad slot inside the related-posts block. */
/* ---------------------------------------------------------- */
.dafy-related-ad-slot {
  grid-column: 1 / -1;      /* Spans the full grid width. */
  width: 100%;
  min-height: 120px;
  margin-block: 8px;
  border-radius: var(--dafy-radius-md);
  overflow: hidden;
}

/* Remove the outer margin used by other slots —
   the spacing is already included in the grid gap. */
.dafy-related-ad-slot [data-dafy-yandex-block] {
  margin-top: 0 !important;
}

/* Ad slot inside .ct-related-posts-items. */
.ct-related-posts-items .dafy-related-ad-slot {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 90px;
    margin-block: 4px;
}

/* Compact page FAQs must not reserve the generic 300px offscreen placeholder. */
.dafy-info-page .custom-faq-item {
  content-visibility: visible;
  contain-intrinsic-size: none;
}
