/* Join pages: code entry, the join card for a game or a game night, and the rejoin confirm page.
   Design: "Join game". A narrow column (480px) on the dark page, a yellow title card, two tabs,
   then the forms. Only used by layouts/join. */

body.gtf--join {
  min-height: 100vh;
}

.gtf-jp {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 20px 48px;

  & [hidden] {
    display: none !important;
  }
}

.gtf-jp__top {
  display: flex;
}

.gtf-jp__main {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* Yellow title card: the game's (or night's) name, then one line about it. */
.gtf-jp__hero {
  padding: 28px 24px;
  border-radius: var(--gtf-radius-card);
  background: var(--gtf-yellow);
  color: var(--gtf-ink);
}

.gtf-jp__title {
  margin: 0;
  font-size: clamp(38px, 11vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 900;
  overflow-wrap: anywhere;
}

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

.gtf-jp__stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.gtf-jp__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.gtf-jp__panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* The two tabs fill the row; the active one is yellow (this page only, over the shared .gtf-seg). */
.gtf-seg.gtf-jp__tabs {
  display: flex;
  gap: 8px;
  padding: 0;
  background: transparent;
}

.gtf-jp__tabs .gtf-seg__tab {
  flex: 1;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--gtf-surface-4);
  border-radius: var(--gtf-radius-btn);
  font-size: 17px;
  font-weight: 800;

  body.gtf &[aria-selected="true"] {
    border-color: var(--gtf-yellow);
    background: var(--gtf-yellow);
    color: var(--gtf-ink);
  }

  &:focus-visible {
    outline: 3px solid color-mix(in oklch, var(--gtf-yellow) 55%, transparent);
    outline-offset: 2px;
  }
}

/* The nickname is the one thing people type here, so it is bigger than the other fields. */
.gtf-jp__input {
  padding: 15px 14px;
  font-size: 20px;
  font-weight: 600;
}

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

.gtf-jp__link {
  align-self: flex-start;
  padding: 4px 0;
  border: 0;
  background: none;
  font-family: var(--gtf-font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;

  body.gtf & {
    color: var(--gtf-yellow);
  }

  body.gtf &:hover {
    color: var(--gtf-yellow-hi);
  }
}

.gtf-jp__not-you {
  align-self: flex-start;
}

/* Logged in: avatar and "We'll use {name}". */
.gtf-jp__me {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--gtf-surface-4);
  border-radius: var(--gtf-radius-card);
  background: var(--gtf-surface-1);
}

.gtf-jp__me-text {
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;

  & strong {
    display: block;
    font-size: 22px;
    font-weight: 800;
  }
}

/* "Already joined with an email?" */
.gtf-jp__rejoin {
  border-top-width: 2px;
  padding-top: 12px;

  & > summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    font-size: 17px;
    font-weight: 700;
    color: var(--gtf-yellow);
  }

  & > summary::before,
  &[open] > summary::before {
    content: none;
  }

  & > summary:hover {
    color: var(--gtf-yellow-hi);
  }
}

/* Host page, Players card: reset a guest's rejoin link (same look as the night roster's button). */
.gtf-host-player__reset {
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  border: 2px solid var(--gtf-surface-4);
  border-radius: 8px;
  background: transparent;
  color: var(--gtf-cream);
  font-family: var(--gtf-font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;

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

.gtf-host-player:has(.gtf-host-player__reset) {
  flex-wrap: wrap;
}
