@import url("https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap");

@font-face {
  font-family: "Digital-7";
  src: url("./assets/Digital-7 Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: "Trebuchet MS", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 189, 89, 0.18), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(255, 103, 103, 0.16), transparent 25%),
    linear-gradient(135deg, #120f14 0%, #1a1824 45%, #0d1119 100%);
  color: #f8f0e4;
  margin: 0;
  min-height: 100vh;
  padding: 1.5rem;
}

.page-shell {
  position: relative;
  min-height: calc(100vh - 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.5;
  pointer-events: none;
}

.page-orb-left {
  width: 240px;
  height: 240px;
  top: 6%;
  left: 4%;
  background: rgba(255, 190, 92, 0.14);
}

.page-orb-right {
  width: 300px;
  height: 300px;
  bottom: 4%;
  right: 3%;
  background: rgba(140, 188, 255, 0.13);
}

.song-list-container {
  max-width: 1280px;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(13, 16, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.song-list-page-shell {
  align-items: flex-start;
  padding-top: 4vh;
}

.song-list-page {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
}

#song-list {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.editor-columns {
  display: grid;
  grid-template-columns: minmax(280px, 35fr) minmax(440px, 65fr);
  gap: 1rem;
  align-items: start;
}

.playlist-panel,
.library-panel {
  display: grid;
  min-width: 0;
  gap: 0.75rem;
  padding: 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.playlist-panel {
  min-height: 0;
}

.playlist-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.playlist-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff4e2;
}

.playlist-panel-copy {
  color: var(--muted);
  font-size: 0.88rem;
}

.playlist-panel #song-list {
  max-height: 75vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.25rem;
}

.player-container {
  --card-bg: rgba(16, 19, 28, 0.86);
  --card-border: rgba(255, 255, 255, 0.08);
  --muted: #d5c2ad;
  --accent: #ffc36f;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 430px);
  grid-template-areas:
    "hero player"
    "copy player";
  align-items: stretch;
  gap: 1.5rem;
  position: relative;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 1.25rem;
  border-radius: 32px;
  border: 1px solid var(--card-border);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--card-bg);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
}

.player-main {
  grid-area: player;
  min-width: 0;
  position: relative;
  display: grid;
  gap: 1rem;
}

.card-hero {
  grid-area: hero;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.6rem;
}

.card-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--accent);
}

#card-title {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.92;
  margin: 0;
  color: #fff4e2;
}

.card-subtitle,
.card-note p,
.player-aside-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-panel {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.auth-status {
  margin: 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.auth-form input {
  min-width: 0;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff4e2;
  font: inherit;
}

.auth-form input::placeholder {
  color: rgba(248, 240, 228, 0.55);
}

.auth-form button,
.auth-logout-btn {
  width: auto;
  max-width: none;
  margin: 0;
}

.card-note {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.track-panel,
.player-aside,
.player-frame {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.track-panel {
  padding: 1rem;
}

.track-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  color: #fff5e7;
  font-size: 0.95rem;
}

.track-list {
  display: grid;
  gap: 0.7rem;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.3rem;
  scrollbar-gutter: stable;
}

.track-list::-webkit-scrollbar {
  width: 0.55rem;
}

.track-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 195, 111, 0.4);
}

.track-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

.track-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.track-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 195, 111, 0.25);
}

.track-item.is-active {
  background: linear-gradient(135deg, rgba(255, 195, 111, 0.16), rgba(255, 126, 103, 0.14));
  border-color: rgba(255, 195, 111, 0.35);
}

.track-number {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff6ea;
  font-size: 0.85rem;
}

.track-meta strong,
.track-meta span {
  display: block;
}

.track-meta strong {
  color: #fff4e2;
}

.track-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  justify-content: center;
}

.playlist-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.player-frame {
  padding: 0.8rem;
}

.player-stage {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(255, 195, 111, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
}

.lcd-display {
  min-height: 5.5rem;
  background: linear-gradient(180deg, #272c26, #11160f);
  color: #f6fbd0;
  font-family: "Digital-7", monospace, Arial, sans-serif;
  font-size: 1.1em;
  border-radius: 16px;
  border: 2px solid #060706;
  text-align: center;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  padding: 0.8rem 0.75rem;
}

.playlist-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.65em;
  letter-spacing: 0.08em;
  color: #c0c89b;
}

.transport-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.transport-btn {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.8rem 0.7rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff2de;
  font: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.transport-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 195, 111, 0.24);
}

.transport-btn-primary {
  background: linear-gradient(135deg, rgba(255, 195, 111, 0.28), rgba(255, 126, 103, 0.24));
  border-color: rgba(255, 195, 111, 0.32);
  color: #fff8ef;
}

#audioPlayer {
  display: block;
  width: 100%;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
}

.song-list-container button,
#songList {
  background: linear-gradient(135deg, #ff9f68, #ff6f61);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  font-size: 0.92rem;
  color: white;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}

