/* Вход через Google, меню аккаунта, очки Игротеки (макет A, work/002-google-login/03-game-design.md).
   Цвета — только токены из common.css. Исключение — 4 цвета логотипа G внутри SVG (их требует Google). */

.top-actions { display: flex; align-items: center; gap: 8px; }
.account { display: contents; }

/* ---------- Кнопка входа ---------- */
.acct-login { font-weight: 600; font-size: 14px; white-space: nowrap; }
.acct-login .g-logo { width: 18px; height: 18px; flex: 0 0 18px; }
.acct-login .g-short { display: none; }
.acct-login:disabled { cursor: progress; opacity: 1; color: var(--muted); }
@media (max-width: 560px) {
  .acct-login .g-long { display: none; }
  .acct-login .g-short { display: inline; }
}
@media (max-width: 360px) {
  .account[data-page="game"] .acct-login .g-short { display: none; }
  .account[data-page="game"] .acct-login { padding: 0; width: 38px; }
}
.acct-spin {
  width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent);
  animation: acct-spin .8s linear infinite;
}
@keyframes acct-spin { to { transform: rotate(360deg); } }

/* ---------- Кнопка вошедшего: аватар (на компьютере ещё имя) ---------- */
.acct-btn { padding: 0 6px; gap: 8px; }
.acct-btn .acct-name, .acct-btn .acct-chev { display: none; }
.acct-btn .acct-chev { width: 14px; height: 14px; color: var(--muted); }
@media (min-width: 561px) {
  .acct-btn { padding: 0 10px 0 6px; }
  .acct-btn .acct-name, .acct-btn .acct-chev { display: inline-block; }
  .acct-btn .acct-name { font-weight: 600; font-size: 14px; white-space: nowrap; }
}
.acct-ava {
  --s: 26px;
  position: relative;
  width: var(--s); height: var(--s); flex: 0 0 var(--s);
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: calc(var(--s) * .46); line-height: 1;
}
.acct-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.acct-ava.lg { --s: 44px; }
.acct-ava.off::after {
  content: ""; position: absolute; right: -2px; bottom: -2px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted); border: 2px solid var(--surface);
}

/* ---------- Выпадающие карточки: меню аккаунта и разбивка очков ---------- */
.acct-pop {
  position: absolute; z-index: 40;
  width: min(280px, calc(100vw - 24px));
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px;
  font-size: 14px; line-height: 1.4;
  animation: acct-pop-in .14s ease-out;
}
@keyframes acct-pop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.acct-who { display: flex; gap: 12px; align-items: center; }
.acct-who > div { min-width: 0; }
.acct-who b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-who small { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pop hr { border: 0; border-top: 1px solid var(--border); margin: 12px -14px; }
.acct-net { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.acct-net i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 auto; }
.acct-net.off i, .acct-net.sending i { background: var(--muted); }
.acct-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.acct-row b { font-variant-numeric: tabular-nums; }
.acct-item {
  display: flex; align-items: center;
  width: calc(100% + 8px); height: 44px; margin: 0 -4px; padding: 0 10px;
  border: 0; border-radius: 12px; background: none;
  color: var(--muted); font-weight: 500; text-align: left; cursor: pointer;
}
.acct-item:hover { background: var(--surface-2); color: var(--text); }
/* Ссылка 12 px, но область касания 44 px (UX-5): поля по вертикали съедены отрицательными отступами, вид прежний. */
.acct-privacy { display: block; width: fit-content; margin: -5px 0 -13px; padding: 13px 0; line-height: 18px; font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.acct-privacy:hover { color: var(--text); }

/* ---------- Главная: плашка «Очки» (как «Счёт» в 2048) ---------- */
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hero-text { min-width: 0; }
.pts-box {
  position: relative; flex: 0 0 auto;
  min-width: 92px; padding: 6px 14px;
  border: 0; border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  text-align: center; cursor: pointer;
}
.pts-box:hover { background: color-mix(in srgb, var(--surface-2), var(--text) 5%); }
.pts-box span { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pts-box b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.25; white-space: nowrap; }
.pts-box.long b { font-size: 18px; }
.pts-add {
  position: absolute; left: 0; right: 0; top: 4px;
  font-style: normal; font-weight: 700; color: var(--accent);
  opacity: 0; pointer-events: none; white-space: nowrap;
}
.pts-add.show { animation: pts-float .9s ease-out; }
@keyframes pts-float { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-30px); } }
.pts-pop h3 { margin: 0 0 10px; font-size: 15px; }
.brk { display: grid; gap: 9px; }
.brk-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 10px; }
.brk-row b { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.brk-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.brk-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.brk-total { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-weight: 700; font-variant-numeric: tabular-nums; }
.brk-note { margin: 10px 0 8px; font-size: 13px; color: var(--muted); }
.acct-login.wide { width: 100%; height: 44px; justify-content: center; }
.acct-login.wide .g-long { display: inline; }
.acct-login.wide .g-short { display: none; }

/* ---------- Окно конца партии: «+N очков» и подсказка «Дальше» ---------- */
.award { margin: -4px 0 16px; text-align: center; }
.award:empty { display: none; }
.award-pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 14px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 16px;
}
.award-pill b { font-size: 20px; font-variant-numeric: tabular-nums; }
.award-line { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.award.zero .award-pill { background: var(--surface-2); color: var(--muted); }
.award-next {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin: 10px 0 0; padding: 8px 12px;
  border: 1px dashed var(--border); border-radius: 10px;
  font-size: 13px; color: var(--muted); text-align: left;
}
.award-next b { color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.award-ask { margin: -8px 0 16px; text-align: center; font-size: 14px; color: var(--accent); font-weight: 600; }
.award-ask[hidden] { display: none; }

/* ---------- Уведомление внизу экрана ---------- */
.acct-toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px); width: max-content;
  background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 60;
}
.acct-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .acct-pop { animation: none; }
  .acct-spin { animation-duration: 2.4s; }
  .pts-add.show { animation: pts-fade .9s linear; }
  .acct-toast { transition: opacity .2s; transform: translate(-50%, 0); }
}
@keyframes pts-fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
