/* =============================================================
   CYBERPUNK WATER MARGIN 108 · DOU DI ZHU (斗地主) STYLES
   ============================================================= */

/* Main Arena Section Enhancement */
.ddz-arena-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* Mode Switcher Tabs */
.ddz-mode-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ddz-mode-btn {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--text-muted);
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ddz-mode-btn:hover {
  border-color: var(--gold-light);
  color: #FFF;
  transform: translateY(-2px);
}

.ddz-mode-btn.active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25) 0%, rgba(255, 215, 0, 0.1) 100%);
  border-color: #FFD700;
  color: #FFD700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.35);
}

.ddz-mode-btn .badge-mode {
  background: rgba(255, 215, 0, 0.2);
  color: #FFF;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Mode Sub-Banner / Status */
.ddz-sub-banner {
  background: rgba(12, 16, 26, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  padding: 12px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.88rem;
}

.ddz-sub-banner .mode-desc {
  color: #A0AEC0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ddz-sub-banner .mode-desc strong {
  color: #00F0FF;
}

.ddz-pvp-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ddz-pvp-input {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  width: 100px;
  text-align: center;
}

.ddz-pvp-input:focus {
  outline: none;
  border-color: #00F0FF;
}

/* Stakes & Chips Bar */
.ddz-chips-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.ddz-user-chips {
  background: rgba(26, 32, 44, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ddz-user-chips .chip-val {
  color: #FFD700;
  font-weight: 800;
  font-family: var(--font-mono);
}

.btn-faucet {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid #00F0FF;
  color: #00F0FF;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-faucet:hover {
  background: #00F0FF;
  color: #000;
}

/* =============================================================
   POKER TABLE (Radial Velvet Green & Cyber Gold)
   ============================================================= */
.ddz-table-felt {
  background: radial-gradient(circle at center, #0F452B 0%, #08281A 65%, #04140D 100%);
  border: 10px solid #2B1D0C;
  outline: 3px solid #D4AF37;
  border-radius: 48px;
  padding: 28px 24px 20px 24px;
  position: relative;
  min-height: 600px;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.85), 0 10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}

/* Top Center Bar: Bottom Cards & Pot */
.ddz-top-pot-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
}

.ddz-pot-box {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 12px;
  padding: 8px 18px;
  backdrop-filter: blur(6px);
  text-align: center;
}

.ddz-pot-box .pot-title {
  font-size: 0.72rem;
  color: #A0AEC0;
}

.ddz-pot-box .pot-num {
  font-size: 1.4rem;
  font-weight: 900;
  color: #FFD700;
  font-family: var(--font-mono);
}

.ddz-mult-badge {
  background: rgba(255, 77, 77, 0.2);
  border: 1px solid #FF4D4D;
  color: #FF4D4D;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  margin-top: 2px;
}

/* Bottom Cards (3张底牌) */
.ddz-bottom-cards-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ddz-bottom-cards-label {
  font-size: 0.72rem;
  color: #FFD700;
  letter-spacing: 1px;
  font-weight: 700;
}

.ddz-bottom-cards-list {
  display: flex;
  gap: 8px;
}

/* Opponent Seats (Left & Right) */
.ddz-opponents-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin: 10px 0;
}

.ddz-seat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 220px;
  background: rgba(5, 12, 10, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 12px 10px;
  position: relative;
  transition: all 0.2s ease;
}

.ddz-seat-box.seat-landlord {
  border-color: #FFD700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
  background: rgba(30, 24, 8, 0.8);
}

.ddz-seat-box.seat-peasant {
  border-color: rgba(0, 240, 255, 0.4);
}

.ddz-seat-box.active-turn {
  outline: 2px solid #00F0FF;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
  animation: pulseSeat 1.5s infinite;
}

@keyframes pulseSeat {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.ddz-avatar-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
}

.ddz-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #D4AF37;
  background: #000;
}

.ddz-role-pill {
  position: absolute;
  bottom: -4px;
  right: -8px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  color: #FFF;
}

.role-landlord {
  background: linear-gradient(135deg, #B8860B 0%, #FFD700 100%);
  color: #000;
}

.role-peasant {
  background: linear-gradient(135deg, #0984E3 0%, #00CEC9 100%);
}

.role-undecided {
  background: rgba(255, 255, 255, 0.2);
  color: #CCC;
}

.ddz-seat-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFF;
  margin-bottom: 4px;
  text-align: center;
}

.ddz-seat-tag {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.5);
  color: #A0AEC0;
  margin-bottom: 6px;
}

/* Card Fan for Opponents */
.ddz-card-fan-count {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  color: #FFD700;
  font-family: var(--font-mono);
}

.ddz-opp-played-cards {
  min-height: 70px;
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Speech / Status Bubble */
.ddz-speech-bubble {
  position: absolute;
  top: -24px;
  background: #FFD700;
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 10;
}

.ddz-speech-bubble.show {
  opacity: 1;
}

/* Center Trick Table */
.ddz-center-trick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  width: 100%;
  margin: 10px 0;
  position: relative;
}

.ddz-trick-cards {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  min-height: 80px;
}

.ddz-trick-desc {
  font-size: 0.82rem;
  color: #00F0FF;
  margin-top: 6px;
  font-weight: 700;
}

/* Player Zone (Seat 0 - Bottom) */
.ddz-player-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 10px;
  position: relative;
}