#songList {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(135deg, rgba(18, 11, 8, 0.2), rgba(18, 11, 8, 0.42)),
    url("./assets/kwStorm-wAlpha.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-color: rgba(255, 190, 106, 0.5);
  color: #fff8ef;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 24px rgba(255, 125, 58, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#songList:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 205, 133, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 28px rgba(255, 125, 58, 0.28);
}

#song-list button {
  width: 100%;
  max-width: none;
  margin: 0;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
}

.track-list .track-item {
  width: 100%;
  max-width: none;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.track-item-empty {
  cursor: default;
}

#playlist-selector {
  background: rgba(255, 255, 255, 0.06);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-family: "Digital-7", monospace, Arial, sans-serif;
  font-size: 0.95em;
  width: auto;
  min-width: 11.5rem;
  text-align: center;
}

#playlist-selector option {
  background: #18151c;
  color: #f6f0e8;
  padding: 5px;
  text-align: center;
}

#playlist-selector:focus {
  outline: none;
  box-shadow: 0 0 5px grey;
}

.player-aside {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 0.9rem;
}

.player-aside-copy {
  display: grid;
  gap: 0.25rem;
}

.player-aside-label {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--accent);
}

.art-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.art-tile,
.art-medallion {
  display: block;
  object-fit: cover;
  border-radius: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.art-tile {
  width: 202px;
  height: 202px;
  margin-right: 1rem;
}

.art-medallion {
  width: 264px;
  height: 264px;
  border-radius: 999px;
}

.titles-container {
  margin-bottom: 1rem;
  text-align: center;
}

.titles-container h1,
.titles-container h2 {
  margin: 0;
  color: #fff4e2;
}

.playlist-name {
  margin: 0.55rem 0 1rem;
  color: #ffc36f;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.song-list-back {
  display: inline-block;
  color: #fff8ef;
  text-decoration: none;
  padding: 0.68rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.song-list-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

#song-list li {
  list-style: none;
}

.song-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.song-entry-select {
  min-width: 0;
  width: 100%;
  margin: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.song-editor-picker {
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#editor-playlist-selector {
  min-width: 12rem;
  max-width: min(24rem, 60vw);
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff4e2;
  font: inherit;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.editor-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.editor-message {
  min-height: 1.5rem;
  color: #ffc36f;
  text-align: center;
}

.song-entry-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #f6f0e8;
  white-space: nowrap;
}

.song-entry-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: #ff9f68;
}

.song-list-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.song-list-empty p {
  margin: 0;
}

.song-list-empty a {
  color: #ffc36f;
}

.song-entry-custom {
  grid-template-columns: minmax(0, 1fr) auto;
}

.song-entry-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.song-entry-controls button,
.library-song button {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0.5rem 0.7rem;
  font-size: 0.84rem;
}

.library-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.library-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff4e2;
}

.library-panel-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.library-browser {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.library-pane {
  min-width: 0;
  display: grid;
  gap: 0.75rem;
}

.library-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.1rem;
}

.library-pane-header h3 {
  margin: 0;
  color: #fff4e2;
  font-size: 0.98rem;
}

.library-pane-label {
  min-width: 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-list {
  display: grid;
  gap: 0.55rem;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
}

.library-song {
  display: block;
  min-width: 0;
  padding: 0.65rem 0.7rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.library-song.is-selected {
  background: linear-gradient(135deg, rgba(255, 195, 111, 0.14), rgba(255, 126, 103, 0.08));
  border-color: rgba(255, 195, 111, 0.35);
}

.library-song-body {
  display: grid;
  min-width: 0;
  gap: 0.55rem;
}

.library-song-select {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: normal;
  text-align: left;
  cursor: pointer;
}

.library-song-select strong {
  min-width: 0;
  color: #fff4e2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-song-select span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.library-song-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(7rem, 1fr));
  gap: 0.35rem;
}

.library-song-actions button {
  width: 100%;
  min-width: 0;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 880px) {
  .player-container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "player"
      "copy";
  }

  .editor-columns,
  .library-browser {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  body {
    padding: 0.5rem;
  }

  .song-entry {
    grid-template-columns: 1fr;
  }

  .song-entry-custom,
  .library-song {
    grid-template-columns: 1fr;
  }

  .library-song-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .auth-form {
    grid-template-columns: 1fr;
  }

  .player-container {
    padding: 0.9rem;
  }

  .lcd-display {
    font-size: 0.92em;
  }

  .transport-controls {
    grid-template-columns: repeat(2, 1fr);
  }

  .player-aside {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-actions {
    flex-direction: column;
    align-items: center;
  }

  .playlist-picker {
    flex-direction: column;
  }

  .editor-toolbar,
  .library-panel-header,
  .song-entry-controls,
  .library-song-actions,
  .library-pane-header {
    justify-content: stretch;
  }
}
