:root {
  --c-bg: #f3f7fb;
  --c-card: #ffffff;
  --c-text: #142235;
  --c-muted: #5a6b80;
  --c-border: #e3eaf3;
  --c-primary: #0e6db8;
  --c-primary-dark: #0a4f87;
  --c-accent: #aedeed;
  --c-accent-bg: #e6f4fb;
  --shadow-sm: 0 1px 2px rgba(20, 34, 53, .06), 0 1px 1px rgba(20, 34, 53, .04);
  --shadow-md: 0 6px 16px rgba(14, 109, 184, .10), 0 2px 4px rgba(20, 34, 53, .06);
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 64px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Heebo', 'Rubik', 'Assistant', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  direction: rtl;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--c-primary);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}


/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

/* Top row: brand on the right (RTL), inline search on the left. */
.site-header__top {
  border-bottom: 1px solid var(--c-border);
}

.site-header__top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--header-h);
}

/* Bottom row: full-width strip of category links. */
.site-header__bottom {
  background: #fff;
}

.site-header__bottom .nav {
  justify-content: flex-start;
  flex: none;
  margin: 0;
  padding: 6px 0;
}

.brand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.brand img {
  height: 26px;
  width: auto;
  display: block;
}

#game-holder-game-element {
  text-align: center;
}

@media (min-width: 768px) {
  .brand img {
    height: 33px;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--c-text);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

.nav__item:hover {
  background: var(--c-accent-bg);
  color: var(--c-primary-dark);
}

.nav__item .mdi {
  font-size: 16px;
  background-color: #8db4c1;
  color: #ffffff;
  transition: color .15s;
  border-radius: 50%;
  display: inline-block;
  width: 25px;
  height: 25px;
  text-align: center;
  line-height: 26px;
}

.nav__item:hover .mdi {
  color: #ffffff;

}

/* Inline search form in the header (replaces the old modal-based search). */
.header-search {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.header-search input {
  width: 350px;
  height: 36px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, background .15s;
}

.header-search input:focus {
  border-color: var(--c-primary);
  background: #fff;
}

.header-search input::placeholder {
  color: var(--c-muted);
}

.header-search button {
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--c-muted);
  cursor: pointer;
}

.header-search button:hover {
  color: var(--c-primary);
}

.header-search svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 640px) {

  /* shrink the search so it still fits next to the logo on small screens */
  .header-search input {
    width: 100%;
    max-width: 350px;
  }

  .header-search {
    flex: 1;
    min-width: 0;
    margin-inline-start: 12px;
  }
}


/* ===== Main ===== */
main.container {
  padding-top: 32px;
  padding-bottom: 48px;
}

/* ===== Hero ===== */
.hero {
  margin-bottom: 28px;
}

.hero__title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  color: var(--c-text);
  line-height: 1.25;
}

.hero__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-muted);
  max-width: 880px;
}

@media (min-width: 768px) {
  .hero__title {
    font-size: 32px;
  }

  .hero__text {
    font-size: 16px;
  }
}

/* ===== Hero slider (between hero text and category sections) ===== */
/* Pre-init: render only the first slide at full size, hide nav, so Splide's
   mount doesn't reflow the layout (CLS killer). */
.splide:not(.is-initialized) .splide__list {
  display: block;
}

.splide:not(.is-initialized) .splide__slide:not(:first-child) {
  display: none;
}

.splide:not(.is-initialized) .splide__pagination,
.splide:not(.is-initialized) .splide__arrows {
  display: none;
}

.hero-slider-wrap {
  margin-bottom: 36px;
  aspect-ratio: 16 / 9;
}

@media (min-width: 1024px) {
  .hero-slider-wrap {
    aspect-ratio: 21 / 9;
    max-height: 480px;
  }
}

.hero-slider {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #0a1828;
  height: 100%;
}

.hero-slider .splide__pagination {
  bottom: 12px;
}

