html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Ruda', sans-serif;
  background-color: #171C2B;
}

@font-face {
  font-family: 'Technology';
  src: url('/fonts/Technology-Regular.woff2') format('woff2'), url('/fonts/Technology-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fony';
  src: url('/fonts/fony.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

svg {
  transform: translateZ(0);
  backface-visibility: hidden;
}

#preloader {
  position: fixed;
  inset: 0;
  background-color: #171C2B;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.5s ease;
}

#preloader.fade-out-background {
  opacity: 0;
}

#preloader-text {
  display: flex;
}

.container {
  display: flex;
  flex-direction: row;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: #171C2B;
  transition: opacity 1.5s ease;
}

.preloader-letter {
  font-size: 1.5rem;
  font-weight: 100;
  letter-spacing: 6px;
  color: #00F2B8;
  font-family: 'Fony';
  margin-bottom: 0.5rem;
  opacity: 0;
  transform: rotateX(-90deg);
  animation: flipFadeIn 0.5s forwards;
}

@keyframes flipFadeIn {
  to {
    opacity: 1;
    transform: rotateX(0deg);
  }
}

#preloader-text.fade-out-text span {
  animation: fadeOut 0.5s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
  }
}

.manifesto-button {
  position: fixed;
  top: 5px;
  right: 35px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

.manifesto-button img {
  width: 17px;
  height: 17px;
}

.manifesto-modal {
  display: none;
  position: fixed;
  z-index: 19999;
  inset: 0;
  overflow: auto;
  background-color: rgba(23, 28, 43, 0.2);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.5s ease;
  font-family: monospace, monospace;
}

.manifesto-modal a {
  color: #00F2B8;
  text-decoration: none;
  font-weight: bold;
}

.manifesto-icons {
  position: absolute;
  top: 2rem;
  left: 2rem;
  display: flex;
  gap: 20px;
}

.save-settings-btn {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 25px;
  background-color: #00F2B8;
  color: #171C2B;
  cursor: pointer;
  font-family: Ruda;
}

.save-settings-btn:hover {
  scale: 0.95;
}

.settings-panel {
  max-width: 420px;
  margin: 0 auto;
  padding: 10px 4px 0;
  font-family: 'Ruda', sans-serif;
}

.settings-title {
  margin: 0 0 14px;
  text-align: center;
  color: #00F2B8;
  font-family: 'Ruda', sans-serif;
  font-size: 1.5rem;
}

.settings-options {
  display: grid;
  gap: 10px;
}

.settings-option {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d9fff3;
  font-size: 0.98rem;
}

.settings-option input {
  accent-color: #00F2B8;
}

.settings-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.settings-btn {
  border: 1px solid #00F2B8;
  background: transparent;
  color: #00F2B8;
  border-radius: 999px;
  padding: 8px 12px;
  font-family: 'Ruda', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
}

.settings-btn-danger {
  border-color: #ff5f7c;
  color: #ff9bb0;
}

.settings-save {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 2px;
}

.manifesto-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  background: none;
  border: none;
  color: #00F2B8;
  cursor: pointer;
}

.disclaimer {
  margin-top: 3rem;
}

.manifesto-content {
  background-color: #171C2B;
  margin: 2% auto;
  padding: 2rem;
  border: 2px solid #00F2B8;
  border-radius: 25px;
  color: #fff;
  max-width: 960px;
  position: relative;
  animation: slideUp 0.4s ease;
}

.manifesto-content.settings-view {
  max-width: 500px;
  padding: 1.2rem 1rem 1rem;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.left-panel {
  display: flex;
  flex-direction: column;
  width: 65%;
  padding: 20px;
  box-sizing: border-box;
  background-color: #f2f2f2;
  transition: background-color 0.5s ease;
}

#resizer {
  position: absolute;
  top: 0;
  left: calc(65% - 2.5px);
  width: 5px;
  height: 100%;
  background-color: transparent;
  cursor: ew-resize;
  z-index: 10;
}

.right-panel {
  width: 35%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: linear-gradient(135deg, #5587e4 0%, #d68255 20%, #ec7b2a 40%, #4b85ea 60%, #C36C8B 80%, #55cbd8 100%);
  padding: 20px;
  overflow-y: auto;
  box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
}

.top-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 100;
  letter-spacing: 6px;
  color: #171C2B;
  font-family: 'Fony';
  margin-bottom: 0.5rem;
}

