/* activity/styles/minigames.css */
/* Styles for DJ Slot Machine and Mini Games */

/* ==================== MINIGAME OVERLAY (CRITICAL - SHOWS ANIMATIONS) ==================== */

.minigame-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.minigame-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.minigame-overlay.fadeout {
  opacity: 0;
  transition: opacity 2s ease;
  pointer-events: none;
}

.minigame-content {
  max-width: 800px;
  width: 90%;
  padding: 24px;
  color: #fff;
  text-align: center;
  overflow: hidden;
}

.minigame-content h2 {
  font-size: 36px;
  margin: 0 0 16px 0;
  color: #fff;
  text-shadow: 0 2px 12px rgba(139, 92, 246, 0.8);
}

/* ==================== TRACK REVEAL (WINNER DISPLAY) ==================== */

.track-reveal {
  margin-top: 32px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.track-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.result-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
  border: 2px solid rgba(251, 191, 36, 0.6);
  border-radius: 16px;
  padding: 20px;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.4);
}

.result-cover {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.result-info {
  flex: 1;
  text-align: left;
}

.result-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.result-artist {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.result-label {
  font-size: 16px;
  font-weight: 600;
  color: #fbbf24;
}

/* ==================== WHEEL OF DEATH ==================== */

.wheel-of-death {
  padding: 24px;
}

.wheel-subtitle {
  text-align: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 24px;
}

.wheel-container {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.death-wheel {
  width: 100%;
  height: auto;
}

.wheel-segment.cycling path {
  fill: rgba(139, 92, 246, 0.35) !important;
  stroke: rgba(167, 139, 250, 0.8) !important;
  stroke-width: 3px !important;
}

.wheel-segment.winner path {
  fill: rgba(251, 191, 36, 0.4) !important;
  stroke: #fbbf24 !important;
  stroke-width: 4px !important;
}

.wheel-album-art {
  border-radius: 50%;
}

.wheel-label {
  text-align: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 24px;
}

/* ==================== CARD PICKER ==================== */

.card-picker {
  padding: 24px;
}

.card-subtitle, .card-game-subtitle {
  text-align: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 32px;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  padding: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.game-card {
  perspective: 1000px;
  height: 180px;
  cursor: default;
  animation: cardAppear 0.5s ease forwards;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(30px) rotateX(-20deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.game-card.flipping .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}

.card-front {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
  border: 2px solid rgba(139, 92, 246, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.card-back {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid rgba(139, 92, 246, 0.4);
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back-pattern {
  font-size: 48px;
  opacity: 0.5;
}

.card-cover {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: 8px;
}

.card-title {
  font-size: 12px;
  color: #fff;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-card.eliminated {
  animation: cardEliminated 0.5s ease forwards;
}

@keyframes cardEliminated {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.8) rotateZ(10deg);
  }
}

.game-card.winner {
  animation: cardWinner 1s ease-in-out infinite;
}

.game-card.winner .card-front {
  border-color: #fbbf24;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
}

@keyframes cardWinner {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ==================== CONFETTI ==================== */

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10001;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
}

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

/* ==================== DJ SLOT MACHINE BUTTON ==================== */

/* Button container - positioned above queue tabs */
.dj-slot-button-container {
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.dj-slot-button {
  width: 48px;
  height: 48px;
  font-size: 28px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(139, 92, 246, 0.5);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dj-slot-button:not(:disabled):hover {
  transform: scale(1.1) rotate(5deg);
  border-color: rgba(139, 92, 246, 0.8);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
  background: rgba(20, 20, 30, 0.9);
}

.dj-slot-button:not(:disabled):active {
  transform: scale(0.95) rotate(-5deg);
}

.dj-slot-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(100, 100, 100, 0.5);
}

.dj-slot-button:disabled:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ==================== DJ MINIGAME MODAL ==================== */

.dj-minigame-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dj-minigame-modal.active {
  opacity: 1;
}

.dj-minigame-modal .modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.dj-minigame-modal.active .modal-content {
  transform: scale(1);
}

.dj-minigame-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.dj-minigame-modal .modal-header h3 {
  margin: 0;
  font-size: 28px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
}

.dj-minigame-modal .btn-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.dj-minigame-modal .btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.dj-minigame-modal .modal-description {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 24px;
  text-align: center;
}

/* ==================== GAME OPTIONS ==================== */

.game-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.game-option {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
}

.game-option:hover {
  border-color: rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.game-option:active {
  transform: translateY(0);
}

.game-option.disabled,
.game-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  border-color: rgba(100, 100, 100, 0.3);
  background: linear-gradient(135deg, rgba(50, 50, 50, 0.1) 0%, rgba(50, 50, 50, 0.1) 100%);
}

.game-option.disabled:hover,
.game-option:disabled:hover {
  transform: none;
  box-shadow: none;
}

.game-icon {
  font-size: 48px;
  min-width: 60px;
  text-align: center;
}

.game-info {
  flex: 1;
  text-align: left;
}

.game-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.game-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

/* ==================== MUTE TOGGLES ==================== */

.minigame-mute-toggle {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.mute-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  transition: color 0.2s ease;
}

.mute-toggle:hover {
  color: #fff;
}

.mute-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #8b5cf6;
}

/* ==================== MODAL ACTIONS ==================== */

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

.modal-actions .dj-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-actions .dj-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-actions .dj-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==================== GENRES MURDER STYLES ==================== */

.genres-murder {
  position: relative;
  padding: 24px;
}

.genres-murder h2 {
  margin: 0 0 16px 0;
  text-align: center;
  font-size: 32px;
  text-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.genres-murder-subtitle {
  text-align: center;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 32px;
}

.genres-container {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  padding: 40px 20px;
  min-height: 300px;
}

.genre-card {
  position: relative;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.2) 100%);
  border: 2px solid rgba(139, 92, 246, 0.4);
  border-radius: 12px;
  padding: 20px;
  animation: cardFadeIn 0.5s ease forwards;
  animation-delay: var(--delay, 0s);
  opacity: 0;
  transition: all 0.3s ease;
}

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

.genre-card.stabbed {
  animation: cardEliminate 0.5s ease forwards;
}

@keyframes cardEliminate {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.5) rotate(15deg);
  }
}

.genre-card.winner {
  border-color: #fbbf24;
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
  animation: winnerPulse 1s ease-in-out infinite;
}

@keyframes winnerPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.genre-card-inner {
  text-align: center;
}

.genre-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.genre-name {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.genre-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.track-card-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

.track-card-title {
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== MURDER KNIFE ==================== */

.murder-knife {
  position: absolute;
  font-size: 64px;
  pointer-events: none;
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Start at center of the genres-container */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.murder-knife.stabbing {
  animation: stabAttack 0.5s ease-in-out;
}

@keyframes stabAttack {
  0% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  30% {
    transform: translate(-50%, -50%) scale(1.5) rotate(-20deg);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.8) rotate(25deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

/* ==================== BLOOD SPLATTER ==================== */

.blood-splatter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 150%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.blood-splatter.active {
  opacity: 1;
  animation: bloodSplat 0.6s ease-out forwards;
}

@keyframes bloodSplat {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.9;
  }
}

/* Main blood splash */
.blood-splatter::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(180, 0, 0, 0.9) 0%,
    rgba(139, 0, 0, 0.7) 25%,
    rgba(100, 0, 0, 0.5) 45%,
    rgba(80, 0, 0, 0.3) 65%,
    transparent 80%
  );
  border-radius: 40% 60% 50% 45%;
  filter: blur(2px);
}

/* Blood drip trails */
.blood-splatter::after {
  content: '';
  position: absolute;
  top: 40%;
  left: 30%;
  width: 60%;
  height: 80%;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(160, 0, 0, 0.8) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 20%, rgba(140, 0, 0, 0.6) 0%, transparent 45%),
    radial-gradient(ellipse at 45% 60%, rgba(120, 0, 0, 0.5) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 70%, rgba(100, 0, 0, 0.4) 0%, transparent 40%);
  filter: blur(1px);
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
  .dj-slot-button {
    width: 40px;
    height: 40px;
    font-size: 24px;
    bottom: -20px;
    right: -20px;
  }

  .dj-minigame-modal .modal-content {
    padding: 24px;
  }

  .game-icon {
    font-size: 36px;
    min-width: 48px;
  }

  .game-name {
    font-size: 18px;
  }

  .genres-container {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }
}
