/* ===== Blackjack Shared Styles - Green Felt Theme ===== */

/* ===== CSS Variables ===== */
:root {
  --felt: #1a472a;
  --felt-light: #22633a;
  --felt-dark: #0f2d1a;
  --primary: #dc2626;
  --primary-dark: #b91c1c;
  --primary-light: #ef4444;
  --gold: #fbbf24;
  --card-white: #ffffff;
  --card-back: #1e40af;
  --text: #ffffff;
  --text-muted: #9ca3af;
  --success: #22c55e;
  --danger: #ef4444;
  --bg-card: rgba(0, 0, 0, 0.3);
  --bg-input: rgba(0, 0, 0, 0.4);
}

/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Base Body ===== */
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--felt);
  background-image: radial-gradient(ellipse at center, var(--felt-light) 0%, var(--felt) 70%);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ===== Screen Management ===== */
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===== Utility Classes ===== */
.hidden {
  display: none !important;
}

/* ===== Typography ===== */
.title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2rem;
}

/* ===== Buttons ===== */
.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary,
.btn.primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled),
.btn.primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-secondary,
.btn.secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 2px solid var(--primary);
}

.btn-secondary:hover:not(:disabled),
.btn.secondary:hover:not(:disabled) {
  background: var(--primary);
}

/* ===== Card Styles ===== */
.card {
  background: var(--card-white);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
  position: relative;
}

.card .rank {
  font-weight: bold;
  line-height: 1;
}

.card .suit {
  line-height: 1;
}

.card.red {
  color: #dc2626;
}

.card.black {
  color: #1f2937;
}

.card.face-down {
  background: linear-gradient(135deg, #1e40af 25%, #1e3a8a 75%);
  color: transparent;
}

/* ===== Player Status Badges ===== */
.player-status-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.player-status-badge.playing {
  background: var(--primary);
  color: white;
}

.player-status-badge.stand {
  background: var(--text-muted);
  color: var(--felt-dark);
}

.player-status-badge.bust {
  background: var(--primary);
  color: white;
}

.player-status-badge.blackjack {
  background: var(--gold);
  color: var(--felt-dark);
}

.player-status-badge.win {
  background: var(--success);
  color: white;
}

.player-status-badge.lose {
  background: var(--primary-dark);
  color: white;
}

.player-status-badge.push {
  background: var(--text-muted);
  color: var(--felt-dark);
}

/* ===== Player Spot States ===== */
.player-spot {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.player-spot.active {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.player-spot.bust {
  border-color: var(--primary);
  opacity: 0.7;
}

.player-spot.blackjack {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.1);
}

.player-spot.win {
  border-color: var(--success);
}

.player-spot.lose {
  border-color: var(--primary);
  opacity: 0.6;
}

.player-spot.push {
  border-color: var(--text-muted);
}

/* ===== Animations ===== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ===== Confetti ===== */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 1000;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall 3s ease-out forwards;
}

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