:root {
  --bg-gradient: linear-gradient(135deg, #820c7a, #ef745c);
  --overlay-gradient: linear-gradient(135deg, #5f0959, #c35a47);
  --text-color: #cfefff;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  background-image: var(--bg-gradient);
  overscroll-behavior: none;
  overflow: hidden;
  touch-action: pan-x pan-y;
}

body {
  position: relative;
  padding: 0px;
  margin: 0px;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--bg-gradient);
  font-family: 'Jura', sans-serif;
  font-weight: 400;
  overscroll-behavior: none;
  overflow: hidden;
}

.button-icon {
  width: 40px;
  height: 40px;
}

.button-icon:focus {
  outline: none;
}

.next-button {
  margin-left: 4px;
}

.previous-button {
  margin-right: 4px;
}

.toggle-bars-icon,
.shuffle-icon {
  height: 30px;
  width: 30px;
}

.toggle-lyrics-icon,
.toggle-queue-icon {
  height: 36px;
  width: 36px;
}

.button {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 100%;
  background: none;
  vertical-align: middle;
  align-content: center;
}

.button:focus {
  outline: none;
}

.music-player {
  display: none;
}

.control-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
}

.content {
  height: auto;
  width: 100%;
  bottom: 180px;
  top: 60px;
  position: fixed;
}

nav {
  grid-area: 1 / 1;
}

footer {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}

.footer-side--right {
  grid-area: 1 / 1;
  justify-self: end;
  padding-right: 16px;
}

.overlay {
  height: 100%;
  width: 100%;
  display: none;
  position: fixed;
  padding-top: 40vh;
  background-image: var(--overlay-gradient);
  opacity: 0.9;
  z-index: 5;
}

.load-spinner {
  margin: 0 auto;
  -webkit-animation: rotation 1s infinite linear;
}

@-webkit-keyframes rotation {
  from {
    -webkit-transform: rotate(0deg);
  }
  to {
    -webkit-transform: rotate(359deg);
  }
}

.song-name {
  text-align: center;
  display: none;
  font-size: 24px;
  color: var(--text-color);
  white-space: nowrap;
}

.song-name--scrolling {
  animation: marquee var(--marquee-duration, 6s) ease-in-out infinite alternate;
}

@keyframes marquee {
  0%,
  15% {
    transform: translateX(0);
  }
  85%,
  100% {
    transform: translateX(var(--marquee-offset, 0px));
  }
}

.name-holder {
  align-items: center;
  display: flex;
  justify-content: center;
  height: 30px;
  width: 80%;
  margin: 0 auto;
  overflow: hidden;
}

.name-holder:has(.song-name--scrolling) {
  justify-content: flex-start;
}

.slider-container {
  width: 78%;
  display: flex;
}

