/* components/isback-card-view.js: a card looked at closely on a touch screen, as the app's card
   view (is-back-app cards.rs focus_view_on()): the page dark behind it, darker the lower it is. */
html.rk-cv-lock, html.rk-cv-lock body { overflow: hidden; }
.rk-cv {
  position: fixed; inset: 0; z-index: 100000; display: none; color: #e6edf3; text-align: left;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.97));
  opacity: 0; transition: opacity 0.2s ease; -webkit-tap-highlight-color: transparent;
  font-family: inherit; line-height: 1.45;
}
.rk-cv:not([hidden]) { display: block; }
.rk-cv.rk-cv-in { opacity: 1; }
.rk-cv-scroll {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y; -webkit-overflow-scrolling: touch;
}
.rk-cv-body {
  display: flex; flex-direction: column; align-items: center; gap: 16px; box-sizing: border-box;
  min-height: 100%; padding: 16px 12px calc(24px + env(safe-area-inset-bottom));
}
.rk-cv-wide .rk-cv-body { flex-direction: row; justify-content: center; align-items: center; gap: 32px; padding: 24px; }
.rk-cv-wide .rk-cv-cardbox { position: sticky; top: 24px; align-self: flex-start; }
.rk-cv-wide .rk-cv-info { align-self: center; }

/* The card: its picture, its back behind it (shown while it faces away, printed as a real card's
   back: mirrored left-right, so a tumble shows it upside down); each cropped
   as the gallery's viewer crops it (the print bleed off, its rounded corners). */
.rk-cv-cardbox { flex: 0 0 auto; position: relative; }
.rk-cv-card {
  position: absolute; inset: 0; touch-action: none; cursor: grab; transform-origin: 50% 50%; will-change: transform;
  user-select: none; -webkit-user-select: none; isolation: isolate;
}
.rk-cv-card.rk-cv-lifted { cursor: grabbing; }
.rk-cv-face {
  position: absolute; inset: 0; overflow: hidden; background: #111; z-index: 2;
  border-radius: min(45px, 12%) / min(45px, 8.62%); box-shadow: 0 8px 18px rgba(0, 0, 0, calc(0.7 * var(--rk-cv-shadow, 1)));
}
/* (--rk-cv-shadow: going as a spin starts, back gently once it lands — isback-card-view.js shadowNow()) */
.rk-cv-lifted .rk-cv-face { box-shadow: 0 16px 32px rgba(0, 0, 0, calc(0.75 * var(--rk-cv-shadow, 1))); }
.rk-cv-face img {
  position: absolute; top: -1.323%; left: -1.842%; width: 103.684%; height: 102.646%; display: block;
  -webkit-touch-callout: none; -webkit-user-drag: none; pointer-events: none;
}
.rk-cv-back { display: none; transform: scaleX(-1); }
.rk-cv-away .rk-cv-back { display: block; }
.rk-cv-away > :not(.rk-cv-back) { visibility: hidden; }
.rk-cv-locked .rk-cv-front img { filter: grayscale(1) brightness(.55); }
/* The banlist icon on its corner (components/isback-banlist.css draws [data-ban]::after), as on a tile. */
.rk-cv-front[data-ban] { border-top-right-radius: 12.22% 8.78%; }
.rk-cv-front[data-ban]::after { width: 26%; top: -0.56%; right: -0.78%; }
.rk-cv-front[data-ban] img { clip-path: inset(1.289% 1.776% round min(45px, 11.57%) / min(45px, 8.4%)); }

