/* ============================================================
   cards-v51.css · פס פקודות קומפקטי, קלפים נקיים, צופה מרחף, זירת קרב
   נטען אחרי cards.css.
   ============================================================ */
.cbar { position: sticky; top: calc(var(--nav-h) + 18px); z-index: 50; margin-bottom: 28px; transition: top .45s var(--ease); }
.topnav.is-hidden ~ main .cbar { top: 12px; }
.cbar__row { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: var(--r-pill); background: rgba(18, 22, 66, .92); border: 3px solid var(--ink); box-shadow: 5px 6px 0 var(--ink); }
.cbar .search { flex: 1 1 auto; }
.cbar .search input { min-height: 44px; border-width: 2px; }
.cbar__btn, .cbar__sort select, .cbar__fight { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 2px solid var(--ink); font: 900 1rem var(--f-brand); cursor: pointer; white-space: nowrap; transition: transform .35s var(--spring), background .2s; }
.cbar__btn { background: var(--paper); color: var(--ink); }
.cbar__btn svg { width: 18px; }
.cbar__btn[aria-expanded="true"] { background: var(--gold); }
.cbar__badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: #ff5a8a; color: #fff; font-size: .8rem; }
.cbar__sort select { background: rgba(255,255,255,.08); color: var(--text); appearance: none; padding: 0 14px; }
.cbar__sort option { color: #000; }
.cbar__fight { background: #ff5a5a; color: #fff; text-shadow: 1px 1px 0 var(--ink); box-shadow: 2px 3px 0 var(--ink); }
.cbar__fight:hover, .cbar__btn:hover { transform: translateY(-2px) rotate(-1.5deg); }
.cbar__pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; padding-inline: 10px; }
.cbar__pills:empty { display: none; }
.pill { display: inline-flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: var(--r-pill); background: var(--gold); color: var(--ink); border: 2px solid var(--ink); font: 700 .88rem var(--f-brand); animation: pill-in .4s var(--spring); }
@keyframes pill-in { from { transform: scale(.6) rotate(-6deg); opacity: 0; } }
.pills__count { font: 700 .9rem var(--f-brand); color: var(--muted); }
.drawer { position: absolute; top: calc(100% + 10px); inset-inline: 0; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 16px; padding: 18px; border-radius: var(--r-lg); background: #141a50; border: 3px solid var(--ink); box-shadow: var(--hard-lg); opacity: 0; transform: translateY(-10px) scale(.98); transform-origin: top; transition: opacity .25s var(--ease), transform .45s var(--spring); max-height: min(60vh, 520px); overflow-y: auto; overscroll-behavior: contain; }
.drawer.is-in { opacity: 1; transform: none; }
.drawer__foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .cbar__row { flex-wrap: wrap; border-radius: 22px; }
  .cbar .search { flex: 1 1 100%; }
  .cbar__btn, .cbar__sort, .cbar__fight { flex: 1 1 auto; justify-content: center; }
  .cbar__sort select { width: 100%; text-align: center; }
  .drawer { grid-template-columns: 1fr; position: fixed; top: auto; bottom: 0; inset-inline: 0; max-height: 72vh; border-radius: 22px 22px 0 0; transform: translateY(40px); padding-bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 60; }
}
.tools, .filters, .tools__status { display: none !important; }

/* קלפים נקיים: שום דבר מעל האמנות, פרטים רק בריחוף */
.grid > li { contain-intrinsic-size: auto 360px; }
.js-motion .grid > li { opacity: 0; transform: translateY(46px) rotate(calc(var(--r) * 3)) scale(.9); transition: opacity .5s var(--ease), transform .9s var(--spring); }
.js-motion .grid > li.is-in { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html:not(.reduce-motion) .grid > li.is-in .tcard:not(:hover):not(.is-moving) { animation: breathe 6s ease-in-out var(--d) infinite; }
}
@keyframes breathe { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
.tcard__side { display: none; }
.tcard__info { position: absolute; inset-inline: 0; bottom: 0; z-index: 2; display: grid; gap: 2px; padding: 34px 12px 12px; background: linear-gradient(0deg, rgba(6, 8, 30, .92), transparent); opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .4s var(--spring); pointer-events: none; text-align: start; }
.tcard__info b { font: 900 1.05rem/1.1 var(--f-brand); color: #fff; }
.tcard__info small { font: 700 .82rem var(--f-brand); }
.tcard:hover .tcard__info, .tcard:focus-visible .tcard__info { opacity: 1; transform: none; }
.tcard:hover { z-index: 3; }
@media (hover: none) { .tcard__info { display: none; } }

/* הצופה: הקלף מרחף במרכז, הסיפור לצידו */
.viewer { display: block; padding: 0; }
.viewer__layout { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); align-items: center; gap: clamp(20px, 4vw, 60px); height: 100%; padding: max(20px, env(safe-area-inset-top)) clamp(70px, 8vw, 120px) 20px; max-width: 1400px; margin-inline: auto; }
.viewer__stage { height: 100%; min-height: 0; }
.flip { height: min(82vh, 820px, calc((100vw - 32px) * 1.5)); transform: none; opacity: 1; }
.viewer.is-open .flip { transform: none; }
.flip__float { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--tx, 0deg)) rotateX(var(--ty, 0deg)); transition: transform .8s var(--ease); }
@media (prefers-reduced-motion: no-preference) { html:not(.reduce-motion) .viewer.is-open .flip__float { animation: hover-card 5s ease-in-out .9s infinite; } }
@keyframes hover-card { 0%, 100% { translate: 0 0; } 50% { translate: 0 -14px; } }
.flip::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -5%; height: 6%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent); z-index: -1; }
.viewer__aside { display: grid; gap: 12px; align-content: center; justify-items: start; padding: 22px; border-radius: var(--r-lg); background: rgba(16, 20, 60, .9); border: 3px solid var(--ink); box-shadow: var(--hard-lg); opacity: 0; transform: translateX(-30px); transition: opacity .4s .35s, transform .7s var(--spring) .35s; max-height: 86vh; overflow-y: auto; }
.viewer.is-open .viewer__aside { opacity: 1; transform: none; }
.viewer__side { display: inline-flex; padding: 4px 12px; border-radius: var(--r-pill); background: var(--side-c, var(--gold)); color: var(--ink); border: 2px solid var(--ink); font: 900 .9rem var(--f-brand); }
.viewer__title { font: 900 clamp(1.8rem, 1.2rem + 1.6vw, 2.6rem)/1 var(--f-brand); color: var(--gold); -webkit-text-stroke: .04em var(--ink); paint-order: stroke fill; text-shadow: .05em .06em 0 var(--ink); }
.viewer__powers { font: 700 1rem/1.4 var(--f-brand); color: var(--teal-hi); }
.viewer__story { color: var(--text); line-height: 1.65; }
.viewer__why { padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.06); border-inline-start: 4px solid var(--gold); color: var(--muted); font-size: .95rem; line-height: 1.55; }
.viewer__why:empty, .viewer__story:empty { display: none; }
.viewer__why b { color: var(--gold); font-family: var(--f-brand); }
.viewer__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.viewer__toast { font: 700 .9rem var(--f-brand); color: var(--teal-hi); word-break: break-all; }
.vbtn { position: absolute; z-index: 3; top: 50%; width: 52px; height: 52px; margin-top: -26px; }
.vbtn--prev { right: 14px; } .vbtn--next { left: 14px; }
@media (max-width: 900px) {
  .viewer { overflow-y: auto; }
  .viewer__layout { grid-template-columns: 1fr; height: auto; min-height: 100%; padding: 70px 16px 30px; gap: 22px; }
  .viewer__stage { height: auto; }
  .flip { height: auto; width: min(78vw, 420px); margin-inline: auto; }
  .viewer__aside { max-height: none; transform: translateY(30px); }
  .vbtn { position: fixed; top: 40vh; width: 44px; height: 44px; }
  .vbtn--prev { right: 6px; } .vbtn--next { left: 6px; }
}

