/* ============================================================
   ynet — משחקים (arena embed)
   Mirrors the live ynet games arena visual language:
   white bg, black sans-serif Hebrew, gray subtitles,
   colored square cards with rounded corners,
   compact casual-game icon grid at the bottom.
   ============================================================ */

:root {
  --ink:        rgb(17, 24, 39);
  --ink-soft:   rgb(75, 85, 99);
  --ink-mute:   rgb(107, 114, 128);
  --hair:       rgb(229, 231, 235);
  --paper:      #FFFFFF;
  --pill-bg:    rgb(243, 244, 246);
  --pill-hover: rgb(229, 231, 235);
  --pill-ink:   rgb(55, 65, 81);
  --red:        #CF0000;
  --sans: "Heebo", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.locked { overflow: hidden; }

button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; padding: 0; }
img { display: block; max-width: 100%; }

/* ============================================================
   ARENA container
   ============================================================ */
.arena {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ============================================================
   ROW (section)
   ============================================================ */
.row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.row__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  text-align: right;
}
.row__title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 20px;
  line-height: 28px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.row__sub {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-mute);
  font-weight: 400;
}

/* ============================================================
   RAIL (horizontal scroll carousel)
   ============================================================ */
.row__rail {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0 6px;
  scroll-snap-type: x mandatory;
}
.row__rail::-webkit-scrollbar { display: none; }
.row__rail-inner {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 14px;
}

@media (min-width: 640px) {
  .row__rail-inner { grid-auto-columns: 160px; }
}

.row__rail-wrap { position: relative; }
.rail-arrow {
  position: absolute;
  top: 2px;
  height: var(--art-h, 150px);
  width: 34px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: opacity .18s ease, background .15s ease;
}
.rail-arrow:hover { background: rgba(255,255,255,0.85); }
.rail-arrow--prev { right: 0; }
.rail-arrow--next { left: 0; }
.rail-arrow svg {
  width: 26px;
  height: 26px;
  transition: transform .15s ease;
}
.rail-arrow:hover svg { transform: scale(1.12); }
.rail-arrow.is-hidden { opacity: 0; pointer-events: none; }
@media (max-width: 720px) {
  .rail-arrow { width: 30px; }
  .rail-arrow svg { width: 22px; height: 22px; }
}

/* ============================================================
   CARD (mainline featured/daily)
   ============================================================ */
.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
  background: var(--paper);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .25s ease;
  width: 100%;
}
.card:hover { transform: translateY(-2px); }
.card:active { transform: translateY(0); }

.card__art {
  aspect-ratio: 1 / 1;
  background: var(--bg);
  border-radius: 0;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  transition: box-shadow .25s;
}
.card__badge {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.28);
}
@media (max-width: 720px) {
  .card__badge { font-size: 9px; padding: 3px 6px; top: 6px; left: 6px; }
}

.card__art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,0.18), transparent 55%),
    radial-gradient(circle at 90% 90%, rgba(0,0,0,0.07), transparent 60%);
  pointer-events: none;
}
.card:hover .card__art {
  box-shadow: 0 10px 24px -10px rgba(0,0,0,0.20), 0 4px 8px -4px rgba(0,0,0,0.06);
}
.card__art img {
  width: 64%;
  height: 64%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
  position: relative;
  z-index: 1;
  transition: transform .3s ease;
}
.card:hover .card__art img { transform: scale(1.04); }

.card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}
.card__title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  line-height: 20px;
  color: var(--ink);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card__sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 16px;
  color: var(--ink-mute);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .arena { padding: 14px 14px 18px; gap: 20px; }
  .row { gap: 10px; }
  .row__title { font-size: 17px; line-height: 24px; }
  .row__sub { font-size: 12.5px; line-height: 18px; }
  .row__rail-inner { grid-auto-columns: 122px; gap: 10px; }
  .card { gap: 6px; }
  .card__art { border-radius: 0; }
  .card__title { font-size: 13px; line-height: 18px; }
  .card__sub { font-size: 11.5px; line-height: 14px; }
}

@media (max-width: 380px) {
  .row__rail-inner { grid-auto-columns: 112px; }
}

/* ============================================================
   MODAL — V2 game iframe
   ============================================================ */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.modal--open { opacity: 1; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
}
.modal__panel {
  position: relative;
  margin: 16px 0 0;
  width: min(428px, 96vw);
  height: min(750px, 92vh);
  background: var(--paper);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.45);
  transform: translateY(12px) scale(0.985);
  transition: transform .25s ease;
}
.modal--open .modal__panel { transform: translateY(0) scale(1); }
.modal__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--hair);
}
.modal__actions {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal__close,
.modal__icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--pill-bg);
  color: var(--ink);
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.modal__close:hover,
.modal__icon:hover { background: var(--ink); color: var(--paper); }

