@import url("/guest.css");

/* Authentication + public profile identity for Define That! Beta */
.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 1px solid #3c443d;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(33, 39, 34, .96), rgba(24, 29, 25, .98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 12px 28px rgba(0,0,0,.18);
}

.auth-panel.signed-in {
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-color: rgba(216, 244, 82, .45);
  box-shadow: 0 0 0 1px rgba(216, 244, 82, .08), 0 0 26px rgba(169, 201, 49, .09);
}

.auth-copy,
.auth-profile-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.auth-kicker {
  color: #dff453;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .12em;
}

.auth-copy strong,
.auth-profile-copy strong {
  color: #f6f7ef;
  font-size: 1rem;
}

.auth-copy > span:last-child,
.auth-email,
.auth-message {
  color: #aeb7ae;
  font-size: .78rem;
  line-height: 1.3;
}

.auth-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.google-signin-slot {
  min-width: 250px;
  min-height: 40px;
}

.auth-message {
  min-height: 1em;
  text-align: right;
}

.auth-message.bad {
  color: #ff9f9b;
}

.google-account-badge {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(216, 244, 82, .58);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f7f7f4;
  color: #262a25;
  font-size: 1.15rem;
  font-weight: 950;
  box-shadow: 0 0 16px rgba(216, 244, 82, .1);
}

.auth-signout {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #475048;
  border-radius: 999px;
  background: #202620;
  color: #d9dfd7;
  font-weight: 800;
  cursor: pointer;
}

.auth-signout:hover,
.auth-signout:focus-visible {
  border-color: #718070;
  background: #293129;
}

.auth-signout:disabled {
  opacity: .55;
  cursor: wait;
}

/* Public identity: avatar sits immediately left of Display Name. */
.setup-player-identity {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  min-width: 0;
}

.setup-player-identity > label {
  min-width: 0;
}

.profile-avatar-button {
  width: 64px;
  min-width: 64px;
  height: 66px;
  padding: 4px;
  border: 1px solid #4b564d;
  border-radius: 15px;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 2px;
  background: linear-gradient(180deg, #293129, #202620);
  color: #dff453;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 8px 18px rgba(0,0,0,.18);
}

.profile-avatar-button:hover,
.profile-avatar-button:focus-visible {
  border-color: #dff453;
  box-shadow: 0 0 0 2px rgba(216,244,82,.12), 0 0 18px rgba(216,244,82,.13);
  outline: none;
}

.profile-avatar-button > span:last-child {
  font-size: .55rem;
  font-weight: 950;
  letter-spacing: .1em;
}

.profile-avatar-preview,
.player-avatar {
  overflow: hidden;
}

.profile-avatar-preview {
  width: 43px;
  height: 43px;
  border: 2px solid rgba(216, 244, 82, .66);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #303a31;
  font-size: 1.45rem;
  line-height: 1;
}

.profile-avatar-preview img,
.player-avatar img,
.avatar-option-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.player-avatar > span {
  font-size: 1.05em;
  line-height: 1;
}

/* Avatar picker */
body.avatar-picker-open {
  overflow: hidden;
}

.avatar-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(8, 10, 8, .78);
  backdrop-filter: blur(8px);
}

.avatar-picker-modal.hidden {
  display: none;
}

.avatar-picker-card {
  width: min(520px, 100%);
  max-height: min(82vh, 640px);
  overflow: auto;
  padding: 18px;
  border: 1px solid #566157;
  border-radius: 22px;
  background: linear-gradient(180deg, #252d26, #171d18);
  box-shadow: 0 24px 70px rgba(0,0,0,.5), 0 0 32px rgba(216,244,82,.06);
}

.avatar-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.avatar-picker-head h2 {
  margin: 3px 0 0;
  color: #f4f6ee;
  font-size: 1.45rem;
}

.avatar-picker-close {
  width: 42px;
  height: 42px;
  border: 1px solid #4c564e;
  border-radius: 50%;
  background: #202720;
  color: #e7ebe4;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.avatar-picker-copy {
  margin: 10px 0 15px;
  color: #aeb7ae;
  font-size: .83rem;
  line-height: 1.4;
}

.avatar-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.avatar-option {
  min-height: 108px;
  padding: 10px 7px;
  border: 1px solid #414b42;
  border-radius: 16px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 7px;
  background: #202720;
  color: #dfe4dc;
  cursor: pointer;
}

.avatar-option:hover,
.avatar-option:focus-visible {
  border-color: #859682;
  background: #293129;
  outline: none;
}

.avatar-option.selected {
  border-color: #57ef82;
  box-shadow: 0 0 0 2px rgba(87,239,130,.14), 0 0 22px rgba(87,239,130,.13);
  background: #25342a;
}

.avatar-option-visual {
  width: 58px;
  height: 58px;
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #303a31;
  font-size: 2rem;
  line-height: 1;
}

.avatar-option.selected .avatar-option-visual {
  border-color: #57ef82;
}

.avatar-option strong {
  font-size: .72rem;
  text-align: center;
}

.avatar-picker-done {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 1px solid #b8d13c;
  border-radius: 13px;
  background: #dff453;
  color: #171b16;
  font-weight: 950;
  letter-spacing: .04em;
  cursor: pointer;
}

@media (min-width: 621px) {
  .avatar-picker-modal {
    place-items: center;
  }
}

@media (max-width: 620px) {
  .auth-panel,
  .auth-panel.signed-in {
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 13px;
  }

  .auth-panel.signed-in {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .auth-actions,
  .google-signin-slot {
    width: 100%;
    justify-items: stretch;
  }

  .google-signin-slot {
    min-width: 0;
    display: grid;
    place-items: center;
  }

  .auth-message {
    text-align: left;
  }

  .auth-copy > span:last-child,
  .auth-email,
  .auth-message {
    font-size: .74rem;
  }

  .setup-player-identity {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 9px;
  }

  .profile-avatar-button {
    width: 62px;
    min-width: 62px;
    height: 64px;
  }

  .avatar-picker-modal {
    padding: 10px;
  }

  .avatar-picker-card {
    width: 100%;
    border-radius: 22px 22px 16px 16px;
    padding: 16px 13px 14px;
  }

  .avatar-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .avatar-option {
    min-height: 98px;
  }

  .avatar-option-visual {
    width: 52px;
    height: 52px;
    font-size: 1.75rem;
  }
}

@media (max-width: 370px) {
  .avatar-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
