: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);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
}
.brand {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.brand img {
  height: 44px;
  width: auto;
  display: block;
}
.nav {
  display: none;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  margin-inline-start: auto;
}
@media (min-width: 1024px) { .nav { display: flex; } }
.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;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav__item:hover {
  background: var(--c-accent-bg);
  color: var(--c-primary-dark);
}
.nav__item .mdi {
  font-size: 18px;
  line-height: 1;
  color: var(--c-primary);
  transition: color .15s;
}
.nav__item:hover .mdi { color: var(--c-primary-dark); }
.nav__more {
  color: var(--c-primary);
}
.nav__more:hover { color: var(--c-primary-dark); }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--c-text);
  cursor: pointer;
  margin-inline-start: auto;
}
.menu-toggle:hover { background: var(--c-accent-bg); }
@media (min-width: 1024px) { .menu-toggle { display: none; } }

/* ===== Modal (search + all categories) ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
.modal[data-open="true"] {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
}
.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 34, 53, .55);
  animation: fadeIn .15s ease-out;
}
.modal__panel {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px 20px 24px;
  overflow-y: auto;
  animation: slideUp .2s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: translateY(0) } }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
}
.modal__close {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--c-text);
  align-items: center;
  justify-content: center;
}
.modal__close:hover { background: var(--c-accent-bg); }

/* ===== Search form (used in modal AND on /categories page) ===== */
.search {
  display: flex;
  position: relative;
  width: 100%;
}
.search input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 16px;
  border: 1px solid var(--c-border);
  background: var(--c-bg);
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  color: var(--c-text);
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search input:focus {
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14,109,184,.12);
}
.search input::placeholder { color: var(--c-muted); }
.search button {
  position: absolute;
  inset-inline-start: 6px;
  top: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search button:hover { background: var(--c-accent-bg); color: var(--c-primary); }
.search svg { width: 18px; height: 18px; }

/* Modal-context tweaks */
.modal .search { margin-bottom: 20px; }

.modal__section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.modal__categories {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, 1fr);
}
.modal__cat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--c-text);
  transition: background .15s, color .15s;
}
.modal__cat-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal__cat:hover,
.modal__cat.is-active {
  background: var(--c-accent-bg);
  color: var(--c-primary-dark);
}
.modal__cat-count {
  font-size: 11px;
  color: var(--c-muted);
  background: var(--c-bg);
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.modal__cat:hover .modal__cat-count,
.modal__cat.is-active .modal__cat-count {
  background: #fff;
}

/* ===== 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) ===== */
.hero-slider-wrap {
  margin-bottom: 36px;
}
.hero-slider {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #0a1828;
}
.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; }
}
.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); }

/* ===== 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;
}

/* ===== Categories page ===== */
.page-search {
  max-width: 560px;
  margin: 0 auto 24px;
}
.page-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
@media (min-width: 640px) { .page-categories { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .page-categories { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .page-categories { grid-template-columns: repeat(5, 1fr); } }

/* ===== 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;
}
