* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    
  }
  

body {
  font-family: 'Kanit', sans-serif;
  /* font-weight: bold; */
  overflow-y: hidden;
  background: black;
  transition: background 0.5s ease;

  overflow-y: hidden; /* ✅ keep this */
  height: 100vh;       /* ✅ constrain height */
  
}

.dynamic-fade-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}





#bg-gradient-A, #bg-gradient-B {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.8s ease;
}




h1 {
    color: white;
}


/* General container styles for the song row */
.song-row {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 50, 0.6);
    border-radius: 8px;
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: overlay;
    box-shadow: 0 4px 15px rgba(0, 0, 50, 0.8);
    min-height: 100px;
    height:150px;
    flex-shrink: 0; /* prevent it from shrinking */
    transition: background-size 0.3s ease-in-out, background-color 0.3s ease;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    flex-direction: row-reverse; /* flip image + content order */
}

/* .song-row:hover {
    background-size: 110%;
    background-color: rgba(0, 0, 0, 0.7); /* Darkens background image only */
/* } */

.song-row .song-row-buttons,
.song-row button {
  pointer-events: none;
}

/* Button base styles */
button, a {
    font-family: inherit;
    padding: 8px 12px;
    background-color: #0044cc;
    color: white;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 50, 255, 0.8);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease, visibility 0.5s ease;
}

button:hover, a:hover {
    background-color: #005ce6;
    box-shadow: 0 0 10px rgba(0, 100, 255, 1);
}

.song-row button {
    opacity: 0;
    visibility: hidden;
}

.song-row.selected-row button {
    opacity: 1;
    visibility: visible;
  }
  

.song-row:hover button {
    opacity: 1;
    visibility: visible;
}

/* Specific button styles */
button.load-engine-btn {
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 100, 255, 0.9);
}

button.load-engine-btn:hover {
    box-shadow: 0 0 15px rgba(0, 150, 255, 1);
}

/* Buttons container */
.song-row-buttons {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px; /* Add space between buttons */
    position: absolute;
    bottom: 15px;
    right: 15px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Show buttons on hover */
.song-row:hover .song-row-buttons {
    opacity: 1;
    visibility: visible;
}

.song-row.selected-row .song-row-buttons {
    opacity: 1;
    visibility: visible;
  }
  

/* Image container and content */
.image-container {
    position: relative;
    height: 300px; /* Fixed height */
    width: 300px; /* Fixed width */
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0, 0, 50, 0.8); /* Neon-style glow */
}

/* Song image */
.song-img {
    max-height: 100%; /* Constrain height */
    max-width: 100%; /* Constrain width */
    height: 100%; /* Match container height */
    width: auto; /* Maintain proportions */
    object-fit: cover; /* Prevent distortion */
    border-radius: 8px;
}

/* Folder text positioned in the center of the image */
.folder-text {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 30px;
    color: white; /* Neon blue color */
    background-color: rgba(0, 0, 50, 0.6); /* Semi-transparent background */
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 1;
    text-align: center; /* Center-align text */
    white-space: nowrap; /* Prevent line breaks unless necessary */
    max-width: 100%; /* Constrain text width to image width */
    overflow: hidden; /* Ensure text doesn't overflow container */
    text-overflow: ellipsis; /* Add ellipsis if text overflows */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Audio visualizer */
.audio-visualizer {
    flex-grow: 1;
    height: 100px;
    width: 50px;
    border: 2px solid white;
    border-radius: 16px;
    background-color: rgba(0, 0, 0, 0.4);

    box-shadow: none;
}


/* Specific styles for the iframe */
#engine-iframe {
    height: 90px;
    width: 100%;
    border: none;
}


/* Overlay styling for popup */
.leaderboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999;
}

/* Enhanced Leaderboard Popup Styling */
.leaderboard-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 50, 0.9);
    color: white;
    border: 2px solid #005ce6;
    border-radius: 10px;
    padding: 20px;
    width: 400px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 50, 255, 0.8);
    text-align: center;
    font-family: 'Kanit', sans-serif;
}

.leaderboard-popup h2 {
    font-size: 24px;
    color: #00d4ff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.leaderboard-popup ol {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.leaderboard-popup li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 18px;
    color: white;
}

.leaderboard-popup li:first-child span:first-child {
    font-weight: bold;
    color: gold; /* Highlight the first player's rank */
}


