/* ═══════════════════════════════════════════════════════════════════════════
   minimal.css — simplified, quieter layer loaded last on host + guest pages.
   Principles: one primary action per area, secondary actions on hover / in
   menus, fewer columns, no permanent chrome. Remove this file to revert the look.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Footer: part of the page, not a permanent bar over the content ──────── */
.legal-footer-bar {
  position: static;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 28px 10px 18px;
  font-size: 11px;
  opacity: 0.6;
}
.legal-footer-bar:hover { opacity: 1; }

/* ─── Dashboard intro: one quiet line, +/− reveals the explanation ────────── */
.dashboard-intro {
  padding: 14px 18px;
  margin-bottom: 28px;
  background: rgba(223, 255, 0, 0.04);
  border-color: rgba(223, 255, 0, 0.1);
}
.dashboard-intro.is-open { align-items: flex-start; padding: 18px 22px; }
.dashboard-intro-text { flex: 1; min-width: 0; }
.dashboard-intro-head { display: flex; align-items: center; gap: 10px; }
.dashboard-intro-title { margin: 0; font-size: 16px; }
.intro-toggle {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(223, 255, 0, 0.35);
  background: transparent;
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.intro-toggle:hover { background: rgba(223, 255, 0, 0.12); transform: scale(1.08); }
.dashboard-intro-body { margin-top: 10px; }
.dashboard-intro-body[hidden] { display: none; }
.dashboard-intro .btn-add-playlist { padding: 8px 16px; font-size: 13px; box-shadow: none; }
@media (max-width: 600px) {
  .dashboard-intro { flex-direction: row; align-items: center; }
  .dashboard-intro.is-open { flex-direction: column; align-items: stretch; }
  .dashboard-intro .btn-add-playlist { width: auto; }
  .dashboard-intro.is-open .btn-add-playlist { width: 100%; }
}

/* ─── Party list: closed-party actions appear on hover ────────────────────── */
.party-card .btn-reopen-party,
.party-card .btn-delete-party { opacity: 0; transition: opacity 0.15s; }
.party-card:hover .btn-reopen-party,
.party-card:hover .btn-delete-party,
.party-card:focus-within .btn-reopen-party,
.party-card:focus-within .btn-delete-party { opacity: 1; }
.party-card .btn-delete-party:hover { color: var(--danger); }
@media (hover: none) {
  .party-card .btn-reopen-party,
  .party-card .btn-delete-party { opacity: 1; }
}
.status-badge { text-transform: none; letter-spacing: 0.02em; font-size: 11px; }

/* ─── Party detail header: close button is quiet until hovered ────────────── */
.party-detail-header { gap: 10px; margin: 14px 0 22px; }
.btn-close-party {
  margin-inline-start: auto;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-close-party:hover { color: var(--danger); border-color: var(--danger); background: rgba(240, 64, 96, 0.08); }

/* ─── Tabs: underline only, no box ────────────────────────────────────────── */
.party-detail-tabs {
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  margin-bottom: 22px;
}
.tab-btn { padding: 10px 14px; font-size: 14px; }

/* ─── Guest list rows: dot status, one visible action, rest in ⋯ ──────────── */
.guest-row {
  padding: 10px 14px;
  flex-wrap: nowrap;
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.guest-row:hover { background: rgba(255, 255, 255, 0.03); border-color: transparent; border-bottom-color: var(--border-subtle); }
.guest-list { display: flex; flex-direction: column; gap: 0; }
.guest-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: transparent; border: 1.5px solid var(--text-muted);
  flex-shrink: 0;
}
.guest-status-dot.is-in { background: var(--success); border-color: var(--success); }
.guest-row-info { flex: 1; min-width: 0; }
.guest-display-name { font-weight: 700; }
.guest-row-sub { font-size: 12px; color: var(--text-muted); }
.guest-code { color: var(--accent-cyan); font-weight: 700; letter-spacing: 0.08em; }
.guest-row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.row-menu { position: relative; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 18px; font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}
.row-menu-btn:hover, .row-menu[open] > .row-menu-btn { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.row-menu-pop {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-end: 0;
  z-index: 50;
  min-width: 170px;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
}
.row-menu-item {
  background: none; border: none;
  text-align: start;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  color: var(--text);
  font: inherit; font-size: 13px;
  cursor: pointer;
}
.row-menu-item:hover { background: rgba(255, 255, 255, 0.07); }
.row-menu-danger { color: var(--danger); }
.row-menu-danger:hover { background: rgba(240, 64, 96, 0.12); }

/* ─── Playlist header row ─────────────────────────────────────────────────── */
.playlist-header-row { gap: 8px; margin-bottom: 10px; }
.playlist-header-row .btn { box-shadow: none; }
.pl-song-count { text-transform: none; letter-spacing: 0; font-weight: 600; }

/* ─── Playlist table: fewer columns, quiet chrome ─────────────────────────── */
.playlist-table th {
  background: none;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 600;
}
.playlist-table td { padding: 10px 12px; }
.pl-song .pl-title,
.pl-song .pl-artist { text-align: left; }
.pl-song .pl-title { font-weight: 700; line-height: 1.3; }
.pl-song .pl-artist { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
td.pl-score { width: auto; white-space: nowrap; text-align: right; }
td.pl-score .pl-think-alike-ico { width: 22px; height: 22px; vertical-align: middle; margin-inline-end: 4px; }
.pl-score-inner { font-size: 15px; }

/* Submitter chips: × only shows on hover */
.pl-submitter-chip { padding: 2px 7px; gap: 0; background: rgba(255, 255, 255, 0.05); }
.pl-submitter-del { width: 0; margin: 0; overflow: hidden; background: none; transition: width 0.12s, margin 0.12s; }
.pl-submitter-chip:hover .pl-submitter-del { width: 16px; margin-inline-start: 4px; }
@media (hover: none) { .pl-submitter-del { width: 16px; margin-inline-start: 4px; } }

/* Row actions (hide / delete): only on row hover */
.pl-actions-cell { width: 70px; }
.pl-actions { opacity: 0; transition: opacity 0.15s; }
.playlist-table tbody tr:hover .pl-actions,
.playlist-table tbody tr:focus-within .pl-actions,
.pl-row-hidden .pl-actions { opacity: 1; }
@media (hover: none) { .pl-actions { opacity: 0.8; } }
.pl-action-btn { background: transparent; }

/* Play button: neutral circle instead of a red YouTube logo per row */
.pl-youtube { width: 40px; }
.pl-yt-btn {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  opacity: 1;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}
.pl-yt-btn .pl-yt-icon { width: 14px; height: 14px; fill: currentColor; }
.pl-yt-btn .pl-play-icon { margin-left: 2px; }
.pl-yt-btn:hover:not(:disabled) { color: var(--text-on-accent); background: var(--accent); border-color: var(--accent); transform: none; }
.pl-yt-btn .pl-yt-stop { fill: var(--accent); }

/* ─── Hearts: bigger, and unmistakable when selected ─────────────────────── */
.pl-like { width: 56px; }
.playlist-table .btn-like {
  width: 44px; height: 44px;
  padding: 0;
  border: none;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  transition: color 0.15s, transform 0.15s, background 0.15s;
}
.playlist-table .btn-like .heart-icon { font-size: inherit; color: inherit; }
.playlist-table .btn-like:hover { color: #e0435c; background: rgba(224, 67, 92, 0.08); transform: scale(1.08); }
.playlist-table .btn-like.liked {
  color: #ff3d6e;
  font-size: 34px;
  background: rgba(255, 61, 110, 0.12);
  filter: drop-shadow(0 0 8px rgba(255, 61, 110, 0.55));
}
.playlist-table .btn-like.liked .heart-icon { color: inherit; animation: heart-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.playlist-table tbody tr:has(.btn-like.liked) { background: rgba(255, 61, 110, 0.05); }

/* ─── Export dialog ───────────────────────────────────────────────────────── */
.cp-title { margin-bottom: 16px; }
.cp-quick-btn {
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--text-on-accent);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.cp-quick-btn:hover:not(:disabled) { background: var(--accent-hover); }
.cp-quick-btn:active { transform: scale(0.99); }
.cp-quick-btn:disabled { opacity: 0.7; cursor: progress; }
.cp-quick-main { font-size: 15px; font-weight: 800; }
.cp-quick-sub { font-size: 12px; font-weight: 600; opacity: 0.7; }
.cp-more { margin-top: 14px; }
.cp-more > summary {
  cursor: pointer;
  list-style: none;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px;
}
.cp-more > summary::-webkit-details-marker { display: none; }
.cp-more > summary::after { content: ' ▾'; }
.cp-more[open] > summary::after { content: ' ▴'; }
.cp-more > summary:hover { color: var(--text); }
.cp-more .cp-downloads { margin-top: 8px; }

/* ─── Guest page ──────────────────────────────────────────────────────────── */
.slots-remaining { font-size: 13px; }
#modal-overlay .tutorial-btns { margin: 6px 0 16px; }

/* ─── Mobile: one compact line per song ───────────────────────────────────── */
@media (max-width: 640px) {
  .playlist-header-row .btn { flex: 1 1 auto; }
  .pl-song-count { width: 100%; text-align: center; margin: 2px 0 0; }

  .playlist-table tr {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 8px;
    padding: 10px 4px;
  }
  .playlist-table td.pl-song        { grid-column: 1; grid-row: 1; min-width: 0; }
  .playlist-table td.pl-song .pl-title,
  .playlist-table td.pl-song .pl-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0; }
  .playlist-table td.pl-score       { grid-column: 2; grid-row: 1 / span 2; padding: 0; }
  .playlist-table td.pl-like        { grid-column: 3; grid-row: 1 / span 2; width: auto; }
  .playlist-table td.pl-youtube     { grid-column: 4; grid-row: 1 / span 2; width: auto; }
  .playlist-table td.pl-actions-cell{ grid-column: 3; grid-row: 1 / span 2; width: auto; }
  .playlist-table td.pl-score .pl-think-alike-ico { width: 18px; height: 18px; }

  /* Guest: who brought it, as a quiet second line under the song */
  #guest-leaderboard td.pl-submitters {
    display: block;
    grid-column: 1; grid-row: 2;
    font-size: 11px;
    padding: 2px 0 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* Host: chips are management tools — desktop only */
  #party-playlist-container td.pl-submitters { display: none; }
  /* Host mobile: actions follow the play button */
  #party-playlist-container .playlist-table tr { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  #party-playlist-container td.pl-youtube      { grid-column: 3; }
  #party-playlist-container td.pl-actions-cell { grid-column: 4; }

  .playlist-table .btn-like { width: 40px; height: 40px; font-size: 26px; }
  .playlist-table .btn-like.liked { font-size: 31px; }

  .guest-row { padding: 10px 6px; gap: 10px; }
  .guest-row-actions .btn-copy-invite { padding: 6px 10px; }
}

/* ─── Fixes ───────────────────────────────────────────────────────────────── */
/* Submitters cell must stay a table cell (flex breaks the row borders) */
@media (min-width: 641px) {
  .playlist-table td.pl-submitters { display: table-cell; }
  .playlist-table td.pl-submitters .pl-submitter-chip { margin: 2px; }
}
.playlist-table th:nth-child(4) { text-align: right; }

/* Guest rows read right-to-left: status dot → name → actions */
.guest-row { direction: rtl; }
.guest-row-info { text-align: right; }
.row-menu-pop { inset-inline-start: auto; inset-inline-end: auto; left: 0; right: auto; }

@media (max-width: 640px) {
  /* Desktop cell padding must not leak into the mobile grid */
  .playlist-table td { padding: 0; }
  /* Phones: row actions are always visible — don't depend on the device reporting "no hover" */
  .playlist-table .pl-actions { opacity: 0.85; }
  .pl-submitter-del { width: 16px; margin-inline-start: 4px; }
  /* Fixed columns so scores / hearts / play line up across rows */
  .playlist-table tr { grid-template-columns: minmax(0, 1fr) 62px 44px 34px !important; }
  #party-playlist-container .playlist-table tr { grid-template-columns: minmax(0, 1fr) 62px 34px 64px !important; }
  .playlist-table td.pl-score { text-align: right; }
  .playlist-table td.pl-song,
  #guest-leaderboard td.pl-submitters { padding-left: 4px; text-align: left; }
}

/* ─── Host playlist: multi-select + manual order ──────────────────────────── */
#party-playlist-container .playlist-table th:nth-child(4) { text-align: left; }
#party-playlist-container .playlist-table th:nth-child(6) { text-align: right; }
.playlist-table .pl-drag,
.playlist-table .pl-select { width: 1%; white-space: nowrap; padding-right: 0; }
.playlist-table .pl-drag { padding-left: 6px; }
.pl-check {
  width: 17px; height: 17px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.pl-row-selected { background: rgba(255, 255, 255, 0.05); }

.pl-bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}
.pl-bulk-bar.hidden { display: none !important; }
.pl-bulk-bar > span { margin-right: auto; }

.pl-order-hint { font-size: 12px; color: var(--text-muted); margin: -2px 0 10px; direction: rtl; text-align: right; }

.pl-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 30px;
  color: var(--text-muted);
  opacity: 0.6;
  cursor: grab;
  touch-action: none;      /* touch drags reorder instead of scrolling */
  user-select: none;
  border-radius: var(--radius-xs);
  transition: opacity 0.15s, color 0.15s, background-color 0.15s;
}
.playlist-table tr:hover .pl-drag-handle { opacity: 1; }
.pl-drag-handle:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.pl-drag-handle:active,
.playlist-table tr.pl-dragging .pl-drag-handle { opacity: 1; color: var(--accent); }
.pl-grip-icon { width: 18px; height: 18px; pointer-events: none; }
.playlist-table tr.pl-dragging {
  background: rgba(255, 255, 255, 0.09);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.playlist-table tr.pl-dragging .pl-drag-handle { cursor: grabbing; }
body:has(tr.pl-dragging) { user-select: none; cursor: grabbing; }

@media (max-width: 640px) {
  /* Host mobile: two leading columns — drag handle, checkbox */
  #party-playlist-container .playlist-table tbody tr {
    grid-template-columns: 30px auto minmax(0, 1fr) 62px 34px 64px !important;
  }
  #party-playlist-container .playlist-table td.pl-drag        { display: block; grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  #party-playlist-container .playlist-table td.pl-select      { display: block; grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  #party-playlist-container .playlist-table td.pl-song        { grid-column: 3; }
  #party-playlist-container .playlist-table td.pl-score       { grid-column: 4; }
  #party-playlist-container .playlist-table td.pl-youtube     { grid-column: 5; }
  #party-playlist-container .playlist-table td.pl-actions-cell{ grid-column: 6; }
  .pl-drag-handle { width: 30px; height: 40px; opacity: 0.85; }
  .pl-check { width: 20px; height: 20px; }
}
