/* iOS Safari safe area adjustment */
.ios-fix {
  position: absolute !important;
  bottom: env(safe-area-inset-bottom) !important;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(100% - env(safe-area-inset-bottom));
}

/* iOS bottom offset class to place iframe 10% up from bottom when in fullscreen */
.ios-bottom-offset {
    position: fixed !important;
    bottom: 10vh !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: calc(100vh - 10vh) !important;
    z-index: 99999 !important;
}

/* Prevent horizontal overflow due to small negative margins or transforms */
html, body { overflow-x: hidden; }

/* Remove tiny gray borders and outlines from all images (force) */
img, a img, .game-image {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

      /* ===== Hover overlay (game title card) =====
         overlay remains clipped inside .game-card because .game-card has overflow:hidden by default.
      */
      .game-card .game-card-overlay {
        position: absolute; left: -1px; right: -1px; bottom: -1px;
        height: 60%; transform: translateY(100%);
        transition: transform .28s cubic-bezier(.2,.9,.2,1), opacity .18s ease;
        opacity: 0; pointer-events: none; box-sizing: border-box; padding: 0 8px 14px;
        display: flex; align-items: flex-end; justify-content: center; text-align: center;
        z-index: 20; /* sits above anchor content but below floating badges */
        background: linear-gradient(to top, rgba(0,0,0,0.98) 0%, rgba(0,0,0,0.9) 20%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
        /* reduced bottom radius for a flatter bottom look */
        border-radius: 0 0 0.7rem 0.7rem; /* TL TR BR BL -> only TL and BR rounded */
      }
      .game-card:hover .game-card-overlay, .game-card.is-active .game-card-overlay { transform: translateY(0); opacity: 1; }
    
      /* If you apply `.badge-outside` to a specific .game-card and want the badge outside
         while keeping the overlay masked, the overlay will be clipped via clip-path. */
      .game-card.badge-outside .game-card-overlay {
        -webkit-clip-path: inset(0 round 6px 6px 6px 6px);
        clip-path: inset(0 round 6px 6px 6px 6px);
        z-index: 20;
      }
    
      .game-card .game-card-overlay h3, .game-card .game-card-overlay .game-title {
        margin: 0 !important; padding: 0 !important; box-sizing: border-box !important;
        font-size: 13px !important; line-height: 1.15 !important; font-weight: 600 !important;
        color: #fff !important; text-align: center !important;
        display: -webkit-box !important; -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important; overflow: hidden !important; text-overflow: ellipsis !important;
        white-space: normal !important; word-break: break-word !important; max-height: 30px !important;
      }
      @media (max-width: 639px) {
        .game-card .game-card-overlay h3, .game-card .game-card-overlay .game-title {
          font-size: 12px !important; line-height: 1.05 !important; -webkit-line-clamp: 1 !important; max-height: 16px !important;
        }
      }

/* ---------- GAME IFRAME CONTAINER (aspect ratio box) ---------- */
/* NOTE: top corners are rounded, bottom corners are square so the info-bar sits flush */
.game-iframe-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;              /* clip children to rounded corners */
    background-color: #000;
    border-radius: 0.75rem 0.75rem 0 0; /* top-left/top-right rounded, bottom corners 0 */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    margin-bottom: 0 !important;
}
@media (max-width: 639px) {
    .game-iframe-container { padding-bottom: 100%; }
}

/* iOS / fallback fullscreen class — used by the JS fake-fullscreen path */
.game-iframe-container.ios-fullscreen,
.game-iframe-container.fullscreen.ios-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    padding-bottom: 0 !important;
    z-index: 99999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #000 !important;
}

/* iframe fills container and inherits the same top-radius so corners show */
.game-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    border-radius: 12px 12px 0 0 !important; /* enforce top corners on iframe itself */
    background: transparent;
}

/* Ensure overlays that sit above the iframe respect the same top radii */
.game-play-overlay,
#gameLoadingOverlay {
    border-radius: 12px 12px 0 0;
    overflow: hidden; /* clip overlay children to the same rounded corners */
    position: absolute;
    inset: 0;
}

/* Play overlay: desktop pill, mobile small circle */
.game-play-overlay {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display:flex;
    align-items:center;
    justify-content:center;
    z-index: 30; /* below header (header has z-50) so header remains on top when scrolling */
    cursor: pointer;
    gap: 8px;
    flex-direction: column;
    transition: opacity .18s ease;
    /* overlay visuals are set with pseudo elements in original CSS */
    overflow: hidden;
}
.game-play-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--game-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    filter: blur(15px);
    transform: scale(1.03);
    z-index: -2;
}
.game-play-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: -1;
}

/* play button base */
.play-btn {
    display:flex;
    align-items:center;
    justify-content:center;
    min-width: 220px;
    max-width: 520px;
    width: 25%;
    min-height: 64px;
    padding: 0 26px;
    border-radius: 9999px;
    box-shadow: 0 10px 30px rgba(255,255,255,0.18), 0 4px 8px rgba(0,0,0,0.06);
    font-size: 22px; /* increased on desktop */
    color: #0f172a;
    border: 2px solid rgba(255,255,255,0.12);
    gap: 12px;
    transform-origin: center;
    animation: pulseScale 1400ms ease-in-out infinite;
    user-select: none;
    backdrop-filter: saturate(120%);
}

