/* Hub pages on a scrolling page, in v1's website look (v1 public/css/account.css + client/other.css):
   /account, /reset-password and /verify-email use v1's forest-green account theme with cream text and
   orange buttons; /rules, /terms and /privacy are v1's beige pages with a tan card and GS body text.
   The page title is v1's Edo-font home link. */
html, body.page { height: auto; min-height: 100%; overflow: auto; }
body.page { display: flex; justify-content: center; padding: 32px 16px; box-sizing: border-box; background: #3a5e3a; color: #f5f0d9; text-shadow: 0 1px 1px rgba(1, 1, 1, 0.3); }
body.page > .panel { max-width: 620px; padding: 24px; background: rgba(0, 0, 0, 0.15); border: 1px solid rgba(245, 240, 217, 0.2); border-radius: 6px; }
body.page h1 { font: 34px "Edo", var(--font); letter-spacing: 1px; }
body.page .panel h1 a { color: inherit; text-decoration: none; }
body.page h2 { font-size: 18px; color: #f5f0d9; opacity: 0.85; }
body.page .panel a { color: #f7941d; }
body.page .panel a:hover { color: #e98200; }
body.page .panel button { background: #f7941d; }
body.page .panel button:hover { background: #e98200; }
body.page .panel button.secondary { background: transparent; box-shadow: inset 0 0 0 1px #f7941d; color: #f7941d; text-shadow: none; }
body.page .panel button.secondary:hover { background: rgba(247, 148, 29, 0.15); }
body.page .panel button.link { background: none; box-shadow: none; color: #f7941d; }
body.page .panel input:not([type=checkbox]):not([type=range]), body.page .panel select { background: #3e3e2f; color: #f5f0d9; text-shadow: none; }
body.page .panel input:focus, body.page .panel select:focus { background: #4a4a3a; box-shadow: 0 0 5px rgba(247, 148, 29, 0.5); outline: none; }
body.page label { color: #f5f0d9; }
body.page .form-note, body.page .hint { color: rgba(245, 240, 217, 0.75); }
body.page .form-error { color: #ffb4a8; }
body.page .form-ok { color: #b8f0a0; }
#app { display: flex; flex-direction: column; gap: 14px; }
#app form { display: flex; flex-direction: column; gap: 10px; }
#app section { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid rgba(245, 240, 217, 0.2); }
#app h3 { margin: 0; font-size: 17px; font-weight: normal; color: #f5f0d9; }
.profile { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.profile-name { font-size: 22px; }
.title-tag { margin-left: 8px; padding: 1px 6px; border-radius: 4px; background: #f7941d; color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; vertical-align: middle; }
.banner { padding: 10px 12px; border-radius: 4px; background: rgba(255, 193, 7, 0.4); font-size: 14px; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row > * { flex: 1 1 140px; }
.table-wrap { overflow-x: auto; }
table.worlds { width: 100%; border-collapse: collapse; font-size: 13px; }
table.worlds th, table.worlds td { padding: 5px 6px; border-bottom: 1px solid rgba(245, 240, 217, 0.2); text-align: left; white-space: nowrap; }
table.worlds th { font-size: 12px; font-weight: normal; color: rgba(245, 240, 217, 0.75); }
table.worlds input:not([type=checkbox]) { width: 120px; padding: 5px 6px; }
.panel button.small { padding: 5px 9px; font-size: 13px; }
.key-box { display: block; padding: 8px; border-radius: 4px; background: #2a2a20; font: 12px ui-monospace, Consolas, monospace; text-shadow: none; word-break: break-all; user-select: all; }
a.button { display: block; padding: 9px 10px; border-radius: 4px; background: #f7941d; color: #fff !important; text-align: center; text-decoration: none; text-shadow: 1px 1px #000; }
a.button:hover { background: #e98200; }

.friends { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.friends .online { color: #7d5; }
.friends .offline { opacity: 0.5; }

/* Legal pages: v1's beige site with a tan card (div#rules / #terms / #privacy). */
body.page:has(.legal) { background: #ddc; color: #3c3c3c; text-shadow: none; }
body.page > .panel.legal { max-width: 760px; background: #dca; border: none; border-radius: 0; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.3), 0 6px 20px 0 rgba(0, 0, 0, 0.3); }
.legal { text-align: left; line-height: 1.55; font-family: "GS", var(--font); font-size: 16px; letter-spacing: 0.3px; }
.legal h1, .legal h2 { text-align: center; }
body.page .legal h1 { color: #642; }
body.page .legal h2 { color: #3c3c3c; font-size: 24px; opacity: 1; }
.legal h3, .legal h4 { margin: 1.4em 0 0.4em; font-family: var(--font); font-weight: normal; }
.legal ul { padding-left: 1.3em; }
body.page .legal a { color: #642; text-decoration: underline; }
body.page .legal a:hover { color: #000; }
.legal-links { margin-top: 24px; text-align: center; font-size: 14px; opacity: 0.85; }
.legal-links a { color: inherit; }
body.page .legal-links a { color: inherit; }
html:has(> body.page) { background: #3a5e3a; }
html:has(> body.page .legal) { background: #ddc; }

/* ==== /account (client/account/accountPage.js): the game's start-menu look ======================
   Beige page with the logo, brown Hammersmith One text, orange buttons with a 1px black text shadow,
   4px corners, green/red accents; tabs for Account / Shop / Supporter / Admin. Phone: 16px gutters. */
html:has(> body.acct) { background: var(--beige); }
html:has(> body.acct) { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
/* clip, not hidden: a hidden overflow would make the body a scroll container and break the sticky try-on preview */
body.acct { height: auto; min-height: 100%; overflow: visible; overflow-x: clip; }
body.acct { margin: 0; padding: 0 16px 32px; box-sizing: border-box; background: var(--beige); color: var(--brown); text-shadow: none; }
body.acct *, body.acct *::before, body.acct *::after { box-sizing: border-box; }
.acct-top { max-width: 980px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 6px; }
.acct-logo { display: block; width: clamp(150px, 34vw, 240px); height: clamp(58px, 12vw, 92px); background: url(/assets/src/img/logo.png) no-repeat left center / contain; color: transparent; overflow: hidden; }
.acct a.btn, .acct button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 14px; border: none; border-radius: var(--r); background: var(--orange); color: #fff; font: 15px var(--font); letter-spacing: 0.6px; text-shadow: var(--shadow); text-decoration: none; cursor: pointer; }
.acct a.btn:hover, .acct button:hover { background: var(--orange-hover); }
.acct button.secondary { background: rgba(102, 68, 34, 0.12); color: var(--brown); text-shadow: none; }
.acct button.secondary:hover { background: rgba(102, 68, 34, 0.22); }
.acct button.green { background: var(--green); }
.acct button.green:hover { background: var(--green-hover); }
.acct button.danger { background: var(--red); }
.acct button.danger:hover { background: var(--red-hover); }
.acct button.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.acct button.link { min-height: 0; padding: 0; background: none; color: var(--brown); text-shadow: none; text-decoration: underline; }
.acct button:disabled, .acct button:disabled:hover { opacity: 0.55; cursor: default; background: var(--orange); }
.acct button.secondary:disabled:hover { background: rgba(102, 68, 34, 0.12); }
.acct input:not([type=checkbox]):not([type=color]):not([type=range]), .acct select { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid rgba(102, 68, 34, 0.25); border-radius: var(--r); background: #fff; color: #222; font: 16px var(--font); letter-spacing: 0; }
.acct input:focus, .acct select:focus { outline: 2px solid var(--orange); outline-offset: 0; }
.acct label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.acct h2 { margin: 0; font-size: 22px; font-weight: normal; }
.acct h3 { margin: 0; font-size: 18px; font-weight: normal; }
.acct p { margin: 0; }
.acct .muted { color: rgba(102, 68, 34, 0.72); font-size: 14px; }
.acct .form-error { color: var(--red); font-size: 14px; }
.acct .form-error:empty, .acct .form-ok:empty { display: none; }
.acct .form-ok { color: #3a7d1c; font-size: 14px; }
/* The game's popups (client/ui/dialog.js) keep the game's dark window look here too: the page's light-background
   buttons would vanish on it. */
.acct .modal-panel { color: #fff; text-shadow: var(--shadow); }
.acct .modal-panel button.secondary { background: var(--box); color: #fff; text-shadow: var(--shadow); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.acct .modal-panel button.secondary:hover { background: var(--box-hover); }
.acct-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acct-row > input { flex: 1 1 160px; width: auto; }

#acct-app { max-width: 980px; margin: 0 auto; }
.acct-tabs { display: flex; gap: 4px; margin: 8px 0 0; overflow-x: auto; scrollbar-width: none; }
.acct-tabs button { flex: none; min-height: 40px; border-radius: var(--r) var(--r) 0 0; background: rgba(102, 68, 34, 0.14); color: var(--brown); text-shadow: none; font-size: 16px; }
.acct-tabs button:hover { background: rgba(102, 68, 34, 0.24); }
.acct-tabs button.active { background: var(--tan); }
.acct-body { padding: 18px; background: var(--tan); border-radius: 0 var(--r) var(--r) var(--r); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); display: flex; flex-direction: column; gap: 16px; }
.acct-card { padding: 14px; border-radius: var(--r); background: rgba(255, 255, 255, 0.38); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.acct-card form { display: flex; flex-direction: column; gap: 10px; }
.acct-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; align-items: start; }
.acct-notice { padding: 10px 12px; border-radius: var(--r); background: rgba(249, 174, 26, 0.3); font-size: 14px; }
.acct-notice.ok { background: rgba(85, 187, 51, 0.25); }
.acct-notice.bad { background: rgba(221, 68, 0, 0.2); }
.acct .acct-foot { max-width: 980px; margin: 20px auto 0; text-align: center; font-size: 14px; }
.acct-foot a { color: var(--brown); }
.acct-signedout { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 24px 0; text-align: center; }

/* Profile header */
.acct-profile { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.acct-name { padding: 4px 10px; border-radius: var(--r); background: var(--box-strong); color: #fff; font-size: 22px; text-shadow: var(--shadow); max-width: 100%; }
.acct-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.acct-tag { padding: 2px 8px; border-radius: var(--r); background: var(--orange); color: #fff; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; text-shadow: var(--shadow); }
.acct-tag.green { background: var(--green); }
.acct-tag.red { background: var(--red); }
.acct-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; }

/* Friends */
.friends { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.friends li { display: flex; align-items: center; gap: 8px; }
.friends li > .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friends .online { color: var(--green); }
.friends .offline { opacity: 0.5; }

/* Shop */
.shop-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.shop-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 10px; }
.shop-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tryon { position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--r); background: radial-gradient(circle at 50% 40%, #eed 0%, #cba 100%); overflow: hidden; }
.tryon canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.tryon-cap { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 4px 8px; border-radius: var(--r); background: var(--box-strong); color: #fff; font-size: 13px; text-align: center; text-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.acct .chips button { min-height: 30px; padding: 4px 10px; border-radius: 15px; font-size: 13px; background: rgba(102, 68, 34, 0.12); color: var(--brown); text-shadow: none; }
.acct .chips button.active, body.page .panel .chips button.secondary.active { background: var(--brown); color: #fff; box-shadow: none; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shop-item { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 2px solid transparent; border-radius: var(--r); background: rgba(255, 255, 255, 0.45); cursor: pointer; min-width: 0; }
.shop-item:hover { background: rgba(255, 255, 255, 0.65); }
.shop-item.selected { border-color: var(--orange); }
.shop-item .icon { aspect-ratio: 1; border-radius: var(--r); display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #eed 0%, #cba 100%); font-size: 30px; overflow: hidden; }
.shop-item .icon img { width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.shop-item .name { font-size: 15px; line-height: 1.2; }
.shop-item .price { font-size: 13px; color: rgba(102, 68, 34, 0.75); }
.shop-item button { width: 100%; padding: 6px 8px; font-size: 14px; white-space: nowrap; }
.shop-item .owned { padding: 6px; border-radius: var(--r); background: rgba(85, 187, 51, 0.25); text-align: center; font-size: 13px; }
.dev-note { font-size: 12px; color: var(--red); }

/* Name colours */
.name-products { display: flex; flex-wrap: wrap; gap: 6px; }
.name-preview { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 10px; border-radius: var(--r); background: linear-gradient(180deg, #7d9f6a, #4e6b3f); }
.name-preview .label-demo { padding: 2px 8px; border-radius: var(--r); background: var(--box); color: #fff; font-size: 20px; text-shadow: var(--shadow); white-space: nowrap; }
.pickers { display: flex; flex-wrap: wrap; gap: 10px; }
.acct label.picker { flex-direction: row; align-items: center; gap: 6px; }
.picker input[type=color] { width: 46px; height: 38px; padding: 2px; border: 1px solid rgba(102, 68, 34, 0.3); border-radius: var(--r); background: #fff; cursor: pointer; }
.acct .picker input.hex { width: 96px !important; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.styles-list { display: flex; flex-direction: column; gap: 6px; }
.styles-list .style-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--r); background: var(--box-strong); color: #fff; text-shadow: var(--shadow); }

/* Supporter */
.member-price { font-size: 28px; }
.member-price small { font-size: 15px; opacity: 0.75; }
.perks { margin: 0; padding-left: 1.2em; font-size: 14px; }
.progress { height: 14px; border-radius: 7px; background: rgba(102, 68, 34, 0.18); overflow: hidden; }
.progress > div { height: 100%; border-radius: 7px; background: linear-gradient(90deg, var(--orange), var(--green)); }
.tiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.tier { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--r); background: rgba(255, 255, 255, 0.35); font-size: 14px; opacity: 0.6; }
.tier.got { opacity: 1; background: rgba(85, 187, 51, 0.22); }
.tier .ns-badge { font-size: 18px; }
.amounts { display: flex; flex-wrap: wrap; gap: 6px; }
.acct .amounts button.active, body.page .panel .amounts button.secondary.active { background: var(--brown); color: #fff; box-shadow: none; }
.acct-profile > .ns-badge { font-size: 26px; margin: 0; }
.amount-input { display: flex; align-items: center; gap: 6px; }
.acct .amount-input input { max-width: 140px; }

/* Admin */
.table-wrap { overflow-x: auto; }
table.worlds { width: 100%; border-collapse: collapse; font-size: 13px; }
table.worlds th, table.worlds td { padding: 5px 6px; border-bottom: 1px solid rgba(102, 68, 34, 0.2); text-align: left; white-space: nowrap; }
table.worlds th { font-weight: normal; color: rgba(102, 68, 34, 0.75); }
.acct table.worlds input:not([type=checkbox]) { width: 120px; min-height: 30px; padding: 4px 6px; font-size: 13px; }
.acct .key-box { display: block; padding: 8px; border-radius: var(--r); background: #2a2a20; color: #f5f0d9; font: 12px ui-monospace, Consolas, monospace; word-break: break-all; user-select: all; }


@media (max-width: 720px) {
  .shop-layout { grid-template-columns: minmax(0, 1fr); }
  .shop-side { position: static; }
  .tryon { max-width: 240px; margin: 0 auto; }
  .acct-body { padding: 12px; }
  .acct-card { padding: 12px; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.styles-list button.secondary { background: rgba(255, 255, 255, 0.2); color: #fff; text-shadow: var(--shadow); }

/* Crowns, packs and the weekly member drop */
.crowns-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; border-radius: var(--r); background: rgba(102, 68, 34, 0.12); }
.crowns-bar .grow { flex: 1; min-width: 200px; margin: 0; font-size: 14px; }
.crown-balance { font-size: 26px; white-space: nowrap; }
.small-caps { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pack { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px; border: 2px solid transparent; border-radius: var(--r); background: rgba(255, 255, 255, 0.45); text-align: center; }
.pack.popular { border-color: var(--orange); }
.pack-crowns { font-size: 22px; white-space: nowrap; }
.pack-bonus { font-size: 13px; color: var(--green); }
.pack button { width: 100%; }
.weekly-card { background: linear-gradient(135deg, rgba(192, 92, 255, 0.18), rgba(255, 255, 255, 0.38)); }
.weekly-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.weekly-row .shop-item.weekly { width: 140px; flex: none; }
.weekly-info { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.weekly-info p { margin: 0; font-size: 14px; }
.weekly-name { font-size: 22px; }
td.plus { color: var(--green); }
td.minus { color: var(--red); }
.acct textarea.bug-text { width: 100%; min-height: 6em; padding: 8px 10px; border: 1px solid rgba(102, 68, 34, 0.3); border-radius: var(--r); background: #fff; color: var(--ink); font: 15px var(--font); resize: vertical; }

/* Admin dashboard */
.admin { display: flex; flex-direction: column; gap: 16px; }
.acct-body-inner, .account-detail { display: flex; flex-direction: column; gap: 16px; }
.acct label.inline { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; }
.acct input.short { max-width: 160px; }
table.worlds tr.picked td { background: rgba(249, 174, 26, 0.18); }
table.worlds td.wrap { white-space: normal; min-width: 200px; }
table.worlds td.mono { font: 11px ui-monospace, Consolas, monospace; }
table.events tr.ev-login_failed td, table.events tr.ev-password_change_failed td, table.events tr.ev-dispute td { color: var(--red); }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.bugs { display: flex; flex-direction: column; gap: 10px; }
.bug { padding: 10px 12px; border-radius: var(--r); background: rgba(255, 255, 255, 0.45); display: flex; flex-direction: column; gap: 6px; border-left: 4px solid var(--red); }
.bug.in_progress { border-left-color: var(--orange); }
.bug.fixed { border-left-color: var(--green); opacity: 0.8; }
.bug-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; }
.bug-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bug-ctx { font-size: 12px; overflow-wrap: anywhere; }

/* Cosmetics tab: the grid scrolls in its own box beside the sticky preview; the outfit being tried on */
.shop-scroll { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); min-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.shop-side { max-height: calc(100vh - 24px); overflow-y: auto; }
.outfit { display: flex; flex-wrap: wrap; gap: 6px; }
.outfit:empty { display: none; }
.outfit-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 14px; background: var(--brown); color: #fff; font-size: 13px; }
.acct .outfit-chip button.link { min-height: 0; padding: 0 6px; color: #fff; font-size: 16px; text-decoration: none; }
@media (max-width: 720px) {
  .shop-scroll { max-height: 70vh; }
  .shop-side { max-height: none; }
}
