/* ===================================================================
   lobby-presence.css — startup DM count, waiting room, DM roster panel.
   Reuses the parchment/ember palette tokens from styles.css.
   =================================================================== */

/* ---- Startup-page live DM counter (rendered inside the Lobby) ---- */
.lobby-live {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 16px; padding: 9px 13px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 12%, var(--parchment-light));
  border: 1px solid var(--parchment-edge);
}
.lobby-live .ll-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffd98a, var(--gold-deep));
  box-shadow: 0 0 8px rgba(232, 195, 114, .8);
  animation: llpulse 2.4s ease-in-out infinite;
  flex: none;
}
.lobby-live .ll-text { font-size: 13px; color: var(--ink-soft); line-height: 1.3; }
.lobby-live .ll-text b { color: var(--ink); font-size: 15px; }
/* --ink-soft (not --ink-faint) so small text clears WCAG 1.4.3 AA (4.5:1). */
.lobby-live .ll-wait { color: var(--ink-soft); font-style: italic; }

/* Visually-hidden but available to assistive tech (live-region announcements). */
.sr-only {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
@keyframes llpulse { 0%, 100% { opacity: .5; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }

/* Optional room-code field on the startup page. */
.lobby-code { letter-spacing: .12em; text-transform: uppercase; }
.lobby-code::placeholder { letter-spacing: normal; text-transform: none; }
.lobby-code-hint { font-size: 12px; color: var(--ink-soft); font-style: italic; margin: -8px 0 16px; }

/* ---- Waiting room overlay ---- */
.waiting-overlay {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 55%), var(--leather-dark);
  overflow: auto;
}
.waiting-card { width: min(440px, 94vw); border-radius: 16px; padding: 30px 30px 24px; position: relative; text-align: center; }

/* A slow-breathing ember instead of a generic spinner. */
.waiting-ember { display: grid; place-items: center; margin: 8px 0 14px; }
.waiting-ember .we-core {
  width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #ffe7af 0%, var(--gold-bright) 35%, var(--wine-br) 100%);
  box-shadow: 0 0 22px rgba(232, 195, 114, .55), 0 0 44px rgba(162, 54, 68, .35);
  animation: emberbreath 2.6s ease-in-out infinite;
}
@keyframes emberbreath {
  0%, 100% { transform: scale(.9); box-shadow: 0 0 16px rgba(232,195,114,.45), 0 0 30px rgba(162,54,68,.28); }
  50%      { transform: scale(1.06); box-shadow: 0 0 28px rgba(232,195,114,.7), 0 0 56px rgba(162,54,68,.45); }
}

.wait-status { font-size: 15px; color: var(--ink-soft); line-height: 1.5; margin: 6px 4px 16px; }
.waiting-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.waiting-leave { width: 100%; margin-top: 14px; }

/* Invite call-to-action card. */
.invite-pop {
  border: 1px solid var(--gold-deep); border-radius: 12px; padding: 14px;
  background: color-mix(in srgb, var(--gold) 14%, var(--parchment-light));
  animation: invitein .35s var(--ease, ease) both;
}
.invite-room { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.invite-room strong { color: var(--ink); letter-spacing: .1em; }
@keyframes invitein { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---- DM-side waiting roster (floats over the table) ---- */
.dm-wait-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  width: 240px; border-radius: 12px; padding: 0; overflow: hidden;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .4);
}
.dm-wait-panel.collapsed { width: 200px; }
.dmw-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, var(--wine-br), var(--wine)); color: #f6e9d0;
  border: 0; padding: 9px 12px; font-family: var(--font-display); font-size: 12px; letter-spacing: .05em;
}
.dmw-title { flex: 1; text-align: left; }
.dmw-count { font-size: 11px; background: rgba(0, 0, 0, .25); border-radius: 20px; padding: 2px 8px; }
.dmw-body { padding: 8px 10px 10px; max-height: 240px; overflow: auto; }
.dmw-empty { font-size: 12px; color: var(--ink-soft); font-style: italic; margin: 6px 2px; }
.dmw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dmw-player {
  display: flex; align-items: center; gap: 8px;
  background: var(--parchment-light); border: 1px solid var(--parchment-edge); border-radius: 8px; padding: 6px 8px;
}
.dmw-name { flex: 1; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* --ink-soft for AA contrast on parchment (gold-deep was ~3.6:1 at 11px). */
.dmw-sent { font-size: 11px; color: var(--ink-soft); font-family: var(--font-display); letter-spacing: .05em; }
/* min-height keeps the Invite control >=24px (WCAG 2.2 SC 2.5.8 recommendation). */
.btn.tiny { padding: 4px 10px; min-height: 24px; font-size: 11px; border-radius: 6px; }

/* Respect reduced-motion: drop the looping/entrance animations. */
@media (prefers-reduced-motion: reduce) {
  .lobby-live .ll-dot,
  .waiting-ember .we-core { animation: none; }
  .invite-pop { animation: none; }
}
