/*
 * acct.css — the account shell's own rules, linked after site.css by `page()` in
 * server/src/web/account-web-pages.ts: the account page (/account/), the market (/account/market),
 * the vote page (/account/vote) and their framable pops. Served by Caddy from site/ like site.css.
 * Not account.css: Caddy proxies every path starting /account to the web server, which 404s it.
 */
.msg { padding: 10px 14px; border: 1px solid var(--edge); border-left-width: 3px; border-radius: 3px; background: var(--panel); margin: 0 0 16px; }
.msg.ok { border-color: #3fb950; }
.msg.err { border-color: #f85149; }
.rules { color: var(--muted); font-size: 14px; }
.tagline { margin-bottom: 16px; }
form { display: flex; flex-direction: column; gap: 2px; margin: 16px 0; }
form label { color: var(--muted); font-size: 14px; margin-top: 10px; }
form input, form select {
  height: 44px; background: rgba(0,0,0,.25); color: var(--text); border: 1px solid var(--edge); border-radius: 3px;
  padding: 0 12px; font: inherit; box-sizing: border-box;
}
form input:focus, form select:focus { border-color: var(--primary-hi); }
form button { align-self: flex-start; margin-top: 12px; font: inherit; cursor: pointer; }
.points-chip {
  display: inline-block; padding: 2px 10px; border: 1px solid var(--edge-hi); border-radius: 999px;
  background: var(--panel-2); color: var(--text); text-decoration: none; font-size: 14px;
  font-weight: 600; font-variant-numeric: tabular-nums;
}
/* Underline tabs: .tabs, .pop-tabs and site.css .tabbar share one look. */
.tabs { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--edge); margin: 0 0 16px; overflow-x: auto; overflow-y: hidden; }
.tabs a, .pop-tabs a {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px; box-sizing: border-box;
  color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  text-decoration: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: transparent; border-radius: 0; white-space: nowrap; cursor: pointer; transition: color .15s;
}
.tabs a:hover, .pop-tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"], .pop-tabs a[aria-current="page"] {
  color: #fff; border-bottom-color: var(--primary-hi); background: linear-gradient(0deg, rgba(47,111,214,.16), transparent 70%);
}
.acct-hero {
  background: var(--panel); border: 1px solid var(--edge); border-radius: 3px; overflow: hidden;
  margin: 0 0 20px; box-shadow: 0 2px 10px rgba(0,0,0,.35);
}
.acct-hero .banner { border: 0; border-radius: 0; min-height: 150px; }
.acct-hero-row { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; padding: 0 20px; margin-top: -56px; position: relative; }
.acct-hero-meta { flex: 1 1 220px; min-width: 0; padding-bottom: 6px; }
.acct-hero-meta h1 { margin: 0; }
.acct-hero-side { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; }
.acct-hero .tabs { margin: 14px 0 0; padding: 0 8px; border-top: 1px solid var(--edge); border-bottom: 0; background: rgba(0,0,0,.18); }
.acct-hero ~ section { border-top: 0; padding-top: 4px; }
@media (max-width: 600px) {
  .acct-hero .banner { min-height: 110px; }
  .acct-hero-row { padding: 0 12px; }
  .acct-hero-side { flex-basis: 100%; padding-bottom: 0; }
  .acct-hero .tabs { padding: 0; scrollbar-width: none; }
  .acct-hero .tabs a { padding: 0 12px; }
}
.tab-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 12px 0; }
.char { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; row-gap: 12px; padding: 0; overflow: hidden; }
.char-portrait {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 180px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #1f2a3d, var(--bg) 72%); border-bottom: 1px solid var(--edge);
}
.char-portrait img { display: block; width: 100%; height: 100%; padding: 7px; object-fit: contain; }
.char-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0 14px 14px; }
.char-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; overflow-wrap: anywhere; font-size: 18px; font-weight: 600; }
.char-default {
  display: inline-block; width: fit-content; color: var(--link); font-size: 12px; font-weight: 400;
  border: 1px solid var(--primary); border-radius: 999px; padding: 1px 8px;
}
.char-note { color: var(--muted); font-size: 14px; }
.char-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.char-actions .btn:not(.primary) { background: transparent; }
.char-actions form { margin: 0; }
.char-actions form button { margin-top: 0; }
.char-manage summary {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--link); cursor: pointer;
}
.char-manage-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.char-manage-options form { margin: 0; }
.char-manage-options .rules { flex-basis: 100%; margin: 0; }
.char-manage-options form button { margin-top: 0; }
.char-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  background: transparent; border-style: dashed; box-shadow: none;
}
.rewards { display: flex; flex-direction: column; gap: 16px; margin: 12px 0; }
.rw-strip { display: flex; flex-wrap: wrap; gap: 12px; }
.rw-points { flex: 1 1 100%; }
.rw-total { margin: 0; }
.rw-balance { font-size: 2.6rem; font-weight: 800; line-height: 1.1; color: #fff; text-shadow: 0 0 18px var(--glow); }
.rw-breakdown, .rw-rules { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.rw-vote { flex: 1 1 160px; display: grid; align-content: start; gap: 6px; }
.rw-vote[data-ready="1"] { border-color: var(--primary); }
.rw-vote h3 { margin: 0; }
.rw-vote .btn { width: 100%; }
.vote-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.vote-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
  padding: 3px 3px 3px 10px; background: var(--panel); border: 1px solid var(--edge); border-radius: 3px;
}
.vote-list .vote-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-list .btn { min-width: 64px; }
.vote-head { margin: 0; }
.rw-vote-state { color: var(--muted); margin: 0; font-size: 14px; }
.rw-custom { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.rw-preview .profile-head { margin-bottom: 8px; }
.rw-preview .banner { min-height: 110px; }
.rw-preview .profile-row { padding: 0 8px; }
@media (min-width: 761px) { .rw-preview { position: sticky; top: 16px; } }
.rw-settings { display: grid; gap: 8px; margin: 12px 0 0; }
.rw-settings select { height: 32px; }
.rw-settings label.check { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.rw-settings input[type="checkbox"] { height: auto; width: 16px; padding: 0; margin: 0; }
.rw-settings .btn { justify-self: start; }
.rw-shop .rules { margin: 8px 0 0; }
.rw-pane { display: none; }
#rw-cat-hat:checked ~ .rw-panes .rw-pane[data-cat="hat"],
#rw-cat-anim:checked ~ .rw-panes .rw-pane[data-cat="anim"],
#rw-cat-background:checked ~ .rw-panes .rw-pane[data-cat="background"],
#rw-cat-frame:checked ~ .rw-panes .rw-pane[data-cat="frame"] { display: block; margin-top: 12px; }
.rw-need { color: var(--muted); font-size: 12px; }
.tile.locked { background: transparent; }
.tile.locked .tile-label { color: var(--muted); }
.rw-activity summary { min-height: 44px; cursor: pointer; }
.account-auth { max-width: 880px; margin: 0 auto; }
.auth-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.auth-card { padding: 22px 24px; }
.auth-card h2 { margin: 0 0 4px; }
.auth-lede { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.auth-card form { margin: 8px 0 0; gap: 4px; }
.auth-card form label { margin-top: 12px; color: var(--text); font-weight: 600; font-size: 14px; }
.auth-card form input { width: 100%; box-sizing: border-box; }
.auth-hint { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.auth-opt { color: var(--muted); font-weight: 400; }
.auth-card form .auth-submit { align-self: stretch; width: 100%; margin-top: 18px; justify-content: center; text-align: center; }
.auth-alt { max-width: 420px; margin: 24px auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.auth-or { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--edge); }
.auth-discord { min-width: 240px; justify-content: center; }
.auth-foot { text-align: center; color: var(--muted); font-size: 14px; margin: 20px 0 0; }
@media (max-width: 760px) {
  .chars { grid-template-columns: 1fr; }
  .rw-custom { grid-template-columns: minmax(0, 1fr); }
  .auth-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 16px; }
}
.mkt-subtitle { color: var(--muted); margin: 4px 0 16px; }
.mkt-filters { margin: 12px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.mkt-filters a {
  display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 3px; box-sizing: border-box;
  border: 1px solid var(--edge); background: transparent; color: var(--muted); text-decoration: none;
}
.mkt-filters a[aria-current="true"] { border-color: var(--primary); background: var(--panel); color: var(--text); }
form.mkt-search { flex-direction: row; align-items: center; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
form.mkt-search input { width: 220px; flex: none; }
form.mkt-search button { margin-top: 0; background: transparent; }
.mkt-table { width: 100%; border-collapse: collapse; margin: 16px 0; background: var(--panel); border: 1px solid var(--edge); font-variant-numeric: tabular-nums; }
.mkt-table th { padding: 10px 12px; text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--edge); }
.mkt-table td { padding: 11px 12px; border-bottom: 1px solid var(--edge); text-align: left; vertical-align: middle; }
.mkt-table td.mkt-type { font-size: 14px; }
.mkt-table td.mkt-cell-note, .mkt-table td.mkt-cell-posted { color: var(--muted); font-size: 14px; }
.mkt-player { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.mkt-player img { display: block; }
.mkt-face { height: 40px; width: auto; }
.mkt-card .mkt-face { height: 64px; }
.page-bare .mkt-card .mkt-face { height: 48px; }
.mkt-right, .mkt-table .mkt-right { text-align: right; }
.mkt-muted { color: var(--muted); }
.mkt-sell { color: #3fb950; }
.mkt-buy { color: var(--link); }
.mkt-note { color: var(--muted); font-size: 13px; margin: 12px 0; }
.mkt-toggle { display: flex; gap: 8px; margin: 4px 0 10px; }
.mkt-toggle label {
  display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px; border: 1px solid var(--edge);
  border-radius: 3px; cursor: pointer; color: var(--text);
}
.mkt-toggle label:has(input:checked) { border-color: var(--primary); background: var(--panel); }
.mkt-actions { display: flex; justify-content: flex-end; gap: 8px; }
.mkt-actions .btn { background: transparent; }
.mkt-card .mkt-actions { justify-content: flex-start; margin-top: 8px; }
.mkt-remove-form { display: inline; margin: 0; }
.mkt-remove-form button { margin-top: 0; }
.mkt-cards { display: none; flex-direction: column; gap: 10px; margin: 16px 0; }
.mkt-card { padding: 10px 12px; }
.mkt-card a { color: var(--text); }
@media (max-width: 760px) {
  form.mkt-search input { width: auto; flex: 1; min-width: 0; }
  .mkt-table { display: none; }
  .mkt-cards { display: flex; }
}
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); display: flex; padding: 16px; box-sizing: border-box; overflow-y: auto; }
/* margin: auto centres the box when it fits and lets the backdrop scroll when it is taller. */
.modal-box { margin: auto; width: 480px; max-width: 100%; padding: 20px; box-sizing: border-box; }
.modal-box h2 { margin-top: 0; }
.page-bare { max-width: 100%; margin: 0; padding: 12px; box-sizing: border-box; }
.pop-tabs { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--edge); margin: 0 0 12px; }
.pop-tabs .pop-full { margin-left: auto; }
.page-bare .mkt-cards { display: flex; }
