/* ARTCADE floating music player — hub + CROW */
.artcade-music {
  position: fixed;
  z-index: 99990;
  font-family: "IBM Plex Mono", "Consolas", "Courier New", monospace;
  font-size: 9px;
  letter-spacing: 0.04em;
  user-select: none;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

@keyframes artcadeMusicNeonOutline {
  0% {
    border-color: rgba(0, 255, 213, 0.5);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.6),
      0 0 14px rgba(0, 255, 213, 0.28);
  }
  25% {
    border-color: rgba(255, 46, 234, 0.52);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.6),
      0 0 14px rgba(255, 46, 234, 0.3);
  }
  50% {
    border-color: rgba(184, 255, 0, 0.48);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.6),
      0 0 14px rgba(184, 255, 0, 0.24);
  }
  75% {
    border-color: rgba(0, 200, 255, 0.5);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.6),
      0 0 14px rgba(0, 200, 255, 0.26);
  }
  100% {
    border-color: rgba(0, 255, 213, 0.5);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.6),
      0 0 14px rgba(0, 255, 213, 0.28);
  }
}

@keyframes artcadeMusicNeonChip {
  0% {
    border-color: rgba(0, 255, 213, 0.45);
    color: rgba(0, 255, 213, 0.9);
    box-shadow: 0 0 10px rgba(0, 255, 213, 0.2);
  }
  33% {
    border-color: rgba(255, 46, 234, 0.48);
    color: rgba(255, 180, 240, 0.95);
    box-shadow: 0 0 10px rgba(255, 46, 234, 0.22);
  }
  66% {
    border-color: rgba(184, 255, 0, 0.42);
    color: rgba(210, 255, 120, 0.95);
    box-shadow: 0 0 10px rgba(184, 255, 0, 0.18);
  }
  100% {
    border-color: rgba(0, 255, 213, 0.45);
    color: rgba(0, 255, 213, 0.9);
    box-shadow: 0 0 10px rgba(0, 255, 213, 0.2);
  }
}

.artcade-music--tl {
  top: 12px;
  left: 12px;
  right: auto;
  bottom: auto;
}

.artcade-music--tr {
  top: 12px;
  right: 12px;
  left: auto;
  bottom: auto;
}

.artcade-music--bl {
  bottom: 12px;
  left: 12px;
  top: auto;
  right: auto;
}

.artcade-music--br {
  bottom: 12px;
  right: 12px;
  top: auto;
  left: auto;
}

/* Collapsed: manual minimize */
.artcade-music__chip {
  display: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(0, 255, 213, 0.35);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.92);
  color: rgba(0, 255, 213, 0.85);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  animation: artcadeMusicNeonChip 10s ease-in-out infinite;
  transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
}

.artcade-music--minimized .artcade-music__chip,
.artcade-music--idle .artcade-music__chip {
  display: block;
}

.artcade-music--minimized .artcade-music__panel,
.artcade-music--idle .artcade-music__panel {
  display: none;
}

/* Idle: auto-shrink chip */
.artcade-music--idle .artcade-music__chip {
  width: 16px;
  height: 16px;
  font-size: 8px;
  border-radius: 2px;
  opacity: 0.72;
}

.artcade-music--idle:hover .artcade-music__chip {
  opacity: 1;
}

/* Wide, low panel */
.artcade-music__panel {
  width: 168px;
  padding: 3px 5px;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid rgba(0, 255, 213, 0.35);
  border-radius: 3px;
  animation: artcadeMusicNeonOutline 12s ease-in-out infinite;
}

.artcade-music__row {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 20px;
  cursor: default;
}

.artcade-music__handle {
  flex-shrink: 0;
  color: rgba(120, 130, 140, 0.9);
  font-size: 9px;
  line-height: 1;
  padding: 2px 5px 2px 2px;
  margin: -2px 0 -2px -2px;
  cursor: grab;
  touch-action: none;
  border-radius: 2px 0 0 2px;
}

.artcade-music__handle:hover {
  color: rgba(0, 255, 213, 0.85);
}

.artcade-music__handle:active {
  cursor: grabbing;
}

.artcade-music__title {
  flex: 1;
  min-width: 0;
  color: rgba(190, 200, 210, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 7px;
  line-height: 1.2;
  pointer-events: none;
}

.artcade-music__controls {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
}

.artcade-music__btn {
  width: 18px;
  height: 16px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(210, 220, 230, 0.9);
  font-size: 7px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.artcade-music__btn:hover {
  border-color: rgba(0, 255, 213, 0.35);
  color: rgba(0, 255, 213, 0.95);
  box-shadow: 0 0 8px rgba(0, 255, 213, 0.25);
}

.artcade-music__btn--play {
  width: 20px;
  font-size: 8px;
}

.artcade-music__vol {
  width: 34px;
  height: 12px;
  flex-shrink: 0;
  margin: 0;
  padding: 4px 0;
  accent-color: #00ffd5;
  cursor: pointer;
  touch-action: manipulation;
}

.artcade-music__min {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(160, 170, 180, 0.85);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.artcade-music__min:hover {
  color: rgba(255, 46, 234, 0.95);
  text-shadow: 0 0 8px rgba(255, 46, 234, 0.35);
}

.artcade-music__hint {
  display: none;
  margin: 4px 0 0;
  font-size: 7px;
  line-height: 1.35;
  color: rgba(120, 130, 145, 0.85);
  letter-spacing: 0.03em;
}

.artcade-music--empty .artcade-music__row,
.artcade-music--empty .artcade-music__vol {
  display: none;
}

.artcade-music--empty .artcade-music__hint {
  display: block;
}

body.about-open .artcade-music,
body.gallery-open .artcade-music {
  z-index: 100002;
}

@media (prefers-reduced-motion: reduce) {
  .artcade-music__panel,
  .artcade-music__chip {
    animation: none;
    border-color: rgba(0, 255, 213, 0.4);
  }
}
