/* ===================================================
   KURO ARCANA — Cartes à jouer (.cj-*), Blackjack (.bj-*), Poker (.pk-*)
   =================================================== */

/* ---------- CARTES ---------- */
.cj-carte {
  --cj-l: 64px;
  position: relative;
  display: inline-flex;
  flex: none;
  width: var(--cj-l);
  height: calc(var(--cj-l) * 1.4);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.cj-petite { --cj-l: 46px; }

.cj-face {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 215, 0, 0.55);
  background: linear-gradient(160deg, #fffaf0, #f1e6d0);
  font-family: 'Cinzel', serif;
  font-weight: 700;
}

.cj-rouge { color: #b0102c; }
.cj-noire { color: #1a0a1f; }

.cj-coin {
  position: absolute;
  top: 4px;
  left: 5px;
  font-size: calc(var(--cj-l) * 0.22);
  line-height: 1;
  text-align: center;
}

.cj-coin-bas {
  top: auto;
  left: auto;
  right: 5px;
  bottom: 4px;
  transform: rotate(180deg);
}

.cj-centre {
  font-size: calc(var(--cj-l) * 0.5);
  line-height: 1;
}

.cj-figure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--cj-l) * 0.56);
  height: calc(var(--cj-l) * 0.76);
  border: 1px solid currentColor;
  border-radius: 6px;
  font-size: calc(var(--cj-l) * 0.36);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.35), transparent 70%);
}

.cj-dos {
  align-items: center;
  justify-content: center;
  border: 2px solid var(--or-pale);
  background:
    repeating-linear-gradient(45deg, rgba(153, 50, 204, 0.25) 0 6px, transparent 6px 12px),
    radial-gradient(circle at 50% 40%, var(--violet-royal), var(--noir-extreme) 75%);
}

.cj-dos-motif {
  font-size: calc(var(--cj-l) * 0.5);
  color: var(--or-dore);
  text-shadow: 0 0 10px var(--glow-or);
}

/* Distribution et retournement */
.cj-anim-distribuer {
  animation: cj-distribuer 0.35s ease-out both;
  animation-delay: calc(var(--cj-ordre, 0) * 0.12s);
}

.cj-anim-retourner {
  animation: cj-retourner 0.45s ease-out both;
}

@keyframes cj-distribuer {
  from { opacity: 0; transform: translateY(-60px) rotate(-8deg) scale(0.8); }
  to { opacity: 1; transform: none; }
}

@keyframes cj-retourner {
  from { transform: rotateY(90deg); }
  to { transform: rotateY(0); }
}

.cj-rangee {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: calc(64px * 1.4);
}

/* Table de jeu */
.cj-table {
  padding: 20px 16px;
  border: 2px solid rgba(255, 215, 0, 0.45);
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(107, 0, 128, 0.55), transparent 70%),
    radial-gradient(ellipse at 50% 100%, rgba(139, 0, 0, 0.45), transparent 70%),
    var(--noir-fonce);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8), 0 0 24px var(--glow-violet);
}

kbd {
  margin-left: 4px;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 0.7em;
  opacity: 0.7;
}

/* ---------- BLACKJACK ---------- */
.bj-regles {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  line-height: 1.5;
}

.bj-choix-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.bj-jeu {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bj-zone-croupier,
.bj-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bj-etiquette {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--or-dore);
  letter-spacing: 1px;
}

