:root {
  --bg: #000;
  --fg: #fff;
  --accent: #2ecc71;
  --accent-2: #0b66ff;
}

* {
  box-sizing: border-box;
}

/* =========================
   BASE
========================= */
html,
body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: #000;
}

/* Intro page scrolls normally */
body.intro-page {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Search page stays fixed */
body.search-page {
  overflow: hidden;
}

/* =========================
   SINGLE BACKGROUND SYSTEM
========================= */
.bg-wrap {
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bg-wrap img,
.bg-img {
  display: block !important;
  position: absolute;
  inset: 0;
  width: 145%;
  height: 145%;
  object-fit: cover;
  object-position: center top;
  transform: translate(-14%, 18%);
  filter: brightness(0.55) saturate(1.05);
}

/* On larger screens, ease back to a more natural crop */
@media (min-width: 769px) {
  .bg-wrap img,
  .bg-img {
    width: 120%;
    height: 120%;
    transform: translate(-8%, 10%);
  }
}

/* Kill any old overlay system */
body::before {
  content: none !important;
  display: none !important;
}

/* =========================
   LAYOUT
========================= */
.container {
  width: min(920px, 94vw);
  margin: 0 auto;
  padding: 8px 12px 14px;
}

body.search-page .container {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =========================
   HEADER
========================= */
.topbar {
  position: sticky;
  top: 0;
  background: transparent;
  backdrop-filter: none;
  padding: 0;
  border-bottom: none;
  z-index: 5;
}

.header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.header img.logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

h1 {
  font-size: 16px;
  line-height: 1.1;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================
   BUTTONS
========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: var(--accent-2);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(11, 102, 255, .35);
  cursor: pointer;
}

.btn:active {
  transform: translateY(1px);
}

.install-wrap {
  display: flex;
  justify-content: center;
  margin: 8px 0 8px;
}

.install-btn {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #0b66ff, #0848b5);
  color: #fff;
  border: none;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(11, 102, 255, .32);
}

.install-btn[disabled] {
  opacity: .45;
  box-shadow: none;
}

#installBtn {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
}

/* =========================
   GENERIC
========================= */
.muted {
  opacity: .8;
}

.center {
  text-align: center;
}

.small {
  font-size: .9rem;
  color: #cfcfcf;
}

.link {
  color: var(--accent);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.footer-note {
  color: #aaa;
  font-size: .9rem;
  margin-top: 4px;
}

body.search-page .footer-note {
  margin-top: 2px;
}

.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .15);
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =========================
   CARDS / INPUT
========================= */
.card {
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input {
  flex: 1;
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .05);
  color: #fff;
}

/* =========================
   PROMO
========================= */
.promo {
  margin-top: 2px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 6px;
  max-width: 340px;
  width: 78%;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.12);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

.promo img,
.promo-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  object-position: center;
}

/* =========================
   RESULTS
========================= */
.results {
  margin-top: 6px;
  background: transparent;
}

.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.results .header-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 8px 4px 6px;
  font-weight: 700;
  color: #6dfc8d;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, .22);
  backdrop-filter: blur(4px);
}

.results .rows {
  max-height: 65vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 8px;
  background: transparent;
}

.result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  background: transparent;
}

.result-row:hover {
  background: rgba(255, 255, 255, .04);
}

.result-song,
.result-artist {
  white-space: normal;
}

.xbtn {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 480px) {
  .container {
    padding: 6px 10px 12px;
  }

  .header {
    padding: 6px 10px;
    gap: 8px;
  }

  .header img.logo {
    height: 52px;
  }

  h1 {
    font-size: 15px;
  }

  .promo {
    width: 76%;
    max-width: 320px;
  }

  .promo img,
  .promo-img {
    max-height: 340px;
  }

  .results .rows {
    max-height: 60vh;
  }

  .bg-wrap img,
  .bg-img {
    width: 165%;
    height: 165%;
    transform: translate(-20%, 20%);
  }
}
/* === BACKDROP (SAFE — NO LAYOUT CHANGE) === */

body {
  background: url('assets/img/backdrop.png') no-repeat center center fixed;
  background-size: cover;
}

/* Make sure main content sits above background */
header,
main,
.container,
.search-container,
.results,
.promo {
  position: relative;
  z-index: 1;
}
/* ===== Search helper text styling ===== */

.search-helper {
  margin-top: 8px;
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 16px;
}

.search-green {
  color: #00e24b;
  font-weight: 700;
}

.search-white {
  color: #ffffff;
  font-weight: 700;
}
/* ===== Search helper text styling (FINAL FIX) ===== */

.search-helper {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;

  font-size: 16px;

  flex-wrap: nowrap;        /* force single line */
  white-space: nowrap;      /* prevent wrapping */
  overflow: hidden;         /* clean edge */
}

.search-green {
  color: #00ff55;
  font-weight: 700;
}

.search-white {
  color: #ffffff;
  font-weight: 700;
}

/* Mobile adjustment to keep everything on one line */
@media (max-width: 480px) {
  .search-helper {
    font-size: 14px;
  }
}

/* ===== Splash loading screen update ===== */
#splash {
  background: #ffffff !important;
}

.splash-gif,
.splash-logo {
  width: 260px !important;
  max-width: 70vw !important;
  height: auto !important;
  image-rendering: auto;
  animation: none !important;
}
.bottom-help-text {
  position: fixed;
  bottom: 12px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 14px;
  color: #ccc;
  padding: 0 12px;
  z-index: 5;
}

/* ===== FINAL HEADER FIX: CENTERED ON ONE LINE ===== */
.header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center;
  gap: 10px;
  padding: 6px 8px !important;
}

.header img.logo {
  height: 58px;
  width: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

.header h1 {
  font-size: 16px;
  line-height: 1.1;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .header {
    gap: 8px;
    padding: 6px 6px !important;
  }

  .header img.logo {
    height: 50px;
  }

  .header h1 {
    font-size: 15px;
  }
}

/* Make sure image is centered and nicely sized */
.promo img,
.promo-img {
  display: block;
  margin: 0 auto;

  width: 92%;
  max-width: 420px;
  height: auto;

  border-radius: 12px;
}

/* ===== FINAL PROMO POSITION (LOWER + CENTERED) ===== */
.promo {
  display: flex;
  justify-content: center;
  align-items: center;

  margin-top: 32px;    /* move ad lower */
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 8px;

  width: 100%;
  max-width: none;
  border-radius: 18px;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.promo img,
.promo-img {
  display: block;
  margin: 0 auto;

  width: 92%;
  max-width: 420px;
  height: auto;

  border-radius: 12px;
  object-fit: contain;
  object-position: center;
}

/* Keep a little breathing room below the search card */
.card.stack {
  margin-bottom: 6px;
}

/* Keep bottom help text pinned; spacing handled by fixed bottom */
.bottom-help-text {
  margin-top: 0;
}
