html, body { height: 100%; overflow-x: hidden; }

.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('../img/bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.backdrop-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10,10,16,0.55) 0%, rgba(10,10,16,0.86) 62%, var(--void) 100%),
    radial-gradient(70% 45% at 50% 8%, rgba(139,107,255,0.16), transparent 70%);
}

.gate {
  position: fixed;
  inset: 0;
  height: 100dvh;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--void);
  cursor: pointer;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.gate.gate-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.gate-card {
  text-align: center;
  padding: 40px 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
}
.gate-brand {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}
.dim { color: var(--violet); }
.gate-sub {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 9vh 20px calc(var(--bar-h) + 40px);
  padding-bottom: calc(var(--bar-h) + 40px + env(safe-area-inset-bottom));
}

.hero { text-align: center; margin-bottom: 8vh; }
.wordmark {
  font-family: var(--mono);
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.dot.sm { width: 5px; height: 5px; }

.crew { width: 100%; display: flex; justify-content: center; }
.crew-grid {
  display: flex;
  gap: 34px;
  justify-content: center;
  flex-wrap: wrap;
}

.member {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 6px;
  color: var(--text);
  transition: transform 0.2s ease;
}
.member:hover { transform: translateY(-4px); }
.member:focus-visible { outline: 2px solid var(--violet); outline-offset: 4px; border-radius: 12px; }

.pfp {
  width: 64px; height: 64px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow 0.2s ease;
}
.member:hover .pfp { box-shadow: inset 0 0 0 1px var(--violet); }
.pfp img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfp.lg { width: 92px; height: 92px; margin: 0; flex-shrink: 0; }

.handle {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,16,0.7);
  backdrop-filter: blur(4px);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(84vw, 320px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.modal-close {
  background: none; border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }
.modal-body {
  padding: 24px 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.modal-bio {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  margin: 18px 0 0;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.modal-actions:empty { display: none; border-top: none; margin-top: 0; padding-top: 0; }
.modal-action-btn {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 7px 14px;
  cursor: pointer;
}
.modal-action-btn:hover { border-color: var(--violet); color: var(--violet); }

.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  height: var(--bar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "left center right";
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -1px 30px rgba(139,107,255,0.06);
  font-family: var(--mono);
  font-size: 12px;
}

.dock-section { display: flex; align-items: center; gap: 10px; }
.dock-left { grid-area: left; position: relative; justify-self: start; }
.dock-center { grid-area: center; min-width: 0; justify-self: center; }
.dock-right { grid-area: right; color: var(--muted); justify-self: end; }

.dock-transport { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.dock-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.volume-icon { color: var(--muted); font-size: 12px; width: 14px; text-align: center; }

.dock-nowplaying {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.track-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  max-width: 100%;
}
.track-title-btn:hover { background: rgba(255,255,255,0.06); }
.track-chevron { font-size: 9px; color: var(--dim); transition: transform 0.2s ease; }
.track-title-btn[aria-expanded="true"] .track-chevron { transform: rotate(180deg); }

.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 340px;
}
.seek-slider {
  flex: 1;
  accent-color: var(--violet);
  height: 3px;
}

.dock-pill {
  display: flex; align-items: center; gap: 7px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--muted);
  padding: 6px 12px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}
.dock-pill:hover { border-color: var(--line-strong); color: var(--text); }

.info-panel {
  position: absolute;
  bottom: calc(var(--bar-h) + 10px);
  left: 0;
  width: 200px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.info-panel[hidden] { display: none; }
.info-panel p { margin: 0 0 6px; font-family: var(--mono); font-size: 13px; }
.info-panel .muted { color: var(--muted); font-size: 12px; margin-bottom: 0; }

.dock-icon {
  background: none; border: none;
  color: var(--text);
  width: 26px; height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.dock-icon svg { width: 14px; height: 14px; display: block; }
.dock-icon:hover { background: rgba(255,255,255,0.08); }
#playBtn {
  width: 30px; height: 30px;
  color: var(--void);
  background: var(--text);
}
#playBtn svg { width: 15px; height: 15px; }
#playBtn:hover { background: var(--cyan); }

.track-title {
  min-width: 0;
  max-width: 100%;
  color: var(--text);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#trackTitleText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-time { color: var(--dim); flex-shrink: 0; width: 32px; }
.track-time:last-child { text-align: right; }

.volume-slider {
  width: 80px;
  accent-color: var(--violet);
}

.playlist-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(10,10,16,0.5);
}
.playlist-scrim[hidden] { display: none; }

.playlist-panel {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bar-h) + env(safe-area-inset-bottom) + 10px);
  transform: translateX(-50%);
  z-index: 56;
  width: min(92vw, 380px);
  max-height: min(50vh, 420px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
.playlist-panel[hidden] { display: none; }

.playlist-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.playlist-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
}

.playlist-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 10px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.playlist-item:hover { background: rgba(255,255,255,0.06); }
.playlist-item .idx {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  width: 18px;
  flex-shrink: 0;
  text-align: center;
}
.playlist-item.active { color: var(--cyan); }
.playlist-item.active .idx { color: var(--cyan); }
.playlist-item .idx .fa-solid { font-size: 10px; }

@media (max-width: 640px) {
  .app { padding-top: 12vh; }
  .crew-grid { gap: 24px; }
  .pfp { width: 56px; height: 56px; }
  .dock {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "left right"
      "center center";
    height: auto;
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    row-gap: 8px;
  }
  .dock-center { width: 100%; justify-self: center; }
  .progress-row { max-width: none; }
  .dock-icon { width: 34px; height: 34px; }
  .dock-icon svg { width: 17px; height: 17px; }
  #playBtn { width: 38px; height: 38px; }
  #playBtn svg { width: 18px; height: 18px; }
  .volume-slider { width: 60px; }
  :root { --bar-h: 108px; }
  .playlist-panel { width: min(94vw, 380px); }
}

@media (max-width: 380px) {
  .crew-grid { gap: 16px; }
  .pfp { width: 46px; height: 46px; }
  .handle { font-size: 12px; }
  .wordmark { font-size: 26px; }
}
