/* Accounts: the top-bar button, the sign-in window, the people's gate and the account page (account.js). */
input[type=email], input[type=password] { background: var(--panel); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; min-width: 0; }
input[aria-invalid="true"] { border-color: var(--bad); }
.linkish { background: none !important; border: 0 !important; padding: 2px 0; min-height: 0; color: var(--river); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.small { font-size: 12.5px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; font-weight: 600; background: var(--panel); border: 1px solid var(--line); border-radius: 5px;
  padding: 6px 12px; min-height: 32px; color: var(--ink); text-decoration: none; white-space: nowrap; }
a.btn:hover { border-color: var(--accent-deep); background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
a.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent-deep); font-weight: 800; }
a.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* the top bar */
#acctbox { flex-shrink: 0; }
#topbar .acct-btn { display: inline-flex; align-items: center; gap: 7px; padding: 2px 10px 2px 3px; border-radius: 999px; max-width: 190px; position: relative; }
#topbar .acct-btn.guest { padding: 3px 11px 3px 8px; }
.acct-face { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; flex: none; display: inline-flex; }
.acct-face.face-none { background: rgba(255, 255, 255, .1); color: var(--topbar-ink); }
.acct-ico { width: 16px; height: 16px; }
.acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.acct-dot { position: absolute; left: 21px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn, #e0a64a); box-shadow: 0 0 0 2px var(--topbar); }
@media (max-width: 760px) { #topbar .acct-name { display: none; } #topbar .acct-btn { padding: 2px; } #topbar .acct-btn.guest span { display: inline; } }

/* the sign-in window */
#authModal .modal-bg { z-index: 44; }
.auth-modal { max-width: 430px; position: relative; padding-top: 16px; }
.au-x { position: absolute; right: 8px; top: 8px; border: 0; background: none; font-size: 22px; line-height: 1; min-height: 0; padding: 4px 9px; color: var(--muted); }
.au-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 30px 12px 0; }
.au-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 7px 12px; color: var(--muted); font-size: 15px; }
.au-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 800; }
.auth-modal h2 { margin: 0 30px 10px 0; font-family: var(--f-title); font-weight: 600; font-size: 22px; }
.auth-modal form .field input { width: 100%; }
.pw-wrap { display: flex; align-items: stretch; }
.pw-wrap input { flex: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pw-eye { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 0; padding: 0 9px; min-height: 0; color: var(--muted); }
.pw-eye svg { width: 18px; height: 18px; display: block; }
.pw-eye[aria-pressed="true"] { color: var(--ink); background: var(--panel2); }
.au-ferr { color: var(--bad); font-size: 12px; min-height: 0; }
.au-ferr:empty { display: none; }
.au-hint { display: block; margin: -6px 0 10px; }
.au-err { color: var(--bad); min-height: 0; margin: 4px 0 10px; }
.au-err:empty { display: none; }

/* instead of a form for people: sign in, or confirm the e-mail */
.acct-gate { border: 1px dashed color-mix(in srgb, var(--accent-deep) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.acct-gate p { margin: 0 0 10px; }
/* "Playing as …" */
.acct-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.acct-id b { font-size: 15px; }

/* the account page: over everything but the windows */
.acct-page { position: fixed; inset: 0; z-index: 38; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
.acct-wrap { max-width: 920px; margin: 0 auto; padding: 18px 16px 40px; }
.acct-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.acct-head h2 { margin: 0; font-family: var(--f-title); font-weight: 600; font-size: 26px; }
.acct-big { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; border: 2px solid var(--accent-deep); flex: none; display: inline-flex; }
.acct-big.face-none .ico { width: 60%; height: 60%; margin: auto; }
.acct-ok { color: var(--good); font-weight: 700; }
.acct-warn { color: var(--warn, #b7791f); font-weight: 700; }
.acct-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.acct-tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 14px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.acct-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 800; }
.acct-body h3 { margin: 18px 0 8px; font-size: 15px; }
.acct-body h3:first-child { margin-top: 0; }
.acct-form { max-width: 420px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.acct-form .field input { width: 100%; }
.acct-danger summary { cursor: pointer; color: var(--bad); font-weight: 700; }
.acct-danger form { max-width: 420px; margin-top: 8px; }
.acct-mini { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; flex: none; display: inline-flex; vertical-align: middle; margin-right: 5px; border: 1px solid var(--line); }
.acct-mini.face-none .ico { width: 70%; height: 70%; margin: auto; }

/* my games */
.acct-games { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ag { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); flex-wrap: wrap; }
.ag.turn { border-color: var(--accent-deep); box-shadow: inset 4px 0 0 var(--accent); }
.ag.over { opacity: .8; }
.ag-main { flex: 1; min-width: 220px; }
.ag-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ag .code { font-family: var(--f-sign); letter-spacing: .12em; font-size: 15px; }
.ag-status { font-weight: 600; }
.ag.turn .ag-status { color: var(--accent-text); }
.ag-players { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; color: var(--muted); font-size: 13px; }
.ag-p { display: inline-flex; align-items: center; }
.ag-p.me { color: var(--ink); font-weight: 700; }
.ag-when { font-size: 12.5px; white-space: nowrap; }

/* statistics */
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.st-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); }
.st-tile b { font: 600 28px/1.1 var(--f-title); color: var(--ink); font-variant-numeric: tabular-nums; }
.st-tile span { font-size: 12.5px; color: var(--muted); }
.st-tile.wide { grid-column: span 2; justify-content: center; }
.st-places { display: flex; flex-direction: column; gap: 4px; max-width: 420px; }
.st-pl { display: grid; grid-template-columns: 22px 1fr 34px; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.st-pl i { display: block; height: 12px; width: var(--w); min-width: 2px; border-radius: 3px; background: var(--accent); }
.st-pl b { text-align: right; }
.st-ai, .st-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.st-ai li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 8px; }
.st-ai .spacer { display: none; }
.st-bar { grid-column: 2 / -1; display: block; height: 5px; width: var(--w); min-width: 2px; border-radius: 3px; background: var(--good); }
.st-hist li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.st-opp { color: var(--muted); font-size: 13px; }
.pos { color: var(--good); } .neg { color: var(--bad); }

/* the players' table */
table.lb { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.lb th, table.lb td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; }
table.lb th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.lb .num { text-align: right; }
table.lb tr.me td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.lb-who { display: flex; align-items: center; }
@media (max-width: 560px) { .st-tile.wide { grid-column: auto; } .ag-when { order: 3; } }
/* the portrait picker opens over the sign-in window and the account page */
#facePicker .modal-bg { z-index: 46; }