/* enhanced hover animation for play button (new - more unique) */
.play-btn:hover {
    animation: playHoverGlow 1100ms ease-in-out both;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(233,100,49,0.45), 0 6px 14px rgba(0,0,0,0.18);
}

@keyframes playHoverGlow {
  0% { box-shadow: 0 8px 28px rgba(233,100,49,0.35); transform: scale(1); }
  30% { transform: scale(1.08); }
  60% { transform: scale(0.98); }
  100% { transform: scale(1.02); box-shadow: 0 18px 48px rgba(233,100,49,0.6);} 
}

/* a playful icon pop + slide */
.play-btn i {
    transition: transform 0.45s cubic-bezier(.2,.9,.3,1), color 0.25s ease;
    display:inline-block;
}
.play-btn:hover i { transform: translateX(6px) scale(1.18); }

.play-btn.small { display: none; }
.play-label {
    color: #fff;
    font-weight:600;
    font-size: 16px;
    text-shadow: 0 3px 10px rgba(0,0,0,0.6);
}

@media (max-width: 639px) {
    .play-btn { display: none; }
    .play-btn.small {
        display:flex;
        width:75px;
        height:75px;
        min-width:75px;
        min-height:75px;
        border-radius:50%;
        background: linear-gradient(to bottom, #ffd642, #f7b733);
        align-items:center;
        justify-content:center;
        border: 2px solid rgba(255,255,255,0.12);
        font-size:20px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    }
    .play-label { display:block; margin-top:6px; }
    .game-play-overlay::before {filter: blur(2px);}
}

.game-play-overlay.hidden { display:none; pointer-events:none; opacity: 0; }

.spinner {
    width:36px;
    height:36px;
    border-radius:50%;
    border:4px solid rgba(255,255,255,0.15);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.comment-avatar { width:40px; height:40px; border-radius:50%; object-fit:cover; margin-right:10px; }

/* ---------- INFO BAR (make it connect to the iframe) ---------- */
/* top corners are square so it visually connects to the iframe bottom edge */
.top-info-reduced {
    padding: 8px 14px;
    min-height: 56px;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
    margin-top: -6px !important;  /* overlap slightly to remove gap */
    z-index: 40;
    position: relative;
    box-shadow: 0 6px 18px rgba(12,17,43,0.06);
}

/* mobile fullscreen bar */

.vertical-ad-overlay {
    position: fixed;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 110;
    width: 120px;
    max-width: 14%;
    display: none;
}
.vertical-ad-overlay.visible { display:block; }

.game-card {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.75rem;
    position: relative;
    border: none !important;
    box-shadow: 0 6px 18px rgba(12, 17, 43, 0.06);
    background: #fff;
}
.game-card .game-image,
.game-card img.game-image {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0.75rem;
    border: none !important;
    box-shadow: none !important;
}

/* specifically remove tiny gray borders from similar games icons too */
.similar-card img.game-image, .similar-card img {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

img.game-image, .game-card img { border: none !important; box-shadow: none !important; }

/* Exit fullscreen button - 30px, top-left, white icon, glassy black background, hidden when not fullscreen */
#exitFullscreenBtn {
  position: fixed;
  top: 8px;
  left: 8px;
  display: none;                     /* hidden by default */
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(0,0,0,0.55);      /* glassy black */
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 18px rgba(0,0,0,0.32);
  cursor: pointer;
  z-index: 2147483650;
  padding: 0;
  pointer-events: auto;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  opacity: 0.95;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* Icon: white and sized to fit the smaller button */
#exitFullscreenBtn i {
  color: #ffffff !important;
  font-size: 14px;
  line-height: 1;
  display: block;
}

/* Show only when native fullscreen or when your JS adds body.in-fullscreen */
:root:fullscreen #exitFullscreenBtn,
:root:-webkit-full-screen #exitFullscreenBtn,
:root:-ms-fullscreen #exitFullscreenBtn,
body.in-fullscreen #exitFullscreenBtn {
  display: flex !important;
  opacity: 1 !important;
}

/* hover/focus affordance */
#exitFullscreenBtn:hover,
#exitFullscreenBtn:focus {
  transform: scale(1.06);
  background: rgba(0,0,0,0.68);
  box-shadow: 0 10px 26px rgba(0,0,0,0.36);
  outline: none;
}

/* small-screen tweak */
@media (max-width: 640px) {
  #exitFullscreenBtn {
    top: 0px;
    left: 8px;
    width: 34px;
    height: 34px;
    border-radius: 20px;
  }
  #exitFullscreenBtn i { font-size: 16px; }
}

/* Spacing adjustments: align with index.php and reduce side whitespace */
.site-wrapper {
    max-width: 1600px;  /* increased from 1200 to reduce big side whitespace */
    margin: 0 auto;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    box-sizing: border-box;
}
@media (min-width: 640px) {
    .site-wrapper { padding-left: 0.75rem; padding-right: 0.75rem; }
}
@media (min-width: 1024px) {
    .site-wrapper { padding-left: 1rem; padding-right: 1rem; }
}
@media (min-width: 1280px) {
    .site-wrapper { padding-left: 1.25rem; padding-right: 1.25rem; }
}
@media (max-width: 640px) {
    .site-wrapper { padding-left: 12px; padding-right: 12px; box-sizing: border-box; }
}

main.main-wrapper { padding-left: 12px; padding-right: 12px; }