/* The text: name, "#id • Type • Power" and the badge, then each keyword on a teal-edged row. */
.rk-cv-info { flex: 0 0 auto; max-width: 100%; box-sizing: border-box; }
/* (A double-sided card's other side's text, unseen: measured so the card is the same size either side up) */
.rk-cv-ghost { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
.rk-cv-name { font-size: 24px; font-weight: 700; color: #f0f6fc; line-height: 1.3; }
.rk-cv-lock { font-size: 0.8em; }
.rk-cv-stats {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px;
  margin-top: 4px; font-size: 18px; color: #8b949e;
}
.rk-cv-type { font-weight: 700; }
.rk-cv-type.t-rock { color: #3fb950; }
.rk-cv-type.t-paper { color: #58a6ff; }
.rk-cv-type.t-scissors { color: #f0883e; }
.rk-cv-type.t-gun { color: #e3b341; }
.rk-cv-ban {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap;
  padding: 3px 12px 3px 6px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: rgba(232, 20, 28, 0.12); border: 1px solid rgba(232, 20, 28, 0.5); color: #ffb4b4;
}
.rk-cv-ban-limited1, .rk-cv-ban-limited2, .rk-cv-ban-limited3 { background: rgba(240, 136, 62, 0.12); border-color: rgba(240, 136, 62, 0.5); color: #ffd2a8; }
.rk-cv-ban .rk-ban-ico { width: 22px; height: 22px; }
.rk-cv-ban-link { color: inherit; font-weight: 400; text-decoration: underline; margin-left: 2px; }
.rk-cv-owner { margin-top: 6px; font-size: 15px; color: #c39bd3; }
.rk-cv-art {
  display: block; margin-top: 14px; min-width: 170px; height: 42px; padding: 0 16px; border-radius: 8px;
  background: #21262d; border: 1px solid #30363d; color: #e6edf3; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.rk-cv-kws { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.rk-cv-kws li { padding: 9px 14px 12px; background: rgba(0, 255, 204, 0.05); border-left: 3px solid #00ffcc; border-radius: 0 6px 6px 0; }
.rk-cv-kw-name { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rk-cv-kw-name strong { color: #00ffcc; font-size: 18px; }
.rk-cv-kw-tag { color: #00ccff; font-weight: 600; font-size: 15px; white-space: nowrap; }
.rk-cv-kw-desc { margin-top: 4px; color: #cccccc; font-size: 17px; }
.rk-cv-kws li.kw-title strong { text-decoration: underline; text-underline-offset: 3px; color: #00ffcc; font-size: 18px; }
.rk-cv-kws .kw-title-tag { color: #8b949e; }
.rk-cv-none { margin-top: 12px; color: #8b949e; font-size: 15px; }
.rk-cv-info .rka-note { margin-top: 12px; }

/* A deck builder's: how many are in the deck, then ‹ + Add − Cut › (the others: their own buttons). */
.rk-cv-qty { margin-top: 14px; font-size: 14px; color: #aaaaaa; }
.rk-cv-qty strong { color: #00ffcc; }
.rk-cv-actions { display: flex; gap: 10px; margin-top: 12px; }
.rk-cv-btn, .rk-cv-nav {
  height: 48px; border-radius: 10px; border: 1px solid #30363d; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
}
.rk-cv-btn { flex: 1 1 0; min-width: 0; padding: 0 10px; background: #21262d; color: #e6edf3; }
.rk-cv-btn-add { background: linear-gradient(90deg, #00ffcc, #00ccff); color: #000; border: none; }
.rk-cv-btn-cut { background: linear-gradient(90deg, #ff0066, #ff6600); color: #fff; border: none; }
.rk-cv-btn:disabled { opacity: 0.35; cursor: default; }
.rk-cv-nav { flex: 0 0 48px; display: inline-flex; align-items: center; justify-content: center; background: #161b22; color: #e6edf3; padding: 0; }
.rk-cv-nav:disabled { opacity: 0.3; cursor: default; }
.rk-cv-btn:not(:disabled):active, .rk-cv-nav:not(:disabled):active, .rk-cv-art:active { filter: brightness(1.25); }

/* Where it is in its list, and ✕, in the top corners. */
.rk-cv-pos { position: absolute; left: 14px; top: calc(12px + env(safe-area-inset-top)); color: #8b949e; font-size: 14px; font-variant-numeric: tabular-nums; pointer-events: none; }
.rk-cv-close {
  position: absolute; right: 8px; top: calc(6px + env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  background: rgba(22, 27, 34, 0.7); border: 1px solid #30363d; color: #e6edf3; font-size: 18px; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) { .rk-cv { transition: none; } }
