/* Pop-up windows: sign in, username, report and selfie. */

.dialog {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100svh - 24px);
  overflow: auto;
  padding: 20px;
  border-radius: 18px;
  color: var(--color-text);
  background: var(--color-panel);
  border: 1px solid var(--color-line-strong);
  box-shadow: var(--glow-cabinet);
}
.dialog::backdrop { background: var(--color-backdrop); }
.dialog[open],
.dialog form { display: flex; flex-direction: column; gap: 14px; }

.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dialog-actions button { flex: 1; }

fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gap-sm); }
legend { font-weight: 600; font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: 6px; }

/* Report reasons */
.choices label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-well);
  color: var(--color-text);
  cursor: pointer;
}
.choices input { accent-color: var(--color-accent); width: 18px; height: 18px; }

/* Avatar picker */
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.avatar-grid button {
  aspect-ratio: 1;
  padding: 0;
  font-size: 24px;
  border-radius: var(--radius-sm);
  background: var(--color-well);
}
.avatar-grid button[aria-pressed="true"] {
  border-color: var(--color-accent);
  box-shadow: var(--glow-accent);
}

/* ---------- Selfie ---------- */
.selfie-view {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-well);
  display: grid;
  place-items: center;
}
.selfie-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);   /* mirror, like a phone's selfie camera */
}
.selfie-view .result {
  width: 62%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--color-accent-2);
  box-shadow: var(--glow-accent-2);
}
.selfie-view .guide {
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--color-accent-2) 70%, transparent);
  pointer-events: none;
}
.selfie-view .note { padding: 0 20px; text-align: center; }

.file-label {
  position: relative;
  text-align: center;
  font-weight: 700;
  color: var(--color-accent-2);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.file-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* Challenge inbox */
.inbox-list,
.shop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--gap-sm); }
.inbox-list li {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-well);
}
.inbox-list li.new { box-shadow: inset 3px 0 0 var(--color-accent); }
.inbox-list li.empty { color: var(--color-text-muted); }
.inbox-list a { color: var(--color-text); text-decoration: none; }
.inbox-list a b { color: var(--color-gold); }

/* Shop */
.shop-list li {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-well);
}
.shop-list .item-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.shop-list button { flex: none; }