.leaderboard-popup li:last-child {
    border-bottom: none;
}

.leaderboard-popup li span:last-child {
    font-family: monospace;
}


.first-place {
    color: gold;
    font-weight: bold;
}


.leaderboard-popup .close-popup {
    margin-top: 20px;
    background-color: #ff4444;
    font-size: 16px;
    padding: 10px 20px;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
}

.leaderboard-popup .close-popup:hover {
    background-color: #ff2222;
}


.button-container {
    display: none !important;
    margin-top: 10px; /* Add some spacing above the container */
  }
  
  .button-container button {
    display: block; /* Buttons remain block elements to stack vertically */
    width: 100%; /* Optional: make buttons take the full width of the container */
    margin-bottom: 5px; /* Add spacing between buttons */
  }
  

  #not-logged-in-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); /* Semi-transparent black */
    color: lightblue;
    font-size: 2rem;
    font-family: 'Kanit', sans-serif;
    font-weight:bold;
    letter-spacing: 1px; /* Ensure consistent letter spacing */
    display: flex;
    justify-content: center;
    align-items: top;
    z-index: -1; /* Ensure it sits above everything */
    pointer-events: auto; /* Blocks interactions */
}




/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  
  ::-webkit-scrollbar-thumb {
    background: black;
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
  }
  
  ::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 4px;
  }
  
  ::-webkit-scrollbar-track:hover {
    background: #333;
  }



.youtube-icon {
  width: 40px;
  height: 40px;
  opacity: 0.9;
  filter: invert(1) brightness(2);
}

.youtube-link {
  pointer-events: auto; /* clickable even in .song-row */
  outline: none;
  box-shadow: none;
  background: none;
  -webkit-tap-highlight-color: transparent; /* removes mobile/Chrome highlight */
}

.youtube-link:hover,
.youtube-link:active,
.youtube-link:focus,
.youtube-link:focus-visible {
  background: none !important; /* force remove hover background */
  outline: none;
  box-shadow: none;
}




  /* Loading overlay */
  #loading-overlay {
    position: fixed; /* Ensure it covers the entire page */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Dark transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Higher than the header */
    visibility: hidden; /* Hidden by default */
}


/* Spinner animation */
.spinner {
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top: 8px solid #00d4ff;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}





#header {
    position: sticky; /* Stays fixed at the top */
    top: 0; /* Sticks to the top of the page */
    width: 100%; /* Full width */
    background-color: rgba(0, 0, 50, 0.5); /* Dark background with slight transparency */
    padding: 0px 0;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5); /* Subtle shadow effect */
    z-index: 10; /* Ensure it stays above other elements */
    text-align: center;

    border-bottom-right-radius: 20px;
}


/* Keep the top controls centered inside the header */
#top-controls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 0px;
    height:100px;
    margin-left:30px;
}


#top-controls-container .btn {
  white-space: nowrap;
  padding: 10px 18px;
  min-width: max-content;
  font-size: 16px;
}

#create-map-btn {
  background-color: #1c3faa; /* Blue */
  color: white;
}

#community-maps-btn {
  background-color: #2e8b57; /* Green */
  color: white;
}

#market-page-btn {
  background-color: #a83279; /* Pink-purple */
  color: white;
}


#top-controls-container > .btn:last-child {
  margin-right: 0;
}

#pagination-controls {
    display: flex;
    gap: 10px; /* Add spacing between pagination elements */
}

#page-indicator {
    color: white; /* Change text color to white */
    font-size: 26px; /* Adjust font size if needed */
    display: flex;
    align-items: center; /* Vertically center the text */
    justify-content: center; /* Horizontally center the text */
    height: 100%; /* Ensure it takes full height for centering */
}


button:disabled {
    background-color: #808080; /* Grey color for disabled state */
    cursor: not-allowed; /* Change cursor to signify it's disabled */
    opacity: 0.6; /* Make it look faded */
    box-shadow: none; /* Remove glow/shadow for disabled buttons */
}



#music-page-title {
    text-align: center;
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    background: linear-gradient(90deg, #ff00ff, #00d4ff, #ffcc00, #ff00ff);
    background-size: 300% 300%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 0px 10px rgba(255, 0, 255, 0.8), 0px 0px 20px rgba(0, 212, 255, 0.8);
    animation: glow 1.5s infinite alternate, gradientShift 5s infinite linear;
    font-style: normal;
    display: block;
    width: 100%;
    margin: 0px auto;
    position: relative;
}

