:root {
	--bg: #06060a;
	--bg-elev: #0d0d14;
	--panel: #11111b;
	--panel-2: #171724;
	--text: #f0f0ff;
	--muted: #a9a9c7;
	--accent: #e11d48; /* blood red */
	--accent-2: #7f1d1d; /* deep red */
	--green: #22c55e;
	--footer-h: 44px; /* sticky footer height */
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
	margin: 0;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
	background: radial-gradient(1200px 700px at 70% -10%, rgba(225,29,72,0.15), transparent), var(--bg);
	color: var(--text);
	letter-spacing: 0.2px;
	/* Keep content from hiding behind fixed bars */
	padding-bottom: calc(var(--footer-h) + 90px);
}

.layout { display: grid; grid-template-columns: 1fr; min-height: 100vh; }

/* nav removed */

.brand { font-weight: 800; font-size: 22px; }
.brand span { color: var(--accent); }
.nav-item { display: block; color: var(--muted); padding: 10px 8px; border-radius: 8px; cursor: pointer; margin-top: 8px; }
.nav-item:hover, .nav-item.active { background: #1a1a29; color: var(--text); }

.content { background: var(--bg-elev); display: grid; grid-template-rows: auto 1fr; }
.topbar { padding: 16px 20px; position: sticky; top: 0; background: linear-gradient(180deg, rgba(6,6,10,0.9), rgba(6,6,10,0.6)); backdrop-filter: blur(6px); border-bottom: 1px solid #1e1e2e; z-index: 2; }
.tabs { margin-top: 10px; display: flex; gap: 8px; }
.tab { background: #1a1a29; color: var(--muted); border: 1px solid #2a2a3d; padding: 8px 12px; border-radius: 999px; cursor: pointer; }
.tab.active { background: var(--accent-2); color: #fff; border-color: var(--accent); }

.grid { display: grid; gap: 16px; padding: 20px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.card { background: #12121d; border: 1px solid #1f1f2e; border-radius: 12px; padding: 12px; cursor: pointer; transition: transform .15s ease, background .15s ease; }
.card:hover { transform: translateY(-2px); background: #151526; }
.card.active { outline: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(225,29,72,0.15); }
.card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; background: #1d1d2f; }
.card .title { font-weight: 700; margin: 10px 0 4px; }
.card .sub { color: var(--muted); font-size: 12px; }

.actions { padding: 12px 20px 0; }
.search-wrap { 
  position: relative; 
  display: inline-flex; 
  width: min(640px, 100%); 
  margin: 0 auto;
}
.search-icon { 
  position: absolute; 
  left: 16px; 
  top: 50%; 
  transform: translateY(-50%); 
  opacity: .8;
  font-size: 18px;
  color: var(--accent);
}
.search { 
  width: 100%; 
  background: linear-gradient(135deg, #0a0a12, #0e0e18, #0a0a12);
  color: var(--text); 
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 25px; 
  padding: 16px 20px 16px 50px; 
  font-size: 16px;
  font-weight: 500;
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -1px 0 rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  position: relative;
}
.search::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  background: linear-gradient(45deg, var(--accent), #f97316, var(--accent));
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.search:focus { 
  outline: none; 
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(225,29,72,0.25),
    0 8px 32px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.2);
}
.search:focus::before {
  opacity: 1;
}
.search::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.playerbar { position: fixed; bottom: var(--footer-h); left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 10px 16px; background: linear-gradient(180deg, rgba(17,17,27,0.95), rgba(17,17,27,1)); border-top: 1px solid #27273a; z-index: 20; }
.now { display: flex; gap: 12px; align-items: center; }
.now-art { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #1f1f31; }
.now-title { font-weight: 700; }
.now-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

.controls { display: flex; gap: 8px; align-items: center; justify-content: center; }
.btn { background: #1c1c2b; border: 1px solid #2a2a3d; color: var(--text); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.btn:hover { background: #23233a; border-color: #35354a; }

.progress { display: flex; gap: 10px; align-items: center; justify-content: flex-end; color: var(--muted); }
/* blood progress bar */
#seek { 
    appearance: none; height: 6px; border-radius: 999px; width: 100%; max-width: 520px; 
    background:
      linear-gradient(to right, var(--accent) 0, var(--accent) var(--progress, 0%), #2a2a3d var(--progress, 0%), #2a2a3d 100%),
      radial-gradient(circle at 10% 50%, rgba(225,29,72,0.25) 0 2px, transparent 3px) 0 0/20px 8px repeat-x;
    box-shadow: inset 0 0 0 1px #2a2a3d, 0 0 0 2px rgba(225,29,72,0.05);
}
#seek::-webkit-slider-runnable-track { height: 6px; background: transparent; border-radius: 999px; }
#seek::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--accent-2); margin-top: -4px; box-shadow: 0 0 10px rgba(225,29,72,0.3); }
/* Firefox */
#seek::-moz-range-track { height: 6px; background: transparent; border-radius: 999px; }
#seek::-moz-range-progress { height: 6px; background: var(--accent); border-radius: 999px; }
#seek::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--accent-2); background: var(--accent); border-radius: 50%; }

@keyframes bloodFlow {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 0, 20px 0; }
}
#seek { animation: bloodFlow 2s linear infinite; }

/* volume slider */
.vol-icon { opacity: .8; }
#volume { appearance: none; height: 6px; background: linear-gradient(to right, #9ca3af 0, #9ca3af var(--vol,80%), #2a2a3d var(--vol,80%), #2a2a3d 100%); border-radius: 999px; width: 140px; }
#volume::-webkit-slider-thumb { appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #d1d5db; border: 2px solid #9ca3af; margin-top: -4px; box-shadow: 0 0 10px rgba(209,213,219,0.3); }

@media (max-width: 900px) { .playerbar { grid-template-columns: 1fr; gap: 8px; } .progress { justify-content: center; } }

/* Haunting Loader */
.loader-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 40px;
}

.haunting-loader {
  text-align: center;
  position: relative;
}

.ghost {
  font-size: 4rem;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(225,29,72,0.3));
}

.loader-text {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 20px 0;
  opacity: 0.8;
  animation: pulse 2s ease-in-out infinite;
}

.blood-drops {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.drop {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: bloodDrop 1.5s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(225,29,72,0.5);
}

.drop:nth-child(2) {
  animation-delay: 0.3s;
}

.drop:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.4; }
}

@keyframes bloodDrop {
  0%, 100% { 
    transform: translateY(0px) scale(1);
    opacity: 1;
  }
  50% { 
    transform: translateY(20px) scale(0.8);
    opacity: 0.7;
  }
}

.grid.loading {
  justify-content: center;
  align-items: center;
}

/* Hide loader when content is loaded */
.grid:not(.loading) .loader-container {
  display: none;
}

/* No results styling */
.no-results {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

/* Fix grid layout issues during search */
.grid {
  min-height: 200px;
}

.grid:empty {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Sticky footer bar */
.site-footer { position: fixed; bottom: 0; left: 0; right: 0; height: var(--footer-h); display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; text-align: center; color: var(--muted); background: var(--bg-elev); border-top: 1px solid #1e1e2e; z-index: 10; }
.site-footer a { color: var(--muted); text-decoration: none; margin: 0 6px; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }