/* ============================================================
   ynet Premium — games (arena embed, Hebrew / RTL)
   Fixed-size 2x2 cover grid that swaps to a single game view.
   Dimensions mirror the original arenas embed so it drops into
   the same ynet iframe slot:
     grid  — desktop 820x640, mobile 347x345
     game  — header (44px) + iframe (desktop 640px, mobile 590px)
   ============================================================ */

@font-face {
  font-family: "Moses";
  src: url("fonts/Moses.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

: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);
  --red:        #CF0000;
  --link:       #1517ac;
  --sans: "Moses", "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%; }

/* ============================================================
   STAGE — 820px max, centered (matches the arenas layout)
   ============================================================ */
.stage {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* ============================================================
   GRID (2x2 cover tiles)
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 20px;
  height: 640px;
  width: 100%;
}
.grid[hidden] { display: none; }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg, #f3f4f6);
  color: #fff;
  text-align: center;
  transition: transform .3s ease, box-shadow .25s ease;
}
.tile:hover { transform: scale(1.04); box-shadow: 0 14px 30px -12px rgba(0,0,0,0.35); }
.tile:active { transform: scale(1.0); }
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,0.16), transparent 55%),
    radial-gradient(circle at 90% 90%, rgba(0,0,0,0.10), transparent 60%);
  pointer-events: none;
}
.tile__icon {
  width: 104px;
  height: 104px;
  margin-bottom: 10px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.18));
}
.tile__title {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 22px;
  line-height: 1.15;
}
.tile__desc {
  position: relative;
  z-index: 1;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.25;
  opacity: 0.92;
}

/* Full-bleed cover tile (block tree art fills the whole card) */
.tile--cover {
  display: block;
  padding: 0;
  gap: 0;
}
.tile--cover::after { display: none; }
.tile--cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ============================================================
   GAME view (header + iframe)
   ============================================================ */
.game[hidden] { display: none; }
.game-head {
  height: 44px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 8px;
}
.game-back {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--ink);
}
.game-back:hover { color: var(--red); }
.game-fb {
  color: var(--link);
  font-size: 14px;
  text-decoration: underline;
  padding: 0 4px;
  transition: opacity .15s;
}
.game-fb:hover { opacity: .82; }
.game-host {
  position: relative;
  width: 100%;
  height: 640px;
}
.game-host iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--hair);
  border-radius: 8px;
  display: block;
}

@media (max-width: 767px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 12px;
    height: 345px;
    max-width: 347px;
    margin: 0 auto;
  }
  .game-host { height: 590px; }
  .game-host iframe { border: 0; border-radius: 0; }
  .tile { gap: 2px; padding: 8px; }
  .tile--cover { padding: 0; gap: 0; }
  .tile__icon { width: 46px; height: 46px; margin-bottom: 4px; }
  .tile__title { font-size: 13px; }
  .tile__desc { font-size: 10px; }
}

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

/* ============================================================
   FEEDBACK panel (full-screen overlay)
   ============================================================ */
.fb-panel[hidden] { display: none; }
.fb-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  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: var(--link); }
.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; }
.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);
}