.progress {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: #d3d3d3;
  outline: none;
  opacity: 0.3;
  margin: 0 auto;
  -webkit-transition: 0.2s;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.volume-regulator {
  writing-mode: vertical-rl;
  direction: rtl;
  appearance: none;
  position: absolute;
  bottom: 100%;
  left: calc(4vw + 7px);
  margin-bottom: 12px;
  opacity: 0;
  width: 10px;
  height: 120px;
  border-radius: 5px;
  transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.progress:hover {
  opacity: 0.5;
}

.current-time {
  display: flex;
  text-align: left;
  padding-left: 2vw;
  margin-top: -3px;
  font-size: 24px;
  width: 11%;
  white-space: nowrap;
}

.volume-button {
  margin-left: 1vw;
  width: 24px;
  vertical-align: middle;
}

.volume-settings:hover .volume-regulator {
  opacity: 0.3;
}

.volume-settings:mouseout .volume-regulator {
  opacity: 0;
  transition: opacity 0.5s ease-out 2s;
}

.volume-regulator:hover {
  opacity: 0.5;
}

.progress::-moz-range-thumb,
.volume-regulator::-moz-range-thumb {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #000000;
  cursor: pointer;
}

.progress::-webkit-slider-thumb,
.volume-regulator::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #000000;
  cursor: pointer;
}

.volume-settings {
  padding-left: 3vw;
  width: 11%;
  display: flex;
  position: relative;
}

.canvas {
  width: 85%;
  height: 100%;
  align-content: center;
  margin: 0 auto;
  opacity: 0.8;
}

.chart {
  margin: 0 auto;
  text-align: center;
  width: 100%;
  height: 100%;
}

.no-select {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.footing-span {
  position: fixed;
  width: 100%;
  height: 165px;
  bottom: 0;
}

.status-string {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 10px 0;
}

.top-controls {
  position: absolute;
  display: flex;
  flex-direction: row;
  top: 16px;
  right: 16px;
}

.lyrics-button-wrapper {
  display: none;
}

.lyrics-panel {
  display: none;
  position: fixed;
  top: 70px;
  left: 7%;
  right: 7%;
  bottom: 170px;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  z-index: 4;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

.lyrics-content {
  width: 92%;
  max-height: 100%;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 28px 0;
  margin: 0 auto;
}

.lyrics-content::-webkit-scrollbar {
  display: none;
}

.lyrics-text {
  color: var(--text-color);
  font-family: 'Jura', sans-serif;
  font-size: 32px;
  text-align: center;
  white-space: pre-wrap;
  margin: 0;
}

.lyric-line {
  line-height: 1.5;
  margin-bottom: 40px;
}

.verse-break {
  height: 40px;
}

.queue-panel {
  display: none;
  position: fixed;
  top: 70px;
  right: 12px;
  width: 350px;
  max-height: 300px;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  z-index: 4;
  flex-direction: column;
  overflow: hidden;
}

.queue-content {
  display: flex;
  flex-direction: column;
  padding: 12px 12px 8px;
  gap: 8px;
}

.queue-search {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-bottom: 1px solid rgba(207, 239, 255, 0.35);
  border-radius: 6px 6px 0 0;
  color: var(--text-color);
  font-family: 'Jura', sans-serif;
  font-size: 14px;
  padding: 7px 10px;
  outline: none;
  caret-color: var(--text-color);
}

.queue-search::placeholder {
  color: rgba(207, 239, 255, 0.35);
}

.queue-search:focus {
  border-bottom-color: rgba(207, 239, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
}

.queue-list {
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  max-height: 228px;
}

.queue-list::-webkit-scrollbar {
  display: none;
}

.queue-item {
  color: var(--text-color);
  font-family: 'Jura', sans-serif;
  font-size: 14px;
  text-align: left;
  padding: 7px 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  opacity: 0.45;
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-item__title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item__btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-color);
  font-family: 'Jura', sans-serif;
  font-size: 16px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.15s,
    background 0.15s;
}

.queue-item:hover .queue-item__btn {
  opacity: 0.6;
}

.queue-item__btn--remove {
  opacity: 0.5;
}

.queue-item__btn:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.15);
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 0.7;
}

.queue-item--current {
  font-size: 15px;
  opacity: 1;
  cursor: default;
}

.queue-item--current:hover {
  background: none;
  opacity: 1;
}

.queue-item--next {
  opacity: 0.4;
}

.queue-empty {
  color: rgba(207, 239, 255, 0.4);
  font-family: 'Jura', sans-serif;
  font-size: 14px;
  text-align: center;
  padding: 16px 0;
}

.toggle-lyrics-button-active img,
.toggle-bars-button-active img,
.shuffle-button--active img,
.toggle-queue-button--active img {
  opacity: 0.55;
}

/* ── Touch / mobile ─────────────────────────────────────── */

@media (pointer: coarse) {
  .lyrics-panel {
    left: 10%;
    right: 10%;
  }

  .lyrics-text {
    color: var(--text-color);
    font-family: 'Jura', sans-serif;
    font-size: 20px;
    text-align: center;
    white-space: pre-wrap;
    margin: 0;
  }

  .button {
    width: 64px;
    height: 64px;
  }

  .toggle-bars-icon,
  .shuffle-icon,
  .toggle-lyrics-icon,
  .toggle-queue-icon {
    width: 32px;
    height: 32px;
  }

  .song-name {
    font-size: 26px;
  }

  .name-holder {
    height: 60px;
    margin: 0 auto;
  }

  .footing-span {
    height: calc(180px + env(safe-area-inset-bottom, 0px));
    bottom: 0;
  }

  .content {
    bottom: calc(180px + env(safe-area-inset-bottom, 0px));
    width: 90%;
    left: 5%;
  }

  .control-panel {
    padding-top: 8px;
    padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
    height: auto;
  }

  .status-string {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 6px 0;
    padding: 0 3vw;
    gap: 6px;
  }

  .volume-settings {
    flex-shrink: 0;
    padding-left: 0;
    min-width: 40px;
  }

  .volume-button {
    width: 24px;
    margin-left: 0;
  }

  .volume-regulator {
    left: 7px;
    opacity: 0.3;
  }

  .slider-container {
    flex: 1;
    width: auto;
    min-width: 0;
  }

  .progress {
    height: 14px;
    border-radius: 7px;
  }

  .current-time {
    flex-shrink: 0;
    font-size: 20px;
    padding-left: 5px;
    min-width: 40px;
    text-align: right;
  }

  .progress::-webkit-slider-thumb {
    width: 32px;
    height: 32px;
  }

  .progress::-moz-range-thumb {
    width: 32px;
    height: 32px;
  }

  .queue-panel {
    width: min(350px, calc(100vw - 24px));
    max-height: 380px;
  }

  .queue-list {
    max-height: 300px;
  }

  .queue-item {
    font-size: 16px;
    padding: 12px 10px;
  }

  .queue-item--current {
    font-size: 18px;
  }

  /* Always show action buttons on touch devices (no hover state) */
  .queue-item .queue-item__btn {
    opacity: 0.5;
  }

  .queue-search {
    font-size: 16px;
    padding: 10px 12px;
  }
}
