:root {
  --textColor: #fff;
  --primary: #e91e63;
  --boxShadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --ease: all 0.2s ease;
}

body {
  margin:0;
  padding:0;
  width:100%;
  height:100vh;
  overflow:hidden;
  background: linear-gradient(#6084d7 25%, #a2cef4 50%, #a2cef4 50%, #6084d7 100%);
}

#visualizer {
  width:500px;
  height:500px;
}

button {
  overflow: hidden;
  border-radius: 50%;
  border: none;
  display: inline-block;
  color: var(--textColor);
  background-color: var(--primary);
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  transition: var(--ease);
  box-shadow:var(--boxShadow);
  padding: 2em 2.5em;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
button:hover {
  transform:scale(1.02);
}

/* LOADING */
.loading {
  position:fixed;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 70%, #1a1a2e 100%);
  width:100vw;
  height:100vh;
  top:0px;
  left:0px;
  z-index: 5000;
  display:flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.loading.hide {
  display:none;
}

/* FLOATING MUSICAL NOTES */
.music-notes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.music-note {
  position: absolute;
  font-size: 2rem;
  opacity: 0;
  animation: floatNote linear infinite;
  color: rgba(255, 255, 255, 0.15);
}

.music-note:nth-child(1)  { left:  5%; font-size: 1.8rem; animation-duration: 8s;  animation-delay: 0s;   }
.music-note:nth-child(2)  { left: 15%; font-size: 2.5rem; animation-duration: 10s; animation-delay: 1.5s; }
.music-note:nth-child(3)  { left: 25%; font-size: 1.5rem; animation-duration: 7s;  animation-delay: 3s;   }
.music-note:nth-child(4)  { left: 38%; font-size: 2rem;   animation-duration: 9s;  animation-delay: 0.5s; }
.music-note:nth-child(5)  { left: 50%; font-size: 3rem;   animation-duration: 11s; animation-delay: 2s;   }
.music-note:nth-child(6)  { left: 62%; font-size: 1.8rem; animation-duration: 8s;  animation-delay: 4s;   }
.music-note:nth-child(7)  { left: 72%; font-size: 2.2rem; animation-duration: 9s;  animation-delay: 1s;   }
.music-note:nth-child(8)  { left: 82%; font-size: 1.6rem; animation-duration: 7s;  animation-delay: 3.5s; }
.music-note:nth-child(9)  { left: 90%; font-size: 2.8rem; animation-duration: 10s; animation-delay: 2.5s; }
.music-note:nth-child(10) { left: 45%; font-size: 2rem;   animation-duration: 12s; animation-delay: 5s;   }

@keyframes floatNote {
  0% {
    bottom: -10%;
    opacity: 0;
    transform: translateX(0) rotate(0deg);
  }
  10% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.15;
  }
  90% {
    opacity: 0.05;
  }
  100% {
    bottom: 110%;
    opacity: 0;
    transform: translateX(40px) rotate(25deg);
  }
}

/* LOADING DOTS */
.loading-dots > div {
  width: 2rem;
  height: 2rem;
  background-color: rgba(255, 255, 255, 0.6);
  display: inline-block;
  border-radius: 50%;
  animation: 1.5s bounce infinite ease-in-out both;
  margin: 0 4px;
}

.loading-dots .bounce {
  animation-delay: -0.30s;
}

.loading-dots .bounce2 {
  animation-delay: -0.15s;
}

@keyframes bounce {
  0%,80%,100%{
    transform: scale(0);
  }
  40%{
    transform: scale(1);
  }
}

/* MASTER WAITING SCREEN */
.master-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px;
  max-width: 400px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.master-waiting .title {
  font-family: 'Georgia', serif;
  font-size: 2.2em;
  font-weight: bold;
  color: #fff;
  text-align: center;
  margin: 0;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 20px rgba(233, 30, 99, 0.4);
}

.master-waiting .subtitle {
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.5);
  margin: -12px 0 0 0;
  text-align: center;
}

.qr-code {
  background: rgba(255, 255, 255, 0.95);
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

/* QR FULLSCREEN OVERLAY */
.qr-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
  cursor: pointer;
}

.qr-overlay.active {
  opacity: 1;
}

.qr-overlay svg {
  width: min(80vw, 80vh);
  height: min(80vw, 80vh);
  background: #fff;
  padding: 24px;
  border-radius: 20px;
}

.qr-code svg {
  display: block;
}