.mobile-search-only { display: none; }
@media (max-width: 767px) {
    .desktop-search { display: none; }
    .mobile-search-only { display: block; width: 100%; }
    .hide-on-mobile { display: none !important;}
}
@media (max-width: 768px) {
  body, .site-wrapper, .content-wrapper {
    padding-left: 0px;
    padding-right: 0px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  #gameContainer, iframe {
    max-width: 100%;
    width: 100%;
  }
  #iframeLoginBar {
    display: none !important;
  }
}

/* Games grid adjustments: less excessive whitespace and consistent aspect ratios */
.games-grid {
    display: grid;
    grid-auto-flow: dense;
    gap: 0.6rem;
    grid-template-columns: repeat(3, 1fr);
}
@media (min-width: 640px) {
    .games-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
}
@media (min-width: 768px) {
    .games-grid { grid-template-columns: repeat(8, 1fr); } /* 4-per-row on tablet+ */
}
@media (min-width: 1024px) {
    .games-grid { grid-template-columns: repeat(8, 1fr); }
}
.hero-desktop { grid-column: span 2; grid-row: span 2; }
@media (max-width: 639px) { .hero-mobile { grid-column: span 2; grid-row: span 2; } }

.hero-label { font-size: 1.05rem; font-weight: 600; }

/* description collapse */
.description-collapsed {
    max-height: 4.5rem; /* ~3 lines depending on font-size */
    overflow: hidden;
    position: relative;
    transition: max-height .25s ease;
}
.description-expanded { max-height: 2000px; }

/* Sidebar tile tweaks: make tiles larger and square with less spacing */
.sidebar-tile-grid {
    display: grid;
    gap: 0.75rem; /* increased spacing for You May Like / New Games as requested */
    grid-template-columns: repeat(3, 1fr);
}
@media (min-width: 768px) {
    .sidebar-tile-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .sidebar-tile-grid { grid-template-columns: repeat(3, 1fr); } /* keep two columns in sidebar for readable size */
}
.sidebar-tile {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.75rem;
    position: relative;
}

/* Similar games card size tweak (keep original tighter spacing) */
.similar-card {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.75rem;
    position: relative;
}
@media (min-width: 1024px) {
    .similar-card { height: auto; }
}

/* Achievements button icon: default + hover/active/gold color */
#achievementsBtn i {
  color: #ffffff;                     /* default icon color (white) */
  transition: color .15s ease, transform .12s ease;
  display: inline-block;
  line-height: 1;
}

/* change icon to gold on hover, focus, or when dropdown is open (aria-expanded true) */
/* ===== Desktop-only golden glowing Achievements button ===== */
@media (min-width: 641px) {
  /* Button (desktop only) */
  #achievementsBtn {
    background: linear-gradient(180deg, #FFD54A 0%, #F59E0B 100%);
    border: none;
    padding: 10px;
    min-width: 35px;
    min-height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #111827;
    box-shadow: 0 6px 18px rgba(245,158,11,0.28), 0 0 18px rgba(255,213,77,0.18);
    transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
    cursor: pointer;
    position: relative;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    z-index: 9999;
    animation: achGlow 2200ms ease-in-out infinite;
  }

  /* Hover / focus stronger glow */
  #achievementsBtn:hover,
  #achievementsBtn:focus {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 14px 40px rgba(245,158,11,0.40), 0 0 28px rgba(255,213,77,0.28);
  }

  /* Icon style + attention animation */
  #achievementsBtn i {
    color: #111827 !important;
    font-size: 1.05rem;
    line-height: 1;
    display: inline-block;
    transform-origin: center;
    animation: achIconPop 1600ms cubic-bezier(.2,.9,.3,1) infinite;
  }

  /* Glow keyframes */
  @keyframes achGlow {
    0%   { box-shadow: 0 6px 18px rgba(245,158,11,0.22), 0 0 0 rgba(255,213,77,0.10); }
    50%  { box-shadow: 0 10px 30px rgba(245,158,11,0.34), 0 0 18px rgba(255,213,77,0.22); }
    100% { box-shadow: 0 6px 18px rgba(245,158,11,0.22), 0 0 0 rgba(255,213,77,0.10); }
  }

  @keyframes achIconPop {
    0%   { transform: translateY(0) scale(1) rotate(0deg); }
    20%  { transform: translateY(-3px) scale(1.08) rotate(-8deg); }
    45%  { transform: translateY(0) scale(1) rotate(0deg); }
    70%  { transform: translateY(-2px) scale(1.04) rotate(6deg); }
    100% { transform: translateY(0) scale(1) rotate(0deg); }
  }
}

/* keyboard-focus visible outline (accessible) */
#achievementsBtn:focus {
  outline: 3px solid rgba(251,191,36,0.18);
  outline-offset: 4px;
  border-radius: 999px;
}

/* Achievements: row layout with points pinned to the right */
#achievementsDropdown .achievement-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  justify-content: space-between; /* left content on left, points on far right */
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: transparent;
  color: #ffffff; /* text color for dark dropdown */
}

/* left group (icon + text) arranged horizontally */
#achievementsDropdown .achievement-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0; /* allow truncation of the text */
  flex: 1 1 auto; /* take available space */
}

/* icon (desktop/base) */
#achievementsDropdown .achievement-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* middle text now stacked vertically (title above desc) */
#achievementsDropdown .achievement-text {
  display: flex;
  flex-direction: column;     /* STACK title and desc */
  align-items: flex-start;
  gap: 5px;                   /* slightly more spacing between title and desc */
  min-width: 0;
  overflow: hidden;           /* container hides overflow so children can ellipsize */
  font-size: 0.86rem;
  color: #ffffff;
}