/* Glowing animation */
@keyframes glow {
    0% {
        text-shadow: 0px 0px 10px rgba(255, 0, 255, 0.8), 0px 0px 20px rgba(0, 212, 255, 0.8);
    }
    100% {
        text-shadow: 0px 0px 20px rgba(255, 0, 255, 1), 0px 0px 30px rgba(0, 212, 255, 1);
    }
}

/* Gradient animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}



#follow-insta a {
    padding: 8px 12px;
    border: 2px solid rgba(0, 100, 255, 0.7); /* Outline around the link */
    border-radius: 8px;
    background-color: rgba(0, 0, 50, 0.2); /* Semi-transparent background */
    text-decoration: none;
    color: #00d4ff;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#follow-insta a:hover {
    text-decoration: underline;
    color: #005ce6; /* Slightly darker blue for hover */
    background-color: rgba(0, 100, 255, 0.1); /* Slightly lighter transparent background on hover */
    border-color: rgba(0, 150, 255, 0.8); /* Brighten the border on hover */
}


.btn {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.btn:hover {
    transform: scale(1.1); /* Slightly enlarge */
    box-shadow: 0 0 20px rgba(0, 255, 150, 0.8); /* Neon glow effect */
}


.golden-tint {
    background-color: rgba(255, 215, 0, 0.2); /* Soft golden tint */
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8); /* Glowing golden effect */
    border: 2px solid gold;
}

/* Star container for positioning */
.star-container {
    position: absolute;
    width: 40px;
    height: 40px;
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
    z-index: -1;
}

/* White outer star */
/* Outer star with stronger static glow */
.outer-star {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: white;
    clip-path: polygon(
        50% 0%, 
        61% 35%, 
        98% 35%, 
        68% 57%, 
        79% 91%, 
        50% 70%, 
        21% 91%, 
        32% 57%, 
        2% 35%, 
        39% 35%
    );
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}


/* Black inner star */
.inner-star {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: black;
    clip-path: polygon(
        50% 0%, 
        61% 35%, 
        98% 35%, 
        68% 57%, 
        79% 91%, 
        50% 70%, 
        21% 91%, 
        32% 57%, 
        2% 35%, 
        39% 35%
    );
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}




#page-wrapper {
  height: 100vh;
  overflow-x: auto; /* Enable horizontal scroll */
  overflow-y: hidden;
  display: flex;
}


#middle-spacer {
  flex-grow: 1; /* this takes up all extra space */
  min-width: 30px; /* optional: give it a minimum width */
}


#main-content {
  width: 850px;
  flex-grow: 0;
  flex-shrink: 0;
  position: relative;  /* ✅ Isolate transforms inside */
  overflow: hidden;    /* ✅ Clip any translated content */
}




#side-space {
    width: 1000px;
    flex-shrink: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: rgba(0, 0, 0, 0.0);
    display: block; /* make sure it's block-level */
    
}





#side-top {
  display: flex;
  flex-direction: row;
  flex-grow: 1;
  height: 1000px; /* ✅ Enforces vertical limit */
  overflow: hidden; /* Prevent children from overflowing */
}
.half-box {
    flex: 1;
}

@keyframes panBackgroundRight {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}



.left-half {
  transition: background-image 2s ease-in-out;
  border-bottom-left-radius: 36px;
  position: relative;
  overflow-y: auto;         /* ✅ enables vertical scrolling */
  max-height: 100%;         /* ✅ makes sure it doesn't overflow its container */
  background-color: black;
}

  
  .left-bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
    border-bottom-left-radius: 36px;

    background-repeat: repeat-x;
    animation: panBackgroundRight 60s linear infinite;
  }
  
  .left-bg-layer.fading-in {
    z-index: 2;
    opacity: 1;
  }
  
  .left-bg-layer.visible {
    z-index: 1;
    opacity: 1;
  }
  
  .left-bg-layer.hidden {
    z-index: 0;
    opacity: 0;
  }
  
  
  

  .right-half {
    background-color: rgba(0, 0, 50, 0.8);
    padding: 20px;
    overflow-y: auto;
}

