/* ========================================================
   Desi Cards Royale - Cards Styling & 3D Shaders
   ======================================================== */

:root {
  --card-width: 82px;
  --card-height: 122px;
  --card-radius: 8px;
  --gold-foil: linear-gradient(135deg, #ffd700, #b45309, #fef08a, #d97706);
  --card-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

@media (max-width: 600px) {
  :root {
    --card-width: 64px;
    --card-height: 96px;
    --card-radius: 6px;
  }
}

/* Card Root Item */
.card-item {
  width: var(--card-width);
  height: var(--card-height);
  position: relative;
  perspective: 800px;
  user-select: none;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2), box-shadow 0.22s ease;
  flex-shrink: 0;
}

.card-item:hover {
  transform: translateY(-8px) scale(1.04);
  z-index: 20;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

/* Card Front Face */
.card-front {
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: var(--card-radius);
  border: 1.5px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 6px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  font-family: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

/* Suits Color */
.suit-red {
  color: #dc2626;
}
.suit-black {
  color: #0f172a;
}

/* Corner Index */
.card-index {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.card-index.top-left {
  align-self: flex-start;
}

.card-index.bottom-right {
  align-self: flex-end;
  transform: rotate(180deg);
}

.rank-char {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.suit-icon {
  font-size: 0.9rem;
  margin-top: 1px;
}

/* Card Center Art */
.card-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.center-suit-art {
  font-size: 1.8rem;
  opacity: 0.95;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.royal-face-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.6rem;
}

.royal-title {
  font-size: 0.55rem;
  font-weight: 800;
  background: var(--gold-foil);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: -2px;
}

.royal-ace-art {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ace-symbol {
  font-size: 2.2rem;
  line-height: 1;
}
.ace-label {
  font-size: 0.55rem;
  font-weight: 900;
  color: #94a3b8;
}

.dehla-art, .satti-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 900;
}
.dehla-num, .satti-num {
  font-size: 1.3rem;
  line-height: 1;
}
.dehla-symbol, .satti-symbol {
  font-size: 1.1rem;
}

/* Badges for 10s and 7s */
.card-corner-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.5rem;
  font-weight: 900;
  padding: 1px 4px;
  border-radius: 4px;
  text-transform: uppercase;
}
.mendi-badge {
  background: #f59e0b;
  color: #000;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}
.seven-badge {
  background: #10b981;
  color: #fff;
}

/* Court Cards SVG & Labels */
.card-front.is-court-card {
  padding: 3px 4px;
}

.center-suit-art.face-card-art {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.court-svg-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.court-svg {
  width: 100%;
  height: 100%;
  max-width: 58px;
  max-height: 72px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.court-desi-label {
  position: absolute;
  bottom: 0px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffd700;
  font-size: 0.52rem;
  font-weight: 800;
  padding: 0.5px 5px;
  border-radius: 4px;
  border: 0.8px solid rgba(255, 215, 0, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 2;
  white-space: nowrap;
}

/* Gold Face Skin */
.card-front.court-gold-face {
  background: radial-gradient(circle at 50% 50%, #171c28, #090d16) !important;
  border-color: #ffd700 !important;
  color: #ffd700 !important;
  box-shadow: inset 0 0 12px rgba(255, 215, 0, 0.25);
}
.card-front.court-gold-face .rank-char,
.card-front.court-gold-face .suit-icon {
  color: #ffd700 !important;
  text-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

@media (max-width: 600px) {
  .court-svg {
    max-width: 44px;
    max-height: 56px;
  }
  .court-desi-label {
    font-size: 0.42rem;
    padding: 0 3px;
    bottom: -1px;
  }
}

/* Dynamic Card Back Faces */
.card-back {
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1.5px solid #d97706;
}

.back-art-classic, .back-art-taj, .back-art-mandala, .back-art-crimson {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-svg-classic, .back-svg-taj, .back-svg-mandala, .back-svg-crimson {
  width: 100%;
  height: 100%;
  display: block;
}

.back-title-label {
  position: absolute;
  bottom: 4px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffd700;
  font-size: 0.45rem;
  font-weight: 800;
  padding: 0 4px;
  border-radius: 3px;
  border: 0.5px solid rgba(255, 215, 0, 0.4);
  letter-spacing: 0.5px;
  pointer-events: none;
}

/* Interactive States */
.card-item.selected-elevated {
  transform: translateY(-24px) scale(1.06);
  z-index: 30;
}
.card-item.selected-elevated .card-inner {
  border-color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.85), 0 12px 24px rgba(0, 0, 0, 0.6);
}

.card-item.playable-card-pulse {
  transform: translateY(-10px);
  cursor: pointer;
  z-index: 15;
}
.card-item.playable-card-pulse .card-inner {
  border: 2px solid #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.75), 0 8px 20px rgba(0, 0, 0, 0.4);
}

.card-item.hand-card-idle {
  opacity: 1 !important;
  filter: none !important;
  transform: translateY(0);
}
.card-item.hand-card-idle .card-inner {
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.card-item.unplayable-card-dim {
  opacity: 0.88;
  filter: brightness(0.92);
  cursor: not-allowed;
  transform: translateY(0);
}

.card-item.matching-target-rank .card-front {
  border-color: #f59e0b;
  box-shadow: inset 0 0 8px rgba(245, 158, 11, 0.35);
}

/* Discard Pile Stacked Cards */
.stacked-card {
  width: var(--card-width);
  height: var(--card-height);
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.3s ease;
}

/* Bot Fanned Mini Cards */
.bot-fanned-cards {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin-top: 4px;
  position: relative;
}

.bot-mini-card {
  width: 24px;
  height: 36px;
  background: #1e1b4b;
  border: 1px solid #ffd700;
  border-radius: 4px;
  margin-left: -14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  background-image: repeating-linear-gradient(45deg, #b45309 0px, #b45309 2px, #0f172a 2px, #0f172a 6px);
}

/* Authentic Full-Bleed Tournament Playing Cards & Asset Backs */
.card-front.card-full-art {
  padding: 0 !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-full-vector-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  border-radius: var(--card-radius);
  pointer-events: none;
}

.card-back-asset-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--card-radius);
  pointer-events: none;
}

.trump-candidate-pulse {
  animation: trumpPulse 1.5s infinite alternate ease-in-out;
}

@keyframes trumpPulse {
  0% { box-shadow: 0 0 8px rgba(251, 191, 36, 0.4); transform: translateY(-2px); }
  100% { box-shadow: 0 0 22px rgba(251, 191, 36, 0.95); transform: translateY(-6px); }
}

.trump-candidate-badge {
  background: linear-gradient(135deg, #f59e0b, #b45309) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5) !important;
}

/* Corner Index Badges for Full-Art Custom Faces & Number Cards */
.card-corner-index {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 2px 4px;
  background: #ffffff;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.15);
  z-index: 10;
  pointer-events: none;
  font-family: 'Chakra Petch', 'Space Grotesk', system-ui, sans-serif;
  user-select: none;
}

.card-corner-index.top-left {
  top: 2px;
  left: 2px;
}

.card-corner-index.bottom-right {
  display: none;
}

.card-corner-index .corner-rank {
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1;
}

.card-corner-index .corner-suit {
  font-size: 0.82rem;
  line-height: 1;
  margin-top: 1px;
}

.card-corner-index.suit-red {
  color: #dc2626 !important;
}

.card-corner-index.suit-black {
  color: #0f172a !important;
}

@media (max-width: 600px) {
  .card-corner-index {
    padding: 2px 3px;
    border-radius: 4px;
    top: 2px;
    left: 2px;
  }
  .card-corner-index .corner-rank {
    font-size: 0.82rem;
    font-weight: 900;
  }
  .card-corner-index .corner-suit {
    font-size: 0.74rem;
  }
}


