/* ============================================================
   cards-v52.css · 8.11.2026: הקלפים במסך הראשון בטלפון
   - "איך זה נולד" עובר לחלון (cards-top.js) במקום רצועה באמצע העמוד
   - הכריכה בטלפון: כותרת ומניפה זו לצד זו, כפתור משחקים אחד, שתי תגיות קטנות
   - פס הכלים בשורה אחת: חיפוש, וסינון/סדר/קרב כאייקונים
   נטען אחרי cards-story.css.
   ============================================================ */

/* ---------- החלון של "איך זה נולד" ---------- */
.story-strip[data-moved] { display: none; }
.storydlg { width: min(1180px, calc(100vw - 24px)); max-width: none; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 0; background: transparent; color: inherit; overflow: visible; }
.storydlg::backdrop { background: rgba(8, 9, 30, .78); }
.storydlg__box { position: relative; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; padding: 18px clamp(14px, 2.4vw, 30px) 26px; border-radius: 22px; background: #141a50; border: 3px solid var(--ink); box-shadow: 8px 10px 0 var(--ink); }
.storydlg__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
.storydlg__title { flex: 1; margin: 0; font: 900 clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem)/1.05 var(--f-brand); color: var(--gold); -webkit-text-stroke: .05em var(--ink); paint-order: stroke fill; text-shadow: .05em .07em 0 var(--ink); }
.storydlg__lead { margin: 6px 0 0; font: 400 1rem/1.55 var(--f-body, inherit); color: #dfe6ff; -webkit-text-stroke: 0; text-shadow: none; max-width: 62ch; }
.storydlg__x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 2px 3px 0 var(--ink); cursor: pointer; transition: transform .16s cubic-bezier(.16, 1, .3, 1); }
.storydlg__x:hover { transform: rotate(-6deg) scale(1.04); }
.storydlg__x:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.storydlg .cpage { rotate: 0deg; }
/* כניסה 360, יציאה 240, ממקום הכפתור */
@media (prefers-reduced-motion: no-preference) {
  html:not(.reduce-motion) .storydlg[open] .storydlg__box { animation: sdlg-in .36s cubic-bezier(.16, 1, .3, 1) both; }
  html:not(.reduce-motion) .storydlg[open]::backdrop { animation: sdlg-fade .36s cubic-bezier(.16, 1, .3, 1) both; }
  html:not(.reduce-motion) .storydlg.is-out .storydlg__box { animation: sdlg-out .24s cubic-bezier(.7, 0, .84, 0) both; }
  html:not(.reduce-motion) .storydlg.is-out::backdrop { animation: sdlg-fade .24s cubic-bezier(.7, 0, .84, 0) reverse both; }
}
@keyframes sdlg-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes sdlg-out { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes sdlg-fade { from { opacity: 0; } }
html.is-dlg-locked { overflow: hidden; }

/* ---------- טלפון: הכריכה במסך רבע ---------- */
@media (max-width: 760px) {
  .cover { padding: calc(var(--nav-h) + 12px) 0 14px; }
  .cover__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-areas: "title art" "play play" "ctas ctas"; gap: 0 6px; align-items: center; }
  .cover__text { display: contents; }
  .cover__issue, .cover__lead, .cover__tocol { display: none; }
  .cover__title { grid-area: title; font-size: clamp(1.85rem, 1rem + 4.6vw, 2.6rem); }
  .cover__small { font-size: .38em; }
  .cover__art { grid-area: art; order: 0; height: 44vw; max-height: 250px; margin-inline-start: -4px; }
  .cover__logo { width: 48%; top: 2%; }
  .cover__deck .ccard { top: 8%; width: 46%; left: 30%; }
  .cover__play { grid-area: play; margin: 10px 0 0; }
  .cover__games { min-height: 50px; font-size: 1.08rem; }
  .cover__ctas { grid-area: ctas; flex-wrap: nowrap; gap: 8px; margin-top: 10px; }
  .cover__ctas .btn { flex: 1 1 0; justify-content: center; min-height: 44px; padding: 8px 10px; font-size: .95rem; white-space: nowrap; }
  .cover__count { margin-top: 8px; font-size: .92rem; }

  /* פס הכלים: שורה אחת */
  .cbar { margin-bottom: 18px; }
  .cbar__row { flex-wrap: nowrap; gap: 6px; padding: 6px; border-radius: var(--r-pill); }
  .cbar .search { flex: 1 1 auto; min-width: 0; }
  .cbar__btn, .cbar__sort, .cbar__fight { flex: none; }
  .cbar__btn, .cbar__fight { position: relative; width: 44px; height: 44px; padding: 0; justify-content: center; gap: 0; }
  .cbar__btn svg { width: 20px; }
  .cbar__fight .dic { width: 22px; height: 22px; }
  .cbar__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cbar__badge { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; border: 2px solid var(--ink); }
  .cbar__sort select { width: 44px; height: 44px; padding: 0; color: transparent; text-shadow: none; cursor: pointer;
    background: rgba(255, 255, 255, .08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8ecff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 3h5v5M4 20 21 3M21 16v5h-5M15 15l6 6M4 4l5 5'/%3E%3C/svg%3E") center / 20px no-repeat; }
  .cbar__sort select:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
  .cbar__sort option { color: #000; }
  .storydlg { width: calc(100vw - 16px); }
  .storydlg__box { padding: 14px 12px 20px; border-radius: 18px; }
  .storydlg__head { margin-bottom: 24px; }
}
