/* Genomon collector cards — 360×504 design size, scaled with --scale */
.gcard { --scale: 1; --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg; --hyp: 0;
  width: 360px; height: 504px; zoom: var(--scale); perspective: 1400px; cursor: pointer; user-select: none; }
.gc-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s cubic-bezier(.2,.8,.3,1); }
.gcard.active .gc-inner { transition: transform .08s linear; }
.gcard.flipped .gc-inner { transform: rotateX(var(--rx)) rotateY(calc(180deg + var(--ry))); }
.gc-face { position: absolute; inset: 0; border-radius: 20px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4); }
.gc-back { transform: rotateY(180deg); background: #0a1424; }
.gc-back svg { display: block; width: 100%; height: 100%; }
.gc-back .gb-word { font: 700 34px Georgia, 'Palatino Linotype', 'Book Antiqua', serif; letter-spacing: 9px; }
.gc-back .gb-small { font: 600 10px system-ui, sans-serif; letter-spacing: 3.5px; }

/* ---- front ---- */
.gc-front { background: var(--c1d); color: #1d1a14; font-family: system-ui, 'Segoe UI', sans-serif; }
.gc-frame { position: absolute; inset: 0; padding: 11px; border-radius: 20px;
  background: linear-gradient(140deg, var(--c1l) 0%, var(--c1) 30%, var(--c2) 70%, var(--c1d) 100%); }
.gc-frame::before { content: ''; position: absolute; inset: 0; border-radius: 20px; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.07) 0 2px, transparent 2px 7px); }
.finish-silver .gc-frame { box-shadow: inset 0 0 0 3px #e6ecf2, inset 0 0 0 5px #8e9aa8; }
.finish-gold .gc-frame, .finish-prism .gc-frame { box-shadow: inset 0 0 0 3px #f6df96, inset 0 0 0 5px #a87d2a, inset 0 0 0 6px #f6df96; }
.gc-panel { position: relative; height: 100%; border-radius: 11px; padding: 6px 8px 5px; display: flex; flex-direction: column; gap: 4px;
  background: radial-gradient(ellipse at 50% 0%, #fffdf5 0%, #f6efdc 55%, #e9dfc4 100%); box-shadow: inset 0 0 0 1px rgba(80,60,20,.35), inset 0 0 18px rgba(120,90,30,.18); }

.gc-head { display: flex; align-items: center; gap: 6px; height: 30px; }
.gc-stage { font-size: 8.5px; font-weight: 800; letter-spacing: 1px; color: #fff; background: var(--c1d); padding: 2px 6px; border-radius: 8px 3px 3px 8px; white-space: nowrap; }
.gc-name { flex: 1; font: 700 21px/1 Georgia, 'Palatino Linotype', 'Book Antiqua', serif; color: #1d1a14; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.gc-hp { font: 800 20px/1 system-ui, sans-serif; color: #b02a2a; white-space: nowrap; }
.gc-hp small { font-size: 9px; margin-right: 1px; letter-spacing: .5px; }
.gc-types { display: flex; gap: 2px; }
.gc-ti { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tc) 55%, #fff), var(--tc) 55%, color-mix(in srgb, var(--tc) 70%, #000));
  box-shadow: 0 0 0 1.3px rgba(255,255,255,.9), 0 1px 2px rgba(0,0,0,.4); }
.gc-ti svg { width: 64%; height: 64%; }

.gc-window { position: relative; height: 166px; border-radius: 6px; overflow: hidden;
  box-shadow: 0 0 0 2px #c9a24a, 0 0 0 3px #7a5a1a, inset 0 0 22px rgba(0,0,0,.35); }
.gc-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.gc-art { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); width: 158px; height: 158px; object-fit: contain;
  filter: drop-shadow(0 5px 6px rgba(0,0,0,.35)) drop-shadow(0 0 1px rgba(0,0,0,.5)); }
.gc-from { position: absolute; left: 6px; top: 6px; display: flex; align-items: center; gap: 4px; background: rgba(255,250,235,.92); border-radius: 14px;
  padding: 2px 8px 2px 2px; font-size: 8px; color: #5a4a2a; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.gc-from img { width: 24px; height: 24px; object-fit: contain; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #c9a24a; }
.gc-from span { display: flex; flex-direction: column; line-height: 1.1; }
.gc-from b { font-size: 9.5px; color: #1d1a14; }
.gc-shinytag { position: absolute; right: 6px; top: 6px; font-size: 9px; font-weight: 800; letter-spacing: .5px; color: #5a3a00;
  background: linear-gradient(90deg, #fff6c0, #ffd860, #fff6c0); padding: 2px 7px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.gc-ribbon { font-size: 9.5px; font-style: italic; color: #4a3a1c; text-align: center; padding: 2px 8px; margin: 0 14px;
  background: linear-gradient(90deg, transparent, rgba(201,162,74,.55) 15%, rgba(246,223,150,.9) 50%, rgba(201,162,74,.55) 85%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-trait { font-size: 9.5px; line-height: 1.25; padding: 3px 7px; border-radius: 5px; background: rgba(255,255,255,.55); border: 1px solid rgba(160,120,40,.35);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gc-trait b { color: var(--c1d); margin-right: 5px; font-size: 10px; }
.gc-moves { display: flex; flex-direction: column; }
.gc-move { display: flex; align-items: center; gap: 6px; height: 21px; border-bottom: 1px solid rgba(140,110,50,.25); padding: 0 2px; }
.gc-move:last-child { border-bottom: 0; }
.gc-mname { flex: 1; font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-cat svg { width: 12px; height: 12px; display: block; }
.gc-pow { font: 800 15px/1 system-ui, sans-serif; min-width: 26px; text-align: right; }
.gc-eff { font-size: 10px; font-weight: 700; color: #3a6a9a; white-space: nowrap; }
.gc-move small { font-size: 8.5px; color: #7a6a4a; min-width: 26px; text-align: right; }

.gc-bottom { display: flex; gap: 6px; flex: 1; min-height: 0; }
.gc-radar { width: 104px; height: 104px; flex: 0 0 auto; margin-top: -4px; }
.gc-rl text { font: 700 6px system-ui, sans-serif; fill: #5a4a2a; text-anchor: middle; }
.gc-rl tspan { font-weight: 800; fill: #1d1a14; font-size: 7px; }
.gc-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 9px; }
.gc-bst { color: #5a4a2a; } .gc-bst b { color: #1d1a14; }
.gc-match { display: flex; align-items: center; gap: 3px; }
.gc-match span { width: 46px; font-weight: 700; color: #5a4a2a; font-size: 8.5px; }
.gc-match em { color: #8a7a5a; }
.gc-lore { flex: 1; font: italic 9.5px/1.3 Georgia, serif; color: #3a3020; border-top: 1px solid rgba(140,110,50,.35); padding-top: 3px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.gc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 8.5px; font-weight: 700; color: #6a5a3a; letter-spacing: .4px; padding: 0 2px; }
.gc-set { letter-spacing: 2px; }
.finish-gold .gc-rar, .finish-prism .gc-rar { color: #a87d2a; }

/* ---- light & foil ---- */
.gc-glare { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.55) 0%, rgba(255,255,255,.12) 25%, rgba(0,0,0,.18) 80%); mix-blend-mode: overlay; }
.gcard.active .gc-glare { opacity: 1; }
.gc-foil { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; mix-blend-mode: color-dodge;
  background: repeating-linear-gradient(115deg, #ff5a8a 0%, #ffd25a 6%, #5aff9a 12%, #5ad8ff 18%, #b45aff 24%, #ff5a8a 30%);
  background-size: 300% 300%; background-position: var(--mx, 50%) var(--my, 50%); filter: saturate(1.2) brightness(.8); }
.finish-gold .gc-foil { opacity: calc(.06 + var(--hyp, 0) * .18); }
.finish-prism .gc-foil { opacity: calc(.18 + var(--hyp, 0) * .3); }
.is-shiny .gc-foil { opacity: calc(.28 + var(--hyp, 0) * .35); }
.gc-back .gc-foil { opacity: calc(.04 + var(--hyp, 0) * .14); }
.finish-prism .gc-frame, .is-shiny .gc-frame { animation: gcPrism 6s linear infinite; }
@keyframes gcPrism { 0%, 100% { filter: hue-rotate(0deg) saturate(1.1); } 50% { filter: hue-rotate(25deg) saturate(1.35); } }
.is-shiny .gc-panel { background: radial-gradient(ellipse at 50% 0%, #fffef8 0%, #f8f1e0 55%, #efe2c0 100%); }

/* ---- Genodex grid of small cards ---- */
.gc-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px 12px; justify-items: center; }
.gc-thumb { position: relative; width: 180px; height: 252px; padding: 0; border: 0; background: none; border-radius: 10px; overflow: visible; transition: transform .2s; }
.gc-thumb:hover { transform: translateY(-4px) rotate(-1deg); }
.gc-thumb:hover .gc-face { box-shadow: 0 22px 50px rgba(0,0,0,.6), 0 0 0 3px rgba(125,255,216,.6); }
.gc-scale { width: 360px; height: 504px; zoom: .5; position: relative; pointer-events: none; }
.gc-thumb .gc-face { box-shadow: 0 8px 20px rgba(0,0,0,.5); }
.gc-painting, .gc-warn, .gc-caught { position: absolute; z-index: 2; font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.gc-painting { left: 8px; bottom: -8px; background: var(--accent2, #f0c040); color: #1a1a1a; }
.gc-warn { right: 8px; bottom: -8px; background: #f05050; color: #fff; }
.gc-caught { right: -4px; top: -6px; background: #22c39a; color: #062018; }

/* ---- enlarged viewer ---- */
#card-view { position: fixed; inset: 0; z-index: 60; background: radial-gradient(ellipse at 50% 40%, rgba(30,50,80,.92), rgba(4,8,14,.97));
  display: flex; flex-direction: column; align-items: center; justify-content: center; animation: cvIn .2s ease-out; }
@keyframes cvIn { from { opacity: 0; } }
.cv-stage { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; }
.cv-stage .gcard { transform-origin: center; }
.cv-arrow { position: absolute; top: 50%; transform: translateY(-50%); font-size: 42px; line-height: 1; width: 54px; height: 80px; border-radius: 12px;
  background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.15); }
.cv-arrow:hover { background: rgba(255,255,255,.18); }
.cv-prev { left: 18px; } .cv-next { right: 18px; }
.cv-bar { display: flex; gap: 8px; align-items: center; padding: 10px 14px 16px; }
.cv-bar button { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.cv-bar button.on { background: linear-gradient(90deg, #fff6c0, #ffd860); color: #3a2a00; }
.cv-bar small { opacity: .6; font-size: 11px; margin-left: 3px; }
.cv-count { color: #aab; font-size: 13px; min-width: 50px; text-align: center; }
@media (max-width: 700px) { .cv-arrow { width: 36px; font-size: 28px; } .cv-prev { left: 4px; } .cv-next { right: 4px; } }