/* title and description stacked vertically */
#achievementsDropdown .achievement-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;        /* single-line with ellipsis */
  margin: 0;
  margin-bottom: 0;           /* ensure no bottom margin */
  line-height: 1;             /* collapse line height */
}

#achievementsDropdown .achievement-desc {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;         /* reduced size */
  margin-left: 0;             /* remove inline margin */
  margin-top: 0;              /* gap handles spacing */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;        /* single-line with ellipsis */
  line-height: 1;             /* collapse line height */
}

/* points: transparent background, gold text, pinned to right */
#achievementsDropdown .achievement-points {
  margin-left: 8px;
  flex-shrink: 0;
  font-weight: 700;
  background: transparent;       /* <-- removed white pill */
  color: #FBBF24;                 /* gold/yellow color for points */
  padding: 0;                     /* no pill padding */
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
  /* subtle shadow for legibility on dark bg */
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

/* subtle hover highlight of row for affordance */
#achievementsDropdown .achievement-item:hover {
  background: rgba(255,255,255,0.1);
}

/* Achievements dropdown: near-black background (#1A1A1A), single-line items */
#achievementsDropdown {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10005;
  min-width: 360px;
  max-width: 420px;
  background: #1A1A1A;           /* <-- new color */
  color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.24);
  padding: 4px;
  border: 1px solid rgba(255,255,255,0.04);
  transform-origin: center bottom;
  transition: transform .12s ease, opacity .12s ease;
  opacity: 0;
  pointer-events: none;
}
#achievementsDropdown.visible {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 9999999 !important;
  transform: translateY(0) !important;
}
/* Single-line achievement layout (non-scoped rules kept for compatibility) */
.achievement-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
}

/* Hover: slightly lighter */
.achievement-item:hover {
  background: rgba(255,255,255,0.03);
}

/* Icon (fallback/base) */
.achievement-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Middle text (stacked vertically to match scoped rules) */
.achievement-text {
  display: flex;
  flex-direction: column;    /* STACK title + desc */
  align-items: flex-start;
  gap: 3px;                  /* slightly more spacing between title and desc */
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 0.95rem;
  color: #ffffff;
}

.achievement-title {
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  margin-bottom: 0;
  line-height: 1;
}

.achievement-desc {
  color: rgba(255,255,255,0.85);
  font-size: 0.72rem;        /* reduced size here to match scoped version */
  margin-left: 0; /* removed inline left margin */
  margin-top: 0;  /* gap handles spacing */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}

/* Achievement points: gold text to match medal icon */
.achievement-points {
  margin-left: 8px;
  flex-shrink: 0;
  font-weight: 700;
  background: #ffffff;        /* white pill for contrast on dark dropdown */
  color: #FBBF24;             /* gold/yellow (matches medal hover) */
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.04);
}

/* /////////////////////////////////////////////////////////////
   Mobile compact adjustments — only apply on small screens
   ///////////////////////////////////////////////////////////// */
@media (max-width: 640px) {
  /* Make dropdown narrower and more compact */
#achievementsDropdown {
  left: 8px !important;
  right: 8px !important;
  width: calc(100% - 16px) !important;
  max-width: 250px;          /* tighter than desktop */
  min-width: 200px;          /* prevents collapsing on very small devices */
  border-radius: 10px;
  padding: 6px;
  margin: 0 8px;

  /* ↓↓↓ NEW HEIGHT CONTROL ↓↓↓ */
  max-height: 60vh;          /* limits dropdown to 60% of screen height */
  overflow-y: auto;           /* adds scroll if items overflow */
  scrollbar-width: thin;      /* makes scrollbar smaller (for Firefox) */
  scrollbar-color: rgba(255,255,255,0.2) transparent; /* subtle scrollbar color */
}
  /* Tighter rows */
  #achievementsDropdown .achievement-item,
  .achievement-item {
    padding: 6px 8px;
    gap: 6px;
    margin-bottom: 6px;
  }

  /* Smaller icons for mobile */
  #achievementsDropdown .achievement-icon,
  .achievement-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  }

  /* Reduce title / desc font sizes */
  #achievementsDropdown .achievement-title,
  .achievement-title {
    font-size: 0.82rem;
  }
  #achievementsDropdown .achievement-desc,
  .achievement-desc {
    font-size: 0.64rem;
  }

  /* Smaller points badge */
  #achievementsDropdown .achievement-points,
  .achievement-points {
    font-size: 0.68rem;
    padding: 2px 6px;
    margin-left: 6px;
  }

  /* Slightly reduce overall dropdown animation scale so it reads smaller */
  #achievementsDropdown {
    transform-origin: center top;
  }
}

/* Locked / unlocked states unchanged */
.achievement-icon.locked {
  filter: grayscale(100%) opacity(.6);
  transition: filter .22s ease, transform .18s ease;
}
.achievement-icon.unlocked {
  filter: none;
  transform: scale(1.02);
}


/* Centered timer shown over iframe */
#playTimerBadge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  background: #212121;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}


/* Achievement popup - adjusted: slightly shorter height, a bit wider, square particles */
#achievementPopup.achievement-popup {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 2147483647;
  background: rgba(26,26,26,0.5); /* 50% transparent */
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  color: #fff;
  padding: 10px; /* reduced padding to reduce overall height */
  border-radius: 12px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
  min-width: 380px; /* made a bit wider */
  max-width: 560px; /* slightly larger max width */
  width: auto;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.06);
  background-clip: padding-box;
}