.theme-pop[hidden] { display: none; }
.theme-pop {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 132px;
  max-width: calc(100vw - 32px);
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.22);
}
.themeswatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--sw-bg, #fff);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
  position: relative;
  transition: transform .12s;
}
.themeswatch::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--sw-dot, #000);
}
.themeswatch:hover { transform: scale(1.08); }
.themeswatch.is-active { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px #0f68f3; }

.themeswatch--default                     { --sw-bg: #0f68f3; --sw-dot: #FFFFFF; }
.themeswatch[data-theme="pop-minimal"]    { --sw-bg: #FFFFFF; --sw-dot: #FF5A5A; }
.themeswatch[data-theme="editorial-noir"] { --sw-bg: #0E0B12; --sw-dot: #D4FF4E; }
.themeswatch[data-theme="broadsheet"]     { --sw-bg: #F5EEDC; --sw-dot: #E23B2E; }
.themeswatch[data-theme="dark"]           { --sw-bg: #0E0F12; --sw-dot: #C7EA46; }
.themeswatch[data-theme="riso-studio"]    { --sw-bg: #F2EAD9; --sw-dot: #1F6E77; }
.themeswatch[data-theme="workspace"]      { --sw-bg: #FAFAFA; --sw-dot: #2563EB; }
.modal__title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 1 1 auto;
}
.modal__kicker {
  font-size: 10px;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.modal__title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}
.modal__diff[hidden] { display: none; }
.modal__diff {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  flex: 0 0 auto;
  margin-top: 4px;
}
.diffpill {
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: none;
  color: var(--pill-ink);
  transition: color .15s;
}
.diffpill:hover { color: var(--ink); }
.diffpill.is-active { color: #0f68f3; font-weight: 700; }
.modal__body { flex: 1; background: var(--paper); overflow: hidden; }
.modal__host, .modal__host iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 720px) {
  .modal__panel {
    width: 100vw;
    height: auto;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    box-shadow: 0 24px 50px -24px rgba(0,0,0,0.4);
  }
  .modal__body { flex: 0 0 595px; }
  .modal__title { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   FEEDBACK panel (overlay inside the game modal)
   ============================================================ */
.fb-panel[hidden] { display: none; }
.fb-panel {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(3px);
}
.fb-card {
  position: relative;
  width: min(360px, 100%);
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 16px;
  box-shadow: 0 20px 50px -16px rgba(0,0,0,0.30);
  padding: 22px 20px 20px;
  text-align: center;
  animation: fb-rise .25s ease;
}
@keyframes fb-rise { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.fb-x {
  position: absolute; top: 10px; inset-inline-start: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--pill-bg); color: var(--ink);
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
.fb-x:hover { background: var(--ink); color: var(--paper); }
.fb-title { margin: 2px 0; font-size: 18px; font-weight: 800; color: var(--ink); }
.fb-sub { margin: 0 0 12px; font-size: 13px; color: var(--ink-mute); }
.fb-stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.fb-star { font-size: 30px; line-height: 1; color: var(--hair); transition: transform .1s, color .12s; }
.fb-star:hover { transform: scale(1.12); }
.fb-star.is-on { color: #F5B301; }
.fb-text, .fb-email {
  width: 100%; box-sizing: border-box;
  border: 2px solid var(--hair); border-radius: 12px;
  font: inherit; color: var(--ink); outline: none;
  transition: border-color .15s;
}
.fb-text { resize: none; padding: 10px 12px; font-size: 14px; }
.fb-email { margin-top: 8px; padding: 9px 12px; font-size: 13px; }
.fb-text:focus, .fb-email:focus { border-color: #0f68f3; }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-submit {
  margin-top: 14px; width: 100%;
  background: var(--red); color: #fff;
  font-weight: 800; font-size: 15px;
  padding: 11px; border-radius: 12px;
  transition: opacity .15s, transform .1s;
}
.fb-submit:hover { opacity: .92; }
.fb-submit:active { transform: translateY(1px); }
.fb-submit:disabled { opacity: .5; cursor: default; }
.fb-msg { margin: 10px 0 0; font-size: 13px; font-weight: 700; }
.fb-msg.is-ok { color: #1e9e5a; }
.fb-msg.is-err { color: var(--red); }
.fb-msg[hidden] { display: none; }

/* ============================================================
   Powered-by badge (section header + feedback)
   ============================================================ */
.pg-badge {
  flex: 0 0 auto;
  align-self: flex-end;
  margin-bottom: 1px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-mute);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.pg-badge strong { font-weight: 800; color: var(--ink-soft); }
.pg-badge:hover, .pg-badge:hover strong { color: var(--ink); }

.fb-powered {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-mute);
  text-decoration: none;
  transition: color .15s;
}
.fb-powered strong { font-weight: 800; color: var(--ink-soft); }
.fb-powered:hover, .fb-powered:hover strong { color: var(--ink); }

.fb-disclaimer[hidden] { display: none; }
.fb-disclaimer {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-mute);
}

/* ============================================================
   Maintenance notice (shown in place of a game under repair)
   ============================================================ */
.pg-maint {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 32px 28px;
  box-sizing: border-box;
}
.pg-maint__icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pill-bg);
  color: var(--ink);
}
.pg-maint__title {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
}
.pg-maint__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 320px;
}