.hero-slider .splide__pagination__page {
  background: rgba(255, 255, 255, .55);
  opacity: 1;
  width: 8px;
  height: 8px;
  margin: 0 4px;
}

.hero-slider .splide__pagination__page.is-active {
  background: #fff;
  transform: scale(1.3);
}

.hero-slider .splide__arrow {
  background: rgba(20, 34, 53, .5);
  width: 40px;
  height: 40px;
  opacity: .85;
}

.hero-slider .splide__arrow svg {
  fill: #fff;
  width: 18px;
  height: 18px;
}

.hero-slider .splide__arrow:hover {
  background: rgba(20, 34, 53, .8);
  opacity: 1;
}

.hero-slider .splide__arrow:disabled {
  opacity: 0;
}

.hero-slide {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  color: #fff;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .hero-slide {
    aspect-ratio: 21 / 9;
    max-height: 480px;
  }
}

.hero-slide__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease-out;
}

.hero-slide:hover .hero-slide__img {
  transform: scale(1.03);
}

.hero-slide__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 22px 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, .85) 100%);
  color: #fff;
}

@media (min-width: 768px) {
  .hero-slide__overlay {
    padding: 28px 32px 32px;
  }
}

.hero-slide__category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  color: #fff;
}

.hero-slide__category .mdi {
  font-size: 14px;
  line-height: 1;
}

.hero-slide__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

@media (min-width: 768px) {
  .hero-slide__title {
    font-size: 28px;
  }
}

.hero-slide__desc {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .92);
  max-width: 620px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero-slide__desc {
    font-size: 15px;
    -webkit-line-clamp: 3;
  }
}

.hero-slide__rating {
  margin-bottom: 12px;
}

.hero-slide__cta {
  display: inline-block;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--c-primary);
  padding: 8px 16px;
  border-radius: 999px;
  transition: background .15s, transform .15s;
}

.hero-slide:hover .hero-slide__cta {
  background: var(--c-primary-dark);
  transform: translateX(-3px);
}

/* Stars */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 14px;
  color: #fbbf24;
}

.stars .mdi {
  font-size: 17px;
  line-height: 1;
}

.stars__num {
  margin-inline-start: 6px;
  color: rgba(255, 255, 255, .92);
  font-weight: 600;
  font-size: 13px;
}

/* ===== Section description (under category heading) ===== */
.section__desc {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--c-muted);
  max-width: 880px;
}

@media (min-width: 768px) {
  .section__desc {
    font-size: 15px;
  }
}

/* Make section heading link inherit color so it doesn't look hyperlinked */
.section__title a {
  color: inherit;
}

.section__title a:hover {
  color: var(--c-primary);
}

/* Game page subtitle (English name under Hebrew H1) */
.game-page__subtitle {
  margin: -8px 0 16px;
  font-size: 14px;
  color: var(--c-muted);
  font-weight: 500;
}

.section {
  margin-bottom: 32px;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.section__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text);
}

@media (min-width: 768px) {
  .section__title {
    font-size: 26px;
  }
}

.section__more {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-primary);
  white-space: nowrap;
}

.section__more:hover {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

/* ===== Game grid / cards ===== */
.games-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 540px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .games-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .games-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.game-card {
  display: block;
  background: var(--c-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease-out, box-shadow .15s;
  position: relative;
  color: inherit;
}

.game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.game-card__thumb {
  display: block;
  aspect-ratio: 5 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--c-accent-bg);
}

.game-card__body {
  padding: 10px 12px 12px;
}

.game-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.game-card__cat {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--c-muted);
}

/* ===== Game page ===== */
.game-page__breadcrumb {
  font-size: 13px;
  color: var(--c-muted);
  margin: 0 0 12px;
}

.game-page__breadcrumb a:hover {
  color: var(--c-primary);
}

.game-page__title {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 800;
  color: var(--c-text);
}

.game-frame {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  position: relative;
}

