/* CardCircle — account widget, account menu, sign-in and username dialogs, credit animations. */

.account { position: relative; display: flex; align-items: center; gap: 10px; flex: none; }
.account[data-status='loading'] { min-width: 40px; }

/* ---------- Ranked credits pill ---------- */
.credits-pill {
  border-color: rgba(217, 180, 90, 0.55);
  background: linear-gradient(180deg, rgba(217, 180, 90, 0.2), rgba(0, 0, 0, 0.35));
}
.credits-pill .pill-label { color: var(--gold); }
.credits-value { color: var(--gold-2); }
.trophy {
  display: grid;
  place-items: center;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #2b1c04;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, var(--gold-3));
  box-shadow: inset 0 0 0 2px rgba(255, 240, 200, 0.35);
}
.trophy svg { width: 14px; height: 14px; }
.gain { animation: credits-gain 0.9s var(--ease); }
@keyframes credits-gain {
  30% { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(244, 220, 149, 0.3), 0 0 26px rgba(244, 220, 149, 0.5); scale: 1.06; }
}
.coin.coin-fly { position: fixed; z-index: 80; width: 18px; height: 18px; pointer-events: none; }

/* ---------- Sign in button and avatar ---------- */
.account-signin { min-height: 40px; height: 40px; padding: 0 16px 0 12px; }
.account-signin svg { width: 18px; height: 18px; flex: none; }
.account-wrap { position: relative; }
.account-avatar {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 232, 170, 0.7);
  cursor: pointer;
  font: 800 1.05rem/1 var(--font-display);
  color: #2b1c04;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, var(--gold-3));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.12s var(--ease), box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.account-avatar:hover { box-shadow: 0 0 0 3px rgba(244, 220, 149, 0.25), 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.account-avatar:active { transform: scale(0.95); }
.account-avatar[aria-expanded='true'] { box-shadow: 0 0 0 3px rgba(244, 220, 149, 0.45), 0 2px 8px rgba(0, 0, 0, 0.4); }
.account-avatar:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.account-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--win);
  border: 2px solid var(--felt-3);
  animation: dot-pulse 2.2s ease-out infinite;
}
@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(95, 211, 148, 0.6); }
  70%, 100% { box-shadow: 0 0 0 8px rgba(95, 211, 148, 0); }
}

/* ---------- Account menu ---------- */
.account-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 40;
  width: min(290px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #0b2f1f, #061a11);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  animation: menu-in 0.18s var(--ease);
}
.account-menu:focus { outline: none; }
@keyframes menu-in { from { opacity: 0; translate: 0 -6px; } }
.menu-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.menu-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font: 800 1rem/1 var(--font-display);
  color: #2b1c04;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, var(--gold-3));
}
.menu-who { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.menu-name { color: var(--ink); font-size: 1rem; overflow: hidden; text-overflow: ellipsis; }
.menu-email { color: var(--ink-3); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-edit { width: 34px; height: 34px; min-height: 34px; }
.menu-edit svg { width: 16px; height: 16px; }
.menu-section { padding: 12px 0; border-bottom: 1px solid var(--hairline); display: flex; flex-direction: column; gap: 10px; }
.menu-section p { margin: 0; color: var(--ink-2); font-size: 0.9rem; line-height: 1.45; }
.menu-section .menu-label { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
/* One row per game: name and credits on the left, rank and Claim 500 (or the countdown) on the right. */
.menu-wallets { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.menu-wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}
.mw-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mw-name { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); }
.mw-credits { font-weight: 700; font-size: 1.15rem; color: var(--gold-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mw-credits.gain { border-radius: 6px; }
.mw-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.mw-rank {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-2);
  text-decoration: none;
  border: 1px solid rgba(217, 180, 90, 0.35);
}
.mw-rank:hover { background: rgba(217, 180, 90, 0.14); }
.menu-claim { min-height: 34px; height: 34px; padding: 0 12px; font-size: 0.85rem; gap: 6px; }
.menu-claim .coin { width: 16px; height: 16px; }
.menu-section .menu-next { text-align: right; color: var(--ink-3); font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu-section .menu-next.bad { color: var(--lose); white-space: normal; max-width: 150px; }
.menu-links { display: flex; flex-direction: column; padding-top: 8px; }
.menu-item {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font: 600 0.92rem/1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover { background: rgba(255, 255, 255, 0.07); }
.menu-item:focus-visible { outline: 2px solid var(--gold-2); outline-offset: -2px; }
.menu-item svg { width: 18px; height: 18px; color: var(--ink-3); }

/* ---------- Dialogs ---------- */
.account-dialog { width: min(440px, calc(100vw - 32px)); }
.account-body { display: flex; flex-direction: column; gap: 14px; }
.account-body p { margin: 0; }
.account-lead { color: var(--ink-2); }
.account-lead strong { color: var(--ink); word-break: break-all; }
.account-small { font-size: 0.85rem; color: var(--ink-3); }
.account-note {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--push);
  background: rgba(236, 201, 100, 0.08);
  border: 1px solid rgba(236, 201, 100, 0.25);
}
.account-error { color: var(--lose); font-size: 0.9rem; font-weight: 600; }
.btn-google { color: #1f1f1f; background: #fff; border-color: #fff; }
.btn-google:hover:not(:disabled) { background: #f1f3f4; border-color: #f1f3f4; }
.btn-google svg { width: 20px; height: 20px; }
.btn svg { flex: none; }
.account-form .btn-lg svg { width: 20px; height: 20px; }
.account-or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; }
.account-or::before, .account-or::after { content: ''; flex: 1; height: 1px; background: var(--hairline); }
.account-form { display: flex; flex-direction: column; gap: 8px; }
.account-form label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.account-form .btn-gold.btn-lg { margin-top: 4px; }
.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font: 500 1rem var(--font-ui);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 180, 90, 0.25); }
.input:disabled { opacity: 0.5; }
.account-hint { font-size: 0.82rem; color: var(--ink-3); }
.account-hint.bad { color: var(--lose); }
.account-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.account-alt {
  align-self: center;
  padding: 6px 10px;
  border: none;
  background: none;
  color: var(--gold-2);
  font: 600 0.92rem var(--font-ui);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.account-badge {
  align-self: center;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #2b1c04;
  background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 55%, var(--gold-3));
}
.account-badge svg { width: 26px; height: 26px; }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .account { gap: 6px; }
  .account-signin { width: 36px; height: 36px; min-height: 36px; padding: 0; }
  .account-signin span { display: none; }
  .account-avatar { width: 36px; height: 36px; font-size: 0.95rem; }
  .credits-pill .trophy { width: 20px; height: 20px; }
  .credits-pill .trophy svg { width: 12px; height: 12px; }
}
@media (max-width: 400px) {
  .credits-pill .trophy { display: none; }
}
