html.js-loading {
  visibility: hidden;
}

html.loaded {
  visibility: visible;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #121212;
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
  url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231DB954' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
}

button {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-spotify {
  background-color: #1DB954;
}

.text-spotify {
  color: #1DB954;
}

.border-spotify {
  border-color: #1DB954;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #2d2d2d;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #4d4d4d;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5d5d5d;
}

/* Loading spinner */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid #1DB954;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast notification */
#toast {
  z-index: 1000;
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Sound wave animation */
.sound-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 20px;
}

.sound-wave span {
  display: block;
  width: 3px;
  margin: 0 2px;
  background-color: #10b981;
  animation: sound-wave-animation 1.2s infinite ease-in-out;
}

.sound-wave span:nth-child(2) {
  animation-delay: 0.2s;
}

.sound-wave span:nth-child(3) {
  animation-delay: 0.4s;
}

.sound-wave span:nth-child(4) {
  animation-delay: 0.6s;
}

.sound-wave span:nth-child(5) {
  animation-delay: 0.8s;
}

@keyframes sound-wave-animation {
  0%, 100% {
    height: 6px;
  }
  50% {
    height: 18px;
  }
}

/* Card hover effects */
.player-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.player-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* Animated background for active player */
.active-player {
  position: relative;
  overflow: hidden;
}

.active-player::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(29, 185, 84, 0.1) 0%, rgba(29, 185, 84, 0) 70%);
  z-index: 0;
  animation: gradient-shift 2s ease infinite;
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes music-bars {
  0% {
    height: 2px;
  }
  100% {
    height: 20px; /* Corresponds to h-5 in Tailwind */
  }
}

/* Pulse animation for countdown */
.pulse {
  animation: pulse-animation 1s infinite;
}

@keyframes pulse-animation {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Ready badge animation */
.ready-badge {
  animation: ready-badge-animation 2s;
}

@keyframes ready-badge-animation {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

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

.confetti {
  position: absolute;
  z-index: 100;
  border-radius: 50%;
  pointer-events: none;
}

#heart-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

#heart-button:hover {
  transform: scale(1.2);
}

#heart-button:active {
  transform: scale(0.95);
}

@keyframes heart-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.heart-pulse {
  animation: heart-pulse 0.5s ease;
}

.vote-option {
  position: relative;
  border-radius: 0.5rem;
  padding: 1.5rem 1rem;
  min-height: 80px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.2s ease;
  overflow: hidden;
  user-select: none;
}

.vote-option::before {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  transform: scaleX(0);
  transform-origin: 0 0;
  transition: transform 0.3s ease;
}

.vote-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.vote-option:hover::before {
  transform: scaleX(1);
}

.vote-option.selected {
  transform: scale(0.98);
  box-shadow: 0 0 0 3px currentColor, 0 4px 8px rgba(0, 0, 0, 0.3);
}

.vote-option .player-name {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.vote-option .player-score {
  font-size: 0.9rem;
  opacity: 0.7;
}

@keyframes select-option {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(0.98); }
}

@keyframes deselect-option {
  0% { transform: scale(0.98); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.vote-option.selected {
  animation: select-option 0.3s forwards;
}

.vote-option:not(.selected) {
  animation: deselect-option 0.3s forwards;
}

.vote-option.color-1 { background-color: #ff5b5b; color: #ff5b5b; }
.vote-option.color-2 { background-color: #5b8eff; color: #5b8eff; }
.vote-option.color-3 { background-color: #5bff8e; color: #5bff8e; }
.vote-option.color-4 { background-color: #ff5be2; color: #ff5be2; }
.vote-option.color-5 { background-color: #ffbd5b; color: #ffbd5b; }
.vote-option.color-6 { background-color: #5bfff8; color: #5bfff8; }
.vote-option.color-7 { background-color: #af5bff; color: #af5bff; }
.vote-option.color-8 { background-color: #cdff5b; color: #cdff5b; }

.vote-option.color-1, 
.vote-option.color-2, 
.vote-option.color-3, 
.vote-option.color-4, 
.vote-option.color-5, 
.vote-option.color-6, 
.vote-option.color-7, 
.vote-option.color-8 {
  background-color: rgba(var(--color-rgb), 0.3);
  border: 2px solid;
}

.vote-option.color-1 { --color-rgb: 255, 91, 91; }
.vote-option.color-2 { --color-rgb: 91, 142, 255; }
.vote-option.color-3 { --color-rgb: 91, 255, 142; }
.vote-option.color-4 { --color-rgb: 255, 91, 226; }
.vote-option.color-5 { --color-rgb: 255, 189, 91; }
.vote-option.color-6 { --color-rgb: 91, 255, 248; }
.vote-option.color-7 { --color-rgb: 175, 91, 255; }
.vote-option.color-8 { --color-rgb: 205, 255, 91; }

#submit-votes-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

#submit-votes-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#submit-votes-btn:not(:disabled):active {
  transform: translateY(0);
}

#toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#submit-votes-btn .spinner {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 2px solid #ffffff;
  width: 16px;
  height: 16px;
  margin-right: 0.5rem;
}