.game-frame iframe {
  display: block;
  width: 100%;
  border: 0;
  aspect-ratio: var(--ratio, 5 / 3);
}

@media (min-width: 1024px) {
  .game-frame {
    max-width: 960px;
    margin-inline: auto 0;
  }
}

/* Fullscreen toggle button (top-left in RTL, over the iframe) */
.game-frame__fullscreen {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .15s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.game-frame__fullscreen:hover {
  background: rgba(0, 0, 0, .8);
  transform: scale(1.05);
}

.game-frame__fullscreen .mdi {
  font-size: 22px;
  line-height: 1;
}

/* When the frame is fullscreen, the iframe should fill it (no aspect-ratio) */
.game-frame:fullscreen,
.game-frame:-webkit-full-screen {
  max-width: none;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  margin: 0;
}

.game-frame:fullscreen iframe,
.game-frame:-webkit-full-screen iframe {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.game-page__layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .game-page__layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

.game-page__description {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.game-page__description h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--c-text);
}

.game-page__description p {
  margin: 0;
  color: var(--c-text);
  font-size: 15px;
  line-height: 1.7;
}

.related h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--c-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.related .games-grid {
  grid-template-columns: repeat(2, 1fr);
}

/* ===== Homepage tag cloud (top 20 tags) ===== */
.home-tags {
  margin-bottom: 36px;
}

.home-tags__title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text);
}

@media (min-width: 768px) {
  .home-tags__title {
    font-size: 26px;
  }
}

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

/* ===== Tag cloud (on game page) + tag chips ===== */
.tag-cloud {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
}

.tag-cloud__title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tag-cloud__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-primary-dark);
  background: var(--c-accent-bg);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}

.tag:hover {
  background: #fff;
  border-color: var(--c-primary);
  color: var(--c-primary-dark);
}

.tag__count {
  font-size: 11px;
  color: var(--c-muted);
  background: #fff;
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}

/* ===== Footer ===== */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--c-border);
  padding: 24px 0;
  margin-top: 24px;
  font-size: 14px;
  color: var(--c-muted);
  text-align: center;
}

.site-footer a {
  color: var(--c-primary);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-bottom: 10px;
}

.site-footer__links a {
  font-weight: 500;
}

.site-footer__links a:hover {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

.site-footer__copy {
  margin: 0;
}

/* ===== Prose pages (about, terms) ===== */
.prose {
  max-width: 760px;
  margin-inline: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 28px 36px;
}

.prose h1 {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  color: var(--c-text);
}

.prose h2 {
  margin: 28px 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
}

.prose p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--c-text);
}

.prose__lead {
  color: var(--c-muted);
  font-size: 13px;
}

.prose a {
  color: var(--c-primary);
}

.prose a:hover {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

/* ===== Contact form ===== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.contact-form__honey {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-form__field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}

.contact-form__field input,
.contact-form__field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 15px;
  color: var(--c-text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.contact-form__field input:focus,
.contact-form__field textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(14, 109, 184, .12);
}

.contact-form__field textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form__error {
  font-size: 13px;
  color: #b42318;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: background .15s, transform .15s;
}

.btn--primary {
  background: var(--c-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--c-primary-dark);
  color: #fff;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 12px 0 8px;
  font-size: 14px;
}

.alert--success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 32px 0 8px;
}

.pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-text);
  font-weight: 500;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: background .15s, color .15s;
}

.pagination__btn:hover {
  background: var(--c-accent-bg);
  color: var(--c-primary-dark);
}

.pagination__btn.is-active {
  background: var(--c-primary);
  color: #fff;
  pointer-events: none;
}

.pagination__btn.is-disabled {
  opacity: .4;
  pointer-events: none;
  background: transparent;
  box-shadow: none;
}

.pagination__ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  color: var(--c-muted);
}

/* ===== Empty state ===== */
.empty {
  background: #fff;
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--c-muted);
  box-shadow: var(--shadow-sm);
}

/* ===== Utilities ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}