/* SAVE Learning Co. — Shared Kid Profiles UI
 * Expedition palette: paper #F5F1E8, ink #1F1A14, deep field #1B3A2F,
 * gold #C8A24B, rust #A8432A, sky #6B8CAE, cream #EEE6D3.
 */

/* ---------------- Profile chip (header, top-left) ---------------- */
.save-profile-chip {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(245, 241, 232, 0.96);
  border: 1.5px solid var(--chip-accent, #C8A24B);
  border-radius: 999px;
  color: #1F1A14;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 10px rgba(31, 26, 20, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.save-profile-chip:hover,
.save-profile-chip:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(31, 26, 20, 0.24);
  outline: none;
}
.save-profile-chip:active { transform: translateY(0); }

.save-profile-chip__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: #EEE6D3;
  flex-shrink: 0;
  border: 2px solid var(--chip-accent, #C8A24B);
}
.save-profile-chip__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.save-profile-chip__name {
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.save-profile-chip__chev {
  opacity: 0.55;
  margin-left: -2px;
}

/* On phones, slightly smaller and hugged tighter to the corner */
@media (max-width: 480px) {
  .save-profile-chip {
    top: 8px;
    left: 8px;
    padding: 3px 10px 3px 3px;
    font-size: 13px;
  }
  .save-profile-chip__avatar { width: 26px; height: 26px; }
  .save-profile-chip__name { max-width: 70px; }
}

/* ---------------- Picker modal ---------------- */
.save-profile-picker {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(27, 58, 47, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 24px;
  animation: save-picker-fade-in 0.28s ease both;
}
.save-profile-picker.is-closing {
  animation: save-picker-fade-out 0.2s ease both;
}
@keyframes save-picker-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes save-picker-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.save-profile-picker__card {
  position: relative;
  width: min(560px, 100%);
  background: #F5F1E8;
  border: 1.5px solid #C8A24B;
  border-radius: 18px;
  padding: 32px 28px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
  animation: save-card-pop 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes save-card-pop {
  from { transform: translateY(12px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

.save-profile-picker__title {
  margin: 0 0 6px;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(24px, 4vw, 30px);
  color: #1B3A2F;
  letter-spacing: 0.005em;
}
.save-profile-picker__sub {
  margin: 0 auto 24px;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #1F1A14;
  opacity: 0.78;
  max-width: 440px;
}

.save-profile-picker__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 520px) {
  .save-profile-picker__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.save-profile-picker__pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 8px 12px;
  background: #EEE6D3;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: "Source Sans 3", system-ui, sans-serif;
}
.save-profile-picker__pick:hover,
.save-profile-picker__pick:focus-visible {
  transform: translateY(-3px);
  border-color: var(--pick-accent, #C8A24B);
  box-shadow: 0 8px 22px rgba(31, 26, 20, 0.18);
  background: #F5F1E8;
  outline: none;
}
.save-profile-picker__pick:active { transform: translateY(-1px); }

.save-profile-picker__avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: #F5F1E8;
  border: 3px solid var(--pick-accent, #C8A24B);
  box-shadow: inset 0 0 0 2px #F5F1E8;
}
.save-profile-picker__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (min-width: 520px) {
  .save-profile-picker__avatar { width: 96px; height: 96px; }
}

.save-profile-picker__name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: #1B3A2F;
  letter-spacing: 0.01em;
}

.save-profile-picker__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  font-size: 26px;
  line-height: 1;
  background: transparent;
  border: none;
  color: #1F1A14;
  opacity: 0.55;
  cursor: pointer;
  border-radius: 8px;
}
.save-profile-picker__close:hover {
  opacity: 1;
  background: rgba(31, 26, 20, 0.06);
}

/* When this is the first-launch picker, no close button = picker can't be dismissed.
   That's intentional — kid must pick someone before the app boots. */