.right-half::-webkit-scrollbar,
.right-half *::-webkit-scrollbar {
  width: 8px;
}

.right-half::-webkit-scrollbar-thumb,
.right-half *::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

.right-half::-webkit-scrollbar-thumb:hover,
.right-half *::-webkit-scrollbar-thumb:hover {
  background: #888;
}




#side-bottom {
    height: 500px;
    position: relative;
    padding: 5px;
    overflow: visible; /* just in case */
    color: white;
    font-family: 'Kanit', sans-serif;
    display: flex;
    flex-shrink: 0; /* ✅ prevent it from being squished */
    align-items: center;
    justify-content: center;
}

#form-wrapper {
    position: relative;
    height: 100%;
    width: 50%;
    display: flex;
  flex-direction: column;
  justify-content: center; /* ✅ vertical centering */
  align-items: center;

}

#login-form, #signup-form, #logout-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
}



#logout-section {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#logout-top {
  flex-grow: 1; /* takes all free space */
  display: flex;
  flex-direction: column;
  justify-content: center; /* center contents vertically */
  align-items: center;
}

#logout-btn {
  align-self: center;
  width: 80%;
  max-width: 200px;
  margin-top: 12px;
}


#login-form {
    display: flex;
}

#side-bottom input {
    width: 220px;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

#side-bottom button {
    width: 140px;
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
    background-color: #005ce6;
    color: white;
    cursor: pointer;
    font-size: 13px;
}

#side-bottom button:hover {
    background-color: #0077ff;
}

#side-bottom p {
    font-size: 12px;
    color: #ccc;
    margin: 0;
    text-align: center;
    max-width: 220px;
}


.button-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.button-loading::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid #fff;
    border-top: 2px solid #005ce6;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}


.selected-row {
    outline: 3px solid #00d4ff;
    outline-offset: -3px;
    background-color: rgba(0, 0, 0, 0.7); /* Optional: enhance focus effect */
}

#music-container {
  height: 100vh;            /* Fill the viewport vertically */
  overflow: hidden;         /* Hide anything that overflows */
  position: relative;       /* Create local stacking and transform context */
}

#music-list {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* 👈 stretch items full width again */
    transition: transform 0.3s ease;
    overflow: visible; /* allow full height */
  max-height: none;  /* remove artificial max height */
  }
  


  #floating-center-btn:hover {
    transform: translate(-50%, -50%) scale(1.30);
    background-color: #00f0ff;
    box-shadow: 0 0 30px rgba(0, 255, 255, 1);
  }
  


  #floating-center-btn {
    font-family: 'Kanit', sans-serif;
    font-weight: 900;
    z-index: 10;
    font-size: 42px;
    padding: 4px 18px;
    background-color: #00d4ff;
    color: black;
    border-radius: 14px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.9);
    pointer-events: auto;
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
    animation: fadeInOpacity 0.25s ease-out forwards, idlePulse 1.8s ease-in-out infinite;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  }
  
  

  @keyframes fadeInOpacity {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  
  @keyframes fadeInCenter {
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }
  
  .fade-out {
    animation: fadeOutCenter 0.2s ease-in forwards;
  }
  
  @keyframes fadeOutCenter {
    to {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.9);
    }
  }
  

  @keyframes idlePulse {
    0%, 100% {
      transform: translate(-50%, -50%) scale(1);
      box-shadow: 0 0 40px rgba(0, 212, 255, 0.8);
    }
    50% {
      transform: translate(-50%, -50%) scale(1);
      box-shadow: 0 0 85px rgba(0, 255, 255, 1);
    }
  }
  


  @keyframes slideFadeIn {
    0% {
      transform: translateX(-20px);
      opacity: 0;
    }
    100% {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  #leaderboard-display {
    position: relative;
    padding: 20px;
    font-family: 'Kanit', sans-serif;
    color: white;
    z-index: 1;
    max-height: 100%;
    overflow-y: auto;
  }

  /* optional: style the scrollbar like on the right side */
#leaderboard-display::-webkit-scrollbar {
  width: 8px;
}

#leaderboard-display::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

