/* ─── Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body,
#root {
  height: 100%;
  /* min-height removed: Tauri enforces the real window minimum (minHeight: 480).
     A CSS min-height larger than the effective CSS viewport (which shrinks at
     zoom > 1) pushes html taller than the window, clipping the player bar. */
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  user-select: none;
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Allow text selection in specific areas */
input,
textarea,
[data-selectable] {
  user-select: text;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

ul,
ol {
  list-style: none;
}

/* Linux Wayland + GPU compositing (WebKitGTK): grayscale body AA can look washed
   when surfaces are GL-composited; prefer LCD subpixel while compositing stays on. */
html[data-platform="linux"][data-linux-session="wayland"]:not(.no-compositing) {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[data-platform="linux"][data-linux-session="wayland"]:not(.no-compositing):is(
  [data-wayland-text-profile="balanced"],
  [data-wayland-text-profile="gpu"]
) body,
html[data-platform="linux"][data-linux-session="wayland"]:not(.no-compositing):is(
  [data-wayland-text-profile="balanced"],
  [data-wayland-text-profile="gpu"]
) #root {
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  text-rendering: geometricPrecision;
}

/* "Sharp" live preview: greyscale AA reads crisper on some GL-composited stacks (WebKit Never is applied on restart). */
html[data-platform="linux"][data-linux-session="wayland"]:not(.no-compositing)[data-wayland-text-profile="sharp"]
  body,
html[data-platform="linux"][data-linux-session="wayland"]:not(.no-compositing)[data-wayland-text-profile="sharp"]
  #root {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* Card play/enqueue overlays: opacity fade + GL layers can flutter on hover (mainstage). */
html[data-platform="linux"][data-linux-session="wayland"]:not(.no-compositing)
  :is(.album-card-play-overlay, .song-card-play-overlay) {
  transition: none;
}

