/* Styles pour le jeu Coinflip */

.coinflip-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  padding: 2rem 0;
}

/* Scène 3D pour la pièce */
.coin-scene {
  width: 200px;
  height: 200px;
  perspective: 1000px;
}

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

.coin-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  box-shadow: 
    inset 0 0 0 10px rgba(255, 215, 0, 0.5),
    0 0 20px rgba(0, 0, 0, 0.3);
  background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
  border: 4px solid #daa520;
}

.coin-face.heads {
  /* Pile */
  transform: rotateY(0deg);
}

.coin-face.tails {
  /* Face */
  transform: rotateY(180deg);
}

.coin-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #7c5e10;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.coin-icon {
  font-size: 4rem;
  line-height: 1;
}

.coin-label {
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

/* Contrôles de mise */
.bet-controls {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.bet-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bet-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.bet-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  padding-right: 4rem;
  color: var(--fg);
  font-size: 1.2rem;
  font-weight: bold;
  font-family: var(--font-mono);
}

.bet-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 91, 140, 255), 0.2);
}

.bet-currency {
  position: absolute;
  right: 1rem;
  color: var(--muted);
  pointer-events: none;
}

.quick-bets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quick-bet-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.quick-bet-btn:hover {
  background: var(--bg);
  color: var(--fg);
  border-color: var(--accent);
}

.side-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.7;
}

.side-btn:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: var(--muted);
}

.side-btn.selected {
  opacity: 1;
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: 0 4px 12px rgba(var(--accent-rgb, 91, 140, 255), 0.2);
}

.side-icon {
  font-size: 2.5rem;
}

.side-label {
  font-weight: bold;
  text-transform: uppercase;
}

.play-btn {
  width: 100%;
  padding: 1.25rem;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Résultat */
.result-message {
  text-align: center;
  min-height: 3rem;
  font-weight: bold;
  font-size: 1.2rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
}

.result-message.show {
  opacity: 1;
  transform: translateY(0);
}

.result-message.win {
  color: #4ade80;
}

.result-message.lose {
  color: #f87171;
}

/* Animations de la pièce */
@keyframes flipHeads {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(1800deg); } /* 5 tours complets -> Pile (0deg mod 360) */
}

@keyframes flipTails {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(1980deg); } /* 5.5 tours -> Face (180deg mod 360) */
}

.flipping-heads {
  animation: flipHeads 3s cubic-bezier(0.15, 0.9, 0.35, 1) forwards;
}

.flipping-tails {
  animation: flipTails 3s cubic-bezier(0.15, 0.9, 0.35, 1) forwards;
}
