#player-profile::backdrop { background: #08080bbd; }
:is(#profile-details,#ts-profile-details) { padding: 16px var(--dialog-padding) var(--dialog-padding); }
#profile-status { margin: 16px var(--dialog-padding); color: var(--game-muted); font-size: 13px; }
#profile-status:empty { display: none; }
#profile-load-error { align-content: center; gap: 12px; text-align: center; }
#profile-load-status { margin: 0; color: var(--game-muted); }
.profile-identity { display: flex; align-items: center; gap: 12px; }
:is(#profile-avatar-button,#ts-profile-avatar-button) {
  display: block; padding: 0; flex: none;
  border: 0; border-radius: 14px; background: transparent; box-shadow: none; translate: none;
}
.profile-identity-copy { min-width: 0; }
.profile-identity:has(.profile-name-editor:not([hidden])) { align-items: flex-start; }
.profile-identity:has(.profile-name-editor:not([hidden])) .profile-identity-copy { flex: 1; }
a.profile-membership {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 3px;
  padding: 3px 7px; border: 1px solid var(--game-border); border-radius: 6px;
  background: var(--game-control); color: var(--game-muted); font-size: 12px; text-decoration: none;
}
a.profile-membership:is(:hover, :focus-visible) { border-color: var(--game-accent); color: var(--game-text); }
.profile-membership img { object-fit: contain; flex: none; }
.profile-follows { margin-top: 12px; }
.profile-follow-controls { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.profile-follow-controls > button, .profile-follow-status > button, .profile-follow-back {
  padding: 6px 9px; min-height: 36px; border: 1px solid var(--game-border); border-radius: 8px;
  background: var(--game-control); color: var(--game-text); font-size: 13px;
}
.ts-react-popup .profile-follow-stat {
  display: grid; gap: 2px; text-align: start; padding: 0; min-height: 36px;
  border: 0; background: transparent; box-shadow: none; color: var(--game-muted); font-size: 12px;
}
.profile-follow-stat strong { color: var(--game-text); font-size: 16px; font-variant-numeric: tabular-nums; }
.profile-follow-stat:is(:hover, [aria-expanded="true"]) span { text-decoration: underline; }
.ts-react-popup .profile-follow-action {
  margin-inline-start: auto; padding-inline: 16px; font-weight: 700; white-space: nowrap;
  border-color: var(--game-accent); background: var(--game-accent); color: #19100a; box-shadow: none;
}
.ts-react-popup .profile-follow-action[data-following="true"] {
  background: var(--game-control); color: var(--game-text); border-color: var(--game-border);
}
.profile-follow-back { margin: 12px var(--dialog-padding) 0; }
#ts-profile-follow-list {
  inset: 0 0 0 auto; margin: 0; width: min(400px, 100%); max-width: none;
  height: 100dvh; max-height: none; border-radius: 16px 0 0 16px;
}
#ts-profile-follow-list::backdrop { background: #08080b66; }
.profile-follow-tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: none; gap: 4px;
  margin: 14px var(--dialog-padding) 12px; padding: 3px;
  border: 1px solid var(--game-border); border-radius: 10px; background: var(--game-background);
}
.ts-react-popup .profile-follow-tabs > button {
  min-height: 44px; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--game-muted); box-shadow: none; translate: none;
  font-weight: 700; letter-spacing: normal;
}
.profile-follow-tabs > button[aria-pressed="false"]:hover { background: var(--game-control); color: var(--game-text); }
.profile-follow-tabs > button[aria-pressed="true"] {
  border-color: var(--game-accent); background: #342619; color: var(--game-accent);
}
.profile-follow-divider {
  flex: none; margin: 0 var(--dialog-padding) 12px;
  border: 0; border-block-start: 1px solid var(--game-border);
}
.profile-follow-list ul { list-style: none; padding: 0; margin: 0 0 8px; }
.profile-follow-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; padding-block: 4px; }
.profile-follow-list li + li { border-block-start: 1px solid var(--game-border); }
.ts-react-popup .profile-follow-peer {
  display: flex; align-items: center; gap: 10px; width: 100%; padding-inline: 8px;
  text-align: start; overflow-wrap: anywhere; letter-spacing: normal;
  background: transparent; border: 0; box-shadow: none;
}
.ts-react-popup .profile-follow-peer:hover { background: var(--game-control); }
.profile-follow-list .profile-follow-action { min-height: 36px; padding-inline: 10px; font-size: 12px; }
.profile-follow-error { grid-column: 1 / -1; }
@media (max-width: 480px) {
  #ts-profile-follow-list { width: 100%; border-radius: 0; }
}
.profile-follow-status, .profile-follow-list p { margin: 6px 0; color: var(--game-muted); font-size: 12px; }
.profile-follow-status button { margin-inline-start: 6px; }
.profile-name-row { display: flex; align-items: center; gap: 4px; min-width: 0; }
:is(#profile-nickname-edit,#ts-profile-nickname-edit) {
  display: grid; place-items: center; flex: none; width: 44px; min-height: 44px; padding: 0;
  color: var(--game-muted); background: transparent; box-shadow: none;
}
:is(#profile-nickname-edit,#ts-profile-nickname-edit):hover, :is(#profile-nickname-edit,#ts-profile-nickname-edit)[aria-expanded="true"] { color: var(--game-accent); }
:is(#profile-nickname-edit,#ts-profile-nickname-edit) svg { width: 18px; height: 18px; }
:is(#profile-name,#ts-profile-name) { font-size: 20px; overflow-wrap: anywhere; }
:is(#profile-id,#ts-profile-id) { color: var(--game-muted); font: 500 13px var(--quote-font); white-space: nowrap; }
:is(#profile-photo-dialog,#ts-profile-photo-dialog) { --popup-width: 360px; }
:is(#profile-photo-dialog,#ts-profile-photo-dialog) .game-popup-body { padding-top: var(--dialog-padding); }
:is(#profile-photo-actions,#ts-profile-photo-actions) { display: grid; gap: 10px; }
:is(#profile-view-photo,#ts-profile-view-photo) {
  color: var(--game-text); background: var(--game-control); border-color: var(--game-border);
  --button-edge: #09090c;
}
:is(#profile-photo-sign-in,#ts-profile-photo-sign-in) { padding: 8px; color: var(--game-accent); text-align: center; }
:is(#profile-photo-preview,#ts-profile-photo-preview) {
  width: min(100%, 256px); height: auto; margin-inline: auto;
}
:is(#profile-photo-status,#ts-profile-photo-status), #profile-photo-hint { display: block; margin: 12px 0 0; color: var(--game-muted); font-size: 13px; }
:is(#profile-photo-status,#ts-profile-photo-status):empty { display: none; }
.profile-levels {
  display: grid; grid-template-columns: 1fr 1fr; margin: 16px 0 0;
  border: 1px solid var(--game-border); border-radius: 8px; background: var(--game-control);
}
.profile-levels > div { padding: 8px; }
.profile-levels > div + div { border-inline-start: 1px solid var(--game-border); }
.profile-levels dt { color: var(--game-muted); font-size: 12px; }
.profile-levels dd { margin: 3px 0 0; color: var(--game-accent); font-weight: 700; }
:is(#profile-statue,#ts-profile-statue) {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(110px, 53%);
  align-items: center; margin-top: 12px; border: 1px solid var(--game-border);
  border-radius: 10px; background: var(--game-background);
}
.profile-current-level { margin: 16px 0 0; color: var(--game-muted); font-size: 14px; }
.profile-current-level strong { margin-inline-start: 4px; color: var(--game-accent); }
.profile-current-level + #ts-profile-statue { margin-top: 6px; }
.profile-statue-copy { padding: 12px; }
.profile-statue-copy h3 { margin: 0; font-size: 15px; }
.profile-statue-stage {
  display: grid; place-items: center; min-width: 0;
  background: radial-gradient(ellipse 36% 7% at 50% 88%, #0009, transparent 80%);
}
:is(#profile-statue-canvas,#ts-profile-statue-canvas) { position: static; width: 100%; height: 180px; touch-action: pan-y; cursor: grab; }
:is(#profile-statue-canvas,#ts-profile-statue-canvas):active { cursor: grabbing; }
:is(#profile-statue-canvas,#ts-profile-statue-canvas):focus-visible { outline: 2px solid var(--game-accent); outline-offset: -3px; border-radius: 8px; }
:is(#profile-statue-fallback,#ts-profile-statue-fallback) { margin: 10px; object-fit: contain; }
:is(#profile-about,#ts-profile-about,#profile-bio-text) { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
:is(#profile-performance,#ts-profile-performance) { margin-top: 20px; }
:is(#profile-performance,#ts-profile-performance) h3 { margin: 0 0 10px; font-size: 16px; }
.profile-levels.profile-asset-totals { margin: 0 0 10px; }
.profile-periods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.profile-periods button {
  min-height: 40px; padding: 4px 2px; border-radius: 6px; background: var(--game-control);
  color: var(--game-muted); font: 650 clamp(11px, 3.3vw, 13px)/1.1 system-ui, sans-serif;
}
.profile-periods button[aria-pressed="true"] { color: var(--game-accent); border-color: var(--game-accent); }
.profile-levels .profile-balance { color: var(--game-text); font-family: var(--quote-font); font-size: 18px; overflow-wrap: anywhere; }
.profile-balance:not([hidden]) + dd { font-size: 12px; }
:is(#profile-chart,#ts-profile-chart) { margin: 12px 0 16px; }
:is(#profile-chart-point,#ts-profile-chart-point) {
  color: var(--game-muted); font-size: 12px; line-height: 1.35; min-height: 1.35em; margin: 0 0 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.profile-chart-plot { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); height: 154px; }
:is(#profile-chart-empty,#ts-profile-chart-empty) { place-self: center; margin: 0; color: var(--game-muted); font-size: 13px; text-align: center; }
#profile-balance-chart { position: static; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; }
#profile-balance-chart:focus-visible { outline: 2px solid var(--game-accent); outline-offset: 2px; }
:is(#profile-rounds,#ts-profile-rounds) { margin: 0; padding: 0; list-style: none; }
:is(#profile-rounds,#ts-profile-rounds) :is(li, .profile-round-review) {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 8px;
}
:is(#profile-rounds,#ts-profile-rounds) li {
  padding: 8px 0; border-bottom: 1px solid var(--game-border); font-size: 13px;
}
:is(#profile-rounds,#ts-profile-rounds) :is(li, .profile-round-review) > :nth-child(even) { text-align: end; }
:is(#profile-rounds,#ts-profile-rounds) :is(li, .profile-round-review) > :is(time, span) { color: var(--game-muted); font-size: 11px; overflow-wrap: anywhere; }
:is(#profile-rounds,#ts-profile-rounds) li:has(.profile-round-review) { padding: 0; }
:is(#profile-rounds,#ts-profile-rounds) .profile-round-review {
  grid-column: 1 / -1; min-width: 0; padding: 8px 6px; text-align: start;
  border: 0; border-radius: 6px; box-shadow: none; color: inherit; background: transparent; font: inherit;
}
:is(#profile-rounds,#ts-profile-rounds) .profile-round-review:hover { background: var(--game-control); }
:is(#profile-rounds,#ts-profile-rounds) .profile-round-review > .profile-round-action {
  grid-column: 1 / -1; color: var(--game-accent); font-weight: 650;
}
.profile-round-review-error { grid-column: 1 / -1; margin: 0 6px 8px; color: var(--game-muted); }
:is(#profile-rounds,#ts-profile-rounds) li strong small { color: var(--game-muted); font-weight: 500; margin-inline-start: 6px; }
:is(#profile-rounds,#ts-profile-rounds) [data-direction="gain"] { color: var(--game-gain); }
:is(#profile-rounds,#ts-profile-rounds) [data-direction="loss"] { color: #ff7583; }
#profile-history-status { margin: 10px 0 4px; color: var(--game-muted); font-size: 13px; }
#profile-history-status:empty { display: none; }
:is(#profile-history-sign-up,#ts-profile-history-sign-up,.profile-review-sign-in-link) {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  margin-top: 8px; padding-inline: 16px; border-radius: 8px;
  color: var(--game-background); background: var(--game-accent);
  font-weight: 800; font-size: 14px; text-decoration: none; touch-action: manipulation;
}
:is(#profile-history-sign-up,#ts-profile-history-sign-up,.profile-review-sign-in-link):focus-visible { outline: 2px solid var(--game-text); outline-offset: 2px; }
:is(#profile-history-more,#ts-profile-history-more) { margin-top: 10px; width: 100%; background: var(--game-control); color: var(--game-text); font-size: 14px; }
.profile-bio-card {
  margin-top: 12px; padding: 10px 12px; border: 1px solid var(--game-border); border-radius: 8px;
  background: var(--game-control);
}
.profile-bio-card:has(button:not(:disabled):is(:hover, :focus-visible), textarea:focus-visible) { border-color: var(--game-accent); }
:is(#profile-bio-preview,#ts-profile-bio-preview) {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 24px; padding: 0; border: 0; box-shadow: none; background: transparent;
  color: var(--game-text); text-align: start; font: inherit; line-height: 1.5;
}
:is(#profile-bio-preview,#ts-profile-bio-preview) svg { width: 16px; height: 16px; margin-top: 3px; flex: none; color: var(--game-accent); }
:is(#profile-edit,#ts-profile-edit) { display: grid; gap: 8px; margin: 0; }
:is(#profile-edit,#ts-profile-edit) small, :is(#profile-bio-status,#ts-profile-bio-status) { margin: 0; color: var(--game-muted); font-size: 12px; }
:is(#profile-bio-status,#ts-profile-bio-status):not(:empty) { margin-top: 10px; }
:is(#profile-bio,#ts-profile-bio) {
  resize: vertical; min-height: 4.5em; padding: 7px; border: 1px solid var(--game-border); border-radius: 8px;
  background: var(--game-background); color: var(--game-text); font: 16px/1.35 system-ui, sans-serif;
}
.profile-name-editor { display: grid; gap: 8px; margin-bottom: 6px; }
.profile-edit-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
:is(#player-nickname,#ts-player-nickname) {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--game-border);
  border-radius: 8px; color: inherit; background: var(--game-control); font: 16px system-ui;
}
.profile-edit-actions button { min-height: 42px; padding-inline: 14px; }
.profile-edit-actions button[type="button"]:not(:disabled) {
  color: var(--game-text); background: var(--game-control); border-color: var(--game-border);
  --button-edge: #09090c;
}
:is(#nickname-editor,#ts-nickname-editor) p { margin: 0; color: var(--game-muted); font-size: 13px; line-height: 1.5; }
#player-level-badge {
  min-height: 30px; padding-inline: 8px; border: 1px solid #ff9c2444; border-radius: 6px;
  color: var(--game-accent); background: #ff9c2412; font: 650 11px/1.1 system-ui, sans-serif;
  --button-edge: #09090c;
}
/* The same GLB component is mounted in React and legacy profile stages. */
.profile-statue-stage .profile-statue-viewer { display: block; width: 100%; height: 180px; touch-action: pan-y; --poster-color: transparent; background: transparent; }
.profile-statue-stage .profile-statue-viewer:focus-visible { outline: 2px solid var(--game-accent); outline-offset: -3px; border-radius: 8px; }
.profile-statue-stage .profile-statue-viewer[hidden] { display: none; }
