/* =============================================
   style.css — Custom icon + UI styles
   ============================================= */

/* ── Sidebar icon wrapper ─────────────────────────────────────────────────── */
.sidebar-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  min-width: 20px !important;
}

.sidebar-icon svg {
  width: 20px !important;
  height: 20px !important;
  stroke: currentColor !important;
  fill: none !important;
}

/* ── Sidebar: fixed width, doesn't cover game area ──────────────────────── */
#mainNav,
.Sidebar_main__wMHXR,
.Sidebar_main___ex0V {
  z-index: 11 !important;
}

/* Game play cover — below sidebar and header */
#game-cover {
  z-index: 5 !important;
}

/* ── Sidebar container: vertical flex column ─────────────────────────────── */
.Sidebar_container__MtxUB,
.Sidebar_container__CqXNx {
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin !important;
  scrollbar-color: #373952 transparent !important;
}

/* ── Each sidebar item: its OWN full row, no wrapping ────────────────────── */
.Sidebar_link__eU51h,
.Sidebar_link__Tbdup,
.Sidebar_link__wMHXR {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  padding: 8px 12px !important;
  min-height: 38px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  color: #AAADBE !important;
  transition: background 0.15s ease, color 0.15s ease !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-decoration: none !important;
}

.Sidebar_link__eU51h:hover,
.Sidebar_link__Tbdup:hover,
.Sidebar_link__wMHXR:hover {
  background: rgba(255,255,255,0.07) !important;
  color: #ffffff !important;
}

/* ── Sidebar label ───────────────────────────────────────────────────────── */
.Sidebar_labelContainer__pvYx0,
.Sidebar_labelContainer__qHPDa {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  flex: 1 !important;
}

/* ── Sidebar divider ─────────────────────────────────────────────────────── */
.Sidebar_divider__imtDG,
.css-148wt6v,
hr.MuiDivider-root {
  display: block !important;
  height: 1px !important;
  margin: 4px 12px !important;
  background: rgba(255,255,255,0.08) !important;
  border: none !important;
  flex-shrink: 0 !important;
}

/* Active/disabled states */
.Sidebar_active__8_VjJ,
.Sidebar_active__bltDp {
  color: #ffffff !important;
  background: rgba(104,66,255,0.2) !important;
}

.Sidebar_disabled__mPmsL,
.Sidebar_disabled__g_rzR {
  opacity: 0.35 !important;
  cursor: default !important;
  pointer-events: none !important;
}

/* ── Sidebar icon imgs — hide ONLY if icons.js is available (replaced by SVG) */
/* Don't hide completely — let icons.js replace them first */
.Sidebar_link__eU51h img,
.Sidebar_link__Tbdup img,
.Sidebar_link__wMHXR img {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
}

/* ── Category page carousel icons ────────────────────────────────────────── */
.css-nb4mi8 .sidebar-icon,
.css-inysc7 .sidebar-icon {
  width: 24px !important;
  height: 24px !important;
}
.css-nb4mi8 .sidebar-icon svg,
.css-inysc7 .sidebar-icon svg {
  width: 24px !important;
  height: 24px !important;
}
.SEOCategoriesBlock_carouselItemRoot__xv9M_ .sidebar-icon {
  width: 24px !important;
  height: 24px !important;
}


/* ── Icon sizing for category-page carousels ─────────────────────────────── */
.css-nb4mi8 .sidebar-icon,
.css-inysc7 .sidebar-icon {
  width: 24px;
  height: 24px;
}
.css-nb4mi8 .sidebar-icon svg,
.css-inysc7 .sidebar-icon svg {
  width: 24px;
  height: 24px;
}

.SEOCategoriesBlock_carouselItemRoot__xv9M_ .sidebar-icon,
.SEOCategoriesBlock_carouselItemRoot__xv9M_ img {
  width: 24px;
  height: 24px;
}

/* ── Hide broken img icon tags (replaced by JS) ──────────────────────────── */
img[src*="Black01333/img@main/icon/"],
img[src*="imgs.crazygames.com/icon/"],
img[src*="mono-sidebar-icons"] {
  opacity: 0 !important;
  width: 20px !important;
  height: 20px !important;
  pointer-events: none !important;
}


/* ── Pagination buttons ───────────────────────────────────────────────────── */
.czypageBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 14px;
  margin: 0 3px;
  background: #28293D;
  color: #AAADBE;
  border: 1px solid #373952;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  font-family: inherit;
  outline: none;
  box-shadow: none;
}

.czypageBtn:hover {
  background: #373952;
  color: #ffffff;
  border-color: #6842FF;
}

.czypageBtn.active {
  background: #6842FF;
  color: #ffffff;
  border-color: #6842FF;
}

/* Pagination wrapper */
.pagination-wrape {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 24px 0 32px;
}

#pagination-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}


/* ── Search input wrapper — needed for absolute dropdown positioning ─────── */
.TopSearch_inputWrapper__QI6kt {
  position: relative !important;
}

/* ── Search results dropdown ─────────────────────────────────────────────── */
#results a:last-child {
  border-bottom: none !important;
}
#results::-webkit-scrollbar {
  width: 6px;
}
#results::-webkit-scrollbar-thumb {
  background: #373952;
  border-radius: 3px;
}

/* ── Logo fallback — show text if SVG not found ──────────────────────────── */
.Logo_logoImage__nJAeB,
#logoTextSvg {
  /* Keep layout even if img 404s */
  min-width: 20px;
  min-height: 20px;
}

/* ── Search results — shared across all page types ───────────────────────── */
#results,
.search-results {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9999 !important;
  background: #1a1b26 !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 8px !important;
  max-height: 420px !important;
  overflow-y: auto !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
  margin-top: 4px !important;
  scrollbar-width: thin !important;
  scrollbar-color: #373952 transparent !important;
}

/* Parent form must be relative for dropdown to anchor correctly */
/* form.css-sepbq7,
.TopSearch_topSearchForm__b9Z8c {
  position: relative !important;
} */

/* ── Header search: force centered in header ─────────────────────────────── */
.TopSearch_topSearchForm__b9Z8c.TopSearch_isDesktop__2eSKm {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 460px !important;
  max-width: calc(100vw - 280px) !important;
  z-index: 1 !important;
}

/* Ensure header has relative positioning so absolute child anchors correctly */
.Header_root__uPVep {
  position: relative !important;
}

/* ── Header layout fix — left section min-width so search stays centered ─── */
.Header_leftSection__iw1d6 {
  min-width: 120px !important;
  flex-shrink: 0 !important;
}

.Header_rightSection__fcQ4k {
  min-width: 80px !important;
  flex-shrink: 0 !important;
}

/* ── Search centering fix for ALL page types ──────────────────────────────── */
/* hot.html / originals / game pages use css-sepbq7 */
@media (min-width: 1082px) {
  .css-sepbq7 {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
  }
}

/* Ensure input doesn't take full width when form is absolutely positioned */
@media (min-width: 1082px) {
  .css-174kd1d {
    width: 460px !important;
    flex-shrink: 0 !important;
  }
}

/* Search input: full width, centered */
.css-174kd1d {
  opacity: 1 !important;
  width: 460px !important;
}

/* Search icon opacity fix */
.css-4ypg9l {
  opacity: 1 !important;
}

/* Fix for search icon anchor - prevent it from breaking layout */
.css-sepbq7 > a {
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  text-decoration: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Logo: Original SVG logos should display properly ────────────────────── */
/* All emoji replacement CSS has been removed - logos use native SVGs */

/* Keep "crazy games" text visible — css-v5k1q0 contains the text SVG */
.css-v5k1q0 {
  display: flex !important;
  align-items: center !important;
}

/* ── Index page logo styling ──────────────────────────────────────────────── */
.css-15nij48 {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.css-1vhz41m {
  display: flex !important;
  align-items: center !important;
  transition: transform 0.3s ease !important;
}

.css-1vhz41m:hover {
  transform: scale(1.1) rotate(5deg) !important;
  animation: logoWiggle 0.5s ease !important;
}

@keyframes logoWiggle {
  0%, 100% { transform: scale(1.1) rotate(5deg); }
  25% { transform: scale(1.1) rotate(-5deg); }
  50% { transform: scale(1.1) rotate(5deg); }
  75% { transform: scale(1.1) rotate(-5deg); }
}

.css-1vhz41m img {
  display: block !important;
  height: 36px !important;
  width: auto !important;
}

.css-v5k1q0 {
  display: flex !important;
  align-items: center !important;
}

.css-v5k1q0 svg {
  display: block !important;
  height: 35px !important;
  width: auto !important;
}

/* Keep left section min-width on all page types ── */
header .css-15nij48 {
  min-width: 120px;
  flex-shrink: 0;
}

/* ── Index page spacing fix ──────────────────────────────────────────────── */
/* Reduce spacing between header and content on index.html */
.Layout_styledMain__YQszE,
main.Layout_styledMain__YQszE {
  padding-top: 62px !important;
  margin-top: 0 !important;
}

/* ── Index page logo fix ─────────────────────────────────────────────────── */
/* Logo uses native SVGs from HTML - no additional styling needed */

/* Remove "opacity: 0" from game search icon if any */
#microglass {
  opacity: 1 !important;
}
