/* بونوس‌ها و بازی‌های معتبر — RTL */

@font-face { font-family: Vazirmatn; src: url("/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("/fonts/Vazirmatn-Bold.woff2") format("woff2");
  font-weight: 700; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url("/fonts/Vazirmatn-ExtraBold.woff2") format("woff2");
  font-weight: 800; font-display: swap; }

:root {
  --bg: #081d3b;
  --ink: #eaf2ff;
  --muted: #8fa1c4;
  --line: rgba(120, 165, 255, .16);
  --glass: rgba(10, 32, 62, .62);
  --blue: #1d8cff;
  --cyan: #48d8ff;
  --brand: #48d8ff;
  --radius: 20px;
  --font: Vazirmatn, Tahoma, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font: 15px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;          /* clip, not hidden: hidden would break position: sticky */
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── background ──────────────────────────────────────────────────── */

.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
  animation: drift 26s ease-in-out infinite; }
.b1 { width: 520px; height: 520px; top: -160px; inset-inline-end: -120px;
  background: radial-gradient(circle, #1d8cff, transparent 70%); }
.b2 { width: 460px; height: 460px; top: 30%; inset-inline-start: -140px;
  background: radial-gradient(circle, #0b5cff, transparent 70%); animation-delay: -9s; }
.b3 { width: 400px; height: 400px; bottom: -140px; inset-inline-end: 35%;
  background: radial-gradient(circle, #00a7ff, transparent 70%); animation-delay: -17s; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-40px, -30px) scale(1.08); }
  66% { transform: translate(30px, 25px) scale(.95); }
}

/* ── card grid ───────────────────────────────────────────────────── */

.grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px; padding: 26px 22px 60px; max-width: 1320px; margin: 0 auto;
}

.skeleton {
  height: 300px; border-radius: var(--radius);
  background: linear-gradient(260deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.09) 50%, rgba(255,255,255,.04) 70%);
  background-size: 220% 100%; animation: shine 1.4s linear infinite;
}
@keyframes shine { to { background-position: 220% 0; } }

.card {
  display: block; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px);
  transition: transform .28s cubic-bezier(.2,.8,.3,1), border-color .28s, box-shadow .28s;
  animation: rise .4s backwards;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.card:hover, .card:focus-visible {
  transform: translateY(-5px); border-color: rgba(72, 216, 255, .45);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55); outline: none;
}

.card-img { position: relative; aspect-ratio: 96 / 65; background: #0b1424; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s cubic-bezier(.2,.8,.3,1); }
.card:hover .card-img img { transform: scale(1.05); }
.card-img::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,29,59,.92) 3%, transparent 34%); }
img.noimg { visibility: hidden; }

.card-body { padding: 0 16px 16px; margin-top: -26px; position: relative; z-index: 2; }
.card-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.6;
  text-shadow: 0 2px 12px rgba(0,0,0,.8); }

@keyframes pop { from { opacity: 0; transform: scale(.85); } }

/* Loyalty shop detail: accent stats and CTAs to match the shop section. */
.detail.shop .stat b { color: var(--brand); }
.hero-cta.shop { border-color: rgba(72, 216, 255, .55); color: var(--brand); }
.hero-cta.shop:hover { background: rgba(72, 216, 255, .12); }

/* Admin-written bonus description: side panel docked to the left of the
   hero (last flex item in RTL), wrapping below on narrow screens. */
.hero-desc { margin: 10px 0 0; font-size: 14px; line-height: 2; color: var(--ink); opacity: .85; max-width: 560px; }
.hero-cta.ghost { border-color: rgba(72, 216, 255, .45); color: var(--brand); }
.hero-cta.ghost:hover { background: rgba(72, 216, 255, .08); }
.hero-txt .hero-cta + .hero-cta { margin-inline-start: 10px; }

/* Static sportsbook names on loyalty shop cards and detail pages. */
.shop-games { margin-top: 8px; font-size: 12px; color: var(--brand); direction: ltr; text-align: right; }

/* ── hover popup ─────────────────────────────────────────────────── */

.pop {
  position: absolute; z-index: 40; width: 330px; padding: 14px;
  border-radius: 17px; border: 1px solid rgba(72, 216, 255, .3);
  background: rgba(9, 16, 32, .93); backdrop-filter: blur(16px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .7);
  animation: popin .18s ease-out;
}
.pop[hidden] { display: none; }
@keyframes popin { from { opacity: 0; transform: translateY(6px); } }

.pop-head { margin-bottom: 12px; }
.pop-title { font-size: 14px; font-weight: 700; line-height: 1.6; }
.pop-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pop-meta b { color: var(--cyan); }

