/* =========================================================================
   Thulladle — Theme & Feedback Styles (css/styles.css)
   Preserves original Bhabhi Thulla emerald felt aesthetic & card animations
   ========================================================================= */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(circle at 50% 20%, #064e3b 0%, #022c22 52%, #020617 100%);
  color: #f8fafc;
  min-height: 100vh;
  overflow-x: hidden;
}

.felt-surface {
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.16) 0%, rgba(6, 78, 59, 0.32) 60%, rgba(2, 44, 34, 0.7) 100%);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.65);
}

.playing-card {
  position: relative;
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 65%, #f1f5f9 100%);
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.24s ease, border-color 0.2s ease, opacity 0.2s ease;
  user-select: none;
  will-change: transform;
}

.playing-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  pointer-events: none;
}

@keyframes cardHoverBounce {
  0%   { transform: translateY(0) scale(1); }
  45%  { transform: translateY(-18px) scale(1.06) rotate(-1deg); }
  75%  { transform: translateY(-12px) scale(1.04) rotate(0.5deg); }
  100% { transform: translateY(-14px) scale(1.05) rotate(0deg); }
}

.playing-card:hover:not(:disabled) {
  animation: cardHoverBounce 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow: 0 20px 32px -8px rgba(0, 0, 0, 0.72), 0 0 18px rgba(52, 211, 153, 0.45);
  border-color: #10b981 !important;
  z-index: 20;
}

.playing-card:active:not(:disabled) {
  transform: translateY(-4px) scale(0.98) !important;
  animation: none;
}

/* Face-Down Card Back Model (used in Opponent Fans, Menu Logo & Right-Side Messy Discard Pile) */
.card-back-pattern {
  background-color: #064e3b;
  background-image:
    radial-gradient(#10b981 18%, transparent 19%),
    radial-gradient(#047857 18%, transparent 19%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
  position: relative;
}

.card-back-pattern::after {
  content: "♠";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}

/* Left-to-Right Trick Card Deal & End-of-Turn Gather + Sweep Animations */
@keyframes dealFromLeft {
  0%   { transform: translateX(-28px) translateY(-14px) scale(0.82) rotate(-6deg); opacity: 0; }
  100% { transform: translateX(0) translateY(0) scale(1) rotate(0deg); opacity: 1; }
}

.animate-deal-ltr {
  animation: dealFromLeft 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Phase 1 of End-of-Trick: Cards slide from left into one gathered stack */
.trick-gather-stack .trick-card-slot {
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), margin 0.42s ease, opacity 0.42s ease;
  margin-left: -58px !important;
  transform: translateX(24px) scale(0.94) rotate(3deg);
}
.trick-gather-stack .trick-card-slot:first-child {
  margin-left: 0 !important;
}

/* Phase 2 of End-of-Trick: Gathered stack slides right into the Messy Discard Pile! */
@keyframes slideStackToDiscardRight {
  0%   { transform: translateX(0) scale(0.95) rotate(2deg); opacity: 1; }
  60%  { transform: translateX(180px) translateY(-8px) scale(0.75) rotate(14deg); opacity: 0.9; }
  100% { transform: translateX(290px) translateY(-16px) scale(0.45) rotate(25deg); opacity: 0; }
}

.trick-sweep-to-discard {
  animation: slideStackToDiscardRight 0.52s cubic-bezier(0.55, 0.05, 0.67, 0.19) forwards;
}

/* Thulla Pickup Sweep (slides upward/into victim's hand instead of discard pile) */
@keyframes slideStackToThullaPickup {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.08) rotate(-6deg); opacity: 0.95; }
  100% { transform: translateY(-75px) scale(0.55) rotate(-16deg); opacity: 0; }
}

.trick-sweep-to-pickup {
  animation: slideStackToThullaPickup 0.55s cubic-bezier(0.55, 0.05, 0.67, 0.19) forwards;
}

@keyframes pulseDiscardPile {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1) rotate(3deg); }
  100% { transform: scale(1); }
}

.animate-discard-receive {
  animation: pulseDiscardPile 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-green-glow {
  border: 3px solid #22c55e !important;
  box-shadow: 0 0 22px rgba(34, 197, 94, 0.55) !important;
}

.card-yellow-glow {
  border: 3px solid #eab308 !important;
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.5) !important;
}

.card-gray-glow {
  border: 3px solid #ef4444 !important;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.45) !important;
  opacity: 0.78;
}

.card-illegal-suit {
  opacity: 0.42;
  filter: grayscale(45%);
}

@keyframes popCard {
  0% { transform: scale(0.8) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.animate-card {
  animation: popCard 0.26s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes shakeCard {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px) rotate(-2deg); }
  75% { transform: translateX(6px) rotate(2deg); }
}

.animate-shake {
  animation: shakeCard 0.32s ease-in-out;
}

.adsense-slot-wrapper {
  min-height: 76px;
  background: rgba(2, 6, 23, 0.65);
  border: 1px solid rgba(16, 185, 129, 0.22);
}
