:root {
  --bg: #060816;
  --bg-soft: #0d1230;
  --card: rgba(17, 24, 58, 0.78);
  --card-strong: rgba(19, 28, 70, 0.95);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f7fbff;
  --muted: #a8b3d1;
  --primary: #18f0ff;
  --primary-2: #7c3cff;
  --accent: #ff2bd6;
  --danger: #ff5176;
  --success: #65ffb4;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.42);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at 14% 12%, rgba(124, 60, 255, 0.36), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(24, 240, 255, 0.18), transparent 28%),
    radial-gradient(circle at 74% 86%, rgba(255, 43, 214, 0.18), transparent 30%),
    linear-gradient(135deg, #050713 0%, #0a0e24 48%, #050711 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent);
}

button, input, label { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.app-shell {
  width: min(1480px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
}

.sidebar,
.workspace,
.hero-card,
.player-card,
.queue-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(12, 17, 44, .94), rgba(7, 10, 27, .9));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2), var(--accent));
  box-shadow: 0 0 36px rgba(24, 240, 255, .35);
}

.brand-mark span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.35);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.primary-action,
.add-form button,
.play-btn {
  border: 0;
  color: #03101c;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #7efff0);
  box-shadow: 0 14px 44px rgba(24, 240, 255, .25);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.primary-action:hover,
.add-form button:hover,
.play-btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.15);
  box-shadow: 0 18px 60px rgba(24, 240, 255, .35);
}

.primary-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 16px;
  border-radius: 18px;
}

.primary-action span {
  font-size: 22px;
  line-height: 0;
}

.playlist-panel {
  min-height: 0;
  margin-top: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.panel-head,
.queue-head,
.topbar,
.track-item,
.import-export,
.topbar-actions,
.controls,
.progress-box,
.volume-box,
.queue-tools {
  display: flex;
  align-items: center;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-head h2,
.queue-head h3,
.topbar h2,
.hero-copy h3,
.player-card h3 {
  margin-bottom: 0;
}

.panel-head h2 {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.panel-head span {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(24, 240, 255, .11);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.playlist-list {
  min-height: 0;
  overflow: auto;
  padding-right: 5px;
}

.playlist-item {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text);
  background: rgba(255,255,255,.045);
  text-align: left;
  transition: border .2s ease, transform .2s ease, background .2s ease;
}

.playlist-item:hover,
.playlist-item.active {
  border-color: rgba(24, 240, 255, .5);
  background: rgba(24, 240, 255, .11);
  transform: translateX(3px);
}

.playlist-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #06101e;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 900;
}

.playlist-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.playlist-total {
  color: var(--muted);
  font-size: 12px;
}

.import-export {
  gap: 10px;
  margin-top: 18px;
}

.import-export button,
.ghost-file,
.icon-btn,
.control-btn,
.queue-tools button,
.track-actions button,
.track-play {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.06);
  transition: background .2s ease, border .2s ease, transform .2s ease;
}

.import-export button,
.ghost-file {
  flex: 1;
  padding: 11px 10px;
  border-radius: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.import-export button:hover,
.ghost-file:hover,
.icon-btn:hover,
.control-btn:hover,
.queue-tools button:hover,
.track-actions button:hover,
.track-play:hover {
  border-color: rgba(24,240,255,.45);
  background: rgba(24,240,255,.12);
  transform: translateY(-1px);
}

.legal-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  border-radius: var(--radius-lg);
  background: rgba(7, 10, 27, .42);
  padding: 20px;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h2 {
  font-size: clamp(27px, 3vw, 48px);
  line-height: 1;
  letter-spacing: -.06em;
}

.topbar-actions {
  gap: 10px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.icon-btn.danger:hover {
  border-color: rgba(255,81,118,.65);
  background: rgba(255,81,118,.13);
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, rgba(24,240,255,.14), rgba(124,60,255,.18) 45%, rgba(255,43,214,.12)),
    rgba(18, 26, 62, .72);
  padding: clamp(20px, 3vw, 34px);
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(310px, .78fr);
  gap: 24px;
  align-items: center;
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24,240,255,.32), transparent 65%);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h3 {
  max-width: 800px;
  font-size: clamp(29px, 4vw, 64px);
  line-height: .94;
  letter-spacing: -.07em;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.add-form {
  position: relative;
  z-index: 1;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(3, 8, 26, .48);
}

.add-form label {
  display: block;
  margin: 0 0 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.add-form label span {
  color: var(--muted);
  font-weight: 700;
}

.input-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 13px;
}

input[type="url"],
input[type="text"],
input[type="search"] {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.12);
  outline: none;
  color: var(--text);
  background: rgba(255,255,255,.07);
  border-radius: 16px;
  padding: 14px 15px;
  transition: border .2s ease, background .2s ease, box-shadow .2s ease;
}

input[type="url"]:focus,
input[type="text"]:focus,
input[type="search"]:focus {
  border-color: rgba(24,240,255,.72);
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 4px rgba(24,240,255,.08);
}

.add-form button {
  padding: 0 18px;
  border-radius: 16px;
}

.local-upload {
  margin-top: 13px;
  padding: 14px;
  border: 1px dashed rgba(24,240,255,.35);
  border-radius: 18px;
  background: rgba(24,240,255,.055);
}

.local-upload label {
  color: var(--primary);
}

.local-upload input {
  width: 100%;
  color: var(--muted);
}

.content-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(330px, 440px) minmax(0, 1fr);
  gap: 18px;
}