body.dark .logo {
  color: #00F2B8;
}

.screen-and-diods {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.screen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-color: #171C2B;
  border: 2px solid #686868;
  border-radius: 50px;
  padding: 15px;
  width: 95%;
  margin-bottom: 10px;
}

.station-label {
  font-size: 1.3rem;
  font-weight: bold;
  color: #00F2B8;
}

.track-name {
  font-size: 1rem;
  color: #fff;
}

.track-name a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.track-name a:hover {
  text-decoration: underline;
  color: #00F2B8;
}

@keyframes dots {
  0% { content: '|'; }
  25% { content: '/'; }
  50% { content: '—'; }
  75% { content: '\\'; }
  100% { content: '|'; }
}

.scrolling-text.loading::after {
  content: '|';
  display: inline-block;
  margin-left: 6px;
  font-weight: bold;
  animation: dots 1s steps(4, end) infinite;
  font-family: monospace, monospace;
  user-select: none;
}

.play-timer {
  font-size: 2rem;
  color: #fff;
  margin: 0 10px;
  font-family: 'Technology';
  letter-spacing: 2px;
}

.diods-row {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 20px;
  width: 85%;
}

.equalizer-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 25px;
  width: 100%;
  height: 50px;
}

.equalizer-bar {
  border-radius: 2px;
}

.hidden {
  display: none;
}

#gitbookModal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(23, 28, 43, 0.8);
  backdrop-filter: blur(5px);
  justify-content: center;
  align-items: center;
  font-family: 'Ruda', sans-serif;
  z-index: 20000;
}

#gitbookModal a {
  color: #00F2B8;
  text-decoration: none;
  font-weight: bold;
}

#gitbookModal .manifesto-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  background-color: #171C2B;
  border: 2px solid #00F2B8;
  border-radius: 3px;
  padding: 1rem 1.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #00F2B8 #171C2B;
  font-family: 'Ruda', sans-serif;
  color: #ddd;
}

#gitbookModal .manifesto-content::-webkit-scrollbar {
  width: 8px;
}

#gitbookModal .manifesto-content::-webkit-scrollbar-track {
  background: #171C2B;
  border-radius: 4px;
}

#gitbookModal .manifesto-content::-webkit-scrollbar-thumb {
  background-color: #00F2B8;
  border-radius: 4px;
}

#gitbookCloseBtn {
  position: sticky;
  top: 0;
  right: 0;
  float: right;
  background: none;
  border: none;
  color: #00F2B8;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  z-index: 10;
  backdrop-filter: none;
}

#chatToggleBtn {
  position: relative;
  background-color: #00F2B8;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: bold;
  font-family: 'Ruda', sans-serif;
  color: #171C2B;
  z-index: 10;
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}

#chatToggleBtn .tooltip-text {
  position: absolute;
  top: 50%;
  right: 100%;
  margin-right: 10px;
  transform: translateY(-50%) translateX(10px);
  background-color: #00F2B8;
  color: #171C2B;
  padding: 6px 10px;
  border-radius: 25px;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Ruda', sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform-origin: right center;
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}

#chatToggleBtn:hover .tooltip-text {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
  box-shadow: rgba(0, 0, 0, 0.19) 0px 10px 20px, rgba(0, 0, 0, 0.23) 0px 6px 6px;
}

.genre-box {
  margin-bottom: 15px;
  margin-left: 1rem;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 1.2rem;
}

.genre-select {
  padding: 8px 0;
  padding-left: 30px;
  font-size: 1.2rem;
  border-radius: 3px;
  border: none;
  outline: none;
  cursor: pointer;
  background-color: #68686800;
  color: #fff;
  font-family: 'Ruda', sans-serif;
  text-decoration: underline;
  scrollbar-width: thin;
  scrollbar-color: #00F2B8 #f2f2f265;
  border-radius: 22px;
  background-repeat: no-repeat;
  background-position: 6px center;
  background-size: 16px 16px;
}

.genre-select option {
  font-size: 1rem;
  padding: 10px 12px;
  padding-left: 28px;
  cursor: pointer;
  background: #171c2b;
  background-repeat: no-repeat;
  background-position: 6px center;
  background-size: 14px 14px;
  color: #fff;
  font-family: 'Ruda', sans-serif;
}

/* Custom Genre Select Styles */
.custom-genre-select {
  position: relative;
  display: inline-block;
  min-width: 150px;
}