.ddz-player-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

/* Action Controls Bar */
.ddz-action-bar {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  min-height: 44px;
}

.btn-ddz {
  background: linear-gradient(135deg, #2D3748 0%, #1A202C 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFF;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-ddz:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #00F0FF;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.3);
}

.btn-ddz:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
}

.btn-ddz-primary {
  background: linear-gradient(135deg, #D4AF37 0%, #FFD700 100%);
  color: #000;
  border-color: #FFD700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.btn-ddz-primary:hover:not(:disabled) {
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
  border-color: #FFF;
}

.btn-ddz-pass {
  background: rgba(255, 77, 77, 0.2);
  border-color: #FF4D4D;
  color: #FF4D4D;
}

.btn-ddz-pass:hover:not(:disabled) {
  background: #FF4D4D;
  color: #FFF;
}

/* Player Hand Cards Strip */
.ddz-hand-strip {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 110px;
  width: 100%;
  padding: 10px 0 6px 0;
  overflow-x: auto;
  overflow-y: visible;
}

/* Individual 108 Hero Water Margin Poker Card */
.ddz-card {
  width: 64px;
  height: 94px;
  background: #110D1D;
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  border-radius: 8px;
  position: relative;
  box-shadow: -2px 4px 12px rgba(0, 0, 0, 0.65);
  margin-right: -32px; /* Overlap to show left silk banner */
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.16s ease, border-color 0.16s;
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.ddz-card:last-child {
  margin-right: 0;
}

/* Hero Artwork Background */
.ddz-card-art {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 1;
  opacity: 0.92;
  transition: transform 0.25s ease;
}

.ddz-card:hover .ddz-card-art {
  transform: scale(1.06);
}

/* Dark Vignette Overlay for High Legibility */
.ddz-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(10, 6, 20, 0.88) 0%, rgba(0, 0, 0, 0.2) 48%, rgba(10, 6, 20, 0.75) 100%);
  z-index: 2;
  pointer-events: none;
}

.ddz-card:hover {
  transform: translateY(-12px);
  z-index: 50 !important;
  border-color: #FFD700;
  box-shadow: 0 10px 24px rgba(212, 175, 55, 0.5), 0 0 12px rgba(255, 215, 0, 0.4);
}

.ddz-card.selected {
  transform: translateY(-22px) !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.95), 0 12px 24px rgba(0, 0, 0, 0.9) !important;
  border-color: #FFF !important;
  border-width: 2px !important;
  z-index: 60 !important;
}

/* Red / Black Card Text Colors */
.ddz-card.card-red .ddz-card-rank,
.ddz-card.card-red .ddz-card-suit {
  color: #FF4444 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 4px #000;
}

.ddz-card.card-black .ddz-card-rank,
.ddz-card.card-black .ddz-card-suit {
  color: #FFFFFF !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 4px #000;
}

.ddz-card-corner-top {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.92;
}

.ddz-card-rank {
  font-size: 1.05rem;
  font-weight: 900;
  font-family: var(--font-mono);
  line-height: 1;
}

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

.ddz-card-hero-tag {
  font-size: 0.62rem;
  color: #FFD700;
  font-family: simkai, 'STKaiti', serif;
  margin-top: 2px;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px #000, 0 0 4px #000;
  background: rgba(0, 0, 0, 0.65);
  padding: 1px 3px;
  border-radius: 3px;
  line-height: 1;
}

.ddz-card-star-tag {
  position: relative;
  z-index: 3;
  align-self: center;
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 1px 5px;
  border-radius: 4px;
  text-shadow: 0 1px 2px #000;
  font-family: simkai, 'STKaiti', serif;
  letter-spacing: 0.5px;
}

.ddz-card-center-icon {
  position: relative;
  z-index: 3;
  font-size: 1.3rem;
  align-self: center;
  opacity: 0.85;
}

