@import url('https://fonts.googleapis.com/css2?family=Rye&family=Cinzel:wght@400;700&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  /* Default western theme colors */
  --color-wood-dark: #120904;
  --color-wood-light: #2b180d;
  --color-leather: #1e120c;
  --color-gold-light: #ffd700;
  --color-gold-dark: #c5a019;
  --color-gold-glow: rgba(253, 186, 116, 0.4);
  --color-accent-red: #8b0000;
  --color-accent-green: #1b4d3e;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(18, 9, 4, 0.9);
}
::-webkit-scrollbar-thumb {
  background: var(--color-gold-dark);
  border-radius: 3px;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--color-wood-dark);
  background-image: radial-gradient(circle, rgba(43, 24, 13, 0.7) 0%, rgba(18, 9, 4, 0.95) 100%), url('assets/bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #f3eae1;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  user-select: none;
}

/* Western Fonts */
.font-western {
  font-family: 'Rye', serif;
}

.font-cinzel {
  font-family: 'Cinzel', serif;
}

/* Gold Text Gradient */
.text-gold-gradient {
  background: linear-gradient(135deg, #fff2a3 0%, #f5af19 40%, #e65c00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Gold Glowing Elements */
.gold-glow {
  box-shadow: 0 0 15px var(--color-gold-glow);
}

.border-gold {
  border-color: var(--color-gold-dark);
}

/* Wood and Leather Panels */
.panel-wood {
  background: linear-gradient(135deg, rgba(30, 18, 12, 0.95) 0%, rgba(18, 9, 4, 0.98) 100%);
  border: 2px solid var(--color-gold-dark);
  border-radius: 8px;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), inset 0 0 15px rgba(0, 0, 0, 0.5);
}

.panel-leather {
  background: rgba(30, 18, 12, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(197, 160, 25, 0.3);
  border-radius: 12px;
}

/* Wanted Poster Styling */
.wanted-poster {
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.wanted-poster::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd700, #c5a019, #e65c00);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  filter: blur(8px);
}

.wanted-poster:hover {
  transform: translateY(-8px) scale(1.03);
}

.wanted-poster:hover::after {
  opacity: 0.7;
}

/* Buttons */
.btn-gold {
  background: linear-gradient(135deg, #ffd700 0%, #f5af19 50%, #b8860b 100%);
  color: #120904;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  border: 1px solid #ffd700;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 0 5px rgba(253, 186, 116, 0.3);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, #ffe066 0%, #fbc531 50%, #d4af37 100%);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4), 0 0 15px rgba(253, 186, 116, 0.6);
  transform: translateY(-2px);
}

.btn-gold:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.btn-gold:disabled {
  background: #2b2b2b;
  border-color: #4a4a4a;
  color: #7a7a7a;
  text-shadow: none;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-dark {
  background: linear-gradient(135deg, #2b180d 0%, #120904 100%);
  color: #ffd700;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  border: 1px solid rgba(197, 160, 25, 0.5);
  transition: all 0.2s ease;
}

.btn-dark:hover:not(:disabled) {
  border-color: #ffd700;
  background: linear-gradient(135deg, #3d2314 0%, #1e0f07 100%);
  box-shadow: 0 0 10px rgba(253, 186, 116, 0.2);
  transform: translateY(-1px);
}

.btn-dark:disabled {
  border-color: #2b2b2b;
  color: #5a5a5a;
  cursor: not-allowed;
}

/* Animations */
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-8px, -5px); }
  20%, 40%, 60%, 80% { transform: translate(8px, 5px); }
}

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

@keyframes spin-cylinder {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(1440deg); }
}

.cylinder-spinning {
  animation: spin-cylinder 3s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

/* Card Styling */
.card-container {
  perspective: 1000px;
  width: 100px;
  height: 145px;
}

@media (max-width: 480px) {
  .card-container {
    width: 75px;
    height: 110px;
  }
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.card-container.deal-animation {
  animation: card-deal 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes card-deal {
  0% {
    opacity: 0;
    transform: translateY(-150px) rotate(-20deg) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

.card-container.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.card-back {
  background-image: url('assets/card_back.png');
  background-size: cover;
  background-position: center;
  border: 1px solid var(--color-gold-dark);
}

.card-front {
  background: white;
  color: black;
  transform: rotateY(180deg);
  border: 2px solid var(--color-gold-dark);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  box-sizing: border-box;
}

/* Card Suit Styling */
.card-front.hearts, .card-front.diams {
  color: #b30000;
}
.card-front.spades, .card-front.clubs {
  color: #1a1a1a;
}

/* Coins Falling Animation */
.coin-rain {
  position: absolute;
  top: -50px;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #ffe066 0%, #f5af19 60%, #c5a019 100%);
  border: 1px solid #ffd700;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3), 0 0 4px rgba(255, 215, 0, 0.5);
  pointer-events: none;
  z-index: 100;
}

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Custom CSS visual revolver cylinder */
.cylinder-center {
  width: 50px;
  height: 50px;
  background: radial-gradient(circle, #333 0%, #1a1a1a 80%);
  border: 3px solid var(--color-gold-dark);
  box-shadow: 0 0 10px rgba(0,0,0,0.8);
}

.chamber {
  width: 44px;
  height: 44px;
  background: radial-gradient(circle, #222 0%, #000 100%);
  border: 2px solid #333;
  transition: all 0.3s ease;
}

.chamber.has-bullet {
  background: radial-gradient(circle, #fff2a3 0%, #fbc531 40%, #c5a019 100%);
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.8), inset 0 0 4px rgba(255,255,255,0.5);
}

.chamber.fired {
  background: radial-gradient(circle, #150000 0%, #200000 60%, #050000 100%);
  border-color: #ff3333;
  box-shadow: inset 0 0 10px rgba(255,0,0,0.5);
}

/* Telegram theme variables override (if active) */
body.tg-theme {
  background-color: var(--tg-theme-bg-color, var(--color-wood-dark));
  color: var(--tg-theme-text-color, #f3eae1);
}

.tg-theme .panel-leather {
  background-color: var(--tg-theme-secondary-bg-color, rgba(30, 18, 12, 0.85));
}
