/*!
 * Winamp Resurrected
 * Designed & developed by Serkan Hursgunel — www.serkanhursgunel.com
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  /* Desktop wallpaper; the solid colour shows while the image loads or if it fails. */
  background: var(--page-bg) url('../assets/bg.jpg') center / cover no-repeat;
  color: var(--page-text);
  font-family: var(--wa-font-title);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* The whole player is laid out at design size (1100 px wide) and scaled to fit. */
.deck {
  position: absolute;
  left: 0;
  top: 0;
  width: 1100px;
  transform: translate(var(--ox, 0px), var(--oy, 0px)) scale(var(--scale, 1));
  transform-origin: 0 0;
}

.deck[hidden] {
  display: none;
}

/* ---------- Desktop layer (always under the player windows) ---------- */
.desktop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.deck {
  z-index: 1;
}

wa-desktop-icon {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  pointer-events: auto;
  touch-action: none;
}

wa-desktop-icon[data-dragging] {
  z-index: 1;
  opacity: 0.85;
}

/* Windows XP-style shortcut, shared by every <wa-desktop-icon>. */
.desktop-icon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 76px;
  margin: 0;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--desktop-label-text);
  font: 12px/1.25 var(--desktop-font);
  text-align: center;
  text-decoration: none;
  cursor: default;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.desktop-icon__art {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
}

.desktop-icon__logo {
  display: block;
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

/* Selection tint, masked to the logo's own silhouette. */
.desktop-icon__art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--desktop-selection-tint);
  -webkit-mask: var(--icon-src) center / 48px 48px no-repeat;
  mask: var(--icon-src) center / 48px 48px no-repeat;
  opacity: 0;
}

/* Fallback when the icon file is missing: round badge with initials. */
.desktop-icon__placeholder {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3d8bfd, #0b3fa8);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
  font: 700 17px/1 var(--desktop-font);
  letter-spacing: 0.5px;
}

wa-desktop-icon[data-fallback] .desktop-icon__art::after {
  -webkit-mask: none;
  mask: none;
  border-radius: 50%;
}

.desktop-icon__badge {
  position: absolute;
  left: -2px;
  bottom: -2px;
  z-index: 1;
  width: 16px;
  height: 16px;
}

.desktop-icon__label {
  padding: 1px 4px 2px;
  border: 1px dotted transparent;
  text-shadow: var(--desktop-label-shadow);
}

wa-desktop-icon[data-selected] .desktop-icon__art::after {
  opacity: 1;
}

wa-desktop-icon[data-selected] .desktop-icon__label {
  background: var(--desktop-selection);
  text-shadow: none;
}

wa-desktop-icon[data-selected] .desktop-icon:focus .desktop-icon__label,
.desktop-icon:focus-visible .desktop-icon__label {
  border-color: var(--desktop-focus-border);
}

.stage-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  translate: -50% 0;
  margin: 0;
  max-width: calc(100% - 32px);
  font: 500 12px/1.6 var(--wa-font-title);
  color: var(--page-muted);
  text-shadow: var(--page-text-shadow);
  text-align: center;
  pointer-events: none;
}

.stage-hint kbd {
  display: inline-block;
  min-width: 18px;
  margin: 0 1px;
  padding: 0 4px;
  border: 1px solid var(--page-kbd-border);
  border-radius: 4px;
  background: var(--page-kbd-bg);
  font: inherit;
  text-align: center;
}

@media (max-width: 640px), (max-height: 520px) {
  .stage-hint {
    display: none;
  }
}

.drop-overlay {
  position: fixed;
  inset: 12px;
  z-index: 100;
  display: grid;
  place-items: center;
  border: 4px dashed var(--wa-lcd-text);
  background: rgba(13, 24, 18, 0.72);
  color: var(--wa-lcd-text);
  font: 40px/1 var(--wa-font-lcd);
  text-shadow: var(--wa-lcd-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

body[data-dropping] .drop-overlay {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .drop-overlay {
    transition: none;
  }
}
