#loginPanel[data-password-stage] > div {
  width: min(100%, 430px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: clamp(20px, 5vw, 30px);
  border-color: #776197;
  background: radial-gradient(ellipse at 100% 0%, #253650 0%, transparent 52%), linear-gradient(150deg, #231b35, #151522 72%);
  box-shadow: 0 24px 80px #060510c9;
}
#loginPanel[data-password-stage] h2 { margin: 8px 0 6px; font-size: clamp(1.35rem, 5vw, 1.7rem); line-height: 1.15; }
#loginPanel[data-password-stage] h2 + p { margin-block: 0 16px; font-size: .88rem; line-height: 1.55; }
#loginPanel[data-password-stage] h2 + p:empty { display: none; }
.password-login { display: grid; gap: 12px; margin-block: 18px 0; }
.password-login label { display: grid; gap: 6px; color: #e5ddf3; font-size: .85rem; font-weight: 650; }
.password-login input {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid #645477;
  border-radius: 12px;
  color: #faf5ff;
  background: #11111ec9;
  font-size: 16px;
}
.password-login input:focus { border-color: #b699ff; outline: 2px solid #a689f16e; outline-offset: 1px; }
.password-field { position: relative; }
.password-field input { padding-inline-end: 48px; }
.password-field > button {
  position: absolute;
  inset: auto 2px 2px auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #c5b2ea;
}
.password-field > button:hover, .password-field > button[aria-pressed=true] { background: #a689f125; color: #fff; }
.password-field svg { width: 20px; height: 20px; }
.password-hint { color: #bcb0cf; margin-top: -7px; }
.password-recovery { display: flex; justify-content: flex-end; margin-top: -8px; }
.password-login [data-password-mode] { min-height: 40px; border: 0; background: transparent; color: #decaff; font-weight: 650; }
.password-recovery button { padding-inline: 0; font-size: .84rem; text-decoration: underline; text-underline-offset: 3px; }
.password-login-actions button { width: 100%; border: 1px solid #6c5784; border-radius: 12px; background: #9d7bd314; }
.password-login-actions button:hover { background: #9d7bd32c; }
.password-login .primary-action { width: 100%; min-height: 46px; border-radius: 12px; }
.password-login p[role=status] { margin: 0; padding: 9px 12px; border-radius: 10px; background: #70cbe619; color: #d1f2ff; font-size: .83rem; }
.password-login p[role=status].is-error { color: #ffd4e2; background: #d94d7c20; }
.password-login p[role=status]:empty { display: none; }
#loginPanel .password-social-heading { display: flex; align-items: center; gap: 10px; margin: 17px 0 10px; color: #bbb0d1; font-size: .78rem; }
.password-social-heading::before, .password-social-heading::after { content: ''; flex: 1; height: 1px; background: #b08dd744; }

@media (prefers-reduced-motion: no-preference) {
  #loginPanel:not([hidden]) {
    animation: login-backdrop-in 160ms ease-out both;
  }

  #loginPanel:not([hidden]) > div {
    animation: login-card-in 220ms cubic-bezier(.2, .75, .25, 1) both;
  }
}

@keyframes login-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes login-card-in {
  from { transform: translateY(10px) scale(.985); }
  to { transform: translateY(0) scale(1); }
}

.password-input { position: relative; display: block; }
.password-input-checked input { padding-inline-end: 40px; }
.password-field .password-input-checked input { padding-inline-end: 78px; }
.password-input-check {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #62efc323;
  color: #8af3d0;
  opacity: 0;
  pointer-events: none;
}
.password-field .password-input-check { inset-inline-end: 48px; }
.password-input input:valid:not([aria-invalid=true]) + .password-input-check { opacity: 1; }
.password-input input[aria-invalid=true] { border-color: #df769b; }
@media (prefers-reduced-motion: no-preference) {
  .password-input-check { transition: opacity 140ms ease-out; }
}

#gameGrid .profile-connections .account-connect-button,
.account-dialog .account-connect-button,
#gameGrid .profile-connections .account-settings-bar {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 42px;
  border: 1px solid #736098;
  border-radius: 12px;
  background: #272340;
  color: #f3e9ff;
  font: inherit;
  font-weight: 700;
  text-align: center;
}
#gameGrid .profile-connections .account-connect-button:hover,
.account-dialog .account-connect-button:hover,
#gameGrid .profile-connections .account-settings-bar:hover {
  background: #363055;
}
#gameGrid .profile-connections .telegram-connection > .account-connect-button { grid-column: 2 / -1; }
.account-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  box-sizing: border-box;
  width: min(calc(100vw - 32px), 416px);
  padding: 26px;
  border: 1px solid #776197;
  border-radius: 20px;
  color: #f4edff;
  background: radial-gradient(ellipse at top right, #283650, #1b172a 65%);
  box-shadow: 0 24px 80px #060510c9;
}
.account-dialog::backdrop { background: #090711b8; }
#toast.account-toast {
  inset-inline: auto 18px;
  margin: 0;
  width: max-content;
  max-width: min(420px, calc(100vw - 36px));
}
.account-dialog h2 { margin: 0 36px 12px 0; font-size: 1.3rem; }
.account-dialog p { margin: 0 0 14px; color: #d1c5e6; }
.account-dialog ul { margin: 0 0 16px; padding-inline-start: 20px; }
.account-dialog-close {
  position: absolute;
  inset: 12px 12px auto auto;
  width: 38px;
  height: 38px;
  border: 1px solid #655879;
  border-radius: 10px;
  color: inherit;
  background: #ffffff0a;
}
@media (prefers-reduced-motion: no-preference) {
  .account-dialog[open] { animation: login-card-in 220ms ease-out both; }
  .account-dialog[open]::backdrop { animation: login-backdrop-in 160ms ease-out both; }
}
