/* QuinAI Play — the music player (player.js, F3): the app's player bar, panels and karaoke in the site's tokens. */
html[data-qp] body { padding-bottom: var(--qp-h, 0px); }
html[data-qp] .toast { bottom: calc(24px + var(--qp-h, 0px)); }

.qp-bar { position: fixed; inset: auto 0 0 0; z-index: 40; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--card) 95%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.qp-bar[hidden], .qp-panel[hidden], .qp-viz[hidden], .qp-btn[hidden] { display: none; }
.qp-btn { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--foreground); cursor: pointer; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.qp-btn:hover { background: var(--primary-tint); }
.qp-btn:focus-visible, .qp-wave:focus-visible, .qp-cover:focus-visible, .qp-line:focus-visible, .qp-q-go:focus-visible, .qp-viz:focus-visible, .qp-chip:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; }
.qp-btn:disabled { opacity: 0.4; cursor: default; background: transparent; }
.qp-btn[aria-pressed="true"] { color: var(--primary-text); }
.qp-btn svg { width: 18px; height: 18px; }
.qp-play { width: 40px; height: 40px; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); }
.qp-play:hover { background: var(--primary); filter: brightness(1.12); }
.qp-play svg { width: 16px; height: 16px; }
.qp-play[data-loading] svg { opacity: 0.5; }
.qp-play-lg { width: 56px; height: 56px; }
.qp-play-lg svg { width: 22px; height: 22px; }
.qp-sm { width: 30px; height: 30px; }
.qp-sm svg { width: 15px; height: 15px; }

.qp-viz { position: relative; display: block; width: 100%; height: 40px; padding: 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; overflow: hidden; }
@media (min-width: 768px) { .qp-viz { height: 60px; } }
.qp-viz-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.qp-viz-name { position: absolute; right: 12px; bottom: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; opacity: 0; transition: opacity 150ms var(--ease); }
.qp-viz:hover .qp-viz-name, .qp-viz:focus-visible .qp-viz-name { opacity: 1; }

.qp-wave { --qp-on: var(--primary); --qp-off: color-mix(in srgb, var(--muted-foreground) 40%, transparent); position: relative; height: 24px; border-radius: 4px; cursor: pointer; touch-action: none; }
.qp-wave canvas { display: block; width: 100%; height: 100%; }
.qp-wave-phone { margin: 6px 16px 0; }
.qp-wave-kar { --qp-off: rgba(255, 255, 255, 0.3); height: 40px; flex: 1; }
.qp-wave-song { height: 56px; }