#achievementPopupGameIcon.ap-icon {
  width: 75px;                 /* change this to make the icon bigger/smaller */
  height: 75px;
  min-width: 75px;            /* keep square in flex layouts */
  min-height: 75px;
  border-radius: 10px;
  object-fit: cover;          /* crop to fill cleanly */
  flex-shrink: 0;
  display: block;
  box-shadow: 0 8px 22px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 640px) {
  #achievementPopupGameIcon.ap-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.36);
  }
}

/* Left game icon */
#achievementPopup .ap-icon {
  width: 48px;   /* slightly smaller to reduce height */
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

/* Center text area */
#achievementPopup .ap-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

#achievementPopup .ap-title {
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  letter-spacing: 0.2px;
}

#achievementPopup .ap-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#achievementPopup .ap-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.95);
  font-weight: 700;
}

/* Right trophy wrap - reduced size to lower popup height */
#achievementPopup .ap-trophy-wrap {
  width: 80px;   /* slightly reduced */
  height: 80px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,232,140,0.18), rgba(255,196,0,0.12));
  box-shadow: 0 10px 36px rgba(255,196,0,0.16), inset 0 -6px 18px rgba(0,0,0,0.05);
  flex-shrink: 0;
  border: 1px solid rgba(255,196,0,0.10);
  position: relative; /* IMPORTANT: particle container */
  overflow: visible;
}

/* Trophy image: slightly smaller to match reduced wrap */
#achievementPopup .ap-trophy {
  width: 48px;
  height: 48px;
  display: block;
  background: linear-gradient(to bottom, #ffd642, #f7b733);
  background-clip: padding-box;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  transition: transform 220ms cubic-bezier(.2,.9,.3,1), opacity 180ms ease;
  box-shadow: 0 6px 14px rgba(0,0,0,0.22);
  margin: 0;
}

/* stronger left-right shake with scale to be visible */
@keyframes trophyShakeStronger {
  0%   { transform: rotate(0deg) translateY(0) scale(1); }
  12%  { transform: rotate(-20deg) translateY(-2px) scale(1.03); }
  25%  { transform: rotate(14deg) translateY(1px) scale(1.05); }
  37%  { transform: rotate(-8deg) translateY(-1px) scale(1.02); }
  50%  { transform: rotate(6deg) translateY(0) scale(1.01); }
  75%  { transform: rotate(-3deg) translateY(0) scale(1); }
  100% { transform: rotate(0deg) translateY(0) scale(1); }
}

/* class applied to trigger the animations */
#achievementPopup .ap-trophy-animate {
  animation: trophyShakeStronger 1400ms cubic-bezier(.2,.9,.3,1) 1 both;
}

/* particle style (SQUARE now) */
#achievementPopup .ap-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 4px; /* square-ish corners */
  pointer-events: none;
  opacity: 0.98;
  will-change: transform, opacity;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  transform-origin: center;
  mix-blend-mode: screen;
}

/* show/hide & quick hide transition */
#achievementPopup.visible {
  display: flex !important;
  opacity: 1;
  transition: opacity 160ms ease, transform 160ms cubic-bezier(.2,.9,.3,1);
}
#achievementPopup.hiding {
  opacity: 0;
}

/* responsive */
@media (max-width: 420px) {
  #achievementPopup.achievement-popup {
    left: 8px;
    right: 8px;
    top: 8px;
    min-width: auto;
    width: calc(100% - 16px);
    padding: 8px;
  }
  #achievementPopupGameIcon.ap-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.36);
  }
  #achievementPopup .ap-trophy-wrap { width: 64px; height: 64px; }
  #achievementPopup .ap-trophy { width: 44px; height: 44px; }
  #achievementPopup .ap-icon { width: 44px; height: 44px; }
}

/* Locked / unlocked states unchanged */
.achievement-icon.locked {
  filter: grayscale(100%) opacity(.6);
  transition: filter .22s ease, transform .18s ease;
}
.achievement-icon.unlocked {
  filter: none;
  transform: scale(1.02);
}


/* Centered timer shown over iframe */
#playTimerBadge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  background: #212121;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

/* Achievement popup - left-stuck, slightly larger on desktop, compact on mobile */
/* ---------------- Achievement popup (animated slide + trophy jiggle) ---------------- */

/* container */
#achievementPopup.achievement-popup {
  position: absolute;
  top: 20px;
  left: 0; /* STICK to left side of iframe container */
  z-index: 2147483647;
  transform: translateX(-10px); /* start slightly off-canvas (hidden) in case JS toggles only classes */
  transition: opacity 180ms ease; /* keep transition for opacity fallback */
  background: #121212; /* single black background (solid) */
  color: #fff;
  padding: 10px 12px; /* a bit roomier on desktop */
  border-radius: 0 12px 12px 0;
  display: none;
  align-items: center;
  gap: 10px; /* slightly larger gap on desktop */
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  min-width: 300px;   /* a bit larger */
  max-width: 520px;   /* allow a wider popup on desktop */
  width: auto;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,0.04);
  overflow: visible;
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  backdrop-filter: blur(6px) saturate(120%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  will-change: transform, opacity;
}

