/* The player lobby (player_shell/_lobby) and the avatar editor page (player_shell/_avatar_editor), on the
   player shell (20_player_shell.css). The avatar creator's own markup (category pills, option tiles) is
   styled in avatar_creator.css, which the account page shares. */

/* ---------- Lobby ---------- */

.gtf-lobby {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 4px;
}

.gtf-lobby__main {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.gtf-lobby__hello {
  padding: 24px;
  border-radius: var(--gtf-radius-card);
  background: var(--gtf-yellow);
  color: var(--gtf-ink);
}

.gtf-lobby__title {
  margin: 0;
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.gtf-lobby__joined {
  margin: 12px 0 0;
  font-size: 19px;
  line-height: 1.4;
}

.gtf-lobby__h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.gtf-lobby__next .gtf-lobby__h2 {
  margin-bottom: 8px;
}

.gtf-lobby__text {
  max-width: 32em;
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--gtf-text-2);
}

.gtf-lobby__steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.gtf-lobby__step {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-top: 2px solid var(--gtf-surface-2);
}

.gtf-lobby__num {
  flex: none;
  width: 20px;
  font-family: var(--gtf-mono);
  font-size: 18px;
  color: var(--gtf-yellow);
}

.gtf-lobby__step-title,
.gtf-lobby__step-text {
  display: block;
}

.gtf-lobby__step-title {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
}

.gtf-lobby__step-text {
  margin-top: 3px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--gtf-text-2);
}

/* The shell header becomes the lobby's top row while a lobby is on the page. */
.gtf-ph__coins {
  display: none;
}

.gtf-pl:has(.gtf-lobby) .gtf-ph {
  flex-wrap: nowrap;
  gap: 16px;
  padding: 4px 0 28px;
  border-bottom: 0;

  & .avatar-component {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    border-radius: 30%;
  }

  & .avatar-component__initials {
    font-size: 24px;
  }

  & .gtf-ph__name {
    font-size: 22px;
    letter-spacing: -0.01em;
  }

  & .gtf-ph__context,
  & .gtf-ph__stat {
    display: none;
  }

  & .gtf-ph__coins {
    display: block;
    margin-top: 2px;
    font-family: var(--gtf-mono);
    font-size: 15px;
    color: var(--gtf-yellow);
  }

  & .gtf-ph__action {
    flex: none;
    flex-basis: auto;
    justify-content: center;
    min-height: 44px;
    padding: 12px 16px;
    border-radius: var(--gtf-radius-btn);
    background: var(--gtf-surface-2);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    color: var(--gtf-cream);

    &:hover {
      background: var(--gtf-surface-4);
    }
  }
}

/* While the editor is open it is the whole screen: no header, none of the game under it. */
.gtf-pl:has(.gtf-av) #player-avatar,
.gtf-pl:has(.gtf-av) #avatar-editor ~ * {
  display: none;
}

/* ---------- Avatar editor page ---------- */

.gtf-av {
  padding-top: 4px;
}

.gtf-av__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 4px;
}

.gtf-av__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--gtf-yellow);
}

.gtf-av__coins {
  font-family: var(--gtf-mono);
  font-size: 16px;
  color: var(--gtf-yellow);
}

.gtf-av__title {
  outline: 0; /* the page moves focus here when it opens; no ring on a heading */
  margin: 0 0 20px;
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.gtf-av__form {
  position: relative;
}

.gtf-av__layout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 56px;
  align-items: flex-start;
}

.gtf-av__stage {
  display: flex;
  flex: 1 1 240px;
  justify-content: center;
  min-width: 0;
}

/* The live Pixi / Spine canvas, in a rounded square on the player's own colour (as everywhere else). */
.gtf-av__stage .gtf-av__preview {
  width: clamp(160px, 52vw, 240px);
  height: auto;
  aspect-ratio: 1;
  border: 0;
  border-radius: 30%;
  background: var(--avatar-colour, var(--gtf-surface-2));

  & canvas {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
  }
}

.gtf-av__panel {
  flex: 2 1 380px;
  min-width: 0;
}

.gtf-av__bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--gtf-surface-2);
  background: var(--gtf-ink);
}

.gtf-av__bar-inner {
  max-width: 440px;
  margin: 0 auto;
}

.gtf-av__note {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--gtf-text-2);
}

.gtf-av__actions {
  display: flex;
  gap: 8px;
}

.gtf-av__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border: 2px solid var(--gtf-surface-4);
  border-radius: var(--gtf-radius-btn);
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--gtf-cream);
  cursor: pointer;

  &:hover {
    border-color: var(--gtf-yellow);
  }
}

.gtf-av__btn--save {
  flex: 1;
  border-color: var(--gtf-orange);
  background: var(--gtf-orange);
  font-size: 18px;
  font-weight: 800;
  color: var(--gtf-ink);

  &:hover {
    border-color: var(--gtf-orange-hi);
    background: var(--gtf-orange-hi);
  }
}
