* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: #000;
  color: #eee;
  font-family: "Segoe UI", Tahoma, sans-serif;
  overflow: hidden;
}

canvas#mdCanvas, canvas#fxCanvas {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  display: block;
}
canvas#fxCanvas { display: none; }

/* ── Landing gate ── */
#gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(124,58,237,0.25), transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(236,72,153,0.2), transparent 55%),
    #050508;
}
.gate-title {
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.18em;
  background: linear-gradient(90deg, #f472b6, #a78bfa, #34d399, #fbbf24, #f472b6);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hueflow 6s linear infinite;
}
@keyframes hueflow { to { background-position: 300% 0; } }
.gate-sub { color: #9da0b3; letter-spacing: 0.25em; text-transform: uppercase; font-size: 0.8rem; }
#enterBtn {
  margin-top: 10px;
  font-size: 1.3rem; font-weight: 800; letter-spacing: 0.15em;
  padding: 16px 54px;
  background: transparent; color: #fff;
  border: 2px solid #a78bfa; border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(167,139,250,0.35), inset 0 0 18px rgba(167,139,250,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}
#enterBtn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 60px rgba(236,72,153,0.5), inset 0 0 26px rgba(236,72,153,0.25);
  border-color: #f472b6;
}
.gate-hint { color: #6a6a82; font-size: 0.8rem; }

/* ── Bars ── */
.bar {
  position: fixed; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(5,5,10,0.85), rgba(5,5,10,0.55));
  backdrop-filter: blur(8px);
  transition: opacity 0.4s, transform 0.4s;
  flex-wrap: wrap;
}
.bar.top { top: 0; }
.bar.bottom {
  bottom: 0;
  background: linear-gradient(0deg, rgba(5,5,10,0.85), rgba(5,5,10,0.55));
}
body.ui-hidden .bar { opacity: 0; transform: translateY(-8px); pointer-events: none; }
body.ui-hidden .bar.bottom { transform: translateY(8px); }
body.ui-hidden { cursor: none; }

.brand {
  font-weight: 900; letter-spacing: 0.2em; font-size: 0.9rem;
  background: linear-gradient(90deg, #f472b6, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.modes { display: flex; gap: 6px; flex-wrap: wrap; }
.group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #c7c7d7;
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.chip:hover { border-color: rgba(255,255,255,0.4); color: #fff; }
.chip.active {
  background: rgba(167,139,250,0.18);
  border-color: #a78bfa;
  color: #ddd6fe;
}
.icon-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  color: #c7c7d7;
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 0.95rem;
  cursor: pointer;
}
.icon-btn:hover { border-color: rgba(255,255,255,0.4); color: #fff; }

.transport { flex: 1; min-width: 240px; }
.track-name {
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.8rem; color: #9da0b3;
}
#seek { flex: 1; accent-color: #a78bfa; }
.time { font-size: 0.75rem; color: #6a6a82; font-family: monospace; }

.presets { margin-left: auto; }
.preset-name {
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.75rem; color: #a78bfa; font-style: italic;
}

/* ── Toast + drop hint ── */
#toast {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%);
  z-index: 30;
  background: rgba(10,10,18,0.85);
  border: 1px solid rgba(167,139,250,0.4);
  color: #ddd6fe;
  border-radius: 99px;
  padding: 8px 20px;
  font-size: 0.85rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
  max-width: 80vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#toast.show { opacity: 1; }

/* The id selector below outranks the UA's [hidden] rule — restore it */
#dropHint[hidden] { display: none; }

#dropHint {
  position: fixed; inset: 24px; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  border: 3px dashed rgba(167,139,250,0.7);
  border-radius: 24px;
  background: rgba(10,10,18,0.6);
  font-size: 1.6rem; font-weight: 800; letter-spacing: 0.1em; color: #ddd6fe;
  pointer-events: none;
}

@media (max-width: 640px) {
  .preset-name, .track-name { display: none; }
}
