/* Sign in / register / profile picker */

.profiles-page {
  max-width: 760px;
}

.profiles-loading {
  text-align: center;
  color: var(--ink-faint);
  padding: 3rem 0;
  /* Only a slow load shows it; a quick one goes straight to the card. */
  animation: profiles-loading-in 0.2s ease 0.4s both;
}

@keyframes profiles-loading-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.profiles-card {
  margin: 2.25rem auto 0;
  max-width: 420px;
  padding: 1.75rem 1.75rem 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-soft);
  background: rgba(10, 18, 48, 0.85);
  box-shadow: var(--shadow-card);
}

.profiles-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  color: var(--gold);
  text-align: center;
}

.profiles-card .sub {
  margin: 0 0 1.4rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.profiles-card label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.profiles-card input,
.profiles-card select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-soft);
  background: rgba(7, 13, 36, 0.85);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.profiles-card input:focus,
.profiles-card select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.profiles-card .btn {
  width: 100%;
  margin-top: 0.35rem;
}

.auth-toggle {
  margin-top: 1.1rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-faint);
}

.auth-toggle button {
  border: none;
  background: none;
  padding: 0;
  color: var(--gold);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Google Sign-In button wrapper — centres the GSI-rendered iframe */
.google-btn-wrap {
  display: flex;
  justify-content: center;
  /* The GSI button (size "large") arrives late; hold its height so the form does not jump. */
  min-height: 44px;
  margin-bottom: 0.25rem;
}

/* Cloudflare Turnstile check on the email form (only when the server has it on). */
.turnstile-wrap {
  display: flex;
  justify-content: center;
  /* The widget is 65 px tall; hold the space so the button does not jump. */
  min-height: 65px;
  margin: 0.5rem 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.1rem 0 0.9rem;
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gold-soft);
}

.auth-error {
  margin: 0 0 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(240, 106, 106, 0.14);
  border: 1px solid rgba(240, 106, 106, 0.4);
  color: #ffb0b0;
  font-size: 0.88rem;
}

.auth-notice {
  margin: 0 0 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(120, 200, 140, 0.14);
  border: 1px solid rgba(120, 200, 140, 0.4);
  color: #c9f0d2;
  font-size: 0.88rem;
}

/* "Adding this child changes your price" — gold, so it reads as a decision, not a success. */
.auth-notice.price-confirm {
  background: rgba(255, 214, 102, 0.14);
  border-color: rgba(255, 214, 102, 0.5);
  color: #ffe9a8;
}
.auth-notice.price-confirm p {
  margin: 0.2rem 0;
}
.auth-notice.price-confirm strong {
  color: #fff3c4;
}

.auth-price-line {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
  text-align: center;
}

.auth-consent {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.4rem 0 1rem;
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--ink-faint);
}

.auth-consent input {
  display: inline-block;
  width: auto !important;
  margin: 0.2rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--gold);
}

.auth-consent a {
  color: var(--gold);
  font-weight: 700;
}

.auth-forgot {
  margin: -0.4rem 0 1rem;
  text-align: right;
  font-size: 0.82rem;
}

.auth-forgot button {
  border: none;
  background: none;
  padding: 0;
  color: var(--ink-faint);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.auth-forgot button:hover { color: var(--gold); }

/* Picker */

.picker-header {
  text-align: center;
  margin: 2rem 0 1.5rem;
}

.picker-header h1 {
  margin: 0 0 0.3rem;
  font-size: 1.7rem;
  color: var(--gold);
}

.picker-header p {
  margin: 0;
  color: var(--ink-muted);
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.picker-child,
.picker-add,
.picker-parent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1.35rem 0.9rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--gold-soft);
  background: rgba(10, 18, 48, 0.85);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}

.picker-child:hover,
.picker-add:hover,
.picker-parent:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}

/* A paused child: visible so nobody thinks it is lost, dimmed so nobody taps it to play. */
.picker-child.is-paused {
  opacity: 0.55;
  border-style: dashed;
  text-decoration: none;
}
.picker-child.is-paused .picker-year { color: #ffe9a8; font-weight: 800; }

.picker-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  font-size: 2.3rem;
  background: var(--navy-700);
  border: 2px solid var(--gold-soft);
}

.picker-name {
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--gold);
}

.picker-year {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-faint);
}

.picker-add .picker-avatar {
  background: var(--gold-faint);
  border-style: dashed;
}

/* Author-only tools. The top nav no longer carries an Admin tab, so this is the
   way in; the /admin pages are gated on the email allowlist server-side too. */
.picker-admin {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
}

.picker-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius-pill);
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.picker-admin-link:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Sign out tucks in under the admin link when there is one. */
.picker-admin + .picker-footer {
  margin-top: 0.85rem;
}

.picker-footer {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.picker-footer .link-btn {
  border: none;
  background: none;
  color: var(--ink-faint);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.picker-footer .link-btn:hover { color: var(--gold); }

/* Add-child avatar choices */
.avatar-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.avatar-options button {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 2px solid var(--gold-soft);
  background: rgba(7, 13, 36, 0.85);
  font-size: 1.3rem;
  cursor: pointer;
}

.avatar-options button.selected {
  border-color: var(--gold);
  background: var(--gold-faint);
}
