.profiles-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 2rem;
  text-align: center;
}
.profiles-logo { width: 64px; height: auto; color: var(--accent); }
.profiles-screen h1 { font-family: var(--font-display); font-size: 2.2rem; letter-spacing: 0.03em; margin: 0; }

.profiles-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
  max-width: 900px;
}
.profile-tile { cursor: pointer; width: 140px; }
.profile-circle {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: #fff;
  margin: 0 auto 0.7rem;
  transition: outline 0.15s;
  outline: 3px solid transparent;
}
.profile-tile:hover .profile-circle { outline-color: var(--fg); }
.profile-circle.add-circle { background: var(--bg-elevated-2); color: var(--fg-muted); font-size: 3rem; }
.profile-tile-name { color: var(--fg-muted); font-size: 0.95rem; }

.profile-delete {
  display: none;
  position: absolute;
  top: -6px;
  right: -6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  border: 2px solid var(--bg);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.profiles-grid.managing .profile-tile[data-id] .profile-delete { display: block; }
.profiles-grid.managing .profile-tile[data-id] .profile-circle { outline-color: var(--accent); }

.profile-edit-overlay {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
}
.profiles-grid.managing .profile-tile[data-id] .profile-edit-overlay { display: flex; }
.profiles-grid.managing .profile-tile[data-id]:hover .profile-edit-overlay { opacity: 1; }

.add-profile-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: min(360px, 90vw);
}
.add-profile-form h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 1rem; }
.add-profile-form input {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1rem;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: var(--radius);
  font-family: var(--font-body);
}
.avatar-preview-row { display: flex; align-items: center; gap: 1rem; justify-content: center; margin-bottom: 1.2rem; }
.avatar-preview {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  flex-shrink: 0;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}
.emoji-swatch {
  aspect-ratio: 1;
  font-size: 1.4rem;
  background: var(--bg-elevated-2);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}
.emoji-swatch.selected { border-color: var(--accent); }
.emoji-swatch:hover { background: #2b2b31; }

.color-picker { display: flex; gap: 0.6rem; justify-content: center; margin-bottom: 1.2rem; }
.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.color-swatch.selected { border-color: var(--fg); }
.add-profile-actions { display: flex; gap: 0.8rem; justify-content: center; }
.add-profile-actions .play-btn { margin-top: 0; }

/* Header profile badge (index/detail/category/setup) ------------------ */
.profile-badge { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; padding: 0.3rem 0.6rem; border-radius: var(--radius); }
.profile-badge:hover { background: var(--bg-elevated); }
.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  flex-shrink: 0;
}
.profile-name { color: var(--fg-muted); font-size: 0.85rem; }

/* Photo import + crop modal ------------------------------------------- */
.crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}
.crop-dialog {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  width: min(340px, 90vw);
}
.crop-dialog h2 { font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 1rem; }
.crop-viewport {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  cursor: grab;
  touch-action: none;
}
.crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
#crop-zoom { width: 100%; margin-bottom: 1.2rem; accent-color: var(--accent); }