/* Slide-in/out animations for the popup */
@keyframes popupSlideIn {
  0% { transform: translateX(-22px); opacity: 0; }
  60% { transform: translateX(6px); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes popupSlideOut {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-18px); opacity: 0; }
}

/* visible / hide states (slide in/out)
   Note: your JS toggles .visible/.hiding — we use those to trigger the animations.
*/
#achievementPopup.visible {
  display: flex !important;
  opacity: 1;
  transform: translateX(0);
  animation: popupSlideIn 420ms cubic-bezier(.2,.9,.3,1) both;
}
#achievementPopup.hiding {
  /* run a short slide-out before hiding */
  opacity: 0;
  animation: popupSlideOut 240ms ease both;
}

/* LEFT: larger game icon on desktop */
#achievementPopupGameIcon.ap-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 6px 16px rgba(0,0,0,0.45);
  margin: 0;
  display: block;
}

/* text column: reasonable spacing for larger popup */
#achievementPopup .ap-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
}

/* title / desc / sub: slightly larger on desktop */
#achievementPopup .ap-title {
  margin: 0;
  font-weight: 800;
  font-size: 15px;    /* larger on desktop */
  line-height: 1.05;
  color: #f7b733;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#achievementPopup .ap-desc {
  margin: 0;
  font-size: 13px; /* larger on desktop */
  line-height: 1.05;
  color: rgba(255,255,255,0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#achievementPopup .ap-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1;
  color: rgba(255,255,255,0.95);
  font-weight: 700;
}

/* RIGHT: trophy area uses gradient background */
#achievementPopup .ap-trophy-wrap {
  width: 56px;   /* bigger */
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #ffd642, #f7b733);
  box-shadow: 0 6px 18px rgba(0,0,0,0.28); /* neutral shadow */
  border: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
  position: relative;
  overflow: visible;
  margin: 0;
}

/* Trophy "icon" — gradient background; mask is applied by JS if available.
   We add pop + loop-jiggle animations in a single rule so your existing JS class
   `ap-trophy-animate` continues to work (JS adds/removes that class).
*/

/* small pop animation used before jiggle */
@keyframes trophyPop {
  0% { transform: translateY(6px) scale(.86) rotate(0deg); opacity: 0; }
  55% { transform: translateY(-6px) scale(1.12) rotate(-6deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
}

/* gentle, attractive jiggle loop */
@keyframes trophyJiggle {
  0% { transform: rotate(0deg) translateY(0) scale(1); }
  10% { transform: rotate(-6deg) translateY(-1px) scale(1.02); }
  30% { transform: rotate(6deg) translateY(0px) scale(1.03); }
  50% { transform: rotate(-4deg) translateY(-1px) scale(1.01); }
  70% { transform: rotate(4deg) translateY(0px) scale(1.02); }
  100% { transform: rotate(0deg) translateY(0) scale(1); }
}

/* Combined: first run trophyPop once, then start infinite jiggle (delay ensures pop plays) */
/* The delays/timings keep the pop visible then begin jiggle automatically when JS toggles ap-trophy-animate */
#achievementPopup .ap-trophy.ap-trophy-animate {
  width: 40px;
  height: 40px;
  display: block;
  background: linear-gradient(to bottom, #ffd642, #f7b733);
  background-clip: padding-box;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  box-shadow: 0 6px 14px rgba(0,0,0,0.22);
  margin: 0;

  /* pop then jiggle:
     - trophyPop runs once immediately
     - trophyJiggle begins after 420ms and loops forever
  */
  animation:
    trophyPop 420ms cubic-bezier(.2,.9,.3,1) 1 both,
    trophyJiggle 1600ms ease-in-out 520ms infinite both;
  transform-origin: center;
}

/* Provide a non-animated baseline when class not present */
#achievementPopup .ap-trophy {
  width: 40px;
  height: 40px;
  display: block;
  background: linear-gradient(to bottom, #ffd642, #f7b733);
  background-clip: padding-box;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  transition: transform 220ms cubic-bezier(.2,.9,.3,1), opacity 180ms ease;
  box-shadow: 0 6px 14px rgba(0,0,0,0.22);
  margin: 0;
  transform-origin: center;
}

/* particles - compact */
#achievementPopup .ap-particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0.95;
  will-change: transform, opacity;
  box-shadow: 0 3px 6px rgba(0,0,0,0.12);
  mix-blend-mode: screen;
  transform-origin: center;
}

/* responsive shrink for small screens (keep original smaller sizes) */
@media (max-width: 520px) {
  #achievementPopup {
    top: 8px;
    left: 8px;
    right: 8px;
    min-width: auto;
    width: calc(100% - 16px);
    border-radius: 8px;
    padding: 6px 8px;
    gap: 6px;
  }
  #achievementPopupGameIcon.ap-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }
  #achievementPopup .ap-trophy-wrap { width: 44px; height: 44px; }
  #achievementPopup .ap-trophy { width: 32px; height: 32px; }
  #achievementPopup .ap-text { gap: 2px; }
  #achievementPopup .ap-title { font-size: 12px; }
  #achievementPopup .ap-desc,
  #achievementPopup .ap-sub { font-size: 11px; }
}


/* ===== Compact Achievements Menu (single black background, tightened spacing) ===== */
#achievementsDropdown {
  background: #000; /* single black background */
  color: #fff;
  padding: 6px;     /* reduced padding */
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
  max-width: 320px; /* reduced */
  font-size: 13px;
  line-height: 1;
}