#leaderboard-display::-webkit-scrollbar-thumb:hover {
  background: #888;
}
  
  #leaderboard-display h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #00ffff;
    text-shadow: 0 0 5px rgba(0,255,255,0.3);
  }
  
  #leaderboard-display ol {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-size: 18px;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
  
    /* animation */
    opacity: 0;
    transform: translateX(-20px);
    animation: slideFadeIn 0.4s ease forwards;
  }
  
  .leaderboard-entry span:first-child {
    font-size: 18px;
  }
  
  .leaderboard-entry span:last-child {
    font-family: monospace;
    font-size: 17px;
  }
  
  .leaderboard-entry:hover {
    background-color: rgba(255,255,255,0.08);
    transform: scale(1.02);
  }
  

  .row-click-overlay {
    background: transparent;
    pointer-events: auto;
  }
  




  .song-row.shifted-left {
    transform: translateX(-100px);
    /* transition: transform 0.3s ease; */
    opacity: 0.4;
  }
  
  .song-row.selected-row {
    transform: translateX(0); /* Reset shift for selected */
    opacity: 1;
  }
  

  #volume-slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 20px;
  }
  
  #volume-slider {
    width: 100px;
    cursor: pointer;
    margin-right:30px;
  }
  



  .sort-dropdown {
    padding: 8px 12px;
    background-color: #000a33;
    color: #00d4ff;
    border: 2px solid #005ce6;
    border-radius: 6px;
    font-size: 16px;
    box-shadow: 0 0 8px rgba(0, 150, 255, 0.5);
    font-family: 'Kanit', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
  }
  
  .sort-dropdown:hover {
    background-color: #001f4d;
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.8);
  }
  
  .sort-dropdown:focus {
    outline: none;
    box-shadow: 0 0 14px rgba(0, 255, 255, 0.9);
  }
  


  /* @keyframes songRowPopIn {
    0% {
      opacity: 0;
      transform: translate(-100px, 20px) scale(0.95);
    }
    100% {
      opacity: 0.4;
      transform: translateX(-100px) translateY(0) scale(1);
    }
  }
   */
/*   
  .song-row.animate-in {
    animation: songRowPopIn 0.4s ease-out forwards;
  }
   */




  #engine-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    pointer-events: auto;
  }
  
  .engine-loading-content {
    text-align: center;
    color: white;
    font-family: 'Kanit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }
  
  #engine-loading-text {
    font-size: 1.8rem;
    margin-top: 20px;
    text-shadow: 0 0 10px #00d4ff;
  }
  
  #engine-loading-overlay .spinner {
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid #00d4ff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
  }
  
  

  .iframe-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .iframe-popup-content {
    background-color: #111;
    border: 2px solid #00d4ff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    font-family: 'Kanit', sans-serif;
    color: white;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
  }
  
  .iframe-popup.hidden {
    display: none;
  }
  

  .guest-title {
    font-size: 64px;
    color: #00d4ff;
    font-weight: 900;
    text-shadow: none;
  }
  


  .footer {
    padding: 5px 0;
    background-color: rgba(0, 0, 0, 0.0); /* or 0.2 for subtle tint */
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .social-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding-top: 10px;
    
  }

  .social-link {
    background: none !important;
    padding: 0;
    box-shadow: none;
    border: none;
  }
  
  
  .social-link img {
    width: 32px;
    height: 32px;
    filter: brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(0%) hue-rotate(240deg);
    transition: filter 0.3s ease, transform 0.2s ease;
  }
  
  .social-link:hover img {
    filter: brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(0%) hue-rotate(240deg);
    transform: scale(1.1);
  }
  


  .practice-floating-button {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 16px;
    padding: 6px 16px;
    background-color: #00d4ff;
    color: black;
    border: none;
    border-radius: 12px;
    font-family: 'Kanit', sans-serif;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    outline: none;
    box-shadow: none;

    
    animation: fadeInOpacity 0.25s ease-out forwards, idlePulse 1.8s ease-in-out infinite;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  }
  
  .practice-floating-button:hover {
    background-color: #33e0ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 1);
  }
  
  
  
  .song-stats-box {
    position: absolute;
    bottom: 5px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
    pointer-events: none;
  }
  


  .like-floating-button {
    padding: 7px 10px;
    font-size: 14px;
    background-color: #ff44aa;
    color: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(255, 68, 170, 0.8);
    z-index: 3;
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease;

    width: 75px; /* Adjust as needed */
    text-align: center;
    white-space: nowrap;
  }
  
  .like-floating-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 68, 170, 1);
  }
  

