/* Juegitos - Card Styles & SVGs */

.solitaire-card {
  position: absolute;
  width: 100%;
  max-width: var(--card-width);
  height: var(--card-height);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  touch-action: none;
}

.solitaire-card.can-move:hover {
  filter: brightness(1.05);
}

.solitaire-card.selected-glow {
  transform: translateY(-8px);
  box-shadow: 0 0 12px 3px rgba(245, 158, 11, 0.9), 0 8px 16px rgba(0, 0, 0, 0.5);
  z-index: 999 !important;
}

.solitaire-card.hint-glow {
  animation: hintPulse 0.8s ease-in-out infinite alternate;
}

@keyframes hintPulse {
  from {
    box-shadow: 0 0 6px 2px #f59e0b;
    transform: scale(1);
  }
  to {
    box-shadow: 0 0 16px 5px #f59e0b;
    transform: scale(1.04);
  }
}

.solitaire-card.is-dragging {
  opacity: 0.6;
  transform: scale(1.06);
  z-index: 1000 !important;
}

/* ========================================================
   CARD BACKS (Burgundy Spider & Pinstripes)
======================================================== */
.card-back {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background-color: #7a111a; /* Burgundy/Maroon as in screenshot */
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back-border {
  width: 100%;
  height: 100%;
  border: 1.5px solid #ffffff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Stock Pile: Centered White Spider */
.stock-card-back .spider-emblem {
  width: 60%;
  height: 60%;
}

/* Tableau: Horizontal White Pinstripes */
.tableau-card-back .pinstripe-bg {
  background: repeating-linear-gradient(
    0deg,
    #7a111a,
    #7a111a 3px,
    rgba(255, 255, 255, 0.9) 3px,
    rgba(255, 255, 255, 0.9) 4.5px
  );
}

/* ========================================================
   CARD FACES
======================================================== */
.card-face {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 4px;
  position: relative;
  overflow: hidden;
}

.card-face.card-red {
  color: #dc2626;
}

.card-face.card-black {
  color: #1e1e1e;
}

.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.card-rank {
  font-size: clamp(0.75rem, 2.5vw, 1.05rem);
  font-weight: 700;
  margin-bottom: 1px;
}

.corner-bottom-right {
  transform: rotate(180deg);
}

.card-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.royalty-art {
  width: 75%;
  height: 75%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================================
   FOUNDATION & STOCK STACKS
======================================================== */
.foundation-slot {
  width: 100%;
  max-width: var(--card-width);
  height: var(--card-height);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.foundation-spider-watermark {
  width: 65%;
  height: 65%;
}

.foundation-completed-card {
  position: absolute;
  top: 0;
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  animation: foundationSweep 0.5s ease-out;
}

@keyframes foundationSweep {
  0% { transform: scale(1.2) translateY(-20px); }
  100% { transform: scale(1) translateY(0); }
}

.stock-fanned-card {
  position: absolute;
  top: 0;
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 6px;
  box-shadow: -2px 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.stock-area:hover .stock-fanned-card {
  transform: translateY(-2px);
}

.empty-stock-placeholder {
  width: var(--card-width);
  height: var(--card-height);
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.5rem;
}
