@media (max-width: 768px) {
  html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100svh;
    box-sizing: border-box;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
  }

  .container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .left-panel, .right-panel {
    width: 100%;
    padding: 10px;
  }

  .left-panel {
    flex: 0 0 auto;
  }

  .right-panel {
    flex: 1 1 auto;
    flex-direction: column;
    box-shadow: unset;
  }

  #chat {
    display: none !important;
  }

  #resizer {
    display: none;
  }

  .wadada {
    rotate: 90deg;
    top: unset;
    right: unset;
    bottom: 20%;
    left: -65px;
  }

  .wadada a {
    color: #fff;
  }

  .left-panel button {
    bottom: 10px !important;
    right: 10px !important;
    padding: 6px 10px !important;
    font-size: 14px;
  }

  .manifesto-button {
    position: fixed;
    top: 5px;
    left: 5px;
    right: unset;
    rotate: unset;
  }

  .manifesto-close {
    position: fixed;
    top: 5px;
    right: 15px;
    z-index: 3100;
    font-size: 3rem;
    background-color: #171C2B;
  }

  .manifesto-modal {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100dvh;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    margin: 0;
  }

  .manifesto-content {
    width: 100%;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    border-radius: 0;
    box-sizing: border-box;
    border: none;
  }

  .playlist-area {
    flex: 1 1 auto;
    overflow-y: auto;
  }

  #themeToggle img {
    width: 15px;
    height: 15px;
  }

  .station-label,
  .track-name {
    width: 60%;
  }

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

  .center-circle {
    position: relative;
  }

  .play-ellipse {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 170px;
    height: 170px;
  }

  .play-btn {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .player-controls {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    position: relative;
  }

  .chat-container {
    display: none;
    bottom: 1rem;
    max-height: 50%;
    max-width: 92%;
    border-radius: 25px;
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 0.5rem;
  }

  .genre-box,
  .genre-select {
    font-size: 1rem;
    max-width: 90%;
  }

  .genre-box {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

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

  .genre-search::placeholder {
    width: 6ch;
    padding-left: unset;
  }

  #connectWalletBtn {
    display: none !important;
  }

  #radioModeBtn {
    margin-left: auto;
  }

  #randomBtn {
    position: absolute;
    left: 50%;
    top: 145px;
    transform: translateX(-50%) !important;
    width: 170px;
    height: 80px;
    z-index: 999;
  }

  #randomBtn:hover,
  #randomBtn:active {
    transform: translateX(-50%) !important;
  }

  .volume-container {
    display: none;
  }

  #ffBtn:hover,
  #rrBtn:hover,
  #shuffleBtn:hover,
  #favBtn:hover,
  #ffBtn:active,
  #rrBtn:active,
  #shuffleBtn:active,
  #favBtn:active {
    transform: none !important;
    filter: none !important;
  }

  .player-btn {
    filter: unset;
  }

  .player-btn:hover {
    filter: unset;
    transform: translate(-50%, -50%) scale(0.95);
  }

  .play-btn:active {
    transform: translate(-50%, -50%) scale(0.95) !important;
    animation: none !important;
    transition: none !important;
  }

  #playlist li {
    box-shadow: unset;
  }

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

  .screen-and-diods {
    margin-bottom: 20px;
  }

  .screen {
    width: 90%;
    height: 1rem;
  }

  .diods-row {
    display: none;
  }

  .left-group,
  .right-group {
    max-width: unset;
    min-width: 100%;
    padding-left: 15px;
  }

  .right-group {
    justify-content: flex-start;
  }

  .right-group,
  .right-group .track-name,
  .right-group .scrolling-text,
  .right-group .scrolling-text a {
    margin-left: 0 !important;
  }

  .right-group .scrolling-text a {
    max-width: 100%;
  }

  .scrolling-text.marquee {
    animation: scrollText 10s linear infinite;
    display: inline-block;
    white-space: nowrap;
  }

  @keyframes scrollText {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
  }

  .track-name {
    max-width: 100%;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .station-label {
    width: 100%;
  }

  .center-group {
    display: none;
  }

  .play-ellipse {
    left: 50%;
    top: 32%;
    width: 150px;
    height: 150px;
  }

  .play-btn {
    left: 50%;
    top: 32%;
    width: 120px;
    height: 120px;
    object-fit: contain;
    display: block;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    backface-visibility: hidden;
    will-change: transform;
  }

  .left-stack,
  .right-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }
}

.player-controls.chat-collapsed {
  margin-top: 50px;
  transform: scale(1.2);
  transform-origin: center top;
  transition: margin-top 0.3s ease, transform 0.3s ease;
}

@media (max-width: 768px) {
  .player-controls.chat-collapsed {
    margin-top: 100px;
    transform: scale(1.1);
  }

  #mobileChatToggleBtn {
    display: block;
    margin-right: 0.7rem;
    margin-bottom: 0.7rem;
  }

  li.active .title-ellipsis {
    max-width: calc(100% - 160px);
  }

  #playlist img[alt="Share station"] {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .migration-notice-modal {
    padding: 12px;
  }

  .migration-notice-content {
    padding: 18px;
  }
}