.like-loading-spinner {
  border: 3px solid #fff;
  border-top: 3px solid #00ffd9;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: pulseSpin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

/* 🔁 Custom animation */
@keyframes pulseSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}



.like-floating-button.liked {
  background-color: #3cc36e !important; /* light green */
}

.like-floating-button.unliked {
  background-color: #ff4d6d !important; /* reddish-pink */
}



#intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: white;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: all;
}

#close-intro-overlay {
  position: absolute;
  top: 20px;
  right: 30px;
  padding: 10px 18px;
  background-color: black;
  color: white;
  font-size: 20px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10000;
}







#black-fade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: black;
  z-index: 4000; /* must be under iframe (5000), but over page content */
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.8s ease;
  will-change: opacity;
  transform: none !important;
}



#black-fade-overlay.blackout-fade-out {
  opacity: 0;
}



#email-verification-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#email-verification-overlay.hidden {
  display: none;
}

#code-input-container input {
  width: 36px;
  height: 48px;
  font-size: 28px;
  text-align: center;
  border: 2px solid white;
  border-radius: 6px;
  background: black;
  color: white;
  outline: none;
}

.email-spinner {
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top: 6px solid #00d4ff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: email-spin 1s linear infinite;
}

@keyframes email-spin {
  to { transform: rotate(360deg); }
}



#bottom-controls-bar {
  position: fixed;
  bottom: 0;
  left: 0; /* Will be overridden below */
  background-color: rgba(128, 128, 128, 0.6);
  z-index: 11;
  height: 100px;
  width: 850px; /* Match main-content */
  margin-left: 0;
  display: flex;
  display: none !important;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.5);
}


.bottom-controls-content {
  font-size: 18px;
  color: white;
  font-weight: bold;
  font-family: 'Kanit', sans-serif;
  text-align: left;
}










.layer {
  position: fixed;
  top: -80px;   /* give buffer above */
  left: -80px;  /* give buffer left */
  width: calc(100vw + 160px); /* viewport + padding both sides */
  height: calc(100vh + 160px);
  pointer-events: none;
  z-index: 0;
  overflow: hidden; /* prevent scrollbars from the extra size */
}


.layer .square {
  position: absolute;
  background: rgba(255, 255, 255, 1);
  border: 2px solid rgba(255, 255, 255, 1);
  opacity: 0.05;
  border-radius: 8px;
  animation: fadeInOut 6s ease-in-out infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.25; }
}





/* Left panel leaderboard: loading row */
#leaderboard-display .lb-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.9;
  font-size: 14px;
  color: #ccc;
}

/* Small spinner used inside side panel */
.spinner--sm {
  border: 4px solid rgba(255,255,255,0.25);
  border-top: 4px solid #00d4ff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  animation: spin 0.9s linear infinite;
}

#leaderboard-meta {
  margin-top: 12px;
  font-size: 12px;
  color: #aaaaaa;
  text-align: right;
  opacity: 0.9;
}



@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}





/* --- Wallet / Profile card --- */
.profile-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 18px 18px 20px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(0,212,255,0.12), rgba(0,0,0,0.6)),
              rgba(0,0,0,0.55);
  border: 1px solid rgba(0,212,255,0.35);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4), inset 0 0 18px rgba(0,212,255,0.08);
  backdrop-filter: blur(2px);
  color: #e9faff;
}

.profile-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.profile-hello {
  font-size: 18px;
  opacity: 0.85;
}

.profile-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
}

.balance-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  row-gap: 8px;
  column-gap: 14px;
  margin-top: 4px;
}

.balance-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8fe7ff;
  font-weight: 600;
  white-space: nowrap;
}

.balance-dots {
  height: 1px;
  background: linear-gradient(90deg, transparent, #00d4ff80, transparent);
}

.balance-value {
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.wallet-note {
  margin-top: 10px;
  font-size: 14px;
  color: #9adfff;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.35);
  text-align: center;
}

.wallet-cta {
  margin-top: 10px;
  width: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #7b2cbf, #b5179e);
  color: #fff;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(181, 23, 158, 0.35);
  display: block;       /* allow margin auto to work */
  margin: 12px auto 0;  /* center horizontally */
}





