:root {
  --brand-bg: #16181d;
  --brand-surface: #1f222b;
  --brand-card: #272b34;
  --brand-accent: #e63946;
  --brand-accent-hover: #c1121f;
  --brand-warm: #f4a261;
  --brand-text: #edeef0;
  --brand-muted: #9da0b2;
  --brand-border: #2f333e;
}

/* ── Base ─────────────────────────────────────────────────── */
body {
  background-color: var(--brand-bg);
  color: var(--brand-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ── Background blobs ─────────────────────────────────────── */
.bg-layers {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Steel stripe texture sits above the blobs, stays semi-transparent */
.bg-layers::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 1px,
    rgba(255, 255, 255, 0.022) 1px,
    rgba(255, 255, 255, 0.022) 2px,
    transparent 2px,
    transparent 5px,
    rgba(0, 0, 0, 0.03) 5px,
    rgba(0, 0, 0, 0.03) 6px
  );
}

.blob {
  position: absolute;
  filter: blur(120px);
  will-change: transform, border-radius;
}

.blob-1 {
  width: 55vw;
  height: 45vh;
  background: rgba(230, 57, 70, 0.4);
  top: -10vh;
  left: -10vw;
  animation: blob1 19s ease-in-out infinite;
}

.blob-2 {
  width: 50vw;
  height: 55vh;
  background: rgba(244, 162, 97, 0.3);
  bottom: -15vh;
  right: -10vw;
  animation: blob2 13s ease-in-out infinite;
}

.blob-3 {
  width: 48vw;
  height: 42vh;
  background: rgba(55, 155, 220, 0.25);
  bottom: 20vh;
  left: 22vw;
  animation: blob3 23s ease-in-out infinite;
}

@keyframes blob1 {
  0%   { transform: translate(0, 0) scale(1);           border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  20%  { transform: translate(8vw, -6vh) scale(1.10);   border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  40%  { transform: translate(5vw,  8vh) scale(0.92);   border-radius: 50% 40% 60% 30% / 40% 70% 30% 60%; }
  60%  { transform: translate(-4vw, 4vh) scale(1.08);   border-radius: 40% 60% 30% 70% / 60% 40% 70% 30%; }
  80%  { transform: translate(-7vw,-2vh) scale(0.96);   border-radius: 70% 30% 50% 50% / 30% 60% 40% 70%; }
  100% { transform: translate(0, 0) scale(1);           border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@keyframes blob2 {
  0%   { transform: translate(0, 0) scale(1);           border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
  25%  { transform: translate(-7vw, 5vh) scale(1.12);   border-radius: 60% 40% 40% 60% / 60% 30% 70% 40%; }
  50%  { transform: translate(-3vw,-6vh) scale(0.90);   border-radius: 30% 70% 60% 40% / 50% 60% 40% 50%; }
  75%  { transform: translate( 5vw,-3vh) scale(1.05);   border-radius: 50% 50% 30% 70% / 40% 60% 50% 60%; }
  100% { transform: translate(0, 0) scale(1);           border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

@keyframes blob3 {
  0%   { transform: translate(0, 0) scale(1);           border-radius: 50% 50% 40% 60% / 50% 40% 60% 50%; }
  33%  { transform: translate( 6vw, 4vh) scale(0.87);   border-radius: 70% 30% 60% 40% / 30% 70% 40% 60%; }
  66%  { transform: translate(-5vw,-7vh) scale(1.15);   border-radius: 30% 60% 30% 70% / 60% 30% 60% 40%; }
  100% { transform: translate(0, 0) scale(1);           border-radius: 50% 50% 40% 60% / 50% 40% 60% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none; }
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  background-color: var(--brand-surface) !important;
  border-bottom: 1px solid var(--brand-border);
  position: relative;
  z-index: 1;
}

.navbar-brand {
  color: var(--brand-accent) !important;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-logo {
  height: 32px;
  width: auto;
  filter: invert(1);
  mix-blend-mode: screen;
  flex-shrink: 0;
}

.navbar-nav {
  gap: 0.75rem;
}

.nav-link {
  color: var(--brand-muted) !important;
  transition: color 0.15s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand-text) !important;
}

.navbar-toggler-icon {
  filter: invert(1);
}

/* ── Buttons ──────────────────────────────────────────────── */

/* Retro 3-D lift — applied to every Bootstrap button */
.btn {
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
  transition: background-color 0.15s, border-color 0.15s, color 0.15s,
    box-shadow 0.08s, transform 0.08s;
}

.btn:not(:disabled):active {
  transform: translateY(2px);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.5),
    inset 0 2px 3px rgba(0, 0, 0, 0.25);
}

/* Outline buttons: dark default, lighter on active/selected */
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-light,
.btn-outline-warning {
  background-color: var(--brand-card);
  background-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

.btn-accent {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
  color: var(--brand-text);
  font-weight: 600;
  letter-spacing: 0.02em;
  background-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(0, 0, 0, 0.12) 100%
  );
}

.btn-accent:hover,
.btn-accent:focus {
  background-color: var(--brand-accent-hover);
  border-color: var(--brand-accent-hover);
  color: var(--brand-text);
}

.btn-accent:disabled {
  background-color: var(--brand-border);
  border-color: var(--brand-border);
  color: var(--brand-muted);
  cursor: not-allowed;
  background-image: none;
}

/* ── Hero (index.html) ────────────────────────────────────── */
.hero {
  /* Landscape: fill to bottom of viewport. Portrait: cap at 100vw (square). */
  height: min(calc(100vh - 62px), 100vw);
  background-image:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.48) 0%, rgba(0, 0, 0, 0.68) 100%),
    url('../public/assets/cover.jpeg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.brand-name {
  color: var(--brand-text);
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.9),
    0 0 60px rgba(230, 57, 70, 0.45);
}

/* ── Song list (karaoke.html) ─────────────────────────────── */
.song-list .list-group-item {
  background-color: var(--brand-card);
  border-color: var(--brand-border);
  color: var(--brand-text);
  cursor: pointer;
  transition: background-color 0.12s;
  user-select: none;
}

.song-list .list-group-item:hover {
  background-color: #2e3038;
}

.song-preview-btn {
  transition: background-color 0.15s, border-color 0.15s,
    box-shadow 0.08s, transform 0.08s;
  flex-shrink: 0;
}

/* ── Search clear ────────────────────────────────────────────── */
input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

/* ── Filter row captions ──────────────────────────────────────── */
.filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-muted);
  white-space: nowrap;
}

/* ── Song list expander ───────────────────────────────────────── */
.song-list-expander {
  background-color: var(--brand-card);
  border-color: var(--brand-border);
  color: var(--brand-muted);
  cursor: pointer;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: background-color 0.12s, color 0.12s;
  user-select: none;
}

.song-list-expander:hover {
  background-color: #2e3038;
  color: var(--brand-text);
}

/* ── Filter row: subtle hover vs active/selected ─────────────── */
.filter-row .btn-outline-secondary:not(.active):not(:disabled):hover {
  background-color: #313540;
  background-image: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(0, 0, 0, 0.05) 100%
  );
  border-color: rgba(108, 117, 125, 0.7);
  color: var(--brand-text);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.song-list .list-group-item.in-queue {
  border-left: 3px solid var(--brand-accent);
}

.song-list .text-muted,
.song-artist {
  color: var(--brand-muted) !important;
  font-size: 0.82rem;
}

/* ── Queue drag-and-drop ─────────────────────────────────── */
.queue-panel .list-group-item[draggable] {
  cursor: grab;
}

.queue-panel .list-group-item.queue-dragging {
  opacity: 0.35;
}

.queue-panel .list-group-item.queue-drop-above {
  box-shadow: inset 0 3px 0 var(--brand-accent);
}

.queue-panel .list-group-item.queue-drop-below {
  box-shadow: inset 0 -3px 0 var(--brand-accent);
}

/* ── Queue panel (karaoke.html) ───────────────────────────── */
.queue-panel {
  background-color: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: 0.5rem;
  position: sticky;
  top: 1rem;
}

.queue-panel .list-group-item {
  background-color: var(--brand-card);
  border-color: var(--brand-border);
  color: var(--brand-text);
  font-size: 0.9rem;
}

.queue-panel .list-group-item [data-remove-idx] {
  transition: opacity 0.15s;
}

/* ── Karaoke Presenter ────────────────────────────────────── */
.presenter {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #060810;
  display: flex;
  flex-direction: column;
  color: var(--brand-text);
}

.presenter-blobs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.presenter-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background-color: #f94d00; /* overridden per-song by karaoke.js */
  border-bottom: none;
  min-height: 68px;
  position: relative;
  z-index: 1;
}

.presenter-song-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  min-width: 80px;
}

.presenter-title {
  flex: 1;
  text-align: center;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  color: #000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Stage — the big lyrics area */
.presenter-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 2rem;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.presenter-lyrics {
  font-size: 3rem; /* overridden per-page by fitLyricsToScreen() */
  line-height: 1.75;
  text-align: left;
  font-weight: 500;
  letter-spacing: 0.015em;
  width: 100%;
  animation: lyric-in 0.2s ease;
  color: #c8c8d8;
  text-shadow:
    0 2px 6px rgba(0, 0, 0, 0.9),
    0 4px 20px rgba(0, 0, 0, 0.7);
}

.lyric-table {
  width: 100%;
  border-collapse: collapse;
}

.lyric-table td {
  padding: 0.1em 0.6em 0.1em 0;
  vertical-align: top;
}

.lyric-line {
  display: block;
  padding: 0.05em 0;
  white-space: nowrap;
}

.presenter-lyrics em {
  color: #aaff00;
  font-style: italic;
}

.presenter-lyrics strong {
  color: #ffffff;
}

/* preserve empty lines so spacing between stanzas is visible */
.lyric-line:empty::after {
  content: "\00a0";
}

@keyframes lyric-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer controls */
.presenter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.presenter-counter {
  font-size: 0.85rem;
  color: var(--brand-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.presenter-key-tone {
  background: #fff;
  color: #111;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0 1.5rem;
  align-self: stretch;
  display: flex;
  align-items: center;
  margin: -0.75rem 0;
}

.presenter-key-tone:empty {
  display: none;
}


/* ── Footer ───────────────────────────────────────────────── */
footer {
  background-color: var(--brand-surface);
  border-top: 1px solid var(--brand-border);
  position: relative;
  z-index: 1;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--brand-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--brand-border);
  border-radius: 3px;
}