.bj-total {
  display: inline-block;
  min-width: 34px;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.bj-regle-table {
  margin: 14px 0;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: rgba(255, 215, 0, 0.55);
}

.bj-mains {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.bj-main {
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
}

.bj-main-active {
  border-color: var(--or-dore);
  box-shadow: 0 0 18px var(--glow-or);
}

.bj-mise-main {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
}

.bj-resultat {
  margin: 0;
  padding: 4px 14px;
  border-radius: 12px;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.6);
}

.bj-main-blackjack .bj-resultat,
.bj-main-gagne .bj-resultat { color: var(--or-dore); border: 1px solid var(--or-dore); }
.bj-main-perdu .bj-resultat { color: var(--rouge-lumineux); border: 1px solid var(--rouge-crimson); }
.bj-main-egalite .bj-resultat { color: #fff; border: 1px solid rgba(255, 255, 255, 0.5); }

.bj-barre,
.pk-barre {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: linear-gradient(0deg, rgba(10, 5, 5, 0.97), rgba(26, 10, 10, 0.9));
  border-top: 1px solid rgba(255, 215, 0, 0.3);
}

.bj-bilan {
  margin: 0 0 10px;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  min-height: 1.4em;
}

.bj-plafond { font-size: 0.85rem; color: var(--or-pale); }

.bj-actions,
.pk-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.bj-action,
.pk-action {
  min-height: 52px;
  padding: 10px 12px;
  letter-spacing: 1px;
}

/* ---------- POKER ---------- */
.pk-groupe {
  margin: 0 0 14px;
  padding: 0;
  border: none;
  text-align: center;
}

.pk-groupe legend {
  margin: 0 auto 8px;
  font-family: 'Cinzel', serif;
  color: var(--or-dore);
  letter-spacing: 1px;
}

.pk-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pk-option { min-height: 44px; }

.pk-jeu {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pk-entete {
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

.pk-alerte {
  display: block;
  margin-top: 4px;
  color: var(--or-dore);
}

.pk-table {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: 120px / 60px;
  padding: 22px 18px;
}

.pk-robots {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pk-siege {
  position: relative;
  flex: 1 1 0;
  max-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 14px;
  background: rgba(10, 5, 5, 0.55);
  min-width: 0;
}

.pk-siege-moi {
  align-self: center;
  width: min(100%, 320px);
  max-width: none;
}

.pk-siege-tour {
  border-color: var(--or-dore);
  box-shadow: 0 0 16px var(--glow-or);
}

.pk-siege-couche .pk-cartes { opacity: 0.35; filter: grayscale(0.7); }

.pk-siege-gagnant {
  border-color: var(--or-dore);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.18), rgba(10, 5, 5, 0.6));
}

.pk-siege-tete {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.pk-nom {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  color: var(--or-dore);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pk-nom small { color: rgba(255, 255, 255, 0.6); font-family: 'Poppins', sans-serif; font-weight: 400; }

.pk-bouton-d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: var(--noir-extreme);
  font-weight: 800;
  font-size: 0.75rem;
}

.pk-cartes { min-height: auto; gap: 4px; flex-wrap: nowrap; }

.pk-jetons,
.pk-etat {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.pk-jetons { color: #fff; font-weight: 600; }
.pk-etat { color: rgba(255, 255, 255, 0.7); min-height: 1.3em; }
.pk-etat strong { color: var(--or-dore); }

.pk-mise-tour {
  position: absolute;
  top: -10px;
  right: -6px;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--or-dore);
  background: radial-gradient(circle, var(--rouge-crimson), var(--rouge-sang));
  color: var(--or-dore);
  font-weight: 700;
  font-size: 0.8rem;
}

.pk-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pk-tableau { flex-wrap: nowrap; gap: 6px; min-height: auto; }

.pk-emplacement {
  border: 1px dashed rgba(255, 215, 0, 0.3);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: none;
}

.pk-pot {
  margin: 0;
  font-family: 'Cinzel', serif;
  color: #fff;
}

.pk-pot strong { color: var(--or-dore); }

.pk-relance {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pk-relance .mj-btn-petit { min-height: 44px; min-width: 44px; }

.pk-relance-valeur {
  min-width: 56px;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--or-dore);
}

.pk-tapis { background: linear-gradient(135deg, var(--rouge-crimson), var(--rouge-sang)); }

.pk-resume { font-size: 0.95rem; }

.pk-bilan-jetons {
  margin: 0;
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 1.6rem;
  color: var(--or-dore);
}

@media (max-width: 480px) {
  .cj-carte { --cj-l: 54px; }
  .cj-petite { --cj-l: 40px; }
  .cj-rangee { gap: 6px; min-height: calc(54px * 1.4); }
  .cj-table { padding: 16px 10px; border-radius: 20px; }
  .bj-actions,
  .pk-actions { grid-template-columns: repeat(2, 1fr); }
  kbd { display: none; }
  .bj-mains { gap: 8px; }
  .bj-main { padding: 8px 6px; }
  .bj-mains-2 .cj-carte { --cj-l: 44px; }
  .bj-mains-2 .cj-rangee { min-height: calc(44px * 1.4); }
  .pk-table { padding: 14px 8px; border-radius: 60px / 40px; }
  .pk-robots { gap: 6px; }
  .pk-siege { padding: 6px 4px; }
  .pk-tableau .cj-carte { --cj-l: 46px; }
  .pk-jetons,
  .pk-etat { font-size: 0.8rem; }
  .pk-nom { font-size: 0.85rem; }
  .pk-nom small { display: none; }
  .pk-robots .cj-petite { --cj-l: 34px; }
  .pk-relance { gap: 6px; flex-wrap: nowrap; }
  .pk-relance .mj-btn-petit { padding: 6px 8px; font-size: 0.8rem; letter-spacing: 0; }
  .pk-relance-valeur { min-width: 44px; font-size: 1.05rem; }
  .pk-action { font-size: 0.9rem; padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .cj-anim-distribuer,
  .cj-anim-retourner { animation: none; }
}