.pop-games { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pop-game { text-align: center; min-width: 0; animation: pop .26s backwards; }
.pop-game img { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); background: #0b1424; }
.pop-game span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pop-link { display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700; color: var(--cyan); }
.pop-link span { transition: transform .22s; }
.pop-link:hover span { transform: translateX(-4px); }

/* ── detail page ─────────────────────────────────────────────────── */

.detail { position: relative; z-index: 1; max-width: 1440px; margin: 0 auto;
  padding: 26px 22px 60px; }

.back { display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  color: var(--muted); margin-bottom: 18px; transition: .2s; }
.back:hover { color: var(--ink); }

.hero { display: flex; flex-wrap: wrap; gap: 24px; padding: 20px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(12px); }
.hero-img { flex: 0 0 380px; max-width: 100%; align-self: flex-start;
  border-radius: 15px; overflow: hidden; border: 1px solid var(--line); }
.hero-img img { width: 100%; aspect-ratio: 96/65; object-fit: cover; display: block; }
/* Shop items are 2:1 banners — show the full artwork, not a 96:65 crop. */
.detail.shop .hero-img img { width: 100%; height: auto; aspect-ratio: auto; object-fit: initial; }
.hero-txt { flex: 1 1 300px; }
.hero-txt h1 { margin: 0; font-size: clamp(19px, 3vw, 26px); font-weight: 800; line-height: 1.5; }
.hero-note { margin: 9px 0 0; color: var(--brand); font-size: 14px; }
.hero-stats { display: flex; gap: 26px; margin: 18px 0; flex-wrap: wrap; }
.stat b { display: block; font-size: 22px; font-weight: 800; color: var(--cyan); }
.stat span { font-size: 12px; color: var(--muted); }

.hero-cta { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid rgba(72, 216, 255, .45); color: var(--cyan);
  font-size: 13.5px; font-weight: 700; transition: .2s; }
.hero-cta:hover { background: rgba(72, 216, 255, .12); }

.tools { margin: 26px 0 0; }
.tools input {
  width: 100%; max-width: 420px; padding: 11px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  font: 14px var(--font); outline: none; transition: .2s;
}
.tools input:focus { border-color: rgba(72, 216, 255, .55); }
.tools input::placeholder { color: var(--muted); }

.chips { display: flex; gap: 7px; margin-top: 12px; overflow-x: auto;
  scrollbar-width: none; padding-bottom: 3px; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass); color: var(--muted); font-size: 12px; font-weight: 700;
  white-space: nowrap; cursor: pointer; transition: .18s; }
.chip:hover { color: var(--ink); }
.chip.on { background: linear-gradient(260deg, var(--cyan), var(--blue)); color: #04121f;
  border-color: transparent; }

.count-line { margin: 18px 0 12px; font-size: 13px; color: var(--muted); }
.count-line span { color: var(--cyan); font-weight: 700; }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.game { text-align: center; min-width: 0; animation: pop .28s backwards; }
.game-img { position: relative; border-radius: 13px; overflow: hidden;
  border: 1px solid var(--line); aspect-ratio: 44 / 31; background: #0b1424; }
.game-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.game:hover .game-img img { transform: scale(1.09); }
.game:hover .game-img { border-color: rgba(72, 216, 255, .6); box-shadow: 0 10px 26px rgba(0,0,0,.5); }
.game-play { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; gap: 5px; font-size: 12px; font-weight: 700; color: #04121f;
  background: linear-gradient(260deg, rgba(72,216,255,.9), rgba(29,140,255,.9));
  opacity: 0; transition: opacity .22s; }
.game:hover .game-play { opacity: 1; }
.game-name { font-size: 12px; margin-top: 7px; line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-prov { font-size: 11px; color: var(--muted); }

.modal-more { display: flex; justify-content: center; margin: 28px 0 0; }
.more-btn { padding: 11px 28px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--glass); color: var(--ink); font: 700 13.5px var(--font);
  cursor: pointer; transition: .2s; }
.more-btn:hover { border-color: rgba(72,216,255,.5); color: var(--cyan); }
.more-btn[disabled] { opacity: .5; cursor: default; }
.more-btn[hidden] { display: none; }

.empty { position: relative; z-index: 1; text-align: center; padding: 60px 22px;
  color: var(--muted); font-size: 14px; }

/* A bonus with no eligible game is a valid product (freebet, voucher, app
   install, …); don't show an empty game browser for it. */
.detail.no-games .tools,
.detail.no-games .count-line,
.detail.no-games .games,
.detail.no-games .modal-more,
.detail.no-games #noResult { display: none; }
.no-games-note { display: none; position: relative; z-index: 1; margin: 22px 0 0;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--glass); color: var(--muted); font-size: 13px; }
.detail.no-games .no-games-note { display: block; }

/* ── standalone chrome (hidden inside an iframe) ─────────────────── */

html.in-frame .topbar,
body.in-frame .topbar { display: none; }

.site-foot { position: relative; z-index: 1; text-align: center; padding: 26px 22px 40px;
  color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); margin-top: 20px; }
html.in-frame .site-foot,
body.in-frame .site-foot { display: none; }

/* ── responsive ──────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; padding: 20px 16px 44px; gap: 16px; }
  .head { padding: 26px 16px 6px; }
  .pop { display: none !important; }   /* touch: tapping goes to the detail page */
  .hero { padding: 15px; gap: 16px; }
  .hero-img { flex: 1 1 100%; }
  .detail { padding: 20px 16px 44px; }
  .games { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
}

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