/* Gematrixx v20 — Fixed-size unified result cards for English, Hebrew, Greek and Slavic Gematria.
   Presentation-only parity with the Arabic/Quran-style result cards.
   Desktop column controls change the number of cards per row, never the card width. */

#pageGematriaEN #geoResultsGrid,
#pageHebrewGematria #hebResultsGrid,
#pageGreekGematria #grkResultsGrid,
#pageSlavicGematria #slvResultsGrid{
  --gem-result-cols:6;
  --gem-effective-cols:6;
  --gem-card-width:165px;
  width:max-content !important;
  max-width:100% !important;
  margin:1rem auto 0 !important;
  padding:0 !important;
  display:grid !important;
  grid-template-columns:repeat(var(--gem-effective-cols,var(--gem-result-cols)),var(--gem-card-width)) !important;
  gap:.72rem !important;
  align-items:stretch !important;
  justify-content:center !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  box-sizing:border-box !important;
}

#pageGematriaEN .gem-quran-result-card,
#pageHebrewGematria .gem-quran-result-card,
#pageGreekGematria .gem-quran-result-card,
#pageSlavicGematria .gem-quran-result-card{
  --gem-card-color:var(--gold2);
  width:var(--gem-card-width) !important;
  max-width:var(--gem-card-width) !important;
  min-width:var(--gem-card-width) !important;
  min-height:106px !important;
  box-sizing:border-box !important;
  position:relative !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  gap:.24rem !important;
  padding:.82rem .62rem .72rem !important;
  background:var(--bg3) !important;
  border:1px solid var(--bdr) !important;
  border-radius:10px !important;
  text-align:center !important;
  box-shadow:none !important;
  transition:border-color .15s ease,transform .12s ease,background .15s ease !important;
  cursor:pointer !important;
}

#pageGematriaEN .gem-quran-result-card::before,
#pageHebrewGematria .gem-quran-result-card::before,
#pageGreekGematria .gem-quran-result-card::before,
#pageSlavicGematria .gem-quran-result-card::before{
  content:"";
  position:absolute;
  top:0;
  inset-inline:0;
  height:2px;
  background:var(--gem-card-color) !important;
  opacity:.95;
}

#pageGematriaEN .gem-quran-result-card:hover,
#pageHebrewGematria .gem-quran-result-card:hover,
#pageGreekGematria .gem-quran-result-card:hover,
#pageSlavicGematria .gem-quran-result-card:hover{
  border-color:color-mix(in srgb,var(--gem-card-color) 55%,var(--bdr2)) !important;
  transform:translateY(-1px) !important;
}

#pageGematriaEN .gem-quran-result-card.open,
#pageHebrewGematria .gem-quran-result-card.open,
#pageGreekGematria .gem-quran-result-card.open,
#pageSlavicGematria .gem-quran-result-card.open{
  border-color:var(--gem-card-color) !important;
  background:color-mix(in srgb,var(--bg3) 94%,var(--gem-card-color) 6%) !important;
}

#pageGematriaEN .gem-quran-result-card .gl,
#pageHebrewGematria .gem-quran-result-card .gl,
#pageGreekGematria .gem-quran-result-card .gl,
#pageSlavicGematria .gem-quran-result-card .gl{
  order:1 !important;
  min-height:2.9em !important;
  margin:0 0 .08rem !important;
  padding:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  color:var(--gold2) !important;
  font-family:var(--font-main) !important;
  font-size:.72rem !important;
  font-weight:700 !important;
  line-height:1.42 !important;
  letter-spacing:0 !important;
  text-transform:none !important;
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
  cursor:pointer !important;
}

#pageGematriaEN .gem-quran-result-card .gv,
#pageHebrewGematria .gem-quran-result-card .gv,
#pageGreekGematria .gem-quran-result-card .gv,
#pageSlavicGematria .gem-quran-result-card .gv{
  order:2 !important;
  margin:.02rem 0 0 !important;
  padding:0 !important;
  color:var(--gem-card-color) !important;
  font-family:"Ubuntu Mono",var(--font-main),monospace !important;
  font-size:1.42rem !important;
  font-weight:800 !important;
  line-height:1.1 !important;
  direction:ltr !important;
  unicode-bidi:isolate !important;
  cursor:pointer !important;
}

