/* ——— The Castle Key (js/screens/castlekey.js, js/screens/profiles.js) ——— */

.key-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px auto 0;
  padding: 10px 22px;
  border-radius: 999px;
  border: 3px dashed #d9c3f3;
  background: rgba(255, 255, 255, 0.6);
  color: var(--lilac-deep);
  font-size: 19px;
  font-weight: 600;
  transition: transform 0.15s var(--bounce);
}
.key-btn span { font-size: 26px; }
.key-btn:active { transform: scale(0.96); }
.key-btn.first { padding: 14px 28px; border-style: solid; border-color: #fff; background: var(--lilac); color: #fff; font-size: 22px; box-shadow: 0 6px 0 var(--lilac-deep), var(--shadow); }

.key-help { text-align: center; font-size: 20px; color: var(--ink-soft); }
.key-note { text-align: center; font-size: 15px; color: var(--ink-soft); }

.key-slots { display: flex; justify-content: center; gap: 10px; }
.key-slots.shake { animation: shake 0.45s; }
.key-slot {
  width: 68px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 20px;
  border: 4px dashed #e6cde0;
  background: rgba(255, 255, 255, 0.7);
  color: #d7b8cf;
  font-size: 22px;
  font-weight: 700;
}
.key-slot.next { border-color: var(--pink); color: var(--pink); animation: key-blink 1.2s ease-in-out infinite; }
.key-slot.filled { border: 4px solid var(--pink); background: var(--pink-soft); font-size: 40px; animation: pop-in 0.35s var(--bounce); }
.key-slots.opened .key-slot { border-color: var(--gold); background: #fff4cc; animation: wiggle 0.5s ease-in-out 3; }
@keyframes key-blink { 50% { transform: scale(1.08); } }

.key-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; transition: opacity 0.2s; }
.key-grid.busy { opacity: 0.4; pointer-events: none; }
.key-pic {
  aspect-ratio: 1;
  padding: 0;
  border-radius: 20px;
  border: 4px solid transparent;
  background: #fff;
  box-shadow: 0 4px 0 #f0dcea;
  font-size: clamp(30px, 6vw, 44px);
  transition: transform 0.12s var(--bounce);
}
.key-pic:active { transform: scale(0.88); border-color: var(--pink); }

.family-key { max-width: 560px; margin: 26px auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.family-key-title { font-size: 24px; }
.key-show { display: flex; gap: 10px; }
.key-show span {
  width: 64px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--pink-soft);
  border: 3px solid #fff;
  box-shadow: 0 4px 0 #f0d3e5;
  font-size: 38px;
}
.key-words { font-size: 20px; font-weight: 600; }
.key-tip { font-size: 16px; color: var(--ink-soft); }
.key-status { font-size: 15px; color: var(--mint-deep); font-weight: 600; }
.family-key .link-btn { margin-top: 2px; }

@media (max-width: 640px) {
  .key-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .key-slot { width: 52px; font-size: 18px; }
  .key-slot.filled { font-size: 30px; }
  .key-show span { width: 48px; font-size: 28px; }
}

/* ——— Grown-up accounts: Sign in with Google (js/auth.js, js/screens/profiles.js) ——— */

.google-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px auto 0;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  font-size: 17px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(60, 64, 67, 0.12);
  transition: transform 0.15s var(--bounce);
}
.google-btn:active { transform: scale(0.96); }
.google-g { width: 22px; height: 22px; flex: none; }
.google-modal-btn { display: inline-flex; align-items: center; gap: 8px; }
.google-modal-btn .google-g { width: 20px; height: 20px; }

.account-who { display: flex; align-items: center; gap: 12px; text-align: left; font-size: 17px; }
.account-pic {
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--lilac);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  box-shadow: var(--shadow);
  object-fit: cover;
}
.account-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }

/* ——— "Grown-ups: set up Mathy" (js/screens/signin.js) ——— */
.signin-panel { text-align: center; align-items: center; }
.signin-title { font-size: 28px; }
.signin-lead { font-size: 18px; color: var(--ink-soft); max-width: 460px; }
.signin-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.signin-player {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 96px; padding: 10px 12px; border-radius: 20px;
  background: #fff; box-shadow: 0 4px 0 #f0dcea;
}
.signin-player .profile-avatar { font-size: 40px; width: 64px; height: 64px; display: grid; place-items: center; }
.signin-player .profile-avatar.has-look svg { width: 64px; height: 64px; }
.signin-player small { color: var(--ink-soft); font-weight: 600; }
.signin-body { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.google-btn.big { margin: 4px 0 0; justify-content: center; padding: 14px 22px; font-size: 19px; }
/* Sign in with Apple (iPad/iPhone app): Apple's black button, as big as Google's. */
.apple-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 4px 0 0; padding: 14px 22px; border: 0; border-radius: 999px;
  background: #000; color: #fff; font-size: 19px; font-weight: 600;
  transition: transform 0.15s var(--bounce);
}
.apple-btn:active { transform: scale(0.96); }
.apple-logo { width: 18px; height: 21px; flex: none; margin-top: -3px; }
.signin-or { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 15px; }
.signin-or::before, .signin-or::after { content: ''; flex: 1; height: 2px; background: #eedcea; }
.signin-email { display: flex; flex-direction: column; gap: 10px; }
.signin-email .name-input { width: 100%; font-size: 20px; text-align: center; }
.code-input { letter-spacing: 0.3em; font-size: 28px !important; }
.signin-note { font-size: 16px; color: var(--ink-soft); }
.signin-again { font-size: 15px; }
.signin-again .link-btn { display: inline; margin: 0; padding: 0; }
.signin-fine { font-size: 13px; color: var(--ink-soft); }
.signin-fine a { color: inherit; }
