/* Profile screen (profile-view.js, profile-tabs.js) inside the account dialog, the guest's private rating and the
 * version line. Only theme tokens (style.css), so dither looks, big buttons and TV mode follow. A full screen on
 * phones, a large dialog on desktop and TV. */

/* large dialog while the profile is shown */
.overlay .account-card.is-profile { max-width: 760px; }

/* header: the initial in a ring (like the bots' marks), the name, "since" */
.profile-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.profile-mark { flex: none; }
.profile-mark .person-mark { width: 64px; height: 64px; display: block; }
.profile-who { min-width: 0; }
.profile-who p { margin: 0; }
.profile-name { font-size: 1.35rem; font-weight: 700; overflow-wrap: anywhere; }
.profile-name-note, .profile-since { color: var(--muted); font-size: .9rem; line-height: 1.4; }

/* tabs: one row of equal buttons, the selected one marked by its border and weight (no colour only) */
.profile-tabs { display: flex; gap: 6px; margin: 0 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.profile-tabs [role="tab"] { flex: 1 1 0; min-height: 44px; padding: 8px 10px; background: transparent; color: var(--muted); border-color: var(--line); }
.profile-tabs [role="tab"][aria-selected="true"] { color: var(--text); border: 2px solid var(--gold); font-weight: 700; }
.profile-panel h3 { font-size: 1.1rem; margin: 18px 0 6px; }
.profile-panel h3:first-child { margin-top: 4px; }
.profile-panel > p { margin: 0 0 8px; }
.profile-rank { font-variant-numeric: tabular-nums; }
.profile-bots { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.profile-email { font-weight: 600; overflow-wrap: anywhere; margin-bottom: 4px; }

/* last games: W/L marks, a win filled, a loss outlined (shape, not colour, carries the meaning) */
.profile-recent { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.profile-recent li { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 3.4em; }
.recent-mark { display: grid; place-items: center; width: 2em; height: 2em; border-radius: 6px; font-weight: 700;
  border: 2px solid var(--line-strong); color: var(--text); }
.profile-recent .is-won .recent-mark { background: var(--text); color: var(--bg); border-color: var(--text); }
.recent-variant { font-size: .75rem; color: var(--muted); }

.profile-more { margin: 18px 0 0; border-top: 1px solid var(--line); padding-top: 10px; }
.profile-more summary { cursor: pointer; padding: 10px 0; color: var(--muted); }
.profile-more summary:hover, .profile-more[open] summary { color: var(--text); }

/* guest: the private shadow rating above the sign-in */
.guest-rating { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 4px 0 14px; }
.guest-rating h3 { font-size: 1.05rem; margin: 0 0 4px; }
.guest-rating .acct-ratings { margin: 4px 0 6px; }
.guest-rating .field-hint { margin: 0; }

/* version line: settings dialog and the Account tab */
.version-line { margin: 18px 0 0; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.version-line:empty { display: none; }

/* phones: the profile is a full screen, not a floating card */
@media (max-width: 600px) {
  .account-overlay:has(.account-card.is-profile) { padding: 0; background: var(--bg); }
  .overlay .account-card.is-profile { max-width: none; min-height: 100dvh; border: 0; border-radius: 0; margin: 0;
    padding: calc(12px + var(--safe-top)) calc(16px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(16px + var(--safe-left)); }
  .profile-tabs [role="tab"] { padding: 8px 4px; font-size: .95rem; }
}

/* big buttons / TV: larger tabs and marks */
.big-ui .profile-tabs [role="tab"] { min-height: 64px; font-size: 1.1rem; }
.big-ui .recent-mark { width: 2.4em; height: 2.4em; }
.big-ui .profile-more summary { padding: 18px 0; font-size: 1.1rem; }
.big-ui .version-line { font-size: .95rem; }

/* dither: the selected tab and a win are inversion, never a colour */
.theme-dither .profile-tabs [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--paper); }

@media (forced-colors: active) {
  .profile-tabs [role="tab"][aria-selected="true"], .recent-mark { border-color: CanvasText; }
  .profile-recent .is-won .recent-mark { background: CanvasText; color: Canvas; }
}
