/* ============================================================
   DRAGON VS TIGER - AUTHENTIC 1:1 CASINO SUITE
   Pixel-Perfect Implementation matching Image 2
   - Seamless background with authentic Dragon, Tiger & 3D Table
   - Dynamic interactive bead road history (D, T, E beads)
   - Dynamic live bet metrics (0 / 20420, 0 / 4780, 0 / 24370)
   - 3D Card flip animation & alarm clock timer
   - Realistic chip deposits & flying chip physics
   - Seated bot simulation & real wallet sync
   - Interactive 6 chip buttons & Repeat Bets
   ============================================================ */

:root {
  --dvt-gold: #ffd700;
  --dvt-blue: #1e3a8a;
  --dvt-red: #991b1b;
  --dvt-green: #15803d;
}

/* Fullscreen Viewport */
#screenDragonTiger {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  overflow: hidden;
  display: none;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  z-index: 100;
}

#screenDragonTiger.active,
.app-screen.active#screenDragonTiger {
  display: flex !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000 !important;
  overflow: hidden !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 100 !important;
}

/* Quick Back to Lobby Button (Top Left) */
.dvt-quick-back-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  height: 32px;
  padding: 0 14px;
  background: linear-gradient(180deg, #3d2314 0%, #1a0e08 100%);
  border: 1.5px solid #ffd700;
  border-radius: 16px;
  color: #ffe89e;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  z-index: 75;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,215,0,0.4);
  transition: all 0.15s ease;
  touch-action: manipulation;
}
.dvt-quick-back-btn:active {
  transform: scale(0.94);
  background: linear-gradient(180deg, #1a0e08 0%, #3d2314 100%);
}

.dvt-game-viewport {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* 16:9 / 2.17:1 Stage matching Reference Image (1024 x 472) */
.dvt-arena-stage {
  position: relative;
  width: 100%;
  max-width: 1024px;
  height: 100%;
  max-height: 480px;
  aspect-ratio: 1024 / 472;
  margin: auto;
  background: url('../assets/dvt_reference/dvt_table_authentic_bg.png') no-repeat center center;
  background-size: 100% 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* Common Positioning Anchor */
.dvt-pos-anchor {
  position: absolute;
  box-sizing: border-box;
}

/* ---------------- TOP BUTTONS ---------------- */
.dvt-anchor-menu {
  left: 4.39%;
  top: 2.54%;
  width: 5.5%;
  height: 11%;
  cursor: pointer;
  border-radius: 50%;
  z-index: 60;
}
.dvt-anchor-menu:active {
  transform: scale(0.92);
}

.dvt-anchor-gift {
  left: 86.72%;
  top: 1.69%;
  width: 8.5%;
  height: 13.5%;
  cursor: pointer;
  z-index: 60;
}
.dvt-anchor-gift:active {
  transform: scale(0.92);
}

/* Menu Dropdown */
.dvt-menu-dropdown {
  position: absolute;
  top: 14%;
  left: 4.5%;
  width: 160px;
  background: linear-gradient(180deg, #1e1136 0%, #0d061a 100%);
  border: 1.5px solid #ffd700;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.9);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 95;
}

.dvt-menu-drop-item {
  width: 100%;
  height: 34px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dvt-menu-drop-item:hover {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
}

.dvt-menu-drop-item.highlight {
  background: linear-gradient(90deg, #ca8a04 0%, #eab308 100%);
  color: #000;
  font-weight: 900;
}

/* Broadcast Marquee Ticker - Positioned cleanly in top header bar */
.dvt-broadcast-ticker-pill {
  position: absolute;
  top: 1.8%;
  left: 20%;
  width: 44%;
  height: 26px;
  background: rgba(18, 10, 28, 0.75);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  z-index: 65;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.dvt-ticker-horn {
  font-size: 13px;
  color: #f59e0b;
  flex-shrink: 0;
}

.dvt-ticker-content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.dvt-ticker-text {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  animation: dvtTickerScroll 14s linear infinite;
}

@keyframes dvtTickerScroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ---------------- CENTER CARDS & CLOCK TIMER ---------------- */
.dvt-anchor-card-dragon {
  left: 40.23%;
  top: 9.32%;
  width: 5.47%;
  height: 16.31%;
  perspective: 900px;
  z-index: 25;
}

.dvt-anchor-card-tiger {
  left: 53.71%;
  top: 9.32%;
  width: 5.47%;
  height: 16.31%;
  perspective: 900px;
  z-index: 25;
}

.dvt-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.3, 1);
  border-radius: 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
}

.dvt-card-inner.is-flipped {
  transform: rotateY(180deg);
}

.dvt-card-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #ffd700;
  box-sizing: border-box;
}

.dvt-card-back {
  background: transparent;
  border: none;
}

.dvt-card-back img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.dvt-card-front {
  background: #ffffff;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 4px;
  color: #0f172a;
}

.dvt-card-front.red-suit {
  color: #dc2626;
}

.dvt-card-corner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.dvt-card-corner.bottom-right {
  align-items: flex-end;
  transform: rotate(180deg);
}

.dvt-c-rank {
  font-size: 12px;
  font-weight: 900;
}

.dvt-c-suit {
  font-size: 10px;
}

.dvt-c-center-symbol {
  align-self: center;
  font-size: 18px;
  line-height: 1;
}

/* Card Bottom Fire Glow */
.dvt-card-fire-glow {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 8px;
  border-radius: 50%;
  filter: blur(3px);
  background: radial-gradient(ellipse, #f59e0b 0%, #ef4444 60%, transparent 100%);
  pointer-events: none;
  animation: dvtCardFireGlow 1.2s infinite alternate;
}

@keyframes dvtCardFireGlow {
  0% { transform: translateX(-50%) scale(0.9); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

/* Alarm Clock Countdown Number - Centered inside the alarm clock dial */
.dvt-anchor-clock-num {
  left: 48.44%;
  top: 9.11%;
  width: 3.12%;
  height: 6.36%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  pointer-events: none;
}

.dvt-clock-num-text {
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  line-height: 1;
}

.dvt-clock-num-text.urgent {
  color: #fef08a;
  animation: dvtClockTickUrgent 0.5s infinite alternate;
}

@keyframes dvtClockTickUrgent {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px #ef4444); }
  100% { transform: scale(1.2); filter: drop-shadow(0 0 8px #ef4444); }
}

/* ---------------- BEAD ROAD HISTORY STRIP & TRENDS ---------------- */
.dvt-anchor-bead-road {
  left: 21.97%;
  top: 27.50%;
  width: 49.50%;
  height: 5.50%;
  background: transparent;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  z-index: 20;
}
.dvt-anchor-bead-road::-webkit-scrollbar {
  display: none;
}

.dvt-road-beads-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
}

.dvt-bead-token {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dvt-bead-token.d {
  background: radial-gradient(circle at 35% 35%, #3b82f6 0%, #1e40af 100%);
}

.dvt-bead-token.t {
  background: radial-gradient(circle at 35% 35%, #ef4444 0%, #b91c1c 100%);
}

.dvt-bead-token.tie {
  background: radial-gradient(circle at 35% 35%, #22c55e 0%, #15803d 100%);
}

/* Trends Button Anchor */
.dvt-anchor-trends-btn {
  left: 72.07%;
  top: 27.50%;
  width: 5.2%;
  height: 5.6%;
  cursor: pointer;
  border-radius: 12px;
  z-index: 30;
}
.dvt-anchor-trends-btn:active {
  transform: scale(0.92);
}

/* ---------------- 3 BETTING FELT ZONES & RATIO HEADERS ---------------- */
/* Dragon Zone */
.dvt-anchor-zone-dragon {
  left: 19.04%;
  top: 30.93%;
  width: 20.02%;
  height: 50.42%;
  cursor: pointer;
  z-index: 15;
  overflow: hidden;
}

.dvt-anchor-ratio-dragon {
  left: 24.02%;
  top: 32.84%;
  width: 9.77%;
  height: 4.24%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-weight: 800;
  font-size: 13px;
  color: #ffffff;
  pointer-events: none;
  z-index: 20;
}

/* Tie Zone */
.dvt-anchor-zone-tie {
  left: 39.06%;
  top: 30.93%;
  width: 19.53%;
  height: 50.42%;
  cursor: pointer;
  z-index: 15;
  overflow: hidden;
}

.dvt-anchor-ratio-tie {
  left: 44.92%;
  top: 32.84%;
  width: 8.30%;
  height: 4.24%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-weight: 800;
  font-size: 13px;
  color: #ffffff;
  pointer-events: none;
  z-index: 20;
}

/* Tiger Zone */
.dvt-anchor-zone-tiger {
  left: 58.59%;
  top: 30.93%;
  width: 20.02%;
  height: 50.42%;
  cursor: pointer;
  z-index: 15;
  overflow: hidden;
}

.dvt-anchor-ratio-tiger {
  left: 63.48%;
  top: 32.84%;
  width: 10.25%;
  height: 4.24%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-weight: 800;
  font-size: 13px;
  color: #ffffff;
  pointer-events: none;
  z-index: 20;
}

.dvt-ratio-my {
  color: #fef08a;
  font-weight: 900;
}

.dvt-ratio-slash {
  color: #cbd5e1;
  font-weight: 400;
}

.dvt-ratio-total {
  color: #ffffff;
}

.dvt-ratio-star {
  color: #fbbf24;
  font-size: 11px;
}

/* Zone Win Glow */
.dvt-zone-win-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 8;
}

.dvt-anchor-zone-dragon.zone-won .dvt-zone-win-glow {
  opacity: 1;
  box-shadow: inset 0 0 25px rgba(59, 130, 246, 0.8), 0 0 25px rgba(59, 130, 246, 0.9);
  animation: dvtZoneWonFlash 0.55s infinite alternate;
}

.dvt-anchor-zone-tie.zone-won .dvt-zone-win-glow {
  opacity: 1;
  box-shadow: inset 0 0 25px rgba(34, 197, 94, 0.8), 0 0 25px rgba(34, 197, 94, 0.9);
  animation: dvtZoneWonFlash 0.55s infinite alternate;
}

.dvt-anchor-zone-tiger.zone-won .dvt-zone-win-glow {
  opacity: 1;
  box-shadow: inset 0 0 25px rgba(239, 68, 68, 0.8), 0 0 25px rgba(239, 68, 68, 0.9);
  animation: dvtZoneWonFlash 0.55s infinite alternate;
}

@keyframes dvtZoneWonFlash {
  0% { opacity: 0.6; filter: brightness(1.2); }
  100% { opacity: 1; filter: brightness(1.6); }
}

/* Chips Pool */
.dvt-chips-pool {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 6;
}

.dvt-pooled-chip {
  position: absolute;
  width: 22px;
  height: 22px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
}

/* ---------------- 6 SEATED BOTS FLIGHT ANCHORS ---------------- */
.dvt-anchor-seat-1 { left: 15.6%; top: 38.0%; width: 4.8%; height: 10.5%; pointer-events: none; }
.dvt-anchor-seat-2 { left: 15.6%; top: 53.5%; width: 4.8%; height: 10.5%; pointer-events: none; }
.dvt-anchor-seat-3 { left: 15.6%; top: 69.5%; width: 4.8%; height: 10.5%; pointer-events: none; }
.dvt-anchor-seat-4 { left: 82.5%; top: 38.0%; width: 4.8%; height: 10.5%; pointer-events: none; }
.dvt-anchor-seat-5 { left: 82.5%; top: 53.5%; width: 4.8%; height: 10.5%; pointer-events: none; }
.dvt-anchor-seat-6 { left: 82.5%; top: 69.5%; width: 4.8%; height: 10.5%; pointer-events: none; }

/* ---------------- BOTTOM ACTIONS & CHIP TRAY ---------------- */
/* Human User Live Balance Number */
.dvt-anchor-user-balance {
  left: 22.8%;
  top: 92.2%;
  width: 7.2%;
  height: 4.8%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  z-index: 40;
  cursor: pointer;
}

.dvt-live-bal-txt {
  font-size: 11.5px;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* Interactive Chips Click Trays */
.dvt-chips-interactive-tray {
  position: absolute;
  left: 29.5%;
  top: 80%;
  width: 41.5%;
  height: 19%;
  display: flex;
  align-items: flex-end;
  gap: 0.8%;
  z-index: 50;
}

.dvt-chip-interactive-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  border-radius: 50%;
  position: relative;
  transition: transform 0.15s ease;
}

/* Individual chip sizes and positions matching Image 2 */
.dvt-chip-interactive-btn:nth-child(1) { width: 17.5%; height: 86%; margin-bottom: 3.5%; }
.dvt-chip-interactive-btn:nth-child(2) { width: 16.0%; height: 75%; }
.dvt-chip-interactive-btn:nth-child(3) { width: 16.0%; height: 75%; }
.dvt-chip-interactive-btn:nth-child(4) { width: 16.0%; height: 75%; }
.dvt-chip-interactive-btn:nth-child(5) { width: 16.0%; height: 75%; }
.dvt-chip-interactive-btn:nth-child(6) { width: 16.0%; height: 75%; }

.dvt-chip-interactive-btn.active::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px #ffd700, inset 0 0 8px #ffd700;
  pointer-events: none;
  animation: dvtChipPulse 1.2s infinite alternate;
}

@keyframes dvtChipPulse {
  0% { transform: scale(0.96); opacity: 0.8; }
  100% { transform: scale(1.05); opacity: 1; }
}

/* Repeat Bets Button Anchor */
.dvt-anchor-repeat-btn {
  left: 71.48%;
  top: 87.29%;
  width: 10.35%;
  height: 11.02%;
  cursor: pointer;
  border-radius: 8px;
  z-index: 50;
}
.dvt-anchor-repeat-btn:active {
  transform: scale(0.95);
}

/* Online Users Pill Anchor */
.dvt-anchor-online-pill {
  left: 82.81%;
  top: 87.29%;
  width: 5.27%;
  height: 11.02%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 5px;
  z-index: 50;
  pointer-events: none;
}

.dvt-online-num-text {
  font-size: 11.5px;
  font-weight: 900;
  color: #ffd700;
}

/* ---------------- FLYING CHIPS ANIMATION & CELEBRATIONS ---------------- */
.dvt-flying-chips-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}

.dvt-flying-chip-item {
  position: absolute;
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8));
}

.dvt-floating-coin {
  position: absolute;
  font-size: 22px;
  pointer-events: none;
  animation: dvtFloatCoinUp 1.2s forwards;
}

@keyframes dvtFloatCoinUp {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  30% { opacity: 1; transform: translateY(-20px) scale(1.2); }
  100% { transform: translateY(-70px) scale(0.8); opacity: 0; }
}

/* ---------------- CINEMATIC BANNER SYSTEM (START, STOP, WINS) ---------------- */
.dvt-cinematic-banner-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
}

.dvt-banner-hero {
  animation: dvtBannerPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dvt-hero-badge {
  padding: 10px 28px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9);
}

.dvt-hero-badge.emerald {
  background: linear-gradient(180deg, #166534 0%, #14532d 100%);
  border: 2px solid #4ade80;
}

.dvt-hero-badge.crimson {
  background: linear-gradient(180deg, #991b1b 0%, #7f1d1d 100%);
  border: 2px solid #f87171;
}

.dvt-hero-text {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.dvt-hero-sub {
  font-size: 11px;
  font-weight: 700;
  color: #fef08a;
  letter-spacing: 0.5px;
}

.dvt-victory-showcase {
  animation: dvtVictoryPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dvt-victory-medallion {
  width: 90px;
  height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.9));
}

.dvt-victory-banner-box {
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #ffd700;
  border-radius: 14px;
  padding: 6px 24px;
  margin-top: -10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.9);
}

.dvt-victory-headline {
  font-size: 20px;
  font-weight: 900;
  margin: 0;
  color: #ffd700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.dvt-victory-tag {
  font-size: 11px;
  font-weight: 800;
  color: #4ade80;
}

@keyframes dvtBannerPop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes dvtVictoryPop {
  0% { transform: scale(0.2) rotate(-10deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