.genre-select-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  padding-left: 8px;
  font-size: 1.2rem;
  border-radius: 22px;
  border: none;
  cursor: pointer;
  background-color: #68686800;
  color: #fff;
  font-family: 'Ruda', sans-serif;
  text-decoration: underline;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.genre-select-header:hover {
  background-color: #686868 15;
}

.genre-select-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.genre-select-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.genre-select-text {
  flex: 1;
}

.genre-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #171c2b;
  border-radius: 8px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  z-index: 1000;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
}

.genre-select-dropdown.open {
  max-height: 400px;
  opacity: 1;
  overflow-y: auto;
}

.genre-select-dropdown::-webkit-scrollbar {
  width: 8px;
}

.genre-select-dropdown::-webkit-scrollbar-track {
  background: #171c2b;
}

.genre-select-dropdown::-webkit-scrollbar-thumb {
  background: #00F2B8;
  border-radius: 4px;
}

.genre-select-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.genre-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  color: #fff;
  font-family: 'Ruda', sans-serif;
  font-size: 1rem;
  transition: background-color 0.15s;
}

.genre-select-item:hover {
  background-color: #1f2333;
}

.genre-select-item.selected {
  background-color: #00F2B8 20;
  font-weight: 500;
}

.genre-select-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.genre-select-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.search-wrapper {
  position: relative;
  display: inline-block;
  flex: 1;
}

.genre-search {
  box-sizing: border-box;
  width: 100%;
  margin-left: 0;
  border: 2px solid #fff;
  border-radius: 50px;
  padding: 4px 22px 4px 8px;
  color: #fff;
  background-color: transparent;
  font-family: 'Ruda', sans-serif;
}

.genre-search::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Ruda', sans-serif;
  padding-left: 0.2rem;
}

.genre-search:focus {
  outline: none;
  box-shadow: none;
}

#clearSearch {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  color: #fff;
  display: none;
  line-height: 1;
}

#clearSearch:hover {
  color: #fff;
}

#connectWalletBtn {
  margin-left: auto;
}

#walletAddress {
  font-size: 1rem;
  margin-left: auto;
}

#radioModeBtn {
  margin-left: auto;
  margin-right: 0;
}

.playlist-area {
  flex: 1;
  border-radius: 12px;
  padding: 5px;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #00F2B8 #f2f2f265;
  border-radius: 22px;
}

#playlistLoader {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50px;
  padding: 0.5rem;
  z-index: 999;
}

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

#playlist {
  list-style: none;
  margin: 0;
  padding: 15px;
  overflow-x: hidden;
}

#playlist li.draggable-favorite {
  background-color: var(--favorite-bg, #ffffff39);
  color: #171C2B;
  border: 1px solid rgba(0, 242, 184, 0.15);
}

#playlist li {
  background-color: #ffffff39;
  color: #171C2B;
  padding: 10px;
  margin-bottom: 5px;
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  --buffer-percent: 0%;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.2s;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

#playlist li.active {
  background-color: #171C2B;
  color: #00F2B8;
}

#playlist li.draggable-favorite.active {
  background-color: #171C2B;
  color: #00F2B8;
  border-color: rgba(0, 242, 184, 0.35);
}

#playlist li.active .title-ellipsis {
  display: inline-block;
  max-width: calc(100% - 240px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

#playlist li .progress {
  position: absolute;
  inset: 0 0 0 0;
  height: 100%;
  width: var(--buffer-percent, 0%);
  background-color: #171c2b8b;
  color: #00F2B8;
  border-radius: 3px;
  z-index: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  opacity: 1;
}

#playlist li.radio-mode .progress {
  background-color: #171c2b8b;
}

#playlist li.web3-mode .progress {
  background-color: #00F2B8;
}

#playlist li:hover {
  background-color: #00F2B8;
  color: #000;
  scale: 1.02;
  transition: all 0.3s ease-in-out;
}

#playlist li.radio-mode:hover {
  background-color: #00F2B8;
  color: #000;
}

#playlist li.web3-mode:hover {
  background-color: #ffffff77;
  color: #000;
}

/* Hide remove button by default, show on hover and for active station */
#playlist li .remove-btn {
  opacity: 0;
  color: #00F2B8;
  background-color: transparent;
  transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  pointer-events: none;
}

