:root {
  color-scheme: dark;
  --bg: #050705;
  --bg-soft: #0b100b;
  --panel: rgba(15, 22, 16, 0.9);
  --panel-strong: rgba(20, 30, 21, 0.96);
  --panel-soft: rgba(29, 42, 29, 0.82);
  --text: #f3f7f0;
  --muted: #a9b4a5;
  --line: rgba(154, 255, 77, 0.24);
  --line-strong: rgba(191, 255, 79, 0.58);
  --matcha: #7ea05f;
  --neon: #bfff4f;
  --neon-strong: #d8ff7a;
  --gray: #6f7a6e;
  --black: #050705;
  --danger: #ff6b6b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --glow: 0 0 28px rgba(191, 255, 79, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 20% 18%, rgba(126, 160, 95, 0.18), transparent 34%),
    radial-gradient(circle at 78% 8%, rgba(191, 255, 79, 0.12), transparent 26%),
    linear-gradient(rgba(191, 255, 79, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(191, 255, 79, 0.035) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 42px 42px, 42px 42px, auto;
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%, rgba(191, 255, 79, 0.04));
  mix-blend-mode: screen;
}

h1,
h2,
p {
  margin: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.app-shell.locked {
  display: none;
}

.password-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.password-screen.unlocked {
  display: none;
}

.password-card {
  width: min(100%, 480px);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(15, 22, 16, 0.96), rgba(32, 47, 32, 0.84)),
    var(--panel);
  box-shadow: var(--shadow), var(--glow);
  padding: 30px;
  display: grid;
  gap: 14px;
  text-align: center;
}

.password-card h1 {
  color: var(--neon);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 46px;
  font-style: italic;
  line-height: 1;
  text-shadow: 0 0 20px rgba(191, 255, 79, 0.24);
}

.password-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.password-input,
.search,
.text-field,
.text-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 7, 5, 0.78);
  color: var(--text);
  font: inherit;
  outline: none;
}

.password-input {
  min-height: 48px;
  padding: 0 14px;
  text-align: center;
}

.password-input:focus,
.search:focus,
.text-field:focus,
.text-area:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(191, 255, 79, 0.14), var(--glow);
}

.password-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 900;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(5, 7, 5, 0.86);
  border-bottom: 1px solid var(--line);
  padding: 22px 28px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  gap: 8px;
}

h1 {
  color: var(--neon);
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0;
}

.subtitle {
  color: var(--muted);
  line-height: 1.45;
  font-size: 15px;
}

.tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.tab-link,
.tab-button,
.button {
  appearance: none;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 12px 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.tab-link {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.tab-link:hover {
  border-color: var(--neon);
  box-shadow: var(--glow);
}

.tab-button {
  background: rgba(15, 22, 16, 0.82);
  color: var(--muted);
}

.tab-button:hover,
.tab-button.active,
.button {
  background: linear-gradient(135deg, var(--matcha), var(--neon));
  border-color: var(--neon);
  color: #10160d;
  box-shadow: var(--glow);
}

.button:hover {
  filter: brightness(1.08);
}

.button:active,
.tab-button:active {
  transform: translateY(1px);
}

.main {
  padding: 28px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.home-layout {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(300px, 1.1fr);
  gap: 30px;
  align-items: center;
}

.home-cover {
  width: 100%;
  max-height: 640px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--bg-soft);
  box-shadow: var(--shadow), var(--glow);
}

.home-copy {
  max-width: 680px;
  display: grid;
  gap: 16px;
}

.eyebrow {
  color: var(--neon);
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-copy h2 {
  color: var(--neon);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  font-style: italic;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 20px rgba(191, 255, 79, 0.18);
}

.home-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.65;
  font-size: 17px;
}

.add-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.upload-panel,
.details-panel,
.player,
.library {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.upload-panel,
.details-panel,
.player {
  padding: 18px;
}

.upload-panel {
  display: grid;
  gap: 16px;
}

.drop-zone {
  min-height: 230px;
  border: 2px dashed rgba(191, 255, 79, 0.42);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(191, 255, 79, 0.07), rgba(126, 160, 95, 0.05)),
    rgba(5, 7, 5, 0.62);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  padding: 24px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.drop-zone.dragging {
  border-color: var(--neon);
  background: rgba(191, 255, 79, 0.12);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.upload-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(191, 255, 79, 0.14);
  color: var(--neon);
  font-size: 28px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.drop-title {
  color: var(--text);
  font-weight: 900;
  font-size: 18px;
}

.drop-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

input[type="file"].cover-input {
  position: static;
  width: 100%;
  height: auto;
  opacity: 1;
  pointer-events: auto;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5, 7, 5, 0.58);
  padding: 14px;
}

.stat-value {
  display: block;
  color: var(--neon);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.save-status,
.public-note {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(191, 255, 79, 0.1);
  color: var(--neon);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
  padding: 11px 12px;
}

.library-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.search {
  min-height: 46px;
  padding: 0 14px;
}

.clear {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.clear:hover {
  background: rgba(255, 107, 107, 0.18);
  border-color: rgba(255, 107, 107, 0.55);
  color: var(--text);
}

.player {
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
}

.now-playing {
  min-height: 24px;
  color: var(--neon);
  font-weight: 900;
  overflow-wrap: anywhere;
}

audio {
  width: 100%;
  accent-color: var(--neon);
}

.details-empty,
.empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  line-height: 1.45;
  padding: 24px;
}

.details-empty strong,
.empty strong {
  display: block;
  color: var(--text);
  margin-bottom: 8px;
  font-size: 18px;
}

.details-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.cover-box {
  display: grid;
  gap: 12px;
  align-content: start;
}

.cover-preview {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(5, 7, 5, 0.78);
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.form-row {
  display: grid;
  gap: 6px;
}

.form-row label,
.form-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.text-field,
.text-area {
  padding: 11px 12px;
}

.text-area {
  min-height: 86px;
  resize: vertical;
}

.lyrics-area {
  min-height: 150px;
}

.details-title {
  margin: 0;
  color: var(--neon);
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.library {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.song {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(191, 255, 79, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(8, 12, 8, 0.88);
  padding: 12px;
  display: grid;
  grid-template-columns: 64px 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.song:hover,
.song.active {
  border-color: var(--neon);
  box-shadow: var(--glow);
}

.song-cover-thumb {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle, rgba(191, 255, 79, 0.22), transparent 58%),
    rgba(5, 7, 5, 0.9);
  color: var(--neon);
  font-size: 24px;
  font-weight: 900;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.song-cover-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-button {
  appearance: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(191, 255, 79, 0.14);
  color: var(--neon);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  display: grid;
  place-items: center;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.play-button:hover {
  background: var(--neon);
  color: var(--black);
}

.play-button:active {
  transform: scale(0.96);
}

.song-name {
  color: var(--text);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.song-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.song-index {
  color: var(--neon);
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .topbar,
  .home-layout,
  .add-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    width: 100%;
  }

  .tab-button,
  .tab-link {
    flex: 1 1 140px;
  }

  .home-layout {
    min-height: auto;
    align-items: start;
  }

  .home-cover {
    max-height: 520px;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .cover-preview {
    max-width: 280px;
  }
}

@media (max-width: 560px) {
  .topbar,
  .main {
    padding: 18px;
  }

  h1 {
    font-size: 30px;
  }

  .home-copy h2 {
    font-size: 38px;
  }

  .library-header,
  .stats {
    grid-template-columns: 1fr;
  }

  .song {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .song-cover-thumb {
    width: 54px;
    height: 54px;
  }

  .play-button {
    grid-column: 1;
  }

  .song-index {
    grid-column: 2;
  }
}