.player-card,
.queue-card {
  border-radius: var(--radius-lg);
  background: var(--card);
}

.player-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
}

.visualizer {
  height: 42px;
  display: flex;
  gap: 7px;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 18px;
}

.visualizer span {
  width: 8px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(to top, var(--primary-2), var(--primary));
  opacity: .45;
  animation: none;
}

.player-card.playing .visualizer span {
  animation: pulseBar 1s ease-in-out infinite;
}
.player-card.playing .visualizer span:nth-child(2) { animation-delay: .12s; }
.player-card.playing .visualizer span:nth-child(3) { animation-delay: .24s; }
.player-card.playing .visualizer span:nth-child(4) { animation-delay: .36s; }
.player-card.playing .visualizer span:nth-child(5) { animation-delay: .48s; }

@keyframes pulseBar {
  0%, 100% { height: 12px; opacity: .45; }
  50% { height: 42px; opacity: 1; }
}

.cover-wrap {
  position: relative;
  width: min(100%, 320px);
  aspect-ratio: 1;
  margin: 0 auto 22px;
}

.cover-wrap img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 28px 80px rgba(0,0,0,.46);
}

.cover-glow {
  position: absolute;
  inset: 16px;
  z-index: 1;
  border-radius: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  filter: blur(38px);
  opacity: .42;
}

.track-meta {
  text-align: center;
}

.track-meta p {
  margin: 0 0 7px;
  color: var(--primary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 900;
}

.track-meta h3 {
  font-size: 24px;
  line-height: 1.13;
  letter-spacing: -.035em;
}


.youtube-local-help {
  max-width: 360px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}

.youtube-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(24,240,255,.35);
  border-radius: 999px;
  color: var(--primary);
  background: rgba(24,240,255,.09);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.youtube-open-link[hidden],
.youtube-local-help[hidden] {
  display: none !important;
}

.progress-box {
  gap: 10px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.controls {
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.control-btn,
.play-btn {
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.control-btn {
  width: 46px;
  height: 46px;
  font-size: 20px;
}

.control-btn.active {
  border-color: rgba(24,240,255,.75);
  color: var(--primary);
  background: rgba(24,240,255,.16);
}

.play-btn {
  width: 66px;
  height: 66px;
  font-size: 24px;
}

.volume-box {
  gap: 14px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.youtube-mount {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 32px;
  background: #000;
}

.youtube-mount iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 32px;
}

.cover-wrap.youtube-mode .youtube-mount {
  display: block;
}

.cover-wrap.youtube-mode #coverImage {
  opacity: 0;
}

.queue-card {
  padding: 22px;
  min-width: 0;
}

.queue-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.queue-head h3 {
  font-size: 28px;
  letter-spacing: -.05em;
}

.queue-tools {
  gap: 10px;
}

.queue-tools input {
  width: 220px;
  padding: 11px 12px;
}

.queue-tools button {
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 900;
}

.track-list {
  display: grid;
  gap: 10px;
  max-height: min(654px, calc(100vh - 420px));
  overflow: auto;
  padding-right: 5px;
}

.track-item {
  position: relative;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  background: rgba(255,255,255,.045);
  transition: background .2s ease, border .2s ease, transform .2s ease;
}

.track-item:hover,
.track-item.active {
  border-color: rgba(24,240,255,.44);
  background: rgba(24,240,255,.08);
}

.track-item.dragging {
  opacity: .45;
}

.track-play {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 13px;
}

.track-cover {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 16px;
  background: rgba(255,255,255,.08);
}

.track-info {
  min-width: 0;
  flex: 1;
}

.track-info strong,
.track-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-info strong {
  margin-bottom: 5px;
  color: var(--text);
}

.track-info span {
  color: var(--muted);
  font-size: 13px;
}

.track-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.track-actions button {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 900;
}

.track-actions .delete-track:hover {
  border-color: rgba(255,81,118,.65);
  color: #fff;
  background: rgba(255,81,118,.14);
}

.empty-state {
  padding: 38px 24px;
  border: 1px dashed rgba(255,255,255,.15);
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: min(560px, calc(100% - 32px));
  padding: 13px 16px;
  border: 1px solid rgba(24,240,255,.4);
  border-radius: 16px;
  color: var(--text);
  background: rgba(8, 12, 34, .94);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.04); border-radius: 999px; }
::-webkit-scrollbar-thumb { background: rgba(24,240,255,.28); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(24,240,255,.45); }

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    top: auto;
    height: auto;
  }
  .playlist-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .playlist-item { margin-bottom: 0; }
}