#playlist li:hover .remove-btn {
  opacity: 1;
  color: #171C2B;
  pointer-events: auto;
}

#playlist li.active .remove-btn {
  opacity: 1;
  color: #00F2B8;
  background-color: transparent;
  pointer-events: auto;
}

#playlist li.active:hover {
  color: #171C2B;
}

/* Match active hover delete button with text/icon colors */
#playlist li.active:hover .remove-btn {
  color: #171C2B;
  background-color: #00F2B8;
}

#playlist li.buffer-complete .progress {
  opacity: 0;
}

#playlist li img.station-icon {
  width: 40px;
  height: 40px;
  object-fit: cover;
  position: relative;
  z-index: 1;
  border-radius: 3px;
}

#playlist li span {
  position: relative;
  z-index: 1;
}

.favorite-heart {
  filter: brightness(0) invert(1);
  transform: scale(0.7);
  transition: transform 0.3s ease;
  transform-origin: center;
}

.favorite-heart.bounce {
  animation: heartBounce 0.5s ease-out forwards;
}

@keyframes heartBounce {
  0% { transform: scale(0.2); opacity: 0; }
  50% { transform: scale(1.3); opacity: 1; }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.favorites-filter-icon {
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
  margin-right: 1rem;
  cursor: pointer;
  height: 2.5rem;
  pointer-events: auto;
}

.favorites-filter-icon.active {
  filter: invert(7%) sepia(20%) saturate(500%) hue-rotate(200deg) brightness(90%) contrast(100%);
}

/* Station favorite icon styles for favorites mode */
.station-favorite-icon {
  animation: iconSlideIn 0.3s ease-out;
  flex-shrink: 0;
}

.station-avatar {
  box-shadow: none;
  border: none;
  transition: all 0.3s ease;
}

.station-favorite-icon:hover .station-avatar {
  transform: scale(1.1);
  box-shadow: none;
}

.genre-icon {
  display: block;
  background-color: #00F6B4;
}

.favorites-sort {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.favorites-sort label {
  font-family: 'Ruda', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.favorites-sort select {
  appearance: none;
  background: transparent;
  color: #fff;
  border: none;
  border-radius: 0;
  padding: 4px 0;
  font-family: 'Ruda', sans-serif;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  min-width: 140px;
  position: relative;
  text-decoration: underline;
}

.favorites-sort select option {
  background: #171C2B;
  color: #fff;
  font-family: 'Ruda', sans-serif;
}

.favorites-sort::after {
  content: "";
}

@keyframes iconSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chat-messages {
  scrollbar-width: thin;
  scrollbar-color: #00F2B8 #262f49;
  border-radius: 22px;
}

.chat-messages::-webkit-scrollbar,
.playlist-area::-webkit-scrollbar,
.genre-select::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.playlist-area::-webkit-scrollbar-track,
.genre-select::-webkit-scrollbar-track {
  background: #f2f2f200;
}

.chat-messages::-webkit-scrollbar-thumb,
.playlist-area::-webkit-scrollbar-thumb,
.genre-select::-webkit-scrollbar-thumb {
  background-color: #00F2B8;
  border-radius: 10px;
}

#themeToggle {
  position: absolute;
  top: 5px;
  right: 5px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1000;
}

#themeToggle img {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

#manifestoBtn img {
  transition: opacity 0.2s ease-in-out;
}

body:not(.dark) #manifestoBtn img:hover {
  content: url('/img/about_icon_hover.svg');
}

body.dark #manifestoBtn img:hover {
  content: url('/img/dark/about_icon_hover.svg');
}

.migration-notice-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: rgba(10, 14, 24, 0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.migration-notice-content {
  position: relative;
  width: min(620px, 100%);
  background: #171C2B;
  border: 2px solid #00F2B8;
  border-radius: 20px;
  padding: 24px;
  color: #fff;
  text-align: center;
  font-family: 'Ruda', sans-serif;
}

.migration-notice-content h2 {
  margin-top: 0;
  color: #00F2B8;
}

.migration-notice-content a {
  color: #00F2B8;
  font-weight: 700;
}

.migration-notice-settings-btn {
  margin-top: 8px;
  border: 1px solid #00F2B8;
  background: transparent;
  color: #00F2B8;
  border-radius: 999px;
  padding: 8px 14px;
  font-family: 'Ruda', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
}

.migration-notice-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #00F2B8;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