.ddz-card-corner-bottom {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 0.92;
  transform: rotate(180deg);
}

/* Special Jokers (Song Jiang & Lu Junyi) */
.ddz-card.card-joker-small {
  border-color: #C0C0C0;
}
.ddz-card.card-joker-small .ddz-card-rank,
.ddz-card.card-joker-small .ddz-card-suit {
  color: #E2E8F0 !important;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  font-size: 0.62rem;
  letter-spacing: 0.5px;
}

.ddz-card.card-joker-big {
  border-color: #FF4444;
}
.ddz-card.card-joker-big .ddz-card-rank,
.ddz-card.card-joker-big .ddz-card-suit {
  color: #FF3333 !important;
  text-shadow: 0 0 8px rgba(255, 51, 51, 0.9);
  font-size: 0.62rem;
  letter-spacing: 0.5px;
}

/* Card Back (for opponents or hidden bottom cards) */
.ddz-card-back {
  width: 50px;
  height: 74px;
  background: radial-gradient(circle at center, #8B0000 0%, #4A0000 100%);
  border: 2px solid #D4AF37;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFD700;
  font-size: 0.9rem;
  font-weight: 900;
}

/* Mini Cards for Tricks / Table */
.ddz-card-mini {
  width: 48px;
  height: 72px;
  margin-right: -16px;
  font-size: 0.85rem;
}

.ddz-card-mini .ddz-card-rank {
  font-size: 0.85rem;
}

.ddz-card-mini .ddz-card-suit {
  font-size: 0.68rem;
}

.ddz-card-mini .ddz-card-center-icon {
  font-size: 1.1rem;
}

/* Result Modal Popup */
.ddz-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ddz-modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.ddz-modal-card {
  background: linear-gradient(135deg, #1B2230 0%, #0D111A 100%);
  border: 2px solid #FFD700;
  border-radius: 20px;
  padding: 32px 36px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.35);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.ddz-modal-overlay.show .ddz-modal-card {
  transform: scale(1);
}

.ddz-modal-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.ddz-modal-title.win {
  color: #FFD700;
}

.ddz-modal-title.lose {
  color: #FF7777;
}

.ddz-modal-desc {
  font-size: 0.9rem;
  color: #A0AEC0;
  margin-bottom: 20px;
}

.ddz-settle-table {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
  font-size: 0.85rem;
}

.ddz-settle-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ddz-settle-row:last-child {
  margin-bottom: 0;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.ddz-settle-row .val {
  font-family: var(--font-mono);
  font-weight: 700;
}

.ddz-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

@media (max-width: 768px) {
  .ddz-opponents-row {
    flex-direction: column;
    gap: 16px;
    align-items: center;
  }
  .ddz-seat-box {
    width: 90%;
  }
  .ddz-card {
    width: 44px;
    height: 68px;
    margin-right: -22px;
  }
}

/* Fullscreen Arena Mode */
.ddz-arena-container.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  z-index: 999999 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  padding: 12px 20px !important;
  box-sizing: border-box !important;
  background: radial-gradient(circle at center, #151A24 0%, #080A0E 100%) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

.ddz-arena-container.is-fullscreen .ddz-table-felt {
  flex: 1 !important;
  height: auto !important;
  border-radius: 20px !important;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9) inset !important;
}

.ddz-fullscreen-btn {
  background: linear-gradient(135deg, #2A2438 0%, #161224 100%);
  border: 1px solid #D4AF37;
  color: #FFD700;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ddz-fullscreen-btn:hover {
  background: #D4AF37;
  color: #000;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

/* Responsive Table & Mobile Touch Optimization */
@media (max-width: 900px) {
  .ddz-card {
    width: 52px;
    height: 78px;
    margin-right: -26px;
    padding: 2px 4px;
  }
  .ddz-card-rank {
    font-size: 0.9rem;
  }
  .ddz-card-suit {
    font-size: 0.72rem;
  }
  .ddz-card-hero-tag {
    font-size: 0.52rem;
  }
  .ddz-hand-strip {
    min-height: 90px;
  }
}

@media (max-width: 600px) {
  .ddz-card {
    width: 44px;
    height: 66px;
    margin-right: -25px;
    padding: 2px 3px;
  }
  .ddz-card-rank {
    font-size: 0.82rem;
  }
  .ddz-card-suit {
    font-size: 0.65rem;
  }
  .ddz-card-hero-tag {
    display: none; /* Hide hero name on ultra-small mobile to prevent clutter */
  }
  .ddz-card-star-tag {
    display: none;
  }
  .ddz-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-height: 38px;
  }
  .ddz-table-felt {
    min-height: 480px;
  }
}
