*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: monospace;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: monospace;
  background-image: url("background-music-player.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  .window {
    width: 90vw;
    max-width: 800px;
    min-width: 320px;
    border-radius: 14px;
    overflow: hidden;
    background: #dfddff;
    border: 2.5px solid #1e45fc;
  }

  .titlebar {
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
  }

  .dot-red {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #93222e;
  }
  .dot-yellow {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #f2b63d;
  }
  .dot-green {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #42866c;
  }

  .title-lable {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #1e45fc;
  }

  .main {
    display: flex;
    width: 100%;
  }

  .left {
    flex: 1;
    min-width: 0;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .right {
    flex: 1.25;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
  }

  .song-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
    color: #1e45fc;
  }

  .song-artist {
    font-size: 12px;
    font-weight: 550;
    color: #1e45fc;
    text-align: center;
    opacity: 0.8;
    margin-top: -6px;
    font-style: italic;
  }

  .song-wrap {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    border: none;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
  }

  .song-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .song-placeholder {
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .song-placeholder span {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    padding: 0 8px;
    color: #1e45fc;
  }

  .input-link-row {
    display: flex;
    gap: 8px;
    width: 100%;
  }

  .input-row {
    flex: 1;
    padding: 7px 10px;
    background: #ffffff;
    border: 2px solid #1e45fc;
    border-radius: 8px;
    font-family: monospace;
    font-size: 11px;
    color: #1e45fc;
    outline: none;
    transition: border-color 0.2s;
  }

  .input-row::placeholder {
    color: #1e45fc;
  }

  .input-button {
    padding: 7px 12px;
    border: none;
    border-radius: 8px;
    background: #1e45fc;
    color: #ffffff;
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s;
  }

  .input-button:hover {
    filter: brightness(1.2);
  }

  .status {
    font-size: 10px;
    font-style: italic;
    color: #1e45fc;
    text-align: center;
    min-height: 13px;
  }

  .status.ok {
    color: #1e45fc;
  }

  .status.err {
    color: #1e45fc;
  }

  .progress-bar {
    width: 100%;
    height: 6px;
    background: #ffffff;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
  }

  .progress-fill {
    width: 0%;
    height: 100%;
    background: #1e45fc;
    border-radius: 3px;
    transition: width 0.4s linear;
    pointer-events: none;
  }

  .time-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 550;
    color: #1e45fc;
  }

  .volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 5px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
  }

  .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: #1e45fc;
  }

  .control-button {
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition:
      transform 0.1s,
      filter 0.1s;
  }

  .play-back-button {
    cursor: pointer;
    background: #1e45fc;
    width: 40px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
  }

  .play-back-button:active {
    transform: scale(0.9);
  }

  .play-back-button:hover {
    filter: brightness(1.2);
  }

  .play-button {
    cursor: pointer;
    background: #1e45fc;
    width: 54px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
  }

  .play-button:active {
    transform: scale(0.9);
  }

  .play-button:hover {
    filter: brightness(1.2);
  }

  .play-next-button {
    cursor: pointer;
    background: #1e45fc;
    width: 40px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
  }

  .play-next-button:active {
    transform: scale(0.9);
  }

  .play-next-button:hover {
    filter: brightness(1.2);
  }

  .control-button svg {
    pointer-events: none;
  }

  .history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 2px solid #1e45fc;
  }

  .history-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e45fc;
  }

  .history-count {
    color: #1e45fc;
    font-weight: 700;
    font-size: 12px;
  }

  .history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 320px;
    scrollbar-width: thin;
    scrollbar-color: #1e45fc;
  }

  .history-list::-webkit-scrollbar {
    width: 4px;
  }

  .history-list::-webkit-scrollbar-thumb {
    background: #1e45fc;
    border-radius: 2px;
  }

  .no-history {
    font-size: 11px;
    color: #1e45fc;
    text-align: center;
    padding: 40px 0;
    line-height: 1.8;
  }

  .h-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
  }

  .h-item:hover {
    background: #1e45fc;
  }

  .h-item.active {
    background: #1e45fc;
  }

  .h-item.active .h-name {
    color: #ffffff;
    font-weight: 700;
  }
  .h-item.active .h-num,
  .h-item.active .h-time {
    color: #ffffff;
  }

  .h-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #1e45fc;
  }

  .h-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .h-info {
    flex: 1;
    overflow: hidden;
  }

  .h-name {
    font-size: 12px;
    color: #1e45fc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .h-time {
    font-size: 10px;
    color: #1e45fc;
    margin-top: 2px;
  }

  .h-num {
    font-size: 11px;
    color: #1e45fc;
    min-width: 16px;
    text-align: center;
    font-weight: 600;
    flex-shrink: 0;
  }

  .eq {
    display: none;
    align-items: center;
    gap: 2px;
  }

  .h-item.active .eq {
    display: flex;
  }

  .h-item.active .h-num-static {
    display: none;
  }

  .eq span {
    width: 2px;
    background: #ffffff;
    border-radius: 1px;
    animation: eq 0.8s ease-in-out infinite alternate;
  }

  .eq span:nth-child(2) {
    animation-delay: 0.15s;
    height: 10px;
  }

  .eq span:nth-child(3) {
    animation-delay: 0.3s;
    height: 6px;
  }

  @keyframes eq {
    from {
      height: 4px;
    }
    to {
      height: 14px;
    }
  }
}

@media (max-width: 600px) {
  .main {
    flex-direction: column; /* xếp dọc */
  }

  .left {
    flex: none;
    width: 100%;
  }

  .right {
    width: 100%;
  }
}