.qp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 16px; max-width: 1600px; margin: 0 auto; padding: 8px 16px; }
.qp-song { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qp-cover { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; color: #fff; cursor: pointer; overflow: hidden; }
.qp-titles { min-width: 0; }
.qp-title { margin: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-sub { margin: 0; color: var(--muted-foreground); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp-err { margin: 0; color: var(--primary-text); }
.qp-mid, .qp-side { display: none; }
.qp-phone { display: flex; grid-row: 1; grid-column: 2; align-items: center; gap: 4px; }
.qp-phone .qp-btn:not(.qp-play) { width: 44px; height: 44px; }
.qp-transport { display: flex; align-items: center; justify-content: center; gap: 4px; }
.qp-seek { display: flex; align-items: center; gap: 12px; width: 100%; }
.qp-time { width: 40px; color: var(--muted-foreground); font: 400 12px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.qp-seek .qp-time:first-child { text-align: right; }
.qp-seek .qp-wave { flex: 1; }
.qp-vol { width: 88px; accent-color: var(--primary); }
/* phone: "more" opens the other controls as a second row */
.qp-bar[data-more] .qp-side { display: flex; grid-row: 2; grid-column: 1 / -1; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px; padding-top: 6px; }
.qp-bar[data-more] .qp-side .qp-vol { flex: 1; min-width: 80px; }
@media (min-width: 768px) {
  .qp-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); padding: 8px 32px; }
  .qp-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
  .qp-side, .qp-bar[data-more] .qp-side { display: flex; grid-row: auto; grid-column: auto; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 2px; padding: 0; }
  .qp-bar[data-more] .qp-side .qp-vol { flex: none; }
  .qp-phone, .qp-wave-phone { display: none; }
}

/* the playing marker on the cover (as the app's .q-eq) */
.qp-eqbars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.qp-eqbars[hidden] { display: none; }
.qp-eqbars i { display: block; width: 3px; height: 100%; border-radius: 1px; background: #fff; transform-origin: bottom; }
@media (prefers-reduced-motion: no-preference) {
  .qp-eqbars i { animation: qp-eq 900ms ease-in-out infinite; }
  .qp-eqbars i:nth-child(2) { animation-delay: -300ms; }
  .qp-eqbars i:nth-child(3) { animation-delay: -600ms; }
}
@keyframes qp-eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

/* the panel above the bar */
.qp-panel { position: fixed; right: 16px; left: 16px; bottom: calc(var(--qp-h, 0px) + 8px); z-index: 41; display: flex; flex-direction: column; max-height: min(60dvh, 520px); border: 1px solid var(--border); border-radius: 14px; background: var(--card); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6); }
@media (min-width: 768px) { .qp-panel { left: auto; right: 32px; width: 380px; } }
.qp-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 10px 6px 16px; }
.qp-panel-title { margin: 0; font: 600 1.05rem/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.qp-panel-body { min-height: 0; overflow: auto; padding: 0 8px 12px; }

.qp-lyrics { display: flex; flex-direction: column; gap: 14px; }
.qp-lyrics-panel { max-height: 100%; }
.qp-lyrics-sec { display: flex; flex-direction: column; }
.qp-lyrics-label { margin: 0 0 4px 8px; color: var(--muted-foreground); font: 500 10px/1.4 var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; }
.qp-lyrics-note { margin: 8px; color: var(--muted-foreground); }
.qp-line { padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-foreground); font: 500 15px/1.45 var(--font-sans); text-align: left; cursor: pointer; transition: color 200ms var(--ease), background-color 200ms var(--ease); }
.qp-line:hover { background: var(--primary-tint); color: var(--foreground); }
.qp-line[data-past] { color: color-mix(in srgb, var(--foreground) 70%, transparent); }
.qp-line[data-on] { color: var(--primary-text); font-weight: 600; }

.qp-queue { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.qp-q { display: flex; align-items: center; gap: 2px; padding-right: 4px; border-radius: 8px; }
.qp-q[data-on] { background: var(--primary-tint); }
.qp-q-go { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--foreground); font: 400 14px/1.3 var(--font-sans); text-align: left; cursor: pointer; }
.qp-q[data-on] .qp-q-go { color: var(--primary-text); font-weight: 500; }
.qp-q-cover { flex: none; width: 32px; height: 32px; border-radius: 5px; }
.qp-q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.qp-eq { display: flex; flex-direction: column; gap: 12px; padding: 0 8px; }
.qp-eq-on { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.qp-eq-on input { width: 18px; height: 18px; accent-color: var(--primary); }
.qp-eq-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.qp-chip { min-height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--foreground); font: 500 12px/1 var(--font-sans); cursor: pointer; }
.qp-chip[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); }
.qp-eq-bands { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; }
.qp-eq-band { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qp-eq-band input { writing-mode: vertical-lr; direction: rtl; width: 24px; height: 120px; accent-color: var(--primary); }
.qp-eq-hz { color: var(--muted-foreground); font: 400 10px/1 var(--font-mono); }

/* karaoke */
.qp-kar { position: fixed; inset: 0; z-index: 65; display: flex; flex-direction: column; overflow: hidden; background: #050505; color: #fff; }
.qp-kar-viz { position: absolute; left: 0; right: 0; bottom: 112px; width: 100%; height: 45%; opacity: 0.35; pointer-events: none; }
.qp-kar-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
@media (min-width: 768px) { .qp-kar-head { padding: 12px 32px; } }
.qp-kar-head .qp-titles { flex: 1; }
.qp-kar-head .qp-title { font-size: 16px; font-weight: 600; }
.qp-kar-head .qp-sub { color: rgba(255, 255, 255, 0.6); font-size: 14px; }
.qp-kar-cover { flex: none; width: 40px; height: 40px; border-radius: 6px; }
.qp-kar .qp-btn { color: #fff; }
.qp-kar .qp-btn:hover { background: rgba(255, 255, 255, 0.12); }
.qp-kar .qp-play { color: #fff; background: var(--primary); }
.qp-kar-x { width: 44px; height: 44px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.qp-kar-stage { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 0 24px; text-align: center; }
.qp-kar-label { height: 20px; margin: 0; color: rgba(255, 255, 255, 0.5); font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; }
.qp-kar-line { max-width: 24ch; margin: 0; font-size: clamp(1.75rem, 5vw, 3.25rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.qp-kar-w { -webkit-background-clip: text; background-clip: text; color: transparent; background-image: linear-gradient(90deg, var(--primary-text) 0%, rgba(255, 255, 255, 0.45) 0%); }
.qp-kar-next { display: flex; flex-direction: column; gap: 8px; color: rgba(255, 255, 255, 0.4); font-size: clamp(1rem, 2.4vw, 1.5rem); font-weight: 500; }
.qp-kar-next p { margin: 0; }
.qp-kar-dim { margin: 0; color: rgba(255, 255, 255, 0.5); }
.qp-kar-foot { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 0 16px 24px; }
@media (min-width: 768px) { .qp-kar-foot { padding: 0 32px 24px; } }
.qp-kar-foot .qp-time { color: rgba(255, 255, 255, 0.6); }
.qp-kar-ctr { display: flex; align-items: center; justify-content: center; gap: 12px; }
.qp-kar-ctr .qp-btn:not(.qp-play) { width: 44px; height: 44px; }