/* force header fixed so it always stays on top */
.site-header, .sticky-header, header.site-header, #siteHeader {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999 !important;
  will-change: transform;
}

/* prevent page content from being hidden under the fixed header
   set the value equal to your header's height (change 72px -> actual height) */
body { padding-top: 72px !important; }

/* smaller screens adjust */
@media (max-width:640px) {
  body { padding-top: 56px !important; }
}

/* Hide rating in info row (desktop + mobile) */
#ratingDisplay, #ratingDisplayMobile { display: none !important; }

/* Make the game thumbnail/icon in the info bar smaller */
.top-info-reduced img {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover !important;
  border-radius: 8px !important;
}

/* If you prefer even smaller on mobile */
@media (max-width:640px) {.top-info-reduced img { width: 36px !important; height: 36px !important; }}

/* ---------- CONTROLS DROPDOWN STYLES (insert into existing style block) ---------- */
#controlsDropdown { display: none; position: fixed; z-index: 100000; min-width: 300px; max-width: 420px; max-height: 320px; background: #191919; color: #fff; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.5); padding: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.04); opacity: 0; pointer-events: none; transition: transform .12s ease, opacity .12s ease;}
#controlsDropdown.visible { display: block !important; opacity: 1 !important; pointer-events: auto !important;}
#controlsDropdown .controls-list { max-height: 280px; overflow-y: auto; padding-right: 2px;}
#controlsDropdown .control-line { display: block; padding: 6px 8px; border-radius: 6px; font-size: 0.95rem; color: #e5e7eb; white-space: pre-wrap; line-height: 1.35;}
#controlsDropdown .control-line + .control-line { margin-top: 4px; }
#controlsDropdown .no-controls {padding: 8px;color: rgba(255,255,255,0.7);font-size: 0.95rem;text-align: center;}

/* ---------- Report Modal: themed, accessible and user-friendly ---------- */
#reportModal { display: none; }
#reportModal.visible { display: flex !important; align-items: center; justify-content: center; }
#reportModalBackdrop { background: rgba(2,6,23,0.62); backdrop-filter: blur(6px) saturate(120%); -webkit-backdrop-filter: blur(6px) saturate(120%); }
#reportModal > div > .relative { background: linear-gradient(180deg, rgba(6,10,22,0.98), rgba(10,14,28,0.99)); color: #E6EEF8; border-radius: 12px; box-shadow: 0 20px 60px rgba(3,7,18,0.7), 0 6px 20px rgba(10,14,28,0.45); border: 1px solid rgba(255,255,255,0.04); overflow: hidden; width: 100%; max-width: 920px;}
#reportModal .relative .p-4 { padding: 1rem;}
#reportModal h3 { color: #F3F4F6; font-weight: 700; font-size: 1.05rem;}
#reportModal button[aria-label="Close report dialog"] i { color: #cbd5e1; }
#reportModal .p-4 { padding: 1rem; gap: 1rem;}
#reportModal input[type="email"],
#reportModal textarea,
#reportModal select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 2.4rem; color: #E6EEF8; background-color: #191919; background-image: background-repeat: no-repeat; background-position: right 12px center, right 16px center, right 12px center; background-size: 16px 16px, 8px 8px, 8px 8px; border: 1px solid rgba(255,255,255,0.04); border-radius: 8px; transition: box-shadow .15s ease, border-color .12s ease;}

#reportModal input::placeholder,
#reportModal textarea::placeholder { color: rgba(226,238,248,0.55);}
#reportModal select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 2.4rem; /* room for native arrow */ background-position: right 12px center; background-repeat: no-repeat; background-size: 16px 16px; background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.45) 50%), linear-gradient(135deg, rgba(255,255,255,0.45) 50%, transparent 50%); background-origin: content-box;}
#reportModal textarea { min-height: 110px; resize: vertical; padding-top: .7rem;}
#reportModal .hint { color: rgba(255,255,255,0.66); font-size: 0.86rem; margin-top: 0.25rem;}
#reportModal .bg-[#E96431], 
#reportModal button.bg-primary-dark { background: linear-gradient(180deg,#f97316,#e8592d); color: #fff; border: 1px solid rgba(255,255,255,0.06); padding: .5rem .9rem; border-radius: 8px; font-weight: 600; box-shadow: 0 8px 26px rgba(233,100,49,0.18); transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease;}
#reportModal .bg-[#E96431]:hover,
#reportModal button.bg-primary-dark:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(233,100,49,0.22);}
#reportModal .bg-gray-100 { background: transparent; border: 1px solid rgba(255,255,255,0.04); color: #cbd5e1; padding: .5rem .8rem; border-radius: 8px;}
#reportFeedback { color: #F3F4F6; font-size: 0.92rem;}
@media (max-width: 640px) {
  #reportModal > div > .relative { max-width: 96%; margin: 0 8px; border-radius: 10px; }
  #reportModal input, #reportModal textarea, #reportModal select { font-size: 0.95rem; padding: .55rem .7rem; }
}
@media (forced-colors: active) { #reportModal input, #reportModal textarea, #reportModal select { border: 2px solid WindowText; color: WindowText; background: Window; }}
#reportModal label { color: rgba(230,238,248,0.92); font-size: 0.94rem; font-weight: 600; margin-bottom: .25rem; display:block; }
#reportModal button[aria-label="Close report dialog"] { background: transparent; border: none; padding: .25rem .45rem; border-radius: 8px;}
#reportModal button[aria-label="Close report dialog"]:hover { background: rgba(255,255,255,0.02); }

/* hide the controls & report buttons on mobile explicitly (defense) */
@media (max-width: 800px) {
  #controlsBtn, #reportBtn { display: none !important; }
}

#gameDescription h1, #gameDescription h2, #gameDescription h3 {
  font-weight: 700;
  margin: 1em 0 0.5em;
  color: #f7b733;
}