.share-link-container {
  display: flex;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.share-link-container input {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-right: none;
  border-radius: 10px 0 0 10px;
  font-size: 0.85em;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  min-width: 0;
  backdrop-filter: blur(4px);
}

.share-link-container input:focus {
  border-color: var(--primary);
}

.copy-btn {
  border-radius: 0 10px 10px 0 !important;
  padding: 12px 20px !important;
  font-size: 0.9em !important;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none !important;
  white-space: nowrap;
  box-shadow: none !important;
}

.player-count {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1em;
  font-weight: 600;
  margin: 0;
}

.loading-status {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9em;
  margin: 0;
}

.start-btn {
  margin-top: 8px;
  border-radius: 14px !important;
  padding: 1em 3em !important;
  font-size: 1.3em !important;
  background: linear-gradient(135deg, #e91e63, #ff5252) !important;
  box-shadow: 0 6px 24px rgba(233, 30, 99, 0.5) !important;
  transition: all 0.3s ease !important;
}

.start-btn:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 8px 32px rgba(233, 30, 99, 0.7) !important;
}

/* DEMO LINK */
.demo-link {
  position: absolute;
  bottom: 16px;
  right: 20px;
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  font-size: 0.85em;
  z-index: 1;
  transition: color 0.2s;
}

.demo-link:hover {
  color: rgba(255, 255, 255, 0.5);
}

/* CLIENT WAITING SCREEN */
.waiting-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.waiting-message .title {
  font-family: 'Georgia', serif;
  font-size: 2em;
  font-weight: bold;
  color: #fff;
  margin: 0 0 8px 0;
  text-align: center;
  text-shadow: 0 2px 20px rgba(233, 30, 99, 0.4);
}

.waiting-message p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1em;
  margin: 0;
  text-align: center;
}

.waiting-message .loading-dots {
  margin-bottom: 0;
}

/*  GRID SYSTEM  */
.container {
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.row {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.instruments {
 display:flex;
 gap:10px;
 position: relative;
 z-index: 1;
 width: 100%;
 margin-top: -15%;
}
.instrument {
 width:20%;
 padding-bottom:20%;
 min-width: 0;
 max-width: 300px;
 background-repeat: no-repeat;
 background-size: 100%;
 background-position: center center;
}
.variants .instrument {
  width:25%;
  padding-bottom:25%;
}
.variants {
 display:flex;
 justify-content: center;
 position: absolute;
 bottom: 5%;
 left: 0;
 right: 0;
}
.variant-0,
.variant-1,
.variant-2,
.variant-3,
.variant-4 {
 width:70%;
 display:flex;
}
.hide {
  display:none;
}

.emph {
  opacity:0.5;
}

.taken {
  opacity: 0.25;
  filter: grayscale(80%);
  cursor: not-allowed;
  pointer-events: none;
}

.mine {
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(233, 30, 99, 0.7));
}

.wrap {
  width: 100%;
  height: 100%;
  position: absolute;
  margin: 0 auto;
  perspective: 360px;
  perspective-origin: 50% 50%;
}

.top-plane, .bottom-plane {
  width: 200%;
  height: 130%;
  position: absolute;
  bottom: -30%;
  left: -50%;
  background-image: -webkit-linear-gradient(#a2cef4 2px, transparent 2px), -webkit-linear-gradient(left, #a2cef4 2px, transparent 2px);
  background-size: 100px 100px,100px 100px;
  background-position: -1px -1px,-1px -1px;
  transform: rotateX(85deg);
  animation: planeMoveTop 2s infinite linear;
}

.bottom-plane {
  transform: rotateX(-85deg);
  top: -30%;
  animation: planeMoveBot 2s infinite linear;
}

@keyframes planeMoveTop {
  from {
    background-position: 0px -100px,0px 0px;
  }
  to {
    background-position: 0px 0px, 100px 0px;
  }
}
@keyframes planeMoveBot {
  from {
    background-position: 0px 0px,0px 0px;
  }
  to {
    background-position: 0px -100px, 100px 0px;
  }
}
@media (max-height: 350px) {
  .wrap {
    perspective: 210px;
  }
}

@media (max-width: 500px) {
  .instruments {
    gap: 6px;
    margin-top: -10%;
  }
  .variants .instrument {
    width: 25%;
    padding-bottom: 25%;
  }
  .variant-0,
  .variant-1,
  .variant-2,
  .variant-3,
  .variant-4 {
    width: 85%;
  }
  .variants {
    bottom: 8%;
  }
}
