/* ==========================================================================
   BLACKJACK TABLE STYLESHEET
   Authentic Emerald Felt Table, 3D Dealing, Animated Shoe, Card Hover Lift
   ========================================================================== */

.table-view {
  width: 100%;
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 16px 40px;
  position: relative;
  overflow: hidden;
}

/* Authentic Emerald Green Casino Felt */
.table-blackjack {
  background: radial-gradient(ellipse 90% 70% at 50% 35%, #134e3a 0%, #0c3325 55%, #061912 100%);
  box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.85);
}

/* Felt table curve markings & golden typography */
.table-felt-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(ellipse 70% 45% at 50% 15%, transparent 68%, rgba(216, 178, 106, 0.18) 69%, transparent 70%),
    radial-gradient(ellipse 85% 55% at 50% 15%, transparent 68%, rgba(255, 255, 255, 0.08) 69%, transparent 70%);
}

.table-watermark {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  user-select: none;
  opacity: 0.22;
}

.table-watermark .wm-brand {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.table-watermark .wm-rules {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  margin-top: 4px;
}

/* Card Shoe (Deck holder top right) */
.card-shoe-graphic {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 90px;
  height: 120px;
  background: linear-gradient(135deg, #2b1f1d, #140d0c);
  border: 2px solid rgba(216, 178, 106, 0.4);
  border-radius: 8px 18px 8px 8px;
  box-shadow: -10px 14px 30px rgba(0, 0, 0, 0.7), inset 0 0 15px rgba(0, 0, 0, 0.8);
  transform: rotate(-12deg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 8px;
  z-index: 5;
}

.card-shoe-graphic .shoe-slot {
  height: 6px;
  background: #000;
  border-radius: 3px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.card-shoe-graphic .shoe-label {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  color: var(--gold);
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.1em;
}

/* ==========================================================================
   HANDS & CARD CONTAINERS
   ========================================================================== */

.hands-arena {
  width: min(1000px, 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  z-index: 10;
  margin-top: 10px;
}

.hand-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hand-label-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 11, 12, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.hand-score {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--gold);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.hand-score.blackjack {
  background: var(--gold);
  color: #111;
  box-shadow: 0 0 12px var(--gold-glow);
}

.hand-score.bust {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

.cards-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 145px;
  gap: 12px;
  padding: 10px;
  perspective: 1000px;
  flex-wrap: wrap;
}

/* ==========================================================================
   AUTHENTIC 3D PLAYING CARDS
   Hover-Lift Effect & Shuffling Deal Animations
   ========================================================================== */

.playing-card {
  --cw: 88px;
  width: var(--cw);
  aspect-ratio: 2.5 / 3.5;
  perspective: 1000px;
  position: relative;
  user-select: none;
  cursor: pointer;
  flex: none;
  /* Hover Lift Transition */
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  animation: dealSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Dealing Slide-In from Shoe */
@keyframes dealSlide {
  0% {
    opacity: 0;
    transform: translate(160px, -200px) rotate(25deg) scale(0.6);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
}

/* User requirement: "wenn man über eine karte hovert oder auswählt diese auch herausheben" */
.playing-card:hover {
  transform: translateY(-24px) scale(1.08) rotate(-1.5deg) !important;
  z-index: 50 !important;
  box-shadow: 0 20px 35px -6px rgba(0, 0, 0, 0.8),
              0 0 20px rgba(216, 178, 106, 0.45);
}

.playing-card.selected {
  transform: translateY(-28px) scale(1.1) !important;
  z-index: 60 !important;
  box-shadow: 0 24px 40px -4px rgba(0, 0, 0, 0.9),
              0 0 25px var(--gold-glow);
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 10px;
}

/* 3D Inner Card Flipper */
.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 10px;
}

.playing-card.down .card-inner {
  transform: rotateY(180deg);
}

/* Card Faces */
.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 12px 24px -8px rgba(0, 0, 0, 0.6);
}

/* Front Face: Crisp ivory texture, corner pips, central art */
.card-front {
  background: #fbfaf8;
  color: #1a1a1e;
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  overflow: hidden;
}

.card-front.red {
  color: #c8262c;
}

.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 800;
  line-height: 0.95;
  font-family: var(--font-sans);
}

.card-corner .rank {
  font-size: calc(var(--cw) * 0.22);
}

.card-corner .suit {
  font-size: calc(var(--cw) * 0.18);
}

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

.card-center-pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--cw) * 0.52);
  pointer-events: none;
}

/* Back Face: Intricate casino diamond lattice */
.card-back {
  transform: rotateY(180deg);
  background: repeating-linear-gradient(45deg, var(--accent) 0 3px, transparent 3px 8px),
              repeating-linear-gradient(-45deg, var(--accent) 0 3px, #18181c 3px 8px);
  border: 4px solid #fbfaf8;
}

/* ==========================================================================
   BETTING & ACTION CONTROLS
   ========================================================================== */

.table-controls {
  width: min(840px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 10;
  margin-top: 14px;
}

/* Betting Circle Area */
.bet-circle-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.bet-circle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px dashed rgba(216, 178, 106, 0.5);
  background: rgba(11, 11, 12, 0.4);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.bet-circle:hover {
  border-color: var(--gold);
  background: rgba(11, 11, 12, 0.65);
  transform: scale(1.04);
  box-shadow: 0 0 20px var(--gold-glow);
}

.bet-circle .bc-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.bet-circle .bc-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-top: 2px;
}

.bet-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Game Announcement Banner (You Win / Bust / Push) */
.table-announcement {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(17, 17, 19, 0.95);
  border: 2px solid var(--gold);
  padding: 16px 36px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px var(--gold-glow);
  z-index: 100;
  text-align: center;
  display: none;
  animation: bannerPop 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.table-announcement.show {
  display: block;
}

@keyframes bannerPop {
  0% { transform: translate(-50%, -50%) scale(0.7); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.table-announcement h3 {
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: var(--gold);
  font-weight: 800;
}

.table-announcement p {
  color: var(--text);
  font-size: 1.05rem;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .playing-card {
    --cw: 68px;
  }
  .bet-circle {
    width: 90px;
    height: 90px;
  }
}
