/* ================= Cadico: carta del personaje ================= */
.cadico-fondo { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(14, 9, 6, .72); backdrop-filter: blur(6px); animation: cd-fondo .3s ease both; }
.cadico-fondo[hidden] { display: none; }
@keyframes cd-fondo { from { opacity: 0; } }
.cd-escena { --c: #d99c74; position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; perspective: 1400px;
  --w: min(88vw, 360px, calc((100dvh - 90px) * 5 / 7)); width: var(--w); }
.cd-carta { position: relative; width: var(--w); aspect-ratio: 5 / 7; cursor: pointer; border-radius: 5%/3.6%; outline: none;
  animation: cd-entra .75s cubic-bezier(.2, .8, .25, 1) both; filter: drop-shadow(0 22px 40px rgba(0, 0, 0, .55)); }
.cd-carta:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--c); }
@keyframes cd-entra { 0% { transform: translateY(60px) rotateY(-360deg) scale(.55); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.cd-giro { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.3, .7, .2, 1); }
.cd-giro.volteada { transform: rotateY(180deg); }
.cd-cara { position: absolute; inset: 0; overflow: hidden; border-radius: 5%/3.6%; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 7px solid var(--c); background: #1b120d; color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.cd-dorso { transform: rotateY(180deg); }

/* Frente: el arte cubre toda la carta y los datos van encima, sobre un degradado para que se lean con cualquier dibujo */
.cd-arte { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.sin-arte { background: radial-gradient(120% 90% at 50% 25%, color-mix(in srgb, var(--c) 55%, #000) 0%, #1b120d 80%); }
.cd-vacia { position: absolute; left: 50%; top: 34%; width: 52%; transform: translate(-50%, -50%); filter: invert(1); opacity: .55; }
.cd-velo { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8, 5, 3, .94) 0%, rgba(8, 5, 3, .78) 24%, rgba(8, 5, 3, 0) 56%),
  linear-gradient(to bottom, rgba(8, 5, 3, .55) 0%, rgba(8, 5, 3, 0) 16%); }
.cd-brillo { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: .8;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .55) 45%, rgba(255, 220, 255, .3) 50%, transparent 62%); background-size: 250% 100%;
  animation: cd-brillo 1.6s .5s ease-out both; }
@keyframes cd-brillo { from { background-position: 130% 0; } to { background-position: -40% 0; } }
.cd-etq { position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  background: rgba(8, 5, 3, .72); border: 1px solid rgba(255, 255, 255, .3); }
.cd-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 5px; text-shadow: 0 1px 4px rgba(0, 0, 0, .9); }
.cd-info h2 { margin: 0; font-family: Cinzel, Georgia, serif; font-size: clamp(21px, 7.6vw, 29px); line-height: 1.05; overflow-wrap: anywhere; }
.cd-info em { font-size: 13px; opacity: .9; }
.cd-rango { align-self: flex-start; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #2b1c00; text-shadow: none;
  background: linear-gradient(135deg, #ffe08a, #f2b134); }
.cd-rev { align-self: flex-start; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; text-shadow: none; background: rgba(60, 90, 160, .92); border: 1px solid rgba(255, 255, 255, .5); }
.cd-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cd-chips span { padding: 2px 9px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); text-shadow: none; }
.cd-pie { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 3px; font-size: 13px; font-weight: 700; }
.cd-est { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 12px; opacity: .95; }
.cd-est img { width: 22px; height: 22px; object-fit: contain; border-radius: 50%; background: rgba(255, 255, 255, .85); }

/* Dorso: logo, poder y mediciones */
.cd-dorso { display: flex; flex-direction: column; align-items: center; padding: 14px 14px 12px; gap: 6px; text-align: center;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--c) 45%, #1b120d) 0%, #1b120d 70%); }
.cd-logo { width: 40%; aspect-ratio: 1; max-height: 28%; object-fit: contain; padding: 7px; border-radius: 50%; background: #f6e9d8; box-shadow: 0 0 0 3px var(--c), 0 6px 16px rgba(0, 0, 0, .5); }
.cd-dorso h3 { margin: 0; font-family: Cinzel, Georgia, serif; font-size: 17px; overflow-wrap: anywhere; }
.cd-poder-grande { display: flex; align-items: baseline; gap: 8px; }
.cd-poder-grande small { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.cd-poder-grande b { font-size: 32px; line-height: 1; color: #ffd98a; }
.cd-filas { width: 100%; flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.cd-fila { display: grid; grid-template-columns: 38% 1fr auto; align-items: center; gap: 6px; font-size: 11.5px; text-align: left; }
.cd-fila span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-fila i { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.cd-fila i b { display: block; height: 100%; border-radius: inherit; }
.cd-fila em { font-style: normal; font-weight: 700; min-width: 46px; text-align: right; }
.cd-sin { opacity: .7; font-size: 13px; }

/* Menú ☰ (fuera de la carta para que no gire con ella) */
.cd-menu { position: absolute; top: -4px; right: -4px; z-index: 3; }
.cd-menu-btn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .85); background: rgba(20, 12, 8, .88); color: #fff; font-size: 20px; cursor: pointer; }
.cd-menu-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.cd-menu-panel { position: absolute; top: 50px; right: 0; min-width: 190px; display: flex; flex-direction: column; padding: 6px; border-radius: 14px;
  background: #241812; border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 14px 34px rgba(0, 0, 0, .6); }
.cd-menu-panel[hidden] { display: none; }
.cd-menu-panel button { min-height: 44px; padding: 0 12px; text-align: left; border: 0; border-radius: 10px; background: none; color: #f6ebdc; font: inherit; cursor: pointer; }
.cd-menu-panel button:hover, .cd-menu-panel button:focus-visible { background: rgba(255, 255, 255, .14); outline: none; }
.cd-ayuda { margin: 0; color: rgba(255, 255, 255, .75); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  .cd-carta { animation: cd-fondo .25s ease both; }
  .cd-giro { transition: none; }
  .cd-brillo { animation: none; opacity: 0; }
}
