/* Extends ../styles.css with page-specific styles, mirroring poems-center's dark theme +
   component vocabulary (pc-card/pc-tag-chip/pc-editor/toast/.button) since this page reuses
   the same visual language. */

.pc-view { padding: 0.75rem 1.25rem 3rem; max-width: 960px; margin: 0 auto; }

/* Login corner in the topbar's extra slot — same idea as is-back/deck-builder's #user-info. */
.user-info { color: #999; font-size: 0.82rem; }
.user-info strong { color: #00ffcc; }

.pc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.pc-toolbar input, .pc-toolbar select {
  flex: 1 1 160px;
  min-width: 0;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: .6rem .8rem;
  font-size: 0.95rem;
}
.pc-toolbar .button { flex: 0 0 auto; }

.pc-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.pc-card {
  background: #181818;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* ── Song card glass (home page + /mp3-tracks) ──────────────────────────────
   Uses the @property registrations and fx-glow / fx-sheen keyframes from
   /components/fx.css, which both pages load. Scoped to [data-track-id] so the tag
   cards (also .pc-card) keep the plain look. Sits before the :hover/.active rules
   below so .pc-card.active still wins at equal specificity.
   On /mp3-tracks the list is driven by /components/fx-focus.js (rkFxRipple): each cycle a
   random on-screen card leads, and the rest glow weaker (--fx-strength) and shine later
   (--fx-dist) with distance from it, rippling outwards instead of pulsing in unison. The
   home page's single card isn't driven, so it keeps the plain looping shine. */
.pc-card[data-track-id] {
  position: relative;
  background:
    radial-gradient(420px circle at var(--fx-gx) var(--fx-gy), rgba(0,255,204,calc(0.10 * var(--fx-strength, 1))), transparent 60%),
    radial-gradient(360px circle at calc(100% - var(--fx-gx)) calc(100% - var(--fx-gy)), rgba(56,139,253,calc(0.10 * var(--fx-strength, 1))), transparent 58%),
    rgba(16,18,24,0.64);
  border-color: rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.04);
  animation: fx-glow 30s ease-in-out -8s infinite alternate;
  transition: border-color 0.3s, box-shadow 0.4s, --fx-strength 1.5s ease-in-out;
}
.pc-card[data-track-id]::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(115deg,
    transparent calc(var(--fx-sheen) - 14%),
    rgba(255,255,255,calc(0.04 * var(--fx-strength, 1))) var(--fx-sheen),
    transparent calc(var(--fx-sheen) + 14%));
  animation: fx-sheen 16s ease-in-out -3s infinite;
}
.fx-ripple-driven .pc-card[data-track-id]::after { animation: none; }
.fx-ripple-driven .pc-card[data-track-id].fx-sweep::after { animation: fx-sweep 5.6s ease-in-out calc(var(--fx-dist, 0) * 0.2s) both; }
.pc-card[data-track-id]:hover { border-color: rgba(0,255,204,0.6); }
/* While the song plays, the card's edge glows softly in time with a slow breath. */
.pc-card[data-track-id]:has(.mp3-wave-playbtn.is-playing) {
  border-color: rgba(0,255,204,0.45);
  animation: fx-glow 30s ease-in-out -8s infinite alternate, fx-play-breathe 4s ease-in-out infinite;
}
@keyframes fx-play-breathe {
  0%, 100% { box-shadow: 0 14px 40px rgba(0,0,0,0.38), 0 0 18px rgba(0,255,204,0.12), inset 0 1px 0 rgba(255,255,255,0.04); }
  50%      { box-shadow: 0 14px 40px rgba(0,0,0,0.38), 0 0 30px rgba(0,255,204,0.24), inset 0 1px 0 rgba(255,255,255,0.04); }
}
/* Phones: smaller blur radius (see fx.css), and the playing card's edge glow held steady
   instead of breathing — animating that large box-shadow re-rasterises it (over the blur)
   every frame for the whole song, right while the karaoke is running. */
@media (max-width: 767px) {
  .pc-card[data-track-id] {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
  }
  .pc-card[data-track-id]:has(.mp3-wave-playbtn.is-playing) {
    animation: fx-glow 30s ease-in-out -8s infinite alternate;
    box-shadow: 0 14px 40px rgba(0,0,0,0.38), 0 0 24px rgba(0,255,204,0.18), inset 0 1px 0 rgba(255,255,255,0.04);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pc-card[data-track-id], .pc-card[data-track-id]::after,
  .fx-ripple-driven .pc-card[data-track-id].fx-sweep::after,
  .pc-card[data-track-id]:has(.mp3-wave-playbtn.is-playing) {
    animation: none;
  }
}
.pc-card:hover { border-color: #00ffcc; }
.pc-card.active { border-color: #00ffcc; box-shadow: 0 0 0 2px rgba(0,255,204,.15); }
.pc-card-title {
  font-family: 'Playfair Display', 'Anton', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.pc-card-title .title-text { position: relative; top: -0.08em; }
.pc-card-date {
  margin-left: 0.6rem;
  font-family: Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: #888;
  line-height: 1;
}
.pc-card-meta { color: #999; font-size: 0.82rem; margin-top: 0.25rem; display: flex; flex-wrap: wrap; row-gap: 0.35rem; column-gap: 0.5rem; align-items: center; }
.pc-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid #444;
  color: #ccc;
}
.pc-badge.unpublished { border-color: #ff9900; color: #ff9900; background: rgba(255,153,0,0.15); }
/* An app version's preview song (player.js trackCardHtml()): a violet "MADE WITH <App>-v<version>"
   tag at the end of the title row (the card's top-right corner), linking to the app page, and a
   violet edge, so it never passes for a Rakuel release. The same tag on /mp3-tracks, /shared/,
   /apps/ and Domain Settings. */
.pc-card .pc-badge.mp3-preview-badge {
  margin-left: auto;
  padding: 0.18rem 0.6rem;
  font-family: 'Roboto', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #bc8cff;
  background: rgba(188,140,255,0.14);
  border-color: rgba(188,140,255,0.45);
  text-decoration: none; white-space: nowrap;
}
.pc-card a.pc-badge.mp3-preview-badge:hover { background: rgba(188,140,255,0.26); color: #bc8cff; }
.pc-card[data-track-id].is-preview { border-color: rgba(180,140,255,0.45); }
.pc-card[data-track-id].is-preview:hover { border-color: rgba(180,140,255,0.85); }
/* An app's example song stays purple while it plays too (the playing rule above is more
   specific than .is-preview, so it needs its own), breathing in purple. */
.pc-card[data-track-id].is-preview:has(.mp3-wave-playbtn.is-playing) {
  border-color: rgba(180,140,255,0.45);
  animation: fx-glow 30s ease-in-out -8s infinite alternate, fx-play-breathe-preview 4s ease-in-out infinite;
}
.pc-card[data-track-id].is-preview:has(.mp3-wave-playbtn.is-playing):hover { border-color: rgba(180,140,255,0.85); }
@keyframes fx-play-breathe-preview {
  0%, 100% { box-shadow: 0 14px 40px rgba(0,0,0,0.38), 0 0 18px rgba(180,140,255,0.12), inset 0 1px 0 rgba(255,255,255,0.04); }
  50%      { box-shadow: 0 14px 40px rgba(0,0,0,0.38), 0 0 30px rgba(180,140,255,0.24), inset 0 1px 0 rgba(255,255,255,0.04); }
}
@media (max-width: 767px) {
  .pc-card[data-track-id].is-preview:has(.mp3-wave-playbtn.is-playing) {
    animation: fx-glow 30s ease-in-out -8s infinite alternate;
    box-shadow: 0 14px 40px rgba(0,0,0,0.38), 0 0 24px rgba(180,140,255,0.18), inset 0 1px 0 rgba(255,255,255,0.04);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pc-card[data-track-id].is-preview:has(.mp3-wave-playbtn.is-playing) { animation: none; }
}
.pc-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.06);
}
.pc-tag-chip .dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: 0 0 auto; margin-right: 0.3rem; }
.tag-chip-count { font-size: inherit; font-weight: 400; margin-left: 0.2em; }
.pc-tag-chip.selected { border-color: currentColor; background: rgba(255,255,255,0.12); }

.pc-empty { text-align: center; color: #888; padding: 2rem 1rem; }
.pc-loading { text-align: center; color: #888; padding: 1rem; }

.toast {
  position: fixed;
  right: 1rem; bottom: 1rem;
  background: #ff0066;
  color: #fff;
  padding: .9rem 1rem;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(255,0,102,.5);
  z-index: 200;
  display: none;
  max-width: calc(100vw - 2rem);
}

.toast-spinner {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  margin-right: 0.5rem;
  vertical-align: -0.15em;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mp3-toast-spin 0.8s linear infinite;
}
@keyframes mp3-toast-spin { to { transform: rotate(360deg); } }

.button.secondary {
  background: #1a1a1a;
  color: #00ffcc;
  border: 1px solid #00ffcc;
}
.button.secondary:hover { background: rgba(0,255,204,0.1); }
.button.danger {
  background: #1a1a1a;
  color: #ff4466;
  border: 1px solid #ff4466;
}
.button.danger:hover { background: rgba(255,68,102,0.1); }

/* ── Editor ─────────────────────────────────────────────────────────── */
.pc-editor {
  background: #131313;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 1rem;
  margin-top: 0.6rem;
}
.pc-editor-row { margin-bottom: 0.85rem; }
.pc-editor-row label {
  display: block;
  font-size: 0.78rem;
  color: #999;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pc-editor-row input[type="text"],
.pc-editor-row select {
  width: 100%;
  box-sizing: border-box;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  border-radius: 8px;
  padding: .65rem .8rem;
  font-size: 1rem;
  font-family: inherit;
}
.pc-date-select-group { display: flex; gap: 0.5rem; }
.pc-date-select-group select { width: auto; flex: 1; min-width: 0; }

/* "Game soundtrack" row: Appears In Game checkbox + its Shuffler Weight (is-back jukebox).
   The inner labels opt out of .pc-editor-row label's small uppercase caption look. */
.mp3-game-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.4rem; }
.pc-editor-row .mp3-game-row label {
  display: inline-flex; align-items: center; gap: 0.45rem; margin: 0;
  font-size: 0.9rem; color: #ddd; text-transform: none; letter-spacing: 0;
}
.mp3-check-label { cursor: pointer; }
.mp3-check-label input { width: 1rem; height: 1rem; accent-color: #00ffcc; cursor: pointer; }
.mp3-stepper { position: relative; display: inline-flex; margin-left: 0.3rem; }
.mp3-weight-label input[type="number"] {
  width: 4.5rem; background: #1a1a1a; color: #fff; border: 1px solid #333; border-radius: 8px;
  padding: 0.35rem 1.7rem 0.35rem 0.6rem; font-size: 0.95rem; font-family: inherit;
  -moz-appearance: textfield; appearance: textfield; transition: border-color 0.15s ease;
}
.mp3-weight-label input[type="number"]::-webkit-inner-spin-button,
.mp3-weight-label input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.mp3-weight-label input[type="number"]:hover { border-color: #444; }
.mp3-weight-label input[type="number"]:focus { outline: none; border-color: #00ffcc; }
/* Two slim chevron buttons stacked inside the right edge of the box. */
.mp3-stepper-btns {
  position: absolute; top: 3px; right: 3px; bottom: 3px; width: 1.2rem;
  display: flex; flex-direction: column; gap: 2px;
}
.mp3-stepper-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 0;
  background: #262626; border: none; border-radius: 4px; color: #aaa; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.mp3-stepper-btn:hover { background: rgba(0,255,204,0.15); color: #00ffcc; }
.mp3-stepper-btn:active { background: rgba(0,255,204,0.3); }
.mp3-stepper-btn svg { width: 0.55rem; height: 0.35rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Little blue "i" in a circle; hovering (or focusing) it shows what the setting means. */
.mp3-info-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 1.05rem; height: 1.05rem; border-radius: 50%; flex: 0 0 auto;
  background: #1f6feb; color: #fff; font: italic 700 0.72rem/1 Georgia, serif;
  cursor: help; outline: none;
}
.mp3-info-tip {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: min(18rem, 80vw); padding: 0.55rem 0.7rem; border-radius: 8px;
  background: #0d1117; border: 1px solid #388bfd; box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  color: #e6edf3; font: normal 400 0.8rem/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: left; opacity: 0; visibility: hidden; transition: opacity 0.15s ease; z-index: 20; pointer-events: none;
}
.mp3-info-icon:hover .mp3-info-tip, .mp3-info-icon:focus .mp3-info-tip { opacity: 1; visibility: visible; }
.pc-tag-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.pc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.pc-actions .button { padding: 0.55rem 1rem; font-size: 0.88rem; }

.pc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.25rem;
  box-sizing: border-box;
}
.pc-modal-box {
  background: #181818;
  border: 1px solid rgba(255,68,102,0.4);
  border-radius: 12px;
  padding: 1.5rem 1.6rem;
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
}
.pc-modal-box h3 { margin: 0 0 0.7rem; color: #fff; font-family: 'Playfair Display', 'Anton', sans-serif; }
.pc-modal-box p { margin: 0 0 1rem; color: #ccc; font-size: 0.9rem; line-height: 1.5; }
.pc-modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }

/* ── MP3 Tracks specific ────────────────────────────────────────────── */
.mp3-tag-filter-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.1rem; }
.mp3-thumb-update-bar { margin-bottom: 1.1rem; }

.mp3-tag-manage-panel {
  background: #141414;
  border: 1px solid #262626;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.mp3-card-body { display: flex; gap: 0.9rem; align-items: flex-start; }
.mp3-thumb-col { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; flex: 0 0 auto; }
.mp3-thumb-download {
  font-size: 0.7rem;
  color: #888;
  text-decoration: none;
}
.mp3-thumb-download:hover { color: #00ffcc; text-decoration: underline; }
.mp3-thumb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 10px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #101010;
  border: 1px solid #262626;
}
.mp3-thumb-placeholder {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 10px;
  flex: 0 0 auto;
  background: #101010;
  border: 1px dashed #333;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 1.6rem;
}
.mp3-card-main { flex: 1; min-width: 0; }

.mp3-downloads { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.mp3-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  background: #1a1a1a;
  color: #00ffcc;
  border: 1px solid #00ffcc;
}
.mp3-download-btn:hover { background: rgba(0,255,204,0.1); }
/* The card's links keep their own colour and font on every page that shows it (/apps/ and Domain
   Settings style plain links blue, in their own font, and load this file before their own). */
.pc-card a.mp3-download-btn, .pc-card a.mp3-thumb-download { font-family: 'Roboto', sans-serif; }
.pc-card a.mp3-download-btn { color: #00ffcc; }
.pc-card a.mp3-thumb-download { color: #888; }
.pc-card a.mp3-thumb-download:hover { color: #00ffcc; }
/* Matches .mp3-download-btn's own sizing so the Edit/Close button lines up with the download
   buttons it sits alongside in .mp3-downloads. Shows its text label by default; the icon
   twin is only switched in on mobile (below), where there isn't room for the full word. */
.mp3-downloads .track-edit-btn { padding: 0.3rem 0.7rem; font-size: 0.78rem; }
.track-edit-icon { display: none; }

/* On mobile the downloads row stays in .mp3-card-main's column (same position as desktop,
   starting after the thumbnail). The Edit/Close button shrinks to just its icon (pen / ✕)
   instead of its full text label, so all 4 buttons still fit in that narrower column.
   The nowrap/scroll rules mirror is-back/card-gallery's .view-toggle/.toggle-btn technique,
   kept as a safety net for the rare phone still too narrow even with the icon-only button. */
@media (max-width: 767px) {
  .mp3-downloads {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.3rem;
  }
  .mp3-download-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
  }
  .mp3-downloads .track-edit-btn {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    min-width: 1.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .track-edit-label { display: none; }
  .track-edit-icon { display: inline; font-size: 0.9rem; line-height: 1; }
}

/* On phones too narrow for even the shrunk row above to fit all 4 buttons, drop the least
   essential ones instead of shrinking further or leaving them to horizontal-scroll — Lyrics
   goes first, then Edit/Close, so Song and Instrumental (the two actual audio downloads)
   always stay visible and reachable without scrolling. */
@media (max-width: 420px) {
  .mp3-download-xmlLyrics { display: none; }
}
@media (max-width: 360px) {
  .mp3-downloads .track-edit-btn { display: none; }
}

.mp3-upload-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  padding: 0.5rem 0.6rem;
  background: #181818;
  border: 1px solid #262626;
  border-radius: 10px;
}
.mp3-upload-row .mp3-upload-label { flex: 0 0 8.5rem; color: #ccc; font-size: 0.85rem; font-weight: 600; }
.mp3-upload-row .mp3-upload-status { flex: 1; min-width: 0; color: #888; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp3-upload-row input[type="file"] { flex: 0 0 auto; color: #ccc; font-size: 0.8rem; max-width: 100%; }

/* The song player's own styles (waveform, play/pause icons, synced lyrics) live in player.css,
   shared with the home page and the is-back gameplay jukebox. */

/* ?song=<id> from the site-wide search: the song card flashes once. */
.mp3-deep-hit { animation: mp3-deep-hit 0.85s ease-in-out 3; border-radius: 12px; }
@keyframes mp3-deep-hit { 50% { box-shadow: 0 0 0 3px #00ffcc, 0 0 28px rgba(0,255,204,0.55); } }
