/* Resolve the page palette before the dark header's local colour overrides. */
:root {
  --account-menu-surface: var(--surface, #fff);
  --account-menu-text: var(--text, #242424);
  --account-menu-muted: var(--muted, #666);
  --account-menu-border: var(--border, #ddd);
  --account-menu-link: var(--link, #12689f);
  --account-menu-hover: var(--bg, #f5f5f5);
  --header-login-background: var(--accent, #375a7f);
  --header-login-text: var(--accent-text, #fff);
}
.header-account-controls { position: relative; display: flex; flex: 0 0 auto; align-items: center; gap: 12px; margin-left: auto; }
.account-menu,.notification-menu { position: relative; flex: 0 0 auto; color: var(--header-text, #eee); font-family: var(--body-font, system-ui, sans-serif); font-size: 14px; line-height: 1.45; letter-spacing: normal; text-transform: none; }
:is(.account-menu,.notification-menu) > summary { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; border-radius: 24px; cursor: pointer; list-style: none; }
:is(.account-menu,.notification-menu) > summary::-webkit-details-marker { display: none; }
:is(.account-menu,.notification-menu) > summary:focus-visible { outline: 2px solid var(--account-menu-link); outline-offset: 3px; }
.notification-menu > summary:hover { background: #ffffff12; }
.account-menu > summary { background: transparent; border: 0; box-shadow: none; }
.compendium-compact-icon { display: none; }
.header-inner .game-selector { flex: 0 1 auto; width: max-content; min-width: 0; max-width: 180px; }
.header-inner .game-selector summary { justify-content: flex-start; gap: 8px; }
.compendium-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compendium-caret { flex: 0 0 auto; }
.header-inner .game-options { max-width: 280px; }
.header-inner .game-options a { gap: 16px; overflow-wrap: anywhere; }
.header-inner .game-options a > span { flex: 0 0 auto; }
.notification-menu { position: static; }
.notification-icon-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 auto; }
.notification-icon-wrap svg { display: block; }
.account-menu-avatar { position: relative; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; overflow: hidden; border-radius: 50%; background: var(--avatar-colour); color: #fff; font-size: 16px; font-weight: 600; line-height: 1; }
.account-menu-avatar img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.account-menu-avatar img[hidden] { display: none; }
.account-menu-avatar-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.account-menu-badge,.account-menu-link-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; box-sizing: border-box; padding: 0 5px; border-radius: 12px; color: #fff; background: #c32631; font: 700 11px/1 system-ui,sans-serif; font-variant-numeric: tabular-nums; }
.account-menu-badge { position: absolute; top: -5px; right: -7px; border: 2px solid #171717; height: 22px; min-width: 22px; }
.account-menu-link-badge { margin-left: auto; }
.account-menu-panel { position: absolute; z-index: 100; top: calc(100% + 10px); right: 0; width: 256px; max-width: calc(100vw - 28px); max-height: calc(100dvh - 110px); overflow-y: auto; padding: 8px; background: var(--account-menu-surface); color: var(--account-menu-text); border: 1px solid var(--account-menu-border); border-radius: 12px; box-shadow: 0 10px 35px #0002; box-sizing: border-box; text-align: left; }
.account-menu-name { padding: 12px; margin-bottom: 4px; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; border-bottom: 1px solid var(--account-menu-border); }
:is(.account-menu,.notification-menu) .account-menu-panel a, :is(.account-menu,.notification-menu) .account-menu-panel button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--account-menu-text); font: inherit; font-weight: 400; text-align: left; text-decoration: none; box-sizing: border-box; cursor: pointer; }
:is(.account-menu,.notification-menu) .account-menu-panel a:hover, :is(.account-menu,.notification-menu) .account-menu-panel button:hover, :is(.account-menu,.notification-menu) .account-menu-panel :focus-visible { background: var(--account-menu-hover); color: var(--account-menu-link); }
.account-menu-panel form { border-top: 1px solid var(--account-menu-border); margin: 4px 0 0; padding-top: 4px; }
@media(max-width:560px) {
  .header-inner .game-selector { flex: 0 1 auto; min-width: 0; }
  .header-inner .game-selector summary { gap: 4px; }
  .header-inner .game-options { position: fixed; top: 82px; left: 14px; right: 14px; width: auto; min-width: 0; max-width: 280px; margin-inline: auto; }
}

.account-menu-panel { width: 360px; max-height: min(calc(100dvh - 110px), var(--account-menu-available-height, 100dvh)); overscroll-behavior: contain; }
.account-menu-notifications { border-bottom: 1px solid var(--account-menu-border); margin-bottom: 6px; padding-bottom: 6px; }
.account-menu-notification-heading { display: flex; align-items: center; gap: 12px; padding: 8px 12px 2px; }
.account-menu-notification-heading > strong { font-size: 14px; font-weight: 600; }
.account-menu-scope { margin: 2px 12px 8px; color: var(--account-menu-muted); font-size: 12px; overflow-wrap: anywhere; }
:is(.account-menu,.notification-menu) .account-menu-panel .account-menu-preview { display: block; padding: 12px; border-radius: 6px; overflow-wrap: anywhere; }
:is(.account-menu,.notification-menu) .account-menu-panel .account-menu-preview + .account-menu-preview { border-top: 1px solid var(--account-menu-border); }
.account-menu-preview-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; }
.account-menu-preview-meta strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.account-menu-preview-meta time { flex-shrink: 0; color: var(--account-menu-muted); font-size: 11px; }
.account-menu-preview-action { display: block; color: var(--account-menu-muted); font-size: 12px; margin: 3px 0 6px; }
.account-menu-preview-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; font-size: 13px; font-weight: 600; }
.account-menu-preview-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; color: var(--account-menu-muted); font-size: 13px; line-height: 1.5; margin-top: 3px; }
:is(.account-menu,.notification-menu) .account-menu-panel .account-menu-view-all { color: var(--account-menu-link); font-weight: 600; }
.account-menu-empty { margin: 14px 12px; color: var(--account-menu-muted); font-size: 13px; }
.account-menu > .account-menu-panel { width: 256px; }
.notification-menu > .account-menu-panel { width: 360px; }
.notification-menu .account-menu-notifications { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
@media(max-width:560px) { .header-account-controls { gap: 6px; } }
@media(max-width:420px) {
  .header-inner .game-selector { padding-left: 0; border-left: 0; }
  .header-inner .game-selector summary { min-width: 44px; min-height: 44px; justify-content: center; }
  .compendium-label,.compendium-caret { display: none; }
  .compendium-compact-icon { display: block; }
}

/* Account actions own their alignment, including headers without search. */
.header-auth-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}
/* Inherit the shared .button typography, control height and CMS corner radius. */
.header-auth-button {
  padding: 0 14px;
  text-decoration: none;
}
.header-auth-signup { background: var(--surface); border-color: var(--border); color: var(--text); }
.header-auth-login { background: var(--header-login-background); color: var(--header-login-text); }
.header-auth-button:hover { filter: brightness(1.08); text-decoration: none; }
.header-auth-button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.header-inner--guest .header-search { min-width: 0; }
@media (max-width: 560px) {
  .header-auth-actions { gap: 6px; }
  .header-auth-button { padding-inline: 10px; }
  .header-inner--guest .game-selector { flex: 0 0 44px; padding-left: 0; border-left: 0; }
  .header-inner--guest .game-selector summary { min-width: 44px; min-height: 44px; justify-content: center; }
  .header-inner--guest .compendium-label,.header-inner--guest .compendium-caret { display: none; }
  .header-inner--guest .compendium-compact-icon { display: block; }
  .header-inner--guest .brand { gap: 5px; }
  .header-inner--guest .brand-mark { width: 40px; height: 32px; }
  .header-inner--guest .brand-type { font-size: 18px; }
}
@media (max-width: 360px) {
  .header-inner--guest { padding-inline: 12px; gap: 5px; }
  .header-inner--guest .brand-mark { width: 30px; height: 28px; }
  .header-inner--guest .brand-type { font-size: 16px; }
  .header-auth-button { padding-inline: 6px; font-size: 13px; }
}
