/* Sign-in sheet and account button (account.js). Self-contained: used on the landing page,
   the phone lobby and the hub. */

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 11rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.16));
  background: var(--surface, #141923);
  color: var(--text-primary, #f3f5f8);
  font: 600 0.85rem var(--font-sans, system-ui, sans-serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.account-chip.signed-in {
  border-color: color-mix(in srgb, var(--success, #4ade80) 55%, transparent);
}

.account-chip[hidden] {
  display: none;
}

.account-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: end center;
  padding: 0 0 env(safe-area-inset-bottom);
  background: rgba(3, 6, 12, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.account-sheet[hidden] {
  display: none;
}

.account-sheet__panel {
  width: min(100%, 440px);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.4rem 1.2rem 1.2rem;
  border-radius: 22px 22px 0 0;
  background: var(--surface, #141923);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  color: var(--text-primary, #f3f5f8);
  font-family: var(--font-sans, system-ui, sans-serif);
  text-align: center;
  animation: account-up 0.25s ease-out;
}

@media (min-width: 700px) {
  .account-sheet {
    place-items: center;
  }

  .account-sheet__panel {
    border-radius: 22px;
  }
}

@keyframes account-up {
  from { transform: translateY(30px); opacity: 0; }
}

.account-sheet__panel h2 {
  margin: 0;
  font-size: 1.4rem;
}

.account-sheet__lead,
.account-sheet__sent {
  margin: 0;
  color: var(--muted, #8b95a7);
  font-size: 0.95rem;
}

.account-sheet__sent b {
  color: var(--text-primary, #f3f5f8);
  word-break: break-all;
}

.account-sheet__panel form,
.account-sheet__panel [data-part='start'] {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.account-sheet__panel form[hidden],
.account-sheet__panel [data-part='start'][hidden] {
  display: none;
}

.account-sheet__panel input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.16));
  background: var(--surface-2, #1c2230);
  color: var(--text-primary, #f3f5f8);
  font: 600 1.05rem var(--font-sans, system-ui, sans-serif);
}

.account-sheet__panel input.account-code {
  text-align: center;
  font-size: 1.8rem;
  letter-spacing: 0.4em;
  font-variant-numeric: tabular-nums;
}

.account-sheet__panel button {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font: 700 1rem var(--font-sans, system-ui, sans-serif);
  cursor: pointer;
}

.account-sheet__panel button:disabled {
  opacity: 0.6;
}

.account-sheet__panel button[type='submit'] {
  border: none;
  background: var(--accent, #38bdf8);
  color: var(--accent-contrast, #04131d);
}

.account-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: none;
  background: #fff;
  color: #1f1f1f;
}

.account-gis {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.account-gis[hidden],
.account-google[hidden] {
  display: none;
}

.account-google svg {
  width: 1.3rem;
  height: 1.3rem;
}

.account-or {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted, #8b95a7);
  font-size: 0.85rem;
}

.account-or::before,
.account-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-strong, rgba(255, 255, 255, 0.16));
}

.account-sheet__panel .account-link,
.account-sheet__panel .account-close {
  border: none;
  background: none;
  color: var(--muted, #8b95a7);
  font-weight: 600;
  padding: 0.5rem;
}

.account-error {
  margin: 0;
  min-height: 1.2em;
  color: var(--danger, #f87171);
  font-size: 0.9rem;
}

/* The phone lobby: "Sign in to keep your name…" on the join screen */
.account-join {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.45rem 0.5rem 0.45rem 0.8rem;
  border-radius: 14px;
  background: var(--surface, #141923);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  font-size: 0.9rem;
  color: var(--muted, #8b95a7);
}

.account-join[hidden] {
  display: none;
}

.account-join b {
  color: var(--text-primary, #f3f5f8);
}

.account-join button {
  flex-shrink: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

/* In the lobby it is a slim line, so the game list keeps its room */
#account-vote {
  flex-shrink: 0;
  padding: 0.35rem 0.4rem 0.35rem 0.8rem;
  font-size: 0.82rem;
}

#account-vote button {
  padding: 0.35rem 0.7rem;
}

.account-legal {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted, #8b95a7);
}

.account-legal a {
  color: inherit;
}
