/* Baloot Majlis Custom Styling */

:root {
  --felt-base: #15222e;
  --felt-border: #4d2f19;
  --wood-grain: #5a371c;
  --gold-primary: #d4af37;
  --gold-accent: #f3e5ab;
  --card-w: 52px;
  --card-h: 78px;
}

@media (min-width: 640px) {
  :root {
    --card-w: 64px;
    --card-h: 94px;
  }
}

/* Background Atmosphere */
body {
  background: radial-gradient(circle at center, #1b2632 0%, #0c1219 75%, #05080c 100%);
}

/* Online panel rows: keep long handles from pushing the score out of view */
#online-lb-list > div { min-height: 30px; }

/* Table Style: Rich Velvet Felt with Oak Carved Border */
.baloot-table {
  background: radial-gradient(circle at center, #1e2c3b 0%, #15202b 60%, #101923 100%);
  border: 12px solid #4a2d18;
  outline: 3px solid rgba(212, 175, 55, 0.4);
  box-shadow: 
    inset 0 0 40px rgba(0, 0, 0, 0.8),
    0 20px 50px rgba(0, 0, 0, 0.9);
}

@media (min-width: 640px) {
  .baloot-table {
    border-width: 16px;
  }
}

/* Authentic Baloot Playing Card */
.baloot-card {
  width: var(--card-w);
  height: var(--card-h);
  background: #fdfbf7;
  border-radius: 6px;
  border: 1px solid #dcd3c5;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 4px;
  font-family: 'Cairo', sans-serif;
  user-select: none;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.18s ease;
  cursor: pointer;
  backface-visibility: hidden;
}

.baloot-card.red {
  color: #c92a2a;
}
.baloot-card.black {
  color: #1a1a1a;
}

/* Card indices */
.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.card-val {
  font-weight: 900;
  font-size: 13px;
}
.card-suit {
  font-size: 11px;
}
.card-center {
  align-self: center;
  font-size: 20px;
  line-height: 1;
}

/* Card Back (Opponents) */
.baloot-card-back {
  width: 32px;
  height: 44px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.4);
  background: linear-gradient(135deg, #7a1b1b 25%, #992323 50%, #7a1b1b 75%);
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  background-size: 6px 6px;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,0.1) 0, rgba(255,255,255,0.1) 1px, transparent 0, transparent 50%);
}

.opp-cards-v .baloot-card-back {
  width: 40px;
  height: 28px;
}

/* Human Card Hover & Playable States */
.player-card {
  transform-origin: bottom center;
}
.player-card:not(.disabled):hover,
.player-card:not(.disabled):active {
  transform: translateY(-16px) scale(1.08) !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 175, 55, 0.6);
  z-index: 40 !important;
}

.player-card.disabled {
  opacity: 0.45;
  filter: grayscale(0.6);
  cursor: not-allowed;
}

.player-card.highlight {
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.8);
}

/* Trick Slot Positions inside Center Arena */
.trick-card-slot {
  position: absolute;
  width: var(--card-w);
  height: var(--card-h);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  items-center: center;
  justify-content: center;
}
.slot-north { top: 8px; transform: translateY(0); }
.slot-south { bottom: 8px; transform: translateY(0); }
.slot-west  { left: 10px; transform: translateX(0); }
.slot-east  { right: 10px; transform: translateX(0); }

/* Buttons */
.btn-gold {
  background: linear-gradient(135deg, #d4af37 0%, #aa8010 100%);
  color: #1a1205;
  border: 1px solid #f6e27a;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.btn-gold:hover {
  filter: brightness(1.1);
}

.btn-hokum {
  background: linear-gradient(135deg, #2b7a78 0%, #174d4b 100%);
  color: #def2f1;
  border: 1px solid #3aafa9;
}

.btn-wood {
  background: linear-gradient(135deg, #4a2d18 0%, #2f1b0e 100%);
  color: #eedec8;
  border: 1px solid #7c4d29;
}

.btn-pass {
  background: #1f2937;
  border: 1px solid #374151;
}

.suit-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1c2734;
  border: 1px solid rgba(212,175,55,0.4);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background-color 0.15s;
}
.suit-btn:active {
  transform: scale(0.92);
  background: #2b394a;
}

/* Dealer Chip */
.dealer-chip {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d4af37;
  color: #1a1205;
  font-weight: 900;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Active Turn Pulse on Player Avatars */
.player-avatar.active-turn .avatar-ring {
  box-shadow: 0 0 0 3px #d4af37, 0 0 15px #d4af37;
  animation: pulse-ring 1.4s infinite ease-in-out;
}

@keyframes pulse-ring {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Keyframe animations */
@keyframes fadePop {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}
.animate-fade-pop {
  animation: fadePop 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes scaleIn {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}
.animate-scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Difficulty Cards & Selection State */
.difficulty-card {
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.difficulty-card:hover {
  background: #172433;
  border-color: rgba(212, 175, 55, 0.4);
}
.difficulty-card.active {
  background: linear-gradient(135deg, #18283a 0%, #1a2330 100%);
  border-color: #d4af37;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.25), inset 0 0 10px rgba(212, 175, 55, 0.1);
}
.difficulty-card.active .diff-check {
  opacity: 1 !important;
}

/* Atmosphere Items: Traditional Tea Glass */
.tea-glass {
  width: 26px;
  height: 42px;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px 4px 12px 12px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.5);
}
.tea-liquid {
  position: absolute;
  bottom: 2px;
  left: 2px;
  right: 2px;
  height: 70%;
  background: linear-gradient(to top, #7d1111, #b52a1d);
  border-radius: 2px 2px 8px 8px;
}
.tea-steam {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 12px;
  background: rgba(255,255,255,0.3);
  filter: blur(2px);
  border-radius: 50%;
  animation: steam-rise 2s infinite ease-out;
}
@keyframes steam-rise {
  0% { transform: translate(-50%, 0) scaleX(1); opacity: 0; }
  50% { opacity: 0.6; }
  100% { transform: translate(-50%, -12px) scaleX(2); opacity: 0; }
}

/* Misbaha Beads */
.beads-chain {
  width: 48px;
  height: 30px;
  border: 4px dashed #d97706;
  border-radius: 50%;
  transform: rotate(-25deg);
  opacity: 0.85;
}