/* ===== CARD STYLES & ANIMATIONS — Ponto de Decisão ===== */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap');

/* CSS Custom Properties for Colors */
:root {
  --smoke-white: #edf2f4;
  --obsidian: #0f0f1a;
  --midnight-blue: #16213e;
  --alchemy-gold: #c9a227;
  --suit-spades: #1a1a2e;
  --suit-hearts: #c1121f;
  --suit-diamonds: #c9a227;
  --suit-clubs: #2d6a4f;
  --transition-smooth: 0.3s ease;
}

/* Base Card Styles — Premium Cards */
.card {
  width: clamp(60px, 9vw, 120px);
  height: clamp(84px, 12.6vw, 168px);
  background: linear-gradient(135deg, #fafbfc 0%, var(--smoke-white) 100%);
  color: #1a1a2e;
  border: 2px solid rgba(22, 33, 62, 0.5);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
  animation: cardDeal 0.5s ease-out;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Card Face Typography */
.card-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  z-index: 2;
}

.card-rank {
  font-size: clamp(18px, 2.8vw, 36px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}

.card-suit {
  font-size: clamp(11px, 1.5vw, 20px);
  line-height: 1;
}

/* Card Suit Colors */
.card.suit-spades .card-rank,
.card.suit-spades .card-suit {
  color: var(--suit-spades);
}

.card.suit-hearts .card-rank,
.card.suit-hearts .card-suit {
  color: var(--suit-hearts);
}

.card.suit-diamonds .card-rank,
.card.suit-diamonds .card-suit {
  color: var(--suit-diamonds);
}

.card.suit-clubs .card-rank,
.card.suit-clubs .card-suit {
  color: var(--suit-clubs);
}

/* Card Back Styles */
.card-back {
  width: clamp(60px, 9vw, 120px);
  height: clamp(84px, 12.6vw, 168px);
  background: linear-gradient(
    45deg,
    var(--midnight-blue) 25%,
    var(--obsidian) 25%,
    var(--obsidian) 50%,
    var(--midnight-blue) 50%,
    var(--midnight-blue) 75%,
    var(--obsidian) 75%,
    var(--obsidian)
  );
  background-size: 16px 16px;
  border: 2px solid var(--alchemy-gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--alchemy-gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.card-back::before {
  content: '◆';
  font-size: 24px;
  opacity: 0.6;
}

.card-back:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  border-color: #d4a053;
}

/* ===== ANIMATIONS ===== */

/* Card Deal Animation */
@keyframes cardDeal {
  0% {
    opacity: 0;
    transform: translateY(-30px) rotateZ(-15deg) scale(0.8);
  }
  50% {
    transform: translateY(-5px) rotateZ(-5deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateZ(0) scale(1);
  }
}

/* Card Flip Animation for Showdown */
@keyframes cardFlip {
  0% {
    transform: rotateY(0deg);
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    transform: rotateY(180deg);
    opacity: 1;
  }
}

.card.flip {
  animation: cardFlip 0.6s ease-in-out;
}

/* Card Appear Animation */
@keyframes cardAppear {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.card.appear {
  animation: cardAppear 0.4s ease-out;
}

/* Card Bounce Animation (for winning hand) */
@keyframes cardBounce {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-8px);
  }
  50% {
    transform: translateY(-12px);
  }
  75% {
    transform: translateY(-6px);
  }
}

.card.bounce {
  animation: cardBounce 0.5s ease-in-out;
}

/* Card Fade Out Animation (for mucked hand) */
@keyframes cardFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0.3;
    transform: translateY(10px);
  }
}

.card.fadeout {
  animation: cardFadeOut 0.5s ease-out forwards;
}

/* Glow Effect for Important Cards */
@keyframes cardGlow {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 4px 24px rgba(201, 162, 39, 0.4);
  }
}

.card.glow {
  animation: cardGlow 1.5s ease-in-out infinite;
}

/* Dealing Sequence Animation */
@keyframes dealingSequence {
  0% {
    transform: translateX(-100px) translateY(-100px) rotateZ(-45deg);
    opacity: 0;
  }
  70% {
    transform: translateX(10px) translateY(10px) rotateZ(5deg);
    opacity: 1;
  }
  100% {
    transform: translateX(0) translateY(0) rotateZ(0);
    opacity: 1;
  }
}

.card.dealing-sequence {
  animation: dealingSequence 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== CARD SLOT (EMPTY CARD POSITION) ===== */

.card-slot {
  width: clamp(60px, 9vw, 120px);
  height: clamp(84px, 12.6vw, 168px);
  border: 2px dashed var(--steel-gray);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(141, 153, 174, 0.05);
  color: var(--steel-gray);
  font-size: 12px;
}

/* ===== CARD SIZING VARIANTS ===== */

/* Small Cards (for minimal spaces) */
.card.small {
  width: 80px;
  height: 112px;
}

.card.small .card-rank {
  font-size: 22px;
}

.card.small .card-suit {
  font-size: 12px;
}

.card-back.small {
  width: 80px;
  height: 112px;
  background-size: 12px 12px;
}

/* Large Cards (for detailed view) */
.card.large {
  width: 150px;
  height: 210px;
}

.card.large .card-rank {
  font-size: 48px;
}

.card.large .card-suit {
  font-size: 24px;
}

.card-back.large {
  width: 150px;
  height: 210px;
  background-size: 20px 20px;
  font-size: 18px;
}

/* ===== SPECIAL STATES ===== */

/* Community Card Highlight */
.card.community-card:hover {
  box-shadow: 0 8px 20px rgba(201, 162, 39, 0.3);
  border-color: var(--alchemy-gold);
}

/* Winning Hand Highlight */
.card.winning {
  border-color: var(--alchemy-gold);
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.5);
}

/* Mucked Hand Opacity */
.card.mucked {
  opacity: 0.4;
}

/* Disabled Card State */
.card:disabled,
.card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== RESPONSIVE CARD SIZING ===== */
/* Card dimensions now use clamp() for fluid scaling — no hard overrides needed */

@media (max-width: 768px) {
  /* Reduce hover effect on touch devices */
  .card:hover {
    transform: translateY(-3px);
  }

  .card-back {
    background-size: 10px 10px;
  }
}

/* ===== CARD TRANSITIONS ===== */

.card {
  transition: all 0.3s ease;
}

/* Smooth color transitions */
.card.suit-spades,
.card.suit-hearts,
.card.suit-diamonds,
.card.suit-clubs {
  transition: color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