@media (max-width: 940px) {
  .hero-card,
  .content-grid {
    grid-template-columns: 1fr;
  }
  .track-list {
    max-height: none;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    gap: 0;
  }
  .sidebar,
  .workspace,
  .hero-card,
  .player-card,
  .queue-card {
    border-radius: 0;
  }
  .sidebar,
  .workspace {
    padding: 16px;
  }
  .playlist-list {
    grid-template-columns: 1fr;
  }
  .topbar,
  .queue-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar-actions,
  .queue-tools {
    width: 100%;
  }
  .queue-tools {
    display: grid;
    grid-template-columns: 1fr auto;
  }
  .queue-tools input { width: 100%; }
  .input-line {
    grid-template-columns: 1fr;
  }
  .add-form button {
    min-height: 48px;
  }
  .track-item {
    align-items: flex-start;
  }
  .track-actions {
    flex-direction: column;
  }
}

/* NEON Playlist v1.1.1 · Login y sesión */
.account-card {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(24, 240, 255, .18);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(24, 240, 255, .12), rgba(124, 60, 255, .10));
}

.account-card span,
.account-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.account-card strong {
  display: block;
  margin: 3px 0;
  color: var(--text);
  font-size: 18px;
}

.user-chip {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
  font-size: 13px;
  font-weight: 800;
}

.logout-form {
  margin: 0;
}

.logout-form button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 81, 118, .35);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 81, 118, .12);
  font-weight: 900;
  transition: transform .2s ease, background .2s ease;
}

.logout-form button:hover {
  transform: translateY(-2px);
  background: rgba(255, 81, 118, .22);
}

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
}

.login-shell {
  width: min(520px, 100%);
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 24, 58, .96), rgba(7, 10, 27, .94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.login-card::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 240, 255, .28), transparent 68%);
  pointer-events: none;
}

.login-brand {
  margin-bottom: 26px;
}

.login-card h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 6vw, 46px);
  letter-spacing: -.06em;
  line-height: .95;
}

.login-copy {
  margin-bottom: 24px;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.login-form input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 16px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
}

.login-form input:focus {
  border-color: rgba(24, 240, 255, .75);
  box-shadow: 0 0 0 4px rgba(24, 240, 255, .12);
}

.login-form button {
  min-height: 56px;
  margin-top: 8px;
  border: 0;
  border-radius: 18px;
  color: #03101c;
  background: linear-gradient(135deg, var(--primary), #7efff0);
  font-weight: 1000;
  box-shadow: 0 14px 44px rgba(24, 240, 255, .25);
}

.login-error {
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 81, 118, .35);
  border-radius: 16px;
  color: #ffdce4;
  background: rgba(255, 81, 118, .12);
  font-weight: 800;
}

.demo-access {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(24, 240, 255, .18);
  border-radius: 16px;
  background: rgba(24, 240, 255, .08);
  color: var(--muted);
  font-size: 13px;
}

.demo-access strong {
  color: var(--text);
}

@media (max-width: 760px) {
  .user-chip {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .logout-form button {
    min-height: 40px;
    padding: 0 12px;
  }

  .login-card {
    padding: 24px;
  }
}
