/* haso.lol accounts (account.js) — same toy-box lobby look as app.css: white cards, navy ink, chunky buttons, candy accents. */
.acct { position: relative; flex-shrink: 0; display: flex; align-items: center; }
.acct-in { height: 40px; }
.acct-av {
  width: 36px; height: 36px; margin: 0 2px; padding: 0; border-radius: 50%; border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg); font: 800 17px/1 var(--display); display: grid; place-items: center;
}
.acct-av:hover, .acct-av[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 210px; padding: 6px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 14px 30px -18px rgba(15, 37, 71, .5);
}
.acct-menu[hidden] { display: none; }
.acct-who { margin: 4px 10px 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.acct-who b { color: var(--ink); }
.acct-menu [role="menuitem"] {
  display: block; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 5px; background: none;
  text-align: left; font-weight: 600; font-size: 15px;
}
.acct-menu [role="menuitem"]:hover, .acct-menu [role="menuitem"]:focus-visible { background: var(--bg2); outline-offset: -2px; }

/* dialogs */
.acct-dlg {
  width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 28px 28px 22px; overflow: auto;
  background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 16px;
  box-shadow: 0 30px 60px -30px rgba(15, 37, 71, .55);
}
.acct-dlg::backdrop { background: rgba(8, 16, 36, .55); }
.acct-dlg h2 { margin: 0 34px 8px 0; font-size: 26px; letter-spacing: -.025em; }
.acct-lede { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.acct-x {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; padding: 0; display: grid; place-items: center;
  border: 0; border-radius: 6px; background: none; color: var(--muted);
}
.acct-x:hover { background: var(--bg2); color: var(--ink); }
.acct-x svg { width: 18px; height: 18px; }
.acct-dlg form { display: flex; flex-direction: column; }
.acct-dlg label { font-weight: 600; font-size: 14px; margin: 0 0 5px; }
.acct-dlg input {
  height: 46px; margin: 0 0 14px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--rule); border-radius: 6px;
}
.acct-dlg input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.acct-rules { margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.acct-rules:empty, .acct-err:empty { display: none; }
.acct-err { margin: 0 0 12px; color: var(--accent); font-weight: 600; font-size: 14px; }
.acct-go { height: 48px; justify-content: center; font-size: 16px; }
.acct-go:disabled { opacity: .6; cursor: progress; }
.acct-switch { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
.acct-link { border: 0; padding: 0; background: none; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* My games */
.acct-games { width: min(520px, calc(100vw - 32px)); }
.acct-list ul { list-style: none; margin: 0 -8px; padding: 0; }
.acct-list li + li { border-top: 1px solid var(--rule); }
.acct-list a {
  display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 10px 8px; border-radius: 6px; text-decoration: none;
}
.acct-list a:hover { background: var(--bg2); }
.acct-list img { grid-row: span 2; width: 48px; height: 48px; border-radius: 6px; background: var(--bg2); object-fit: cover; }
.acct-list .t { font-weight: 700; font-size: 15px; align-self: end; }
.acct-list .m { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; align-self: start; }

/* guest nudge after a game: small, out of the way, never blocks play */
.acct-nudge {
  position: fixed; z-index: 110; right: 16px; bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 16px; max-width: calc(100vw - 32px);
  background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 14px 30px -16px rgba(15, 37, 71, .5); font-weight: 600; font-size: 14px;
}
.acct-nudge .btn { height: 36px; }
.acct-nudge .acct-x { position: static; width: 36px; height: 36px; }
@media (prefers-reduced-motion: no-preference) {
  .acct-nudge { animation: acct-up .3s ease-out; }
  .acct-dlg[open] { animation: acct-up .2s ease-out; }
}
@keyframes acct-up { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 640px) {
  .acct-in { padding: 0 6px; font-size: 14px; border-color: transparent; background: none; } /* like .rnd: leave the room to search */
  .acct-dlg { padding: 24px 18px 18px; }
  .acct-dlg h2 { font-size: 23px; }
  .acct-nudge { left: 16px; right: 16px; justify-content: space-between; }
}
