/* The account button, its menu and the language dropdown: one look on every page (/js/account.js).
   A page may tint it with --acct-rgb (the profile uses its accent). */
.account-slot { position: relative; display: flex; align-items: center; --acct: rgb(var(--acct-rgb, 245,184,0)); }
.account-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(var(--acct-rgb, 245,184,0),0.25);
  border-radius: 999px;
  color: #fff;
  font-family: var(--font-text, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.account-btn:hover { border-color: rgba(var(--acct-rgb, 245,184,0),0.5); background: rgba(0,0,0,0.75); }
.account-btn-signin { padding: 8px 16px; color: var(--acct); }
.account-avatar {
  width: 24px; height: 24px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #F5B800, #ff7a00); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
}
.account-avatar img, .account-menu-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-dot {
  position: absolute; top: -2px; right: -2px; width: 11px; height: 11px; border-radius: 50%;
  background: #F5B800; border: 2px solid #000; pointer-events: none;
  animation: accountDot 2s ease-out infinite;
}
@keyframes accountDot { 0% { box-shadow: 0 0 0 0 rgba(245,184,0,0.55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(245,184,0,0); } }
.account-slot .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.account-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 248px; max-width: calc(100vw - 24px);
  background: linear-gradient(145deg, rgba(20,20,20,0.98), rgba(8,8,8,0.99));
  border: 1px solid rgba(var(--acct-rgb, 245,184,0),0.15);
  border-radius: 18px;
  padding: 6px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 60px rgba(var(--acct-rgb, 245,184,0),0.04);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 300;
  text-transform: none; text-align: left;
}
.account-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
/* opening upwards, from a bar at the bottom of a sidebar */
.account-slot.is-up .account-menu { position: fixed; top: auto; right: auto; transform: translateY(6px); }
.account-slot.is-up .account-menu.open { transform: translateY(0); }
.account-menu-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 6px;
}
.account-menu-avatar {
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, #F5B800, #ff7a00); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-text, inherit); font-size: 14px; font-weight: 600;
}
.account-menu-id { min-width: 0; flex: 1; }
.account-menu-name {
  font-family: var(--font-text, inherit); font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-menu-uname {
  font-size: 12px; color: var(--acct); margin-top: 2px; letter-spacing: 0.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.account-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: transparent; border: 0;
  color: rgba(255,255,255,0.85);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px; font-weight: 400; letter-spacing: 0.2px; line-height: 1.3;
  cursor: pointer; text-align: left; text-decoration: none; text-transform: none;
  transition: background 0.15s, color 0.15s;
}
.account-menu-item svg { flex-shrink: 0; opacity: 0.55; transition: opacity 0.15s; }
.account-menu-item:hover { background: rgba(var(--acct-rgb, 245,184,0),0.08); color: #fff; }
.account-menu-item:hover svg { opacity: 1; color: var(--acct); }
.account-menu-item .item-note { margin-left: auto; padding-left: 10px; font-size: 10.5px; color: rgba(var(--acct-rgb, 245,184,0),0.8); white-space: nowrap; }
.account-menu-item .item-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: #F5B800; color: #000; font-size: 11px; font-weight: 700; line-height: 1;
}
.account-menu-divider { height: 1px; background: rgba(255,255,255,0.05); margin: 6px 8px; }
.account-menu-item-danger { color: rgba(255,180,180,0.85); }
.account-menu-item-danger:hover { background: rgba(255,90,90,0.1); color: #ff8a8a; }
.account-menu-item-danger:hover svg { color: #ff8a8a; opacity: 1; }

/* the language: a small «RU ▾» next to the account button */
.lang-dropdown { position: relative; }
.lang-current {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(245,184,0,0.25);
  border-radius: 24px;
  color: #F5B800;
  font-family: var(--font-text, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 12px; font-weight: 700; letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color 0.2s, background 0.2s;
}
.lang-current::after { content: '▾'; font-size: 10px; opacity: 0.5; transition: transform 0.3s; }
.lang-dropdown.open .lang-current::after { transform: rotate(180deg); }
.lang-current:hover { border-color: rgba(245,184,0,0.5); background: rgba(0,0,0,0.75); }
.lang-list {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: rgba(0,0,0,0.8);
  border: 1px solid rgba(245,184,0,0.2);
  border-radius: 14px;
  padding: 4px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  min-width: 56px;
  z-index: 300;
}
.lang-dropdown.open .lang-list { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option {
  display: block; width: 100%;
  padding: 8px 14px;
  background: transparent; border: none; border-radius: 10px;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-text, inherit); font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  cursor: pointer; text-align: center;
  transition: all 0.15s;
}
.lang-option:hover { color: #fff; background: rgba(245,184,0,0.1); }
.lang-option.active { color: #F5B800; background: rgba(245,184,0,0.15); }
.lang-dropdown.is-up .lang-list { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; transform: translateY(8px); }
.lang-dropdown.is-up.open .lang-list { transform: translateY(0); }

@media (max-width: 768px) {
  .account-name { display: none; }
  .account-btn:not(.account-btn-signin) { width: 36px; height: 36px; padding: 0; gap: 0; justify-content: center; }
  .account-btn:not(.account-btn-signin) .account-avatar { width: 100%; height: 100%; font-size: 13px; }
  .account-btn-signin { padding: 7px 12px; font-size: 10px; }
  .lang-current { padding: 7px 12px; font-size: 11px; }
  /* a finger-sized target around the small buttons */
  .account-btn::before, .lang-current::before { content: ''; position: absolute; inset: -7px -3px; }
}
@media (max-width: 640px) {
  .account-menu { min-width: 220px; }
  .account-menu-head { padding: 10px 10px 12px; }
}
@media (prefers-reduced-motion: reduce) { .account-dot { animation: none; } }