#pageGematriaEN .gem-quran-result-card .gen-dr,
#pageHebrewGematria .gem-quran-result-card .gen-dr,
#pageGreekGematria .gem-quran-result-card .gen-dr,
#pageSlavicGematria .gem-quran-result-card .gen-dr{
  order:3 !important;
  margin:.12rem 0 0 !important;
  color:var(--txt3,var(--text-muted)) !important;
  font-family:var(--font-main) !important;
  font-size:.62rem !important;
  line-height:1.2 !important;
}

#pageGematriaEN .gem-quran-result-card .gen-dr span,
#pageHebrewGematria .gem-quran-result-card .gen-dr span,
#pageGreekGematria .gem-quran-result-card .gen-dr span,
#pageSlavicGematria .gem-quran-result-card .gen-dr span{
  color:var(--gold2) !important;
  cursor:pointer !important;
}

html[data-theme="light"] #pageGematriaEN .gem-quran-result-card,
html[data-theme="light"] #pageHebrewGematria .gem-quran-result-card,
html[data-theme="light"] #pageGreekGematria .gem-quran-result-card,
html[data-theme="light"] #pageSlavicGematria .gem-quran-result-card{
  background:var(--bg3) !important;
  border-color:var(--bdr) !important;
}

/* Inline cipher tables continue to span the complete result row. */
#pageGematriaEN #geoResultsGrid > .geo-inline-table-wrap,
#pageHebrewGematria #hebResultsGrid > .geo-inline-table-wrap,
#pageGreekGematria #grkResultsGrid > .geo-inline-table-wrap,
#pageSlavicGematria #slvResultsGrid > .geo-inline-table-wrap{
  grid-column:1 / -1 !important;
}

@media(max-width:1050px){
  #pageGematriaEN #geoResultsGrid,
  #pageHebrewGematria #hebResultsGrid,
  #pageGreekGematria #grkResultsGrid,
  #pageSlavicGematria #slvResultsGrid{
    --gem-card-width:165px;
    grid-template-columns:repeat(4,var(--gem-card-width)) !important;
    gap:.6rem !important;
  }
}
@media(max-width:720px){
  #pageGematriaEN #geoResultsGrid,
  #pageHebrewGematria #hebResultsGrid,
  #pageGreekGematria #grkResultsGrid,
  #pageSlavicGematria #slvResultsGrid{
    grid-template-columns:repeat(3,var(--gem-card-width)) !important;
    gap:.55rem !important;
  }
  #pageGematriaEN .gem-quran-result-card,
  #pageHebrewGematria .gem-quran-result-card,
  #pageGreekGematria .gem-quran-result-card,
  #pageSlavicGematria .gem-quran-result-card{min-height:100px !important;padding:.72rem .48rem .64rem !important}
  #pageGematriaEN .gem-quran-result-card .gl,
  #pageHebrewGematria .gem-quran-result-card .gl,
  #pageGreekGematria .gem-quran-result-card .gl,
  #pageSlavicGematria .gem-quran-result-card .gl{font-size:.68rem !important}
  #pageGematriaEN .gem-quran-result-card .gv,
  #pageHebrewGematria .gem-quran-result-card .gv,
  #pageGreekGematria .gem-quran-result-card .gv,
  #pageSlavicGematria .gem-quran-result-card .gv{font-size:1.28rem !important}
}
@media(max-width:500px){
  #pageGematriaEN #geoResultsGrid,
  #pageHebrewGematria #hebResultsGrid,
  #pageGreekGematria #grkResultsGrid,
  #pageSlavicGematria #slvResultsGrid{
    --gem-card-width:min(165px,calc((100vw - 2.25rem)/2));
    grid-template-columns:repeat(2,var(--gem-card-width)) !important;
    gap:.5rem !important;
  }
  #pageGematriaEN .gem-quran-result-card,
  #pageHebrewGematria .gem-quran-result-card,
  #pageGreekGematria .gem-quran-result-card,
  #pageSlavicGematria .gem-quran-result-card{min-height:96px !important}
}