/* ============================================================
   זירת הקרב
   ============================================================ */
.arena { position: fixed; inset: 0; z-index: 1300; opacity: 0; transition: opacity .3s; overflow-x: hidden; overflow-y: auto; }
.arena.is-open { opacity: 1; }
.arena__bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(60% 60% at 50% 50%, #ff5a5a 0%, #8a1f3a 35%, #1a0b2e 75%); }
.arena__bg::after { content: ""; position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 224, 138, .16) 0 5deg, transparent 5deg 12deg); }
@media (prefers-reduced-motion: no-preference) { html:not(.reduce-motion) .arena__bg::after { animation: rays 30s linear infinite; } }
/* מסכי הקרב עצמם (בחירה, זירה, תוצאה) ב-css/duel.css, שנטען רק כשנפתח קרב */
@media (prefers-reduced-motion: reduce) { .grid > li .tcard, .flip__float { animation: none !important; } }

/* כניסה למשחקים מהשער: כפתור בולט, ראשון בשורה ובמובייל ברוחב מלא */
.cover__play { margin: 14px 0 4px; }
.cover__games { display: inline-flex; align-items: center; gap: 10px; background: #e8323c; color: #fff; font-size: 1.15rem; text-shadow: 1px 1px 0 #0a0b22; }
.cover__games img { width: 36px; height: 36px; margin-block: -6px; filter: drop-shadow(1px 2px 0 rgba(10, 11, 34, .6)); }
.cover__games:hover { background: #ff4a52; }
@media (max-width: 600px) { .cover__games { display: flex; width: 100%; justify-content: center; min-height: 56px; } }
