/* Account/community navigation; independent of the shared realm/map sheet. */
/* /profile/: the player's own space. All artwork is decorative; no invented avatar or live stats. */
.profile-shell { background: radial-gradient(ellipse at 75% 0%, #29403924, transparent 52%); }
.profile-shell .profile-wrap { max-width: 1180px; }

/* The door (signed out). Visible from the first paint. A browser that was signed in before
   (profile hint) keeps it invisible for a moment while the session is read, then fades it in. */
.profile-gate { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.profile-gate[hidden] { display: none; }
.gate-door { padding: clamp(28px, 4vw, 52px); border: 1px solid #b9995a38; background: linear-gradient(120deg, #b9995a12, transparent 60%), var(--plate); }
.gate-door h1 { font-size: clamp(36px, 4.6vw, 58px); line-height: 1.08; margin: 12px 0 14px; }
.gate-lead { color: var(--ash); font-size: 17px; line-height: 1.6; max-width: 520px; margin: 0; }
.profile-shell .gate-actions { margin: 28px 0 0; }
.profile-shell .gate-status { min-height: 1.6em; margin: 16px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.profile-shell .gate-status:empty { min-height: 0; margin: 0; }
.gate-help { margin-top: 22px; border-top: 1px solid var(--rule); padding-top: 14px; }
.gate-help summary { cursor: pointer; color: var(--ash); font-size: 13px; }
.gate-help summary:hover, .gate-help[open] summary { color: var(--gold); }
.gate-help p { margin: 10px 0 0; color: var(--ash); font-size: 13px; line-height: 1.7; }
.gate-new { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: clamp(24px, 3vw, 36px); border: 1px solid var(--rule); background: linear-gradient(165deg, #31574918, var(--plate) 60%); }
.gate-new h2 { font: 400 26px/1.25 var(--f-display); margin: 0; }
.gate-new .eyebrow { margin: 0; }
.gate-steps { margin: 4px 0 6px; padding-left: 1.2em; color: var(--ash); font-size: 14px; line-height: 1.7; display: grid; gap: 4px; }
.gate-new .text-link { font-size: 13px; }
.profile-gate { animation: gate-in .3s .2s both; }
body[data-profile-state="checking"] .profile-gate { animation-delay: .9s; }
body[data-profile-state="checking"] .gate-door button { pointer-events: none; }
@keyframes gate-in { from { opacity: 0; } to { opacity: 1; } }
body[data-profile-state="auth"] #signin, body[data-profile-state="auth"] #signin-device { display: none; }

/* The space (signed in). */
.profile-space[hidden] { display: none; }
.space-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; border: 1px solid #b9995a38; background: linear-gradient(110deg, #b9995a0c, transparent 65%), var(--plate); }
.account-identity { display: flex; align-items: center; gap: 24px; padding: 26px 28px; min-width: 0; flex: 1 1 420px; }
.account-identity > div:last-child { min-width: 0; }
.account-identity h1 { margin: 6px 0 8px; font: 400 clamp(28px, 3.6vw, 42px)/1.15 var(--f-display); overflow-wrap: anywhere; }
.account-identity .eyebrow { margin: 0; }
.identity-note { margin: 0; font-size: 13px; color: var(--ash); overflow-wrap: anywhere; }
.account-crest { flex: 0 0 76px; height: 86px; display: grid; place-items: center; border: 1px solid #b9995a60; background: linear-gradient(145deg, #b9995a16, #0a111a); clip-path: polygon(0 0,100% 0,100% 82%,50% 100%,0 82%); }
.account-crest span { color: var(--gold); font: 44px var(--f-display); }
.space-head-actions { padding: 0 28px 0 0; }
.profile-shell .space-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--rule); border-top: 0; background: var(--rule); }
.profile-shell .space-stats > div { display: block; padding: 16px 20px; border: 0; background: var(--night-2); }
.profile-shell .space-stats dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.profile-shell .space-stats dd { margin-top: 6px; font: 400 24px/1.2 var(--f-display); color: var(--ink); }
.profile-shell .space-stats dd small { display: block; margin-top: 4px; font: 12px var(--f-body); color: var(--gold); }
.space-tabs { position: sticky; top: var(--bar-h); z-index: 5; display: flex; gap: 4px; overflow-x: auto; margin: 22px 0 8px; padding: 6px 0; background: var(--night); scrollbar-width: none; }
.space-tabs a { flex: 0 0 auto; padding: 9px 14px; border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ash); font-size: 13px; text-decoration: none; }
.space-tabs a:hover { color: var(--ink); border-color: var(--rule-2); }
.space-section { padding-top: 36px; scroll-margin-top: calc(var(--bar-h) + 64px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-heading .eyebrow { margin: 0 0 10px; }
.section-heading h2 { font: 400 32px/1.2 var(--f-display); margin: 0; }
.section-heading .text-link { font-size: 13px; white-space: nowrap; }
.profile-shell .roster-status { color: var(--ash); font: 13px/1.6 var(--f-body); margin: 0 0 18px; overflow-wrap: anywhere; }
.profile-shell .roster-status:empty { display: none; }

/* Characters */
.character-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.profile-shell .character-card { padding: 0; margin: 0; border: 1px solid var(--rule-2); background: var(--plate); min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.character-head { display: flex; gap: 14px; align-items: center; padding: 22px 20px 18px; background: linear-gradient(135deg, #b9995a10, #31574912); border-bottom: 1px solid var(--rule); }
.character-head > div { min-width: 0; flex: 1; }
.character-sigil { display: grid; place-items: center; width: 44px; height: 48px; flex: 0 0 44px; border: 1px solid #b9995a45; color: var(--gold); font: 26px var(--f-display); background: #080f16; }
.profile-shell .character-head h3 { font: 400 25px/1.15 var(--f-display); margin: 0 0 7px; overflow-wrap: anywhere; color: var(--ink); }
.character-class { margin: 0; color: var(--ash); font-size: 13px; }
.character-level { display: flex; flex-direction: column; align-items: center; color: var(--gold); font: 26px var(--f-data); }
.character-level small { color: var(--ash); font: 9px var(--f-body); letter-spacing: .12em; text-transform: uppercase; }
.character-info { padding: 6px 20px 8px; margin: 0; flex: 1; }
.profile-shell .character-info > div { grid-template-columns: 100px minmax(0, 1fr); gap: 12px; padding: 9px 0; }
.profile-shell .character-info dt, .profile-shell .character-info dd { font-size: 13px; line-height: 1.5; }
.profile-shell dd.unknown { color: var(--ash-2); font-style: italic; }
.character-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 20px 20px; border-top: 1px solid var(--rule); }
.profile-shell .character-actions .button { min-height: 40px; font-size: 13px; }
.character-actions .text-link { font-size: 13px; }
.roster-note { font-size: 12px; line-height: 1.7; color: var(--ash); margin: 18px 0 0; }

/* Passkeys, sessions, privacy: one row grammar */
.key-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); background: var(--plate); }
.key-list:empty { display: none; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--rule); }
.key-row:last-child { border-bottom: 0; }
.key-row.busy { opacity: .55; pointer-events: none; }
.key-main { min-width: 0; flex: 1 1 320px; }
.key-main b { display: block; font: 500 15px/1.4 var(--f-body); color: var(--ink); overflow-wrap: anywhere; }
.key-main small { display: block; margin-top: 4px; color: var(--ash); font-size: 12px; line-height: 1.6; }
.key-tag { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border: 1px solid var(--gold-25); border-radius: 99px; color: var(--gold); font-size: 11px; letter-spacing: .04em; }
.key-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.profile-shell .key-actions button { min-height: 36px; padding: 0 12px; font-size: 13px; }
.key-rename { display: flex; gap: 8px; flex-basis: 100%; flex-wrap: wrap; }
.key-rename input { flex: 1 1 220px; min-height: 36px; padding: 0 10px; border: 1px solid var(--rule-2); border-radius: var(--radius); background: var(--night); color: var(--ink); font: 14px var(--f-body); }
.key-rename input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.key-advice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.key-advice > div { padding: 18px 20px; border: 1px solid var(--rule); background: var(--night-2); }
.key-advice h3 { margin: 0 0 8px; font: 600 14px var(--f-body); color: var(--ink); }
.key-advice p { margin: 0; color: var(--ash); font-size: 13px; line-height: 1.65; }
.privacy-facts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.privacy-facts li { padding: 14px 18px; border-left: 2px solid var(--gold-25); background: var(--night-2); color: var(--ash); font-size: 13px; line-height: 1.65; }
.privacy-facts b { color: var(--ink); font-weight: 600; }
.profile-community { margin-top: 0; }
.space-launcher { display: flex; align-items: center; justify-content: space-between; gap: 18px 32px; flex-wrap: wrap; margin-top: 44px; }
.launcher-card { padding: 24px 28px; border: 1px solid #b9995a42; background: linear-gradient(165deg, #b9995a17, #16232680 55%, var(--plate)); }
.launcher-card h2 { font: 400 26px/1.25 var(--f-display); margin: 10px 0 8px; }
.launcher-card p:not(.eyebrow) { margin: 0; font-size: 13px; line-height: 1.7; color: var(--ash); }
.launcher-card .eyebrow { margin: 0; }
.profile-community .account-shortcut { position: relative; padding-top: 18px; }
.shortcut-icon { font: 10px var(--f-data); color: var(--ash); letter-spacing: .1em; }
.shortcut-arrow { position: absolute; top: 18px; right: 18px; color: var(--gold); }
/* The public character page (opt-in) */
.public-wrap { max-width: 720px; }
.public-wrap > .eyebrow { margin: 0 0 14px; }
.public-card { border: 1px solid #b9995a38; background: var(--plate); }
.public-card .character-head h1 { font: 400 clamp(30px, 4vw, 44px)/1.1 var(--f-display); margin: 0 0 8px; overflow-wrap: anywhere; }
.public-card .character-info { padding: 8px 24px 12px; }
.public-note { margin: 0; padding: 14px 24px 20px; border-top: 1px solid var(--rule); color: var(--ash); font-size: 12px; line-height: 1.6; }
.public-links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
@media (max-width: 900px) {
  .profile-gate { grid-template-columns: minmax(0, 1fr); }
  .profile-shell .space-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key-advice { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .profile-shell { padding-block: 20px 44px; }
  .gate-door { padding: 24px 20px; }
  .gate-lead { font-size: 15px; }
  .profile-shell .gate-actions { flex-direction: column; align-items: stretch; }
  .account-identity { padding: 20px; gap: 14px; align-items: flex-start; flex-basis: 100%; }
  .account-crest { flex-basis: 48px; height: 56px; }
  .account-crest span { font-size: 30px; }
  .space-head-actions { padding: 0 20px 20px; }
  .profile-shell .space-stats > div { padding: 12px 14px; }
  .profile-shell .space-stats dd { font-size: 20px; }
  .character-grid { grid-template-columns: minmax(0, 1fr); }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-heading h2 { font-size: 28px; }
  .profile-shell .character-info > div { grid-template-columns: 92px minmax(0, 1fr); }
  .key-row { padding: 14px 16px; }
  .space-launcher { padding: 20px; }
}
.shell .sidebar nav a:not([hidden]),
.shell a.quiet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--f-body);
  line-height: 1.35;
}
.shell .sidebar nav a:not([hidden]) {
  justify-content: flex-start;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--ash);
  border-color: transparent;
  font-size: 14px;
  font-weight: 500;
}
.shell .sidebar nav a:hover {
  color: var(--ink);
  background: #ffffff05;
}
.shell .sidebar nav a[aria-current="page"] {
  background: var(--plate-2);
  color: var(--gold);
  border-color: var(--rule);
}
.shell a.quiet:hover {
  border-color: var(--ash);
  background: #ffffff06;
}
.shell a.author-link,
.shell a.title-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-decoration: none;
}
.shell a.author-link:hover,
.shell a.title-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
#view-title { scroll-margin-top: calc(var(--bar-h) + 24px); }
.account-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.account-shortcut {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  min-height: 100px;
  padding: 18px;
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  background: var(--plate);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.account-shortcut:hover {
  border-color: var(--gold);
  background: var(--gold-12);
}
.account-shortcut b { color: var(--gold); font-size: 15px; }
.account-shortcut p,
.account-shortcut small { margin: 0; color: var(--ash); font-size: 13px; line-height: 1.5; }
.account-return { margin-top: 18px; }
@media (max-width: 640px) {
  .account-shortcuts { grid-template-columns: 1fr; }
  .account-shortcut { min-height: 84px; padding: 16px; }
}

/* Text is retained in full; field feedback follows the native UTF-8 limits. */
.field-count,
.field-error {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.field-count { color: var(--ash); font-variant-numeric: tabular-nums; }
.field-error { color: #efb7a5; }
.field-error[hidden] { display: none; }
.field [aria-invalid="true"] { border-color: #efb7a5; }
@media (forced-colors: active) {
  .field-error { color: CanvasText; }
  .field [aria-invalid="true"] { outline: 2px solid Highlight; outline-offset: 2px; }
}

.addressed-item {
  border-color: var(--gold);
  scroll-margin-top: calc(var(--bar-h) + 24px);
}
.linked-item-label {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}
@media (forced-colors: active) {
  .addressed-item { outline: 2px solid Highlight; outline-offset: 2px; }
}

