/* ===== Tarot Game (isolé .tg-*) ======================================= */

.tg-root{
  margin-top: 8px;               /* compact */
  grid-column: 1 / -1;
}

/* Conteneur resserré */
.tg-table{
  position: relative;
  width: 100%;
  border-radius: 10px;
  padding: 8px;                  /* ↓ padding */
  border: 2px dashed rgba(255,255,255,0.7);
  background:
    radial-gradient(120% 120% at 10% 0%, rgba(255,255,255,0.15), transparent 40%),
    radial-gradient(100% 140% at 100% 100%, rgba(0,0,0,0.10), transparent 50%),
    rgba(255,182,193,0.18);
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}

.tg-deck{
  position: relative;
  width: 100%;
  /* + hauteur -> + marge en haut, évite le clipping pendant le shuffle */
  height: clamp(240px, 42vw, 520px);
  overflow: hidden;
}

/* Sparkles sous les cartes, légèrement sous-centré pour “dépasser” */
.tg-sparkles{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-40%);
  width: clamp(120px, 24vw, 260px);
  height: auto;
  opacity: .9;
  z-index: 1; /* sous les cartes (les cartes seront au-dessus) */
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

/* ===== Instructions / Messages (même place, en haut) =================== */

.tg-instructions{
  position: relative;
  z-index: 2001;                /* > cartes */
  display: block;
  max-width: 92%;
  margin: 2px auto 6px;         /* espace réservé au-dessus du deck */
  padding: 6px 12px;
  border: 1px dashed rgba(255,255,255,0.85);
  background: rgba(20,20,20,0.28);
  color: #fff;
  border-radius: 6px;
  font: 400 13px/1.25 "Caslon3", serif;
  font-style: italic;
  text-align: center;
  /* multi-lignes + hauteur réservée pour les significations (≈ 3 lignes) */
  white-space: normal;
  min-height: calc(1.25em * 3 + 12px);
  pointer-events: none;
  opacity: .95;
}

/* Ancien message centré : plus utilisé → forcé masqué */
.tg-message{ display: none !important; }

/* ===== Cartes ========================================================== */

.tg-card{
  position: absolute;
  width: clamp(144px, 21vw, 258px);              /* taille entre-deux */
  height: calc(clamp(144px, 21vw, 258px) * 1.62);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.70);
  background-color: #fff;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform .55s cubic-bezier(.2,.8,.2,1),
              left .55s cubic-bezier(.2,.8,.2,1),
              top .55s cubic-bezier(.2,.8,.2,1);
  will-change: transform, left, top;
  backface-visibility: hidden;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.16);
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.tg-card.is-back{ background-image: var(--tg-back); }
.tg-card.is-deep{ box-shadow: 0 1px 3px rgba(0,0,0,0.10); }
.tg-card.is-selected{ z-index: 999; box-shadow: 0 4px 10px rgba(0,0,0,0.22); }

@keyframes tg-wiggle {
  0%   { transform: translate(-50%,-50%) rotate(-2deg); }
  50%  { transform: translate(-50%,-50%) rotate(2deg); }
  100% { transform: translate(-50%,-50%) rotate(0deg); }
}
.tg-card.is-shuffling{ animation: tg-wiggle .24s ease-in-out infinite alternate; }

.tg-root.is-spread .tg-card{ transition-duration: .65s; }
.tg-root.is-compacting .tg-card{ transition-duration: .55s; }

/* Micro reset local */
.tg-root *{ box-sizing: border-box; }