#gameDescription p {
  margin-bottom: 0.8em;
}

#gameDescription ul, #gameDescription ol {
  margin: 1em 0 1em 1.5em;
}

#gameDescription li {
  list-style-type: disc;
  margin-bottom: 0.3em;
}

#gameDescription img {
  max-width: 100%;
  border-radius: 10px;
  margin: 1em 0;
}
#gameDescription summary{
  font-weight: 500;
  color: #e3e3e3;
}
.faq-item strong {
    font-weight: 500;
    color: #e3e3e3;
} 
/* --------- UPDATED: match desktop iframe button icon images to Achievement button icon size
   + remove any mask/clip that was hiding parts of the PNGs. --------- */
/* Achievements icon uses font-size: 1.05rem (see #achievementsBtn i). Apply same size to images.
   Also clear mask/clip and ensure visible. */
.hidden.sm\:flex .desktop-btn img,
.desktop-btn img,
.btn-action.desktop-btn img {
  width: 1.25rem !important;
  height: 1.25rem !important;
  max-width: 25px !important;
  max-height: 25px !important;
  object-fit: contain !important;
  display: block !important;
  line-height: 1 !important;
  vertical-align: middle !important;

  /* remove rounding/masks that could crop parts of the PNG */
  border-radius: 0 !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  clip-path: none !important;
  overflow: visible !important;
}

/* Make Favorite, Controls, Report, Fullscreen match the Achievements button shape (circle).
   Keep classes untouched — target by IDs only. */
#favBtn,
#controlsBtn,
#reportBtn,
#fullscreenBtn {
  padding: 10px !important;            /* same padding as achievementsBtn */
  min-width: 35px !important;
  min-height: 35px !important;
  width: 35px !important;
  height: 35px !important;
  border-radius: 999px !important;     /* perfect circle */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  overflow: visible !important;        /* ensure image isn't clipped by parent */
}

/* Extra targeted rule to ensure those buttons' images are not masked/clipped */
#favBtn img,
#controlsBtn img,
#reportBtn img,
#fullscreenBtn img {
  width: 1.05rem !important;
  height: 1.05rem !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  clip-path: none !important;
  overflow: visible !important;
  display: block !important;
}

#gameIframe {
  height: calc(70vh);
  max-height: 900px;
  min-height: 320px;
}

/* Make iframe a bit shorter on very small screens */
@media (max-width: 640px) {
  #gameIframe {
    height: calc(58vh);
  }
}

/* Slightly shorter for large screens to keep sidebar visible */
@media (min-width: 1024px) {
  #gameIframe {
    height: calc(66vh);
  }
}
.game-iframe-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio for desktop */
    background-color: transparent; /* Avoid black showing through */
    overflow: hidden;
}

#gameIframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: transparent;
}

/* Mobile adjustment */
@media (max-width: 640px) {
    .game-iframe-container {
        padding-bottom: 100%; /* Square for mobile */
    }
}
/* ---------- HARD FIX: ensure iframe completely fills its container ----------
   Append this block to the END of assets/css/game-page.css
------------------------------------------------------------------------------*/

/* Prefer modern aspect-ratio but do not rely on it entirely */
.game-iframe-container {
  padding-bottom: 0 !important;       /* remove old padding-bottom hacks */
  height: auto !important;
  aspect-ratio: 16 / 9 !important;    /* preferred desktop aspect */
  width: 100% !important;
  max-width: 100% !important;
  min-height: 320px !important;       /* sensible min height */
  overflow: hidden !important;
  position: relative !important;
  background: #000 !important;        /* prevents light gap while loading */
}

/* mobile: prefer square-ish / taller layout */
@media (max-width: 640px) {
  .game-iframe-container {
    aspect-ratio: 1 / 1 !important;   /* matches previous mobile intent */
    min-height: 48vh !important;
  }
}

/* Force iframe to absolutely fill the container */
.game-iframe-container iframe,
#gameIframe {
  position: absolute !important;
  inset: 0 !important;   /* top:0; right:0; bottom:0; left:0 */
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  display: block !important;
  border: none !important;
  background: transparent !important;
  box-sizing: border-box !important;
  border-radius: 12px 12px 0 0 !important;
}

/* Make overlays match exactly and not create gaps */
.game-play-overlay,
#gameLoadingOverlay {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px 12px 0 0 !important;
}

/* Reduce the negative overlap that may expose background */
.top-info-reduced {
  margin-top: -2px !important;  /* was -6px — shrinking reduces visible gap */
  z-index: 40 !important;
}

/* Reserve overflow on container as a last line of defense */
#gameContainer, .game-iframe-container {
  overflow: hidden !important;
}



/* If you prefer the button containers to allow slightly larger tap area without changing visual circle:
   increase min-width/min-height here to 38 or 40px (I left at 35 to match achievements exactly). */

/* ---------- rest of original CSS unchanged ---------- */

/* (Everything that follows remains exactly as before — no functional or layout rules removed.) */

/* NOTE: rest of CSS content is intentionally unchanged from your previous block. */